Skip to main content

Module semantics

Module semantics 

Source
Expand description

The semantic half of a daemon tool: plain data that describes a call without executing it (capabilities, typed call semantics, access manifests, receipt metadata, execution facts) and the helpers that derive the conservative defaults.

Structs§

ApprovalCall
One call as the kernel’s approval rules show it to ToolSemantics::owner_approval_request.
AuthorizationPreflightRecord
BackgroundJob
A job a tool runs in the background for a chat.
CallFileFence
This call’s FileFence, carried in ToolCallContext::extensions.
Deliverable
One artifact a call declares for the owner.
DeliveredArtifact
An artifact one of the request’s agents already delivered to the owner.
FileWrite
The file one call writes, as the tool’s arguments name it.
GrantOffer
What a tool lets the owner grant on a card: the scope an approval covers and the longest it may last. The card offers no button beyond max, and an answer beyond it is capped to it.
MessageAttachment
Metadata for a file saved from an inbound channel message or tool observation.
OwnedFolders
The folders a request’s work made fresh for itself (a spawn’s new_folders, claimed empty by the runtime), shared by every run of the request’s tree. Everything inside them is the work’s own: a change or a delete there acts on nothing anyone else made. A planning and effect fact only, never a trust source for what is read there (a package manager fills them with other people’s code).
PreparedToolInvocation
Validated, canonical tool input. This is the boundary object shared by policy, retry, dispatch, and receipt projection; raw model JSON is not an execution fact.
ProducedFiles
The files a request’s own work produced, shared by every run of its tree, from evidence rather than anyone’s account of them: a capture a tool noted as it saved it, and a file a succeeded call created where its declared write found nothing before (Self::claim_created, the file counterpart of OwnedFolders::claim_created). Each is the request’s own artifact wherever it is saved (a capture lands in the daemon’s inbox, outside any project). Keyed by the resolved path, and a capture also by its resource id, so either handle a later call names finds it. A planning and effect fact, never a trust source for what the file holds.
ReadFileResultMetadata
ResultFit
How the engine fits a call’s result for the model (see ToolDispatchFacts::result_fit).
RuntimePreparationFailure
A failure of the runtime’s own pre-dispatch preparation, attributed to the exact argument declaration that caused it. The dispatcher uses this to decide whether the declaration was its own projection (repairable without involving the model) or the model’s (surfaced as a typed rejection).
ScopeEscalation
Filesystem targets a tool call declared that fall outside the compiled task scope but are not protected host data or credential stores. The controller does not reject such a call outright; it hands the exact out-of-scope targets to the tool, which must obtain explicit user approval (or a persisted capability grant) before running with them.
ScopedGrants
Approvals of typed scopes (GrantScope) the owner gave for a grant session, kept in memory.
StableObservationSubject
A receipt subject an adapter reports verbatim, published ahead of any call so the executor’s checklist can bind to identities that receipts will actually carry. A checklist target outside every advertised subject and member namespace can never be credited, so the checklist tool refuses to compile it into an exact obligation.
TextEdit
One find-and-replace of a FileWriteKind::Edits batch.
ToolAccessDenial
Typed diagnostic emitted when a proposal is rejected by the controller or an adapter is denied by its installed filesystem policy. This is audit telemetry only; the manifest remains the authority and this record never widens it.
ToolArgumentContractViolation
Tool trait — system tools, terminal, MCP-proxied tools.
ToolCallAccessManifest
Prepared filesystem access requested by one exact tool call.
ToolCallContext
The dispatcher’s facts about one tool call, passed to the tool beside its arguments.
ToolCallMetadata
Structured execution metadata returned by tools.
ToolCallOutcome
ToolCallSemantics
Structured completion semantics for a specific tool call.
ToolCapabilities
Safety and execution metadata for policy-driven tool selection.
ToolCollectionObservation
Exact coverage of one collection returned by an adapter. members contains stable identities, never display labels. Only Complete coverage can prove non-membership; counts remain audit facts and are not interpreted as proof on their own.
ToolDispatchFacts
Typed facts about how the dispatcher and the engine treat a tool. A tool states them about itself; nothing keys on its name. Several can hold for one tool, so they are flags beside ToolRole (which scopes tools by agent role) rather than more roles.
ToolEvidenceCapability
Claim-support metadata for one successful tool result. Unlike ToolCapabilities, this describes what information the result can prove, not whether executing the tool is safe.
ToolMutationEffects
Typed mutation effects for one tool call.
ToolObservationEvidence
One exact subject/facet tuple observed in a successful tool result. This is result evidence, not a capability prediction: adapters populate it only after domain I/O has returned.
ToolResultProvenance
Content provenance shared by live completion and durable continuation. The digest is computed over the authoritative pre-compression result; the view-specific fields state exactly what the model and event log retained.
ToolTargetHint
TruncationInfo
Structured record of tool-output truncation. Populated at the tool boundary — the instructional notice text is rendered into the model-visible message by the loop (single site), never embedded in the tool’s returned content, so text-scanning consumers (error-line extraction, classifiers, summaries) always see clean output.
TrustRoots
The owner’s trusted file roots for one turn. A path is trusted only when it normalizes without escaping and equals a root or sits below it. A relative path resolves against cwd (where the file tools resolve it); without one it is never trusted.

Enums§

AgentRole
Role assigned to an agent for role-based tool scoping.
ApprovalKind
Distinguishes different kinds of approval requests so channels can render appropriate buttons (e.g., Allow Once / Deny for commands vs Confirm / Cancel for scheduled-goal confirmations).
ApprovalResponse
Response to an approval request from the user.
ApprovalScope
The scope of an approval the agent kernel gave a call (see ToolCallContext::kernel_approved).
AttachmentProvenance
Where an attachment originated — drives vision retention in archived turns.
AuthorizationPreflightStatus
Deterministic credential/target readiness checked immediately before an autonomous adapter is allowed to perform I/O. The accompanying durable receipt carries the mandate grant, which binds this record to the stable mandate identity and policy version without exposing credentials.
ChannelReach
Which conversations a tool may be offered in (see ToolDispatchFacts::channel_reach).
DeliverableKind
What a deliverable is, by kind: each run delivers one of each kind (the last it declared), and each request delivers each subject once.
DeliveryPlan
When a declared deliverable is sent (FileFence::declare_deliverable).
DurableReplayDecision
A tool-owned decision about whether a previously successful durable receipt still represents current state.
EvidenceAuthority
Strength of the source behind an observation.
EvidencePurpose
The kind of claim an observation can support. These are evidence roles, not request-language keywords or tool names.
EvidenceSource
What a substantive result from a tool can serve as evidence for, by the kind of source it reads (see ToolDispatchFacts::evidence). The capabilities each source supports live with the evidence ontology.
EvidenceTemporalScope
Time coverage of the subject records an observation surface can return. Receipt timestamps independently prove when the observation itself ran; a current query may therefore support historical subject data when the tool exposes both current and historical records.
FileGuard
Which of a tool’s paths are judged against the secret and sensitive patterns. A shell is not: the owner is asked about its commands instead.
FileWriteKind
How one call changes a file (see ToolSemantics::call_file_write).
GoalConfirmationStyle
Typed presentation requested for an exact goal/mandate confirmation.
GoalContext
Which goal facts a call receives (see ToolDispatchFacts::goal_context).
GrantLifetime
How long an owner’s answer to a card may last.
GrantScope
What one owner approval covers, as the tool that asked declares it: typed, so a later call is matched by what it targets, never by its arguments’ text.
NetworkReach
Which addresses a tool’s egress may name. Cloud metadata endpoints are refused for every tool, whatever this says.
Offering
How a tool is offered to the model.
OwnerApprovalNeed
What a tool says about the owner’s approval for one call.
PermissionMode
Permission persistence mode for commands requiring owner approval.
ProducedFile
How one of a request’s files came to be, when the request’s own work produced it (ProducedFiles).
ProjectDirArgument
Which argument of a call names the directory it works in (see ToolDispatchFacts::project_dir_argument).
ReadFileSelectionMetadata
RecapKind
What a run’s activity recap counts a finished call as (see ToolDispatchFacts::recap).
RiskLevel
Relative impact of an operation requiring approval.
SameToolStreak
The consecutive-call allowance of a tool (see ToolDispatchFacts::same_tool_streak). Defined in the kernel so the same-tool guard can take it without a dependency on the tools crate. The consecutive-call allowance of a tool: how long a run may call it in a row before the same-tool guard treats the streak as a loop.
ToolAccessEnforcement
Strength of the boundary that enforced a tool’s declared filesystem manifest. This reports enforcement, not merely manifest presence.
ToolActivity
What kind of work a call is on every card (see ToolDispatchFacts::activity).
ToolCallEffect
Effect classification for a specific tool call.
ToolCallOperation
Canonical adapter operation used by deterministic operation-scoped policy. Unknown/new HTTP verbs deliberately remain untyped and therefore cannot match a delegated mandate scope.
ToolCollectionCompleteness
Whether an adapter returned the whole requested collection. A truncated or otherwise partial list may prove facts about the subjects it contains, but it can never prove that another subject is absent.
ToolInvocationStage
Where an invocation reached in the common execution pipeline.
ToolOutcomeStatus
Structured outcome of a tool invocation. This separates transport/execution success from the domain result: a test runner can execute correctly while reporting failing tests, and a lookup can complete with no matches.
ToolReceiptKind
Shape of the machine receipt produced by a tool invocation.
ToolResultCompleteness
Whether a particular retained view contains the authoritative tool result.
ToolResultContentSource
Origin of the bytes represented by a durable observation receipt.
ToolResultPresentation
How the response layer should treat a successful tool result.
ToolRole
Categorization of a tool for role-based scoping.
ToolSemanticFacet
Fine-grained semantic capability advertised by a tool.
ToolSemanticScope
High-level domain a tool can inspect or mutate.
ToolTargetHintKind
Typed target hint emitted by a tool call.
ToolVerificationMode
How a tool call can contribute verification evidence.
UserRole
The sender’s role, shared across the SDK. Role assigned to a user based on config (owner_ids).

Constants§

EGRESS_EFFECTS
Effects that send data or act outside the owner’s machine and workspace, or cannot be undone. A call with any of these is egress.

Traits§

FileFence
Handed to a file tool by a host whose agents share a workspace. Without one the tool behaves as it would alone.
FileWriteGuard
A write in progress under a FileFence. Dropping it records nothing.
ToolSemantics
What a tool says about a call without executing it: its capabilities, typed semantics, access manifest, receipt protocol, effects and trust. Every method has a conservative default; a tool overrides only what it can state exactly.

Functions§

declared_named_files
The files and resources a call names by its declared facts (see ToolSemantics::named_files): its path and resource-id target hints, its access manifest’s path targets, and its path effects’ targets.
default_call_annotations
Per-call authority annotations from a tool’s capabilities and the call’s typed semantics.
file_fence
The call’s file fence, if its host gave it one.
file_output_trust
Output trust of a file read: the owner’s own files (inside the trusted roots) are Trusted; anything else, or a call whose first present path argument in keys is missing, is someone else’s content.
offered_card_kind
The card kind a card for offer is sent as, from the kind the tool asked for: a once-only offer turns a standard command card into a one-time card, so no session or persistent button is offered. Other kinds (goal confirmations, hand-offs) already offer nothing lasting.
offered_card_mode
The permission mode a card for offer is sent with, from the tool’s own: an offer that lasts at most the session keeps every button session-scoped (Cautious), so the card never advertises Always.
prepare_invocation
Produce the single typed invocation object consumed by the execution control plane. Validation deliberately precedes semantics and access derivation so a rejected proposal can never acquire intended effects.
produced_files
The request’s produced files, carried in ToolCallContext::extensions by a host that keeps them.
require_call_approval
Refuse what (the tool and action, as the refusal names them) unless the agent kernel approved the whole call (ApprovalScope::Call). An approval scoped to one inner request never authorizes the outer call.
semantics_for_exact_read_actions
Classify a mixed-operation tool from the exact action enum in its schema.
within_owned
Whether absolute path resolves inside one of folders, by the one path resolver every scope check uses (aidaemon_policies::resolves_within).

Type Aliases§

DeliverySend
The send a tool hands over with a deliverable sent later: run once, it reports whether the channel accepted it.