Skip to content

Effect receipts and effect retry

An effect intent is the nucleus-owned record that prevents an uncertain provider call from becoming an accidental second operation. It combines the method's sealed effect and retry declarations with the logical task, call and attempt identities. When the caller supplies an idempotency key, the record also binds the caller scope, sealed operation identity and canonical typed request digest.

Admission and outcome flow

flowchart TB
  subgraph CALLER["CALLER CELL"]
    direction TB
    KEY(["Kernel-local caller<br/>caller-scoped key"])
  end
  subgraph OWNER["OWNER CELL"]
    direction TB
    MON["Owner monitor<br/>request digest before dispatch"]
    PROV["Runtime provider"]
  end
  XCI[("Sealed effect and<br/>retry declaration")]
  subgraph NUC["NUCLEUS"]
    direction TB
    INT[("Effect intent")]
    J{{"Ambiguity and retry judgement"}}
  end
  KEY -->|"typed call"| MON
  XCI --> INT
  MON -->|"binds the claim"| INT
  MON -->|"dispatch"| PROV
  MON -->|"dispatch and completion receipts"| J
  INT --> J
  J -->|"completed"| DONE(["Effect retry evidence"])
  J -->|"safe repeat"| NEW(["Fresh AttemptId"])
  J -->|"recoverable"| OBS(["Declared observing recovery method"])
  J -->|"unsafe or unknown"| AMB(["ambiguous_completion"])

Effect intent binds the sealed declaration to the caller's claim before the provider runs. Ambiguity and retry judgement decides from the monitor's receipts, and its four outcomes are the only ways an uncertain call is resolved.

The monitor computes the canonical request digest from the admitted typed dispatch frame before provider execution. Task, call, attempt, deadline and trace identifiers are excluded from that digest, so a transport retry of the same logical request has the same identity. The method's closure, capsule, interface and ordinal remain bound through the sealed operation identity.

Exact idempotency-key reuse

The key is scoped to its caller. Its stored claim contains:

  • the caller scope;
  • the caller-supplied key;
  • the sealed operation identity;
  • the canonical typed-request digest.

The first claim installs one effect intent. Reusing the key with the exact same claim resolves to that original intent. Changing the method, typed request or caller scope is refused; the existing claim is never overwritten. A retry that is admitted receives a fresh concrete attempt identifier while retaining the same task and logical-call identity.

Recovery receipts

A recoverable method names both a request parameter containing its recovery receipt and an observing recovery method. The monitor hashes the declared typed argument before the original dispatch. A response-created receipt cannot serve as recovery authority because that response may be the missing fact.

After a possibly started attempt, the nucleus accepts recovery evidence only when all of these remain true:

  • the receipt digest matches the pre-dispatch binding;
  • the recovery method is the one declared by the original method;
  • the recovery method is pure or read-only;
  • both methods belong to the same sealed closure, capsule and interface.

An observation of "not applied" can make a new attempt eligible. An observation of "applied" completes the intent without repeating it. An unknown result stays ambiguous.

How retry is decided

Whether a call ran, and whether it may be retried, is decided by the nucleus. The nucleus derives ambiguity from monitor-owned dispatch and accepted-completion receipts, then applies the sealed retry contract.

Observed outcome Result
Definitely not dispatched A new attempt may be admitted
Possibly started, retry-safe declaration A new attempt may be admitted
Possibly started, idempotent declaration The original caller claim is required
Possibly started, recoverable declaration Recovery must establish the outcome first
Possibly started, single-attempt or unknown declaration Retry is forbidden and completion remains ambiguous
Monitor completion accepted but not acknowledged Completion acknowledgement is required, not another dispatch
Caller acknowledged completion No retry is required

ambiguous_completion is an explicit authority state. It tells an operator that the effect may or may not have happened and that no retry was made.

Evidence and the return boundary

The kernel-local completion binds the effect class, retry contract, every attempt identifier, ambiguity, retry disposition, effect-intent state and the digests of any idempotency claim or recovery receipt. The application result returns directly to its kernel-local caller and stays in the kernel.

The evidence, lifecycle receipts, faults and logs that operators need are written as sequenced return envelopes. The supervising data plane drains those envelopes without reopening their kernel authority and reports them to the control plane, which validates the return contract and performs the durable observability write. Kernel-local handles and application result values never enter that reporting path.

See Task state for the surrounding task lifecycle and Provider frame validation and supervision for the monitor boundary.