Expand description
Kernel effects, their resolutions and the payload shapes both sides carry (spec §7.8, §7.9, §7.10).
Three rules shape this module:
- An effect is something the host must execute and report back. Terminals, observations, synchronous compaction, knowledge sweeps and budget reports left the union (§7.8, §22.7): they are facts, not commands, so they can never sit in the pending-effect table waiting for a resolution that will never come.
- Every effect has exactly one matching success payload and the same failure path.
EffectKindTag::expected_successis a bijection ontoEffectSuccessTag, andKernelEffect::accept_outcomerefuses any other pairing — a host cannot answer aQueryMemorywith a provider message. Milestone evaluation is not special: it fails through the sameHostEffectFailureas everything else (B7). - The kernel never retries (DEC-5). A
Failedoutcome triggers exactly one policy decision;retryableis host diagnostics, not an instruction, and a host that wants the same intent attempted again must ask for it with a new causation.
Two omissions are deliberate. No outcome payload carries a wall clock (DEC-2) — the envelope’s
accepted time is the only clock fact — and no external payload carries a filesystem path
(§7.10 rule 7): PayloadRef is an opaque locator the kernel never interprets.
Structs§
- Approval
Request - Approval
Success - Archive
Page OutEffect - Archive
Receipt - Call
Provider Effect - Canonical
Memory Query - Canonical
Memory Write - A memory write the kernel authored from a model proposal (§7.6).
- Collapsed
Payload - Digest
- Content digest of a payload or record. Algorithm-prefixed (
sha256:…) so a future algorithm change is visible on the wire rather than silently reinterpreted. - Effect
Failed - The failure arm — identical for every effect kind (§7.9).
- Effect
Resolution Mismatch - A host answered a pending effect with the success payload of a different effect kind.
- Effect
Succeeded - The success arm. The effect kind is implied by the effect being resolved and by
result’s own tag; the host never restates the effect id’s kind here. - Evaluate
Milestone Effect - Execute
Tools Effect - External
Residency - External
Tool Result - A tool result whose body the host persisted before submitting.
- Host
Effect Failure - What the host can say about a failure. No wall clock, no host path, no stack, no raw vendor error — only facts the kernel can act on and replay. Vendor diagnostics belong in the host’s own log, never in a kernel recovery decision.
- Inline
Payload - A payload the host paged back in.
digestandoriginal_sizelet the kernel verify it is the same body it archived. - Inline
Tool Result - Kernel
Effect - One action the kernel published and is now waiting on.
- Launch
Token - Kernel-minted idempotency token for one task launch. The host keys its own launch deduplication on it, which is what makes “the kernel does not retry” (DEC-5) safe: a host re-attempt with the same token is the same launch, not a second child.
- Load
Payload Effect - Measure
Prompt Effect - spc_011-C-02: a preflight token-count request. Reuses the same
RenderedContext/ToolSchemashapeCallProviderEffectalready carries, rather than inventing a parallel candidate-request type — the kernel is asking “how many tokens would this request cost”, the same request it would otherwise hand toCallProvider. - Memory
Access Binding - The operation’s memory authority, carried on every memory effect so the host never has to infer it. Opaque: never a tenant, a namespace or a path.
- Memory
Capabilities - Memory
Persist Receipt - Memory
Persisted Success - Memory
Queried Success - Memory
Recall - Memory
Record Ref - Opaque handle for one persisted memory record. Never a tenant, namespace or path.
- Milestone
Check Result - F5 projection pair (registered in
crate::projection_pairs, 0.2.66): THIS side is the ABI authority; the pre-ABI twin is the richer internal semantic vocabulary. The only legal crossing is the driver’s exhaustive conversion. A milestone verdict. Note what is not here: anerrorfield. Milestone execution failures travel the sameHostEffectFailurepath as every other effect (B7) instead of being folded into the verdict, so “the verifier could not run” and “the verifier said no” stay distinct. - Milestone
Evaluated Success - Milestone
Request - Which phase of which contract the host must evaluate — and nothing else.
- Page
OutArchived Success - Page
OutPayload - The body the host must archive under pressure, with the facts the kernel keeps afterwards. After the resolution only the handle, digest, size and preview survive in core (§7.10 rule 5).
- Paged
OutResidency - Payload
Loaded Success - Payload
Ref - Opaque locator for a payload the host persisted (§7.10 rule 7).
- Persist
Memory Effect - Preempt
Tasks Effect - Prompt
Measured Success - spc_011-C-02: the answer to a
MeasurePrompteffect — onePromptMeasurementfact, wrapped the same way every other effect wraps its one matching success payload. - Provider
Completed - Provider
Context Overflow - Provider
Message - A message on the provider boundary. Distinct from
LogicalMessage: a rendered/returned message can carry tool calls, an initial-context message cannot. - Provider
Success - Query
Memory Effect - Rendered
Context - What the kernel rendered for one provider call.
- Request
Approval Effect - Resident
Payload - Spawn
Tasks Effect - Task
Already Finished - Task
Attempt Ref - Task
Launch - One child launch the host must perform.
- Task
Launch Failed - Task
Launch Failure - Per-launch failure. Reuses the cross-effect classification so a launch failure is triaged with the same vocabulary as every other host failure.
- Task
Launch Outcome - The launch acknowledgement. Historically this was an unconditional echo of the ids with a hard-coded empty failure list, so “spawned” and “actually started” were indistinguishable.
- Task
Launch Started - Task
Preempt Failed - Task
Preempt Outcome - Task
Preempted - Tasks
Preempted Success - Tasks
Spawned Success - Tool
Call - F5 projection pair (registered in
crate::projection_pairs, 0.2.66): THIS side is the ABI authority; the pre-ABI twin is the richer internal semantic vocabulary. The only legal crossing is the driver’s exhaustive conversion. - Tool
Result - An inline tool result body.
call_idlives onInlineToolResult, not here — one id, one place. - Tool
Schema - Tools
Success - Workflow
Budget
Enums§
- Effect
Kind - The closed set of actions a host must execute and report back.
- Effect
Kind Tag - The discriminant of
EffectKind, usable without a payload. - Effect
Outcome - The single entry point for the outcome of a kernel-owned pending effect.
- Effect
Success - The closed per-effect success union. One variant per
EffectKind, no more and no fewer. - Effect
Success Tag - The discriminant of
EffectSuccess, usable without a payload. - Host
Effect Failure Kind - The stable, cross-effect executor failure classification (§7.9).
- Payload
Residency - Where a P3 handle’s body currently lives.
- Provider
Outcome - A provider call that reached the vendor and came back with something the kernel can reason
about.
now_msis gone (DEC-2): the historical field fed the governance rate limiter directly and changed the byte fingerprint of every redelivery, which made idempotent replay unreachable on the highest-frequency path in the system. - Provider
Stop Reason - Typed stop reason — the canonical vocabulary every provider family maps onto.
- Task
Launch Status - Task
Preempt Status - Tool
Result Disposition - Can the batch continue past this result?
- Tool
Result Payload - One tool result, either inline or already persisted by the host.