Files
Assistant/architecture/adrs/ADR-0003-continuity-action-envelope.md
2026-08-16 16:06:10 +03:00

38 lines
3.3 KiB
Markdown

# ADR-0003 — Typed Continuity Action Envelope
**Status:** ACCEPTED_V1
**Accepted:** 2026-08-16
**Decision source:** `ARCH-000001`, accepted for implementation by the Creator; recorded by `ARCH-000002`.
## Context
The Creator console needs one real mutation that preserves the constitutional path:
`Proposal → owner validation → Authority/Integrity checks → Commit → Executor → Outcome/Verification`.
The existing Commit contract carries a Work target but cannot separately identify the Continuity subject, and the existing persistence does not retain a complete immutable authorized envelope across restart. Continuity also has no owner-local idempotency receipt for an externally committed intent.
## Decision
1. The first Creator operation is the single transition `DELIVERED → SATISFIED` on a `ProspectiveItem`. A non-empty evidence reference is required.
2. The operation changes only the `ProspectiveItem`. It does not automatically mutate a parent `Commitment`.
3. The Work `TaskTarget` remains the live justification. A typed Continuity subject separately carries `ProspectiveItemID`, expected Prospective revision, source state, target state, and evidence reference.
4. Commit persists the complete immutable authorized envelope before execution, including action and intent identities, Actor, Principal, grant and grant revision, Scope, Work target and revision, capability, typed operation, Continuity subject, and authorization time.
5. Creator authorization is an explicit allowlist mapping: a valid Creator grant within Scope plus capability `continuity-transition` permits only operation `satisfy-delivered`.
6. Browser input cannot choose Actor, Principal, grant, capability, operation, or source/target state. The authenticated server boundary derives or fixes those values.
7. Continuity remains the sole owner of Prospective state. Its internal executor command performs an atomic compare-and-swap on item ID, owner Principal, `DELIVERED` state, and expected revision.
8. Continuity owns an immutable idempotency receipt keyed by `ActionIntentID`. Repeating the same intent and command returns the recorded result; reusing an intent for different parameters is rejected.
9. Commit invokes Continuity through a remote-capable Executor contract protected by a runtime-only credential. The credential is injected at deployment and never stored in source.
10. A transport timeout is recorded as `UNKNOWN_OUTCOME`; Commit must not blindly retry. Reconciliation performs a read-only receipt lookup by `ActionIntentID` and appends a new attempt/outcome record.
## Consequences
- Commit may depend on `contracts.continuity` for the serializable subject and executor result types, but receives no Continuity storage access.
- Commit and Continuity use separate owner-local transactions; no cross-owner SQL write, join, foreign key, view, trigger, or distributed transaction is introduced.
- Stale Work revision, stale Prospective revision, invalid state, foreign Principal, expired/revoked grant, or an unlisted capability/operation causes rejection without Continuity mutation.
- Restart recovery loads the durable Commit envelope and Continuity receipt; correctness does not depend on process memory.
- Additional operations or Prospective transitions require a later explicit architecture decision.