Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them.
Page: /drakestapleton/aien-architecture-mv/patches/b313822834d1df43
# aien-architecture-mv
Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.
Brought by drakestapleton
Sign in to star 0 stars 0 watching
About Files History Releases Proposed changes Issues For developers
## GitHub aien-dev/aien-architecture-mv#106 (code only)
closed derived `b313822834d1df43` #106
Imported from GitHub aien-dev/aien-architecture-mv#106 (code only)
GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).
Base `b4fce15cc3ec78fca7b4e421a5215de65f10761c` · Head `b83541785b2fc20cfece53cfd695c16ca18a9ed0`
### Apply it
```
git checkout -b patch-b313822834d1df43 b4fce15cc3ec78fca7b4e421a5215de65f10761c
curl -fsSL https://interplane.io/drakestapleton/aien-architecture-mv/patches/b313822834d1df43.patch | git am
```
Raw patch (mbox) · Diff
### Provenance
This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:
```
github-import 1
aien-dev/aien-architecture-mv
106
b83541785b2fc20cfece53cfd695c16ca18a9ed0
```
```
{"kind":"github-import","owner":"aien-dev","repo":"aien-architecture-mv","number":106,"url":"https://github.com/aien-dev/aien-architecture-mv/pull/106","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:41Z","metadata":"unavailable","state_derived":true}
```
### Changes
```
diff --git a/docs/adr/0027-formal-oracle-lean-bootstrap.md b/docs/adr/0027-formal-oracle-lean-bootstrap.md
new file mode 100644
index 0000000..506d8e1
--- /dev/null
+++ b/docs/adr/0027-formal-oracle-lean-bootstrap.md
@@ -0,0 +1,112 @@
+# ADR 0027: Formal verification uses Lean as a temporary oracle; Omega owns the invariants
+
+**Status:** ACCEPTED, 2026-10-01. Decided by the operator, Drake Stapleton, through his Formal Verification Bootstrap Plan of 2026-10-01 (pasted by him, which is the decision; no separate ratification step is needed).
+**Supersedes:** nothing. It rules out one interpretation: that "formal verification" means Lean becomes a permanent AIEN subsystem.
+**Extends:** `doctrine/SOVEREIGNTY.md` section 3 (the Oracle Principle) by naming Lean as a registered Oracle. **Related:** ARCH-0024 (Rust scaffolding, Omega destination, C where hardware-justified), ARCH-0013 (AEGIS as the invariant checker), ARCH-0016 (resident reaction architecture).
+**Evidence base:** `~/handoffs/formal-verification/PLAN.md` (operator plan, sections 1, 4 to 8, 17, 19, 20); `doctrine/SOVEREIGNTY.md` section 3 on `aien-architecture` main b4fce15; aienos main 2ee61b4 (`crates/aienos-aegis/src/capability.rs`, `crates/aienos-artifact/src/receipt.rs`, `native/capability/`).
+
+---
+
+## Context
+
+The project wants machine-checked proofs for a small set of security-relevant invariants (capability attenuation, revocation, receipt consistency, later sequence identity, KV layout, continuity). Lean 4 is a strong tool for this today. Omega, the permanent substrate, cannot yet check proofs. The risk is that a useful tool becomes a permanent dependency simply because replacing it is hard. ARCH-0024 already states the general rule for languages: no scaffold gets permanent ownership because replacement is difficult. This ADR applies that rule to theorem proving.
+
+Formal work is meant to teach Omega what it must eventually own. Lean is successful when AIEN no longer needs it.
+
+## Decision
+
+The ten points below are the operator's, kept in meaning.
+
+1. **Omega owns the invariant semantics.** What an invariant means is defined in AIEN/Omega terms, not in Lean terms.
+2. **Lean is an Oracle-Principle dependency.** It is an Oracle in the sense of `doctrine/SOVEREIGNTY.md` section 3: it may be queried for ground truth and may exist outside the permanent lineage only as explicitly non-required, with a registered deprecation horizon (see Registration).
+3. **Lean source is not canonical identity.** A theorem name or a `.lean` file never defines an invariant. The invariant ID survives migration; the Lean theorem name does not.
+4. **No runtime component depends on Lean.** No kernel, loader, store, agent, or service invokes Lean or Lake at run time.
+5. **No permanent serialized AIEN format contains Lean-specific concepts.** No Lean term, universe, tactic, or declaration name appears in a receipt, artifact, store object, or wire format that is meant to last.
+6. **Lean results may become evidence but never authority by themselves.** A Lean PASS is one evidence input, bound to an exact source and model revision. It does not by itself admit, release, or qualify anything.
+7. **Every Lean-backed invariant needs an Omega takeover condition.** Written in its manifest (`omega_takeover_condition`) before any Lean proof for it is accepted.
+8. **Removing Lean is a required project exit gate** (`LEAN_SEVERANCE = PASS`, see Severance).
+9. **Formal verification supplements empirical qualification.** It does not replace tests, mutation testing, differential tests, silicon qualification, receipts, or hardware evidence.
+10. **Power-button-to-Omega closure is a later project and is explicitly non-blocking.** Firmware and reset-vector ownership are not on this critical path.
+
+### Scaffold classification (operator plan, section 1)
+
+| Item | Classification |
+|---|---|
+| Rust | Scaffolding (ARCH-0024) |
+| C, including current bare-metal C | Scaffolding |
+| Assembly source | Scaffolding where Omega eventually generates the machine instructions itself |
+| Linux | Scaffolding |
+| UEFI | Presently usable scaffolding |
+| NVIDIA kernel interfaces | Hardware-development oracles |
+| Lean | Mathematical oracle |
+| Current `aien-proof` | Evidence scaffold |
+| Existing AIENOS, Physics, sovereign-core implementations | Executable specifications and migration sources |
+
+None of these need to disappear now. Immediate policy: stay as bare metal as practical, avoid unnecessary foreign dependencies, keep shipping, and do not let eventual Omega-only closure block current progress. Eventual policy: no temporary scaffold receives permanent architectural ownership merely because replacing it is difficult.
+
+### Repository strategy
+
+- The **invariant registry** is permanent and implementation-neutral. It lives in `formal/invariants/` in this repository, outside `bootstrap/`, because it must survive Lean. See `formal/invariants/SCHEMA.md`.
+- The **Lean bootstrap**, when it exists (not before FORMAL-2), lives in `bootstrap/formal-oracles/lean/` in this repository, an explicitly disposable area. If it outgrows a small package it moves to a dedicated repository, `aien-formal-oracles`. Either way it declares:
+
+```text
+classification = DEVELOPMENT_ORACLE
+permanent_lineage = false
+deprecation_target = OMEGA_FORMAL_CLOSURE
+```
+
+- No permanent `aien-lean` subsystem is created.
+- This ADR creates no Lean code, no Lean install, and no CI change.
+
+### Registration under the Oracle Principle
+
+`doctrine/SOVEREIGNTY.md` section 3.1 requires each Oracle to be registered with its deprecation horizon. Lean is registered here: horizon = `LEAN_SEVERANCE` (below), deprecation target = `OMEGA_FORMAL_CLOSURE`. The closure qualification must succeed with Lean absent. Section 3.2 (zero code leakage, black-box comparator, disposable status) applies: no Lean source, library, or generated artifact enters the permanent lineage, and Lean talks to AIEN only through serialized results (PASS/FAIL records bound to an invariant ID, model revision, and source revision).
+
+### Severance criteria (operator plan, section 17)
+
+Lean is removable only when all production-relevant Lean-backed invariants satisfy:
+
+1. A stable Omega invariant identity exists.
+2. Omega expresses every relevant assumption.
+3. Omega accepts the positive corpus.
+4. Omega rejects the negative corpus.
+5. Omega kills the required semantic mutants.
+6. Omega produces canonical proof/evidence identity.
+7. Current gates consume Omega proof status.
+8. RSI consumes implementation-neutral/Omega proof evidence.
+9. No runtime invokes Lean.
+10. No required build invokes Lean or Lake.
+11. Deleting the Lean bootstrap changes no production result.
+
+Then `LEAN_SEVERANCE = PASS`, and Lean is removed from required CI, agent preflight, qualification, RSI admission, release generation, developer bootstrap, and permanent lineage. The final Lean tree and receipts are kept only as historical genesis evidence.
+
+### RSI rule (operator plan, section 19)
+
+RSI (`spark-rsi`) never contains Lean. It asks only whether a candidate touches a protected invariant surface; if so, it determines the required invariant IDs, verifies each current proof/evidence object, its exact candidate/source binding, and its dependencies, and requires PASS. A missing, stale, or failing required proof means the candidate is not admitted. There is never a `--skip-proof`, `--trust-model`, or `--assume-safe` option for required hard invariants. The review-branch-only ratification policy and human merge authority are unchanged.
+
+### Non-interference rules (operator plan, section 20)
+
+Until current work lands, this project does not: edit Omega M20 tensor code; edit the active PREFILL integration surfaces; edit active AIENOS C Store, disk, or continuity implementation; fix I11; create a new shared protocol merely because the Lean oracle needs metadata; rewrite working Rust into C for formal-verification purposes; or rewrite working C into Omega before Omega can represent it faithfully. Formal work initially occupies: this ADR, the neutral invariant manifests, the temporary Lean oracle, stable AEGIS capability semantics, stable artifact receipt semantics, and an evidence adapter.
+
+### Rules for the implementing agent
+
+Never upgrade NOT_RUN into PASS. Never treat host or QEMU evidence as physical GB10 qualification. Preserve failed receipts and counterexamples. Separate observed implementation from proposed invariant. Cryptographic correctness (signatures, HMAC, hashes) is an assumption at this level unless separately formalized.
+
+### Milestone naming
+
+The operator plan numbers its milestones M0 to M14. Those collide with the canonical milestone identifiers owned by `doctrine/ROADMAP.md`. In this repository they are cited as FORMAL-0 to FORMAL-14. FORMAL-0 is this ADR; FORMAL-1 is the registry in `formal/invariants/`.
+
+## Relationship to ARCH-0024 and the Oracle Principle
+
+Consistent, with two notes recorded plainly.
+
+1. ARCH-0024 classifies Rust and C as scaffolding and Omega as destination. This ADR adds Lean to the same scaffolding family. No conflict.
+2. The Oracle Principle text in `doctrine/SOVEREIGNTY.md` section 3.1 describes Oracles as producing "reference output tensors" and numerical parity checks, and section 3.2 says "Zero Training Leakage: oracle outputs are verification signals only." It does not mention proof oracles. Treating Lean as an Oracle extends the Principle to a new kind (a symbolic proof checker rather than a numeric comparator). This ADR does not edit SOVEREIGNTY.md; if the operator wants the Oracle definition widened in doctrine text, that is a separate change. Until then, this ADR is the registration of Lean as an Oracle.
+3. ARCH-0013 names AEGIS as the continuous invariant verifier. This ADR does not change that: AEGIS code remains the thing being checked, and Omega-owned invariant identities are what AEGIS-related proofs refer to.
+
+## Consequences
+
+- Invariants get stable `AIEN.INV.*` IDs before any Lean exists (FORMAL-1, this change).
+- Lean work cannot start (FORMAL-2 onward) without this ADR, the registry, and an Omega takeover condition per invariant.
+- Observed implementation facts and proposed invariants are kept separate in each manifest. Where Rust and C implementations of the same invariant differ (they do for capabilities, see the manifests), the invariant states the neutral rule and records each implementation's divergence.
+- Nothing in this ADR changes runtime behavior, CI, or any other repository.
diff --git a/docs/adr/README.md b/docs/adr/README.md
index 4141f6e..4631be1 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -37,3 +37,4 @@ Current ADRs:
- [0022 - The canonical Cortex owner is omega `rx_cortex`](0022-canonical-cortex-owner.md) - Accepted 2026-09-30 (orchestrator engineering call under the operator's standing rule)
- [0024 - Rust is scaffolding, Omega is destination, C where hardware-justified](0024-rust-scaffolding-omega-destination.md) - Accepted by operator Drake Stapleton, 2026-10-01 (supersedes the Rust-to-C migration plan)
- [0026 - Sealed Discovery Examinations](0026-sealed-discovery-examinations.md) - PROPOSED 2026-10-01
+- [0027 - Formal verification uses Lean as a temporary oracle; Omega owns the invariants](0027-formal-oracle-lean-bootstrap.md) - Accepted by operator Drake Stapleton, 2026-10-01 (via his Formal Verification Bootstrap Plan)
diff --git a/formal/invariants/SCHEMA.md b/formal/invariants/SCHEMA.md
new file mode 100644
index 0000000..264ba11
--- /dev/null
+++ b/formal/invariants/SCHEMA.md
@@ -0,0 +1,40 @@
+# Invariant manifest schema (version 0, provisional)
+
+This directory is the implementation-neutral registry of formal invariants (ARCH-0027, FORMAL-1). A manifest says what must be true, in AIEN terms. It never contains Lean, Rust, C, or Omega source. The semantic content is meant to be permanent; this file format is not (ARCH-0027 says the format may change, the invariant IDs may not).
+
+One TOML file per invariant, named `--v.toml`. The invariant ID survives migration between oracles and implementations. Lean theorem names, Rust function names, and file offsets do not identify an invariant.
+
+## Fields
+
+| Field | Type | Meaning |
+|---|---|---|
+| `schema_version` | integer | Manifest format version. `0` today. |
+| `id` | string | Stable ID, `AIEN.INV...V`. Never reused for a different meaning. A changed meaning gets a new `V`. |
+| `version` | integer | Same `N` as in the ID. |
+| `status` | string | `PROPOSED`, `SEEDED`, or `ACTIVE`. `SEEDED` = text written, no oracle model yet. Nothing here is `ACTIVE` until an oracle result is bound to evidence. |
+| `statement` | string | The invariant in plain words, implementation neutral. |
+| `assumptions` | array of strings | What is taken as given (for example cryptographic soundness). |
+| `semantic_types` | array of strings | The abstract kinds of thing the statement ranges over. |
+| `positive_examples` | array of tables | Cases that must be accepted. Each has `name` and `description`. |
+| `negative_examples` | array of tables | Cases that must be rejected. Same shape. |
+| `counterexamples` | array of tables | Known violation patterns a correct checker must catch. Same shape. Failed receipts and counterexamples are preserved, never deleted. |
+| `required_counterexamples` | array of strings | Names of `counterexamples` that a mutant suite must kill for the invariant to count as covered. |
+| `implementation_surfaces` | array of tables | Where the invariant is currently expected to hold. Fields: `repo`, `path`, `kind` (`production`, `reference`, `executable_spec`), `observed_at` (commit), `note`. |
+| `observations` | array of tables | Facts read from code, kept apart from the proposed statement. Each has `surface` and `text`. Where code differs from the statement, a `divergence` entry says so. |
+| `oracle_models` | array of strings | Which oracles are planned to check it (`lean` today). A name here is a plan, not a result. |
+| `evidence_requirements` | array of strings | What evidence is needed besides any proof (tests, mutants, differential runs, receipts). |
+| `omega_takeover_condition` | string | The condition under which Omega replaces every oracle for this invariant. Required before an oracle proof is accepted. |
+
+## Rules
+
+- Observed implementation and proposed invariant stay separate: `statement` is proposed, `observations` is what the code does today.
+- Cryptographic correctness is an assumption unless a separate invariant covers it.
+- A manifest is not evidence. It never records PASS or FAIL. Results live in the evidence machinery and cite the invariant `id`.
+- Paths in `implementation_surfaces` are relative to the named repository and were checked on the commit in `observed_at`.
+- No manifest may contain `--skip-proof`, `--trust-model`, or `--assume-safe` style escape hatches (ARCH-0027, RSI rule).
+
+## Index
+
+- `capability-attenuation-v1.toml`: AIEN.INV.CAP.ATTENUATION.V1
+- `capability-revocation-v1.toml`: AIEN.INV.CAP.REVOCATION_CLOSURE.V1
+- `artifact-receipt-v1.toml`: AIEN.INV.RECEIPT.REJECTION_CONSISTENCY.V1
diff --git a/formal/invariants/artifact-receipt-v1.toml b/formal/invariants/artifact-receipt-v1.toml
new file mode 100644
index 0000000..830ab4d
--- /dev/null
+++ b/formal/invariants/artifact-receipt-v1.toml
@@ -0,0 +1,124 @@
+schema_version = 0
+id = "AIEN.INV.RECEIPT.REJECTION_CONSISTENCY.V1"
+version = 1
+status = "SEEDED"
+
+statement = """
+An admission receipt is internally consistent. A receipt whose decision is Rejected records that nothing ran \
+(execution status NotRun, no exit status, no syscalls, no object reads, no denials, no success-type result flags) \
+and records a rejection stage and a rejection reason. A receipt whose decision is not Rejected records no \
+rejection stage and no rejection reason. A receipt that claims the canary passed also records that execution \
+exited with status zero. An optional field whose presence flag is absent carries only its zero value and so \
+cannot be read as present."""
+
+assumptions = [
+ "Cryptographic identity: digests, nonce derivation, and the Ed25519 signature are sound. Crypto correctness is not proven here.",
+ "The receipt byte layout (512 bytes, magic AIENRCP, version 0) is the contract; the in-memory struct is a view.",
+ "Kernel-emitted receipts are unsigned; host tooling signs them.",
+]
+
+semantic_types = ["Receipt", "Decision", "ExecutionStatus", "PresenceFlags", "ResultFlags", "RejectionStage", "RejectionReason"]
+
+oracle_models = ["lean"]
+
+evidence_requirements = [
+ "positive corpus of valid receipts for each decision",
+ "negative corpus: one receipt per violated rule, each refused",
+ "deliberate mutant that accepts a Rejected receipt with a non-NotRun status, which must not survive",
+ "encode then decode preserves the abstract receipt where practical",
+ "existing implementation unit tests and existing admission receipts keep passing",
+]
+
+required_counterexamples = [
+ "rejected_but_ran",
+ "rejected_without_reason",
+ "non_rejected_with_rejection_fields",
+ "canary_passed_without_clean_exit",
+ "absent_flag_with_nonzero_value",
+]
+
+omega_takeover_condition = """
+Omega expresses the receipt consistency rules as native propositions over the canonical receipt layout, accepts the \
+positive corpus, rejects the negative corpus, kills the required counterexample mutants, and emits a canonical \
+proof/evidence identity that the gates consume, with Lean absent."""
+
+[[positive_examples]]
+name = "admitted_clean"
+description = "Decision Admitted, no rejection stage or reason, execution Exited with status 0, nonce matches verifier identity and sequence."
+
+[[positive_examples]]
+name = "rejected_at_stage"
+description = "Decision Rejected, stage 1..9, a valid reason code, status NotRun, all counters zero, result flags empty or only RECLAIMED."
+
+[[negative_examples]]
+name = "rejected_with_exit_status"
+description = "Decision Rejected but exit_status is nonzero or execution status is Exited."
+
+[[negative_examples]]
+name = "admitted_with_reason"
+description = "Decision Admitted but a rejection reason is present."
+
+[[negative_examples]]
+name = "canary_flag_after_fault"
+description = "CANARY_PASSED set while execution status is Fault."
+
+[[counterexamples]]
+name = "rejected_but_ran"
+description = "A Rejected receipt with status other than NotRun, or nonzero exit status, syscalls, object reads, or denials, is accepted."
+
+[[counterexamples]]
+name = "rejected_without_reason"
+description = "A Rejected receipt with stage 0 or reason 0 is accepted."
+
+[[counterexamples]]
+name = "non_rejected_with_rejection_fields"
+description = "A receipt whose decision is not Rejected, with a nonzero rejection stage or reason, is accepted."
+
+[[counterexamples]]
+name = "canary_passed_without_clean_exit"
+description = "CANARY_PASSED set without execution status Exited and exit status 0 is accepted."
+
+[[counterexamples]]
+name = "absent_flag_with_nonzero_value"
+description = "Machine id digest, generation, context id, or observed time is nonzero while its presence flag is clear, and the receipt is accepted."
+
+[[implementation_surfaces]]
+repo = "aien-dev/aienos"
+path = "crates/aienos-artifact/src/receipt.rs"
+kind = "production"
+observed_at = "2ee61b4b158a385c5fcf2c925a625ac043babb21"
+note = "Rust: receipt::validate (semantic rules) and receipt::decode / encode (strict byte layout)."
+
+[[observations]]
+surface = "crates/aienos-artifact/src/receipt.rs"
+text = """
+validate(r) returns MalformedReceipt when any of these hold. Presence flags: machine_id flag clear and machine_id_digest nonzero; \
+context_id flag clear and generation or context_id nonzero; timestamp flag clear and observed_time_ns nonzero. \
+Codes: rejection_stage > 9, or rejection_reason nonzero and not in 1..=19 or 0x101..=0x10a. \
+Decision Rejected: stage == 0, or reason == 0, or execution_status != NotRun, or exit_status != 0, or syscalls != 0, \
+or object_reads_ok != 0, or denials != 0, or result_flags has any bit other than RECLAIMED. \
+Any other decision: stage != 0 or reason != 0. \
+CANARY_PASSED set and (execution_status != Exited or exit_status != 0). \
+Nonce != receipt_nonce(verifier_identity, sequence)."""
+
+[[observations]]
+surface = "crates/aienos-artifact/src/receipt.rs"
+text = """
+decode applies strict layout checks first (length, magic, version, header size, unknown flag bits, nonzero reserved bytes, \
+signature algorithm) then calls validate, so every decoded receipt satisfies validate. encode is field by field and does not itself call validate."""
+
+[[observations]]
+surface = "crates/aienos-artifact/src/receipt.rs"
+text = """
+The decision enum is Admitted, Rejected, CanaryFailed, Destroyed. validate ties nothing between CanaryFailed or Destroyed decisions and the \
+execution status code CanaryFailed beyond the rules above (for example a CanaryFailed decision with execution status Exited is not refused by validate). \
+That linkage may be intended or a gap; it is recorded, not asserted."""
+
+[[observations]]
+surface = "PLAN.md section 10 versus code"
+text = """
+divergence in strength, not direction: the plan lists 'rejected => NotRun', 'rejected => no successful execution evidence', and 'rejected => stage/reason present'. \
+The code is stronger: Rejected also forces zero exit status, zero syscalls, zero object reads, zero denials, and result flags limited to RECLAIMED. \
+The plan's 'CANARY_PASSED => execution succeeded' maps to execution_status == Exited and exit_status == 0. \
+The plan's 'absent optional-field flag => value cannot be interpreted as present' maps to the three presence-flag rules above (values must be zero). \
+The plan's 'not rejected => rejection-only fields absent' maps to stage and reason both zero; the code treats only those two fields as rejection-only."""
diff --git a/formal/invariants/capability-attenuation-v1.toml b/formal/invariants/capability-attenuation-v1.toml
new file mode 100644
index 0000000..9707d16
--- /dev/null
+++ b/formal/invariants/capability-attenuation-v1.toml
@@ -0,0 +1,150 @@
+schema_version = 0
+id = "AIEN.INV.CAP.ATTENUATION.V1"
+version = 1
+status = "SEEDED"
+
+statement = """
+A valid delegated child capability never possesses authority that its valid parent does not possess. \
+Concretely: the child's scope is contained in the parent's scope; the child's expiry is no later than \
+the parent's expiry; the child's remaining delegation depth is strictly less than the parent's; and a \
+capability with zero remaining delegation depth cannot delegate. Delegation from an invalid parent \
+(expired or revoked) is refused."""
+
+assumptions = [
+ "Cryptographic identity: the signature or MAC binding a capability to its fields is sound and the signing secret is not leaked. Crypto correctness is not proven here.",
+ "The capability graph has no cycles (parents are created before children).",
+ "A scope containment relation exists per scope kind and is the single definition of 'authority subset'.",
+]
+
+semantic_types = ["Capability", "Scope", "Expiry", "DelegationDepth", "Holder", "CapabilityGraph"]
+
+oracle_models = ["lean"]
+
+evidence_requirements = [
+ "positive corpus of accepted delegations",
+ "negative corpus of refused delegations",
+ "deliberate privilege-expansion mutant that must not survive",
+ "differential agreement between Rust and C implementations on the shared corpus where their models overlap",
+ "existing implementation unit tests keep passing",
+]
+
+required_counterexamples = ["scope_expansion", "expiration_extension", "delegation_depth_increase"]
+
+omega_takeover_condition = """
+Omega expresses the containment, expiry, and depth relations as native propositions, accepts the positive \
+corpus, rejects the negative corpus, kills the required counterexample mutants, and emits a canonical \
+proof/evidence identity that the gates consume, with Lean absent."""
+
+[[positive_examples]]
+name = "narrower_filesystem_prefix"
+description = "Parent holds a filesystem scope for /a; child asks for /a/b with depth one lower and the same expiry. Accepted."
+
+[[positive_examples]]
+name = "read_only_from_read_write"
+description = "Parent holds read-write filesystem scope; child asks for read-only on the same prefix. Accepted."
+
+[[positive_examples]]
+name = "equal_scope"
+description = "Child scope equals parent scope. Accepted (containment is non-strict)."
+
+[[negative_examples]]
+name = "write_from_read_only"
+description = "Parent filesystem scope is read-only; child asks for read-write. Refused."
+
+[[negative_examples]]
+name = "delegate_at_depth_zero"
+description = "Parent has delegation depth zero. Any child derivation is refused."
+
+[[negative_examples]]
+name = "different_scope_kind"
+description = "Parent is a Network scope, child asks for a Filesystem scope. Refused (only a system-admin parent contains every kind)."
+
+[[counterexamples]]
+name = "scope_expansion"
+description = "A child whose scope is not contained in the parent's is accepted (wider path, wider host, higher token or depth limit, write from read-only)."
+
+[[counterexamples]]
+name = "expiration_extension"
+description = "A child that outlives its parent is accepted."
+
+[[counterexamples]]
+name = "delegation_depth_increase"
+description = "A child with remaining delegation depth greater than or equal to the parent's is accepted, or a depth-zero parent delegates."
+
+[[counterexamples]]
+name = "invalid_parent_delegates"
+description = "An expired or revoked parent successfully derives a child."
+
+[[implementation_surfaces]]
+repo = "aien-dev/aienos"
+path = "crates/aienos-aegis/src/capability.rs"
+kind = "production"
+observed_at = "2ee61b4b158a385c5fcf2c925a625ac043babb21"
+note = "Rust AEGIS capability graph: CapabilityScope::contains, CapabilityGraph::derive_child_token."
+
+[[implementation_surfaces]]
+repo = "aien-dev/aienos"
+path = "native/capability/aienos_capability.c"
+kind = "reference"
+observed_at = "2ee61b4b158a385c5fcf2c925a625ac043babb21"
+note = "C capability authority (rights bitmask, generation slots). A different model from the Rust one; read only by grep for this manifest, not audited. Needs its own review before FORMAL-3."
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+CapabilityToken fields: id, parent_id (optional), issuer, holder, scope, delegation_depth (u32), \
+valid_until_utc (u64), signature (32 bytes, HMAC-SHA256 over the other fields under a graph master secret)."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+derive_child_token takes no expiry or depth argument. The child always gets valid_until_utc equal to the \
+parent's and delegation_depth equal to parent depth minus one. So 'child expiry <= parent expiry' holds by \
+construction as equality, and 'child depth < parent depth' holds by construction as exactly one less."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+derive_child_token order: look up parent (TokenNotFound), validate parent (revoked, ancestor revoked, \
+expired, bad signature), refuse if parent depth is 0 (DelegationDepthExceeded), refuse if \
+parent.scope.contains(child_scope) is false (ScopeExceeded). The holder argument is not checked against \
+the parent's holder; AegisError::UnauthorizedAgent exists but derive_child_token does not return it."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+CapabilityScope::contains (the subset relation), per kind: SystemAdmin contains everything. Filesystem: \
+child path_within parent prefix (lexical, absolute, no '..' components) and (read_only equal, or child is \
+read_only). Network: host equal or parent '*', and port equal or parent port 0. Model: model_name equal or \
+parent '*', and child max_tokens <= parent. World: child max_depth <= parent. StandingFetch: host equal or \
+parent '*'. Custom: namespace equal and (action equal or parent '*'). Any other pair is false. In particular \
+Device scope has no arm, so a Device parent contains no Device child (only a SystemAdmin parent does), and \
+a SystemAdmin child is contained only by a SystemAdmin parent."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+Expiry is inclusive of the boundary: a token is expired when now_utc > valid_until_utc, so now == valid_until_utc is still valid."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+derive_child_token does not reject a child_id that already exists; the new token replaces the old one in the \
+tokens map and the child id is appended to the parent's child list again. Whether this matters for the invariant \
+is open (it affects identity uniqueness, not attenuation)."""
+
+[[observations]]
+surface = "native/capability/aienos_capability.c"
+text = """
+Grep-level only. The C authority uses a rights bitmask (a child may not set rights its authority lacks: AIENOS_CAP_ERR_AMPLIFY), \
+a fixed maximum chain depth AIENOS_CAP_MAX_DEPTH = 8 counted from the root (not a per-token decreasing counter), \
+and lease_expiry where 0 means no expiry; a child lease may not exceed the authority's lease. Expiry is '>=' there \
+(clock >= lease_expiry is expired), unlike the Rust '>' boundary."""
+
+[[observations]]
+surface = "PLAN.md section 9 versus code"
+text = """
+divergence: the plan states 'child expiration <= parent expiration' and 'child delegation depth < parent delegation depth' as properties to prove. \
+The Rust code satisfies them by construction (equality, and parent minus one). The C code has a different depth model (absolute cap) \
+and a different expiry boundary. The neutral statement therefore says 'no later' and 'strictly less remaining depth' and lists the C model's \
+difference as an open reconciliation item; it is not assumed to be the same rule."""
diff --git a/formal/invariants/capability-revocation-v1.toml b/formal/invariants/capability-revocation-v1.toml
new file mode 100644
index 0000000..681f6fb
--- /dev/null
+++ b/formal/invariants/capability-revocation-v1.toml
@@ -0,0 +1,129 @@
+schema_version = 0
+id = "AIEN.INV.CAP.REVOCATION_CLOSURE.V1"
+version = 1
+status = "SEEDED"
+
+statement = """
+Once a capability is revoked, it is invalid, and every capability descended from it (its children, their \
+children, and so on) is also invalid. An expired capability is invalid. Revoking a capability never makes \
+its ancestors or unrelated capabilities invalid. Validity checks never turn an invalid capability into a \
+valid one."""
+
+assumptions = [
+ "Cryptographic identity: the signature or MAC binding a capability to its fields is sound. Crypto correctness is not proven here.",
+ "The capability graph is acyclic and parent links are recorded when a child is derived.",
+ "Time is supplied by the caller as a single monotone-enough 'now' value; clock correctness is not covered.",
+]
+
+semantic_types = ["Capability", "CapabilityGraph", "RevocationSet", "Time"]
+
+oracle_models = ["lean"]
+
+evidence_requirements = [
+ "positive corpus of valid capabilities staying valid after unrelated revocations",
+ "negative corpus of revoked, descendant-of-revoked, and expired capabilities that must be refused",
+ "deliberate mutant that skips descendant invalidation, which must not survive",
+ "existing implementation unit tests keep passing",
+]
+
+required_counterexamples = ["revoked_token_accepted", "descendant_of_revoked_accepted", "expired_token_accepted"]
+
+omega_takeover_condition = """
+Omega expresses revocation reachability and expiry as native propositions, accepts the positive corpus, \
+rejects the negative corpus, kills the required counterexample mutants, and emits a canonical proof/evidence \
+identity that the gates consume, with Lean absent."""
+
+[[positive_examples]]
+name = "sibling_unaffected"
+description = "Two children of one parent; one is revoked. The other remains valid."
+
+[[positive_examples]]
+name = "parent_unaffected"
+description = "A child is revoked. Its parent remains valid."
+
+[[negative_examples]]
+name = "revoked_itself"
+description = "A revoked token is refused."
+
+[[negative_examples]]
+name = "grandchild_of_revoked"
+description = "Parent revoked after a grandchild was derived. The grandchild is refused."
+
+[[negative_examples]]
+name = "expired"
+description = "Token with now greater than its valid_until is refused."
+
+[[counterexamples]]
+name = "revoked_token_accepted"
+description = "A token in the revoked set passes validation."
+
+[[counterexamples]]
+name = "descendant_of_revoked_accepted"
+description = "A token with a revoked ancestor passes validation."
+
+[[counterexamples]]
+name = "expired_token_accepted"
+description = "A token past its expiry passes validation."
+
+[[counterexamples]]
+name = "revocation_resurrected"
+description = "Re-deriving or re-issuing under an existing id clears a revocation."
+
+[[implementation_surfaces]]
+repo = "aien-dev/aienos"
+path = "crates/aienos-aegis/src/capability.rs"
+kind = "production"
+observed_at = "2ee61b4b158a385c5fcf2c925a625ac043babb21"
+note = "Rust: CapabilityGraph::revoke and CapabilityGraph::validate_token."
+
+[[implementation_surfaces]]
+repo = "aien-dev/aienos"
+path = "native/capability/aienos_capability.c"
+kind = "reference"
+observed_at = "2ee61b4b158a385c5fcf2c925a625ac043babb21"
+note = "C: state_revoke and cascade_revoke over generation slots. Grep-level read only; needs its own review before FORMAL-3."
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+revoke(token_id) walks the recorded child map (a stack, no visited set, so it assumes a DAG) and inserts every \
+reached id, including the starting id, into a revoked set. It does not check that the starting id exists; revoking \
+an unknown id just records it. It is idempotent."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+validate_token checks, in this order: own id in revoked set (TokenRevoked); every ancestor id reached by following \
+parent_id through the graph's token map is in the revoked set (TokenRevoked); now_utc > valid_until_utc (TokenExpired); \
+signature mismatch (InvalidSignature). The ancestor walk stops silently if an ancestor id is missing from the token map. \
+So revocation is enforced twice: eagerly by revoke's descendant walk and lazily by the ancestor walk at validation."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+Because the revocation check precedes the signature check, a token with a forged signature but a revoked id reports \
+TokenRevoked, not InvalidSignature. Both are refusals. Expiry is inclusive: now == valid_until_utc is still valid."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+validate_token validates only the token passed in plus revocation state of its ancestors. It does not re-check ancestors' expiry or \
+signatures. In the current derive rule a child's expiry equals its parent's, so an expired ancestor implies an expired child."""
+
+[[observations]]
+surface = "crates/aienos-aegis/src/capability.rs"
+text = """
+derive_child_token inserts into the token map under child_id without checking for an existing entry and does not clear \
+the revoked set. A re-derived child under a previously revoked id therefore stays revoked. Whether that is intended is not documented in the code read."""
+
+[[observations]]
+surface = "native/capability/aienos_capability.c"
+text = """
+Grep-level only. The C authority revokes by cascade over slots (cascade_revoke) and uses generation slots for reuse; \
+its documented behavior is 'revoking an ancestor revokes the descendants'. Not audited line by line for this manifest."""
+
+[[observations]]
+surface = "PLAN.md section 9 versus code"
+text = """
+no divergence found for 'revocation rejects the revoked token', 'revocation invalidates descendants', 'expired capability is invalid' in the Rust code. \
+The C model differs structurally (generation slots, '>=' expiry) and is recorded under the attenuation manifest."""
```