From fe0b93739f1664f9e2784a6d3b53e05c64248275 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sun, 16 Aug 2026 16:06:10 +0300 Subject: [PATCH] architecture: accept continuity action envelope --- .../ADR-0003-continuity-action-envelope.md | 37 ++++++++++++ architecture/architecture-registry.json | 1 + architecture/architecture-registry.yaml | 2 +- ...002-accept-continuity-action-envelope.json | 57 +++++++++++++++++++ docs/CONTINUITY_ACTION_ENVELOPE_PROPOSAL.md | 21 +++---- 5 files changed, 105 insertions(+), 13 deletions(-) create mode 100644 architecture/adrs/ADR-0003-continuity-action-envelope.md create mode 100644 dev/tasks/ARCH-000002-accept-continuity-action-envelope.json diff --git a/architecture/adrs/ADR-0003-continuity-action-envelope.md b/architecture/adrs/ADR-0003-continuity-action-envelope.md new file mode 100644 index 0000000..6d7f639 --- /dev/null +++ b/architecture/adrs/ADR-0003-continuity-action-envelope.md @@ -0,0 +1,37 @@ +# 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. + diff --git a/architecture/architecture-registry.json b/architecture/architecture-registry.json index 27dd863..0c9ba03 100644 --- a/architecture/architecture-registry.json +++ b/architecture/architecture-registry.json @@ -125,6 +125,7 @@ "contracts.authority", "contracts.capability", "contracts.work", + "contracts.continuity", "platform.events" ], "privileged": true diff --git a/architecture/architecture-registry.yaml b/architecture/architecture-registry.yaml index 348356e..7a24f6b 100644 --- a/architecture/architecture-registry.yaml +++ b/architecture/architecture-registry.yaml @@ -58,7 +58,7 @@ modules: owns: [ActionProposalRecord, AuthorizedAction, ActionAttemptRecord] database_schema: commit boundary_class: remote_capable - may_depend_on: [contracts.authority, contracts.capability, contracts.work, platform.events] + may_depend_on: [contracts.authority, contracts.capability, contracts.work, contracts.continuity, platform.events] privileged: true artifact: diff --git a/dev/tasks/ARCH-000002-accept-continuity-action-envelope.json b/dev/tasks/ARCH-000002-accept-continuity-action-envelope.json new file mode 100644 index 0000000..47e37f2 --- /dev/null +++ b/dev/tasks/ARCH-000002-accept-continuity-action-envelope.json @@ -0,0 +1,57 @@ +{ + "task_id": "ARCH-000002", + "task_revision": 1, + "architecture_revision": "bootstrap-1", + "base_repo_revision": "ccc0f4d95eebac7b05f146838c841e91978e451e", + "risk_tier": "E", + "intent": "Accept the minimum typed Continuity action envelope, owner-local idempotency, strict operation authorization, and reconciliation decision proposed by ARCH-000001.", + "requirement_ids": ["INV-AUTH-001", "INV-OWN-001", "INV-CONT-001", "INV-TOPO-001"], + "allowed_change_scope": { + "paths": [ + "architecture/adrs/ADR-0003-continuity-action-envelope.md", + "architecture/architecture-registry.yaml", + "architecture/architecture-registry.json", + "docs/CONTINUITY_ACTION_ENVELOPE_PROPOSAL.md", + "dev/tasks/ARCH-000002-accept-continuity-action-envelope.json" + ] + }, + "forbidden_change_scope": { + "paths": [ + "architecture/ARCHITECTURE_CONSTITUTION.md", + "architecture/CORE_SEMANTIC_MODEL_V1.md", + "ci/**", + "security/**", + "database/**", + "modules/**", + "contracts/**", + "adapters/**", + "cmd/**", + "deploy/**", + "tests/**" + ] + }, + "allowed_architecture_delta": { + "new_cross_module_dependencies": 1, + "new_canonical_owners": 0, + "new_privileges": 1 + }, + "contracts": { + "consume": ["contracts.authority@v1", "contracts.capability@v1", "contracts.work@v1", "contracts.continuity@v1"], + "may_change": ["commit action envelope", "continuity executor command"] + }, + "semantic_owner": "commit-and-continuity", + "assumptions": [ + "The user's explicit instruction to continue after the decision list accepts all five recommended ARCH-000001 decisions", + "The first mutation changes only ProspectiveItem state from DELIVERED to SATISFIED", + "The runtime executor credential is injected and stored outside the repository" + ], + "acceptance_scenarios": [ + "accepted ADR fixes the typed operation and transition semantics", + "Commit is allowed to depend on the Continuity contract without receiving Continuity storage ownership", + "Continuity owns the idempotency receipt keyed by ActionIntentID", + "timeout remains UNKNOWN_OUTCOME and reconciliation is read-only", + "YAML and JSON architecture registries remain equivalent" + ], + "required_tests": ["architecture preflight", "architecture sentinel", "registry parity", "diff-scope review", "independent Tier E review before promotion"], + "terminal_gap_states": ["BLOCKED_BY_ARCHITECTURE_GAP", "BLOCKED_BY_SPEC_GAP", "BLOCKED_BY_CONFLICT"] +} diff --git a/docs/CONTINUITY_ACTION_ENVELOPE_PROPOSAL.md b/docs/CONTINUITY_ACTION_ENVELOPE_PROPOSAL.md index fcb9ddc..061b41a 100644 --- a/docs/CONTINUITY_ACTION_ENVELOPE_PROPOSAL.md +++ b/docs/CONTINUITY_ACTION_ENVELOPE_PROPOSAL.md @@ -1,6 +1,6 @@ # Continuity Action Envelope Proposal -Status: **PROPOSED — not architecture authority** +Status: **ACCEPTED — recorded by ADR-0003** Task: `ARCH-000001`, revision 1 @@ -67,16 +67,13 @@ The public Creator command endpoint must: - never accept arbitrary capability or operation strings from the browser; - return committed action/attempt identities and outcome state. -## Required decisions before implementation +## Accepted decisions -1. **First allowed transition.** Choose exactly one: - - `DELIVERED → SATISFIED` with an evidence reference (recommended); - - `ARMED → SUPPRESSED` with a cancellation reason, which requires new lifecycle semantics; - - another explicitly specified transition. -2. **Commit durability shape.** Approve a migration storing the full immutable authorized envelope and operation subject. -3. **Idempotency receipt ownership.** Approve a Continuity-owned receipt keyed by `ActionIntentID`, or specify another rebuild/reconciliation source. -4. **Operation authorization.** Define the allowed mapping between Creator grant class, capability, operation, and scope. -5. **Commitment interaction.** State whether the first transition changes only `ProspectiveItem` or also its parent Commitment. Cross-owner or multi-aggregate atomicity must not be implied. +1. The first allowed transition is `DELIVERED → SATISFIED` with a required evidence reference. +2. Commit stores the full immutable authorized envelope and typed operation subject. +3. Continuity owns the idempotency receipt keyed by `ActionIntentID`. +4. The only initial mapping is Creator grant + capability `continuity-transition` + operation `satisfy-delivered`. +5. The operation changes only `ProspectiveItem`; it does not automatically change `Commitment`. ## Proposed implementation slices after acceptance @@ -87,6 +84,6 @@ The public Creator command endpoint must: 5. Session-authenticated Creator command orchestration with revoked/stale/adversarial tests. 6. Gateway allowlist and explicit confirmation UI. -## Current terminal state +## Resolution -`BLOCKED_BY_ARCHITECTURE_GAP` for implementation of Creator mutation. Read-only Creator APIs and the deployed console remain valid and operational. +The architecture gap is resolved by `ADR-0003`. Implementation proceeds under separate Tier D task packets. Read-only Creator APIs and the deployed console remain valid and operational during delivery.