interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / formal / invariants / capability-revocation-v1.toml

129 lines · 5911 bytes Raw Blame History
1schema_version = 0
2id = "AIEN.INV.CAP.REVOCATION_CLOSURE.V1"
3version = 1
4status = "SEEDED"
5
6statement = """
7Once a capability is revoked, it is invalid, and every capability descended from it (its children, their \
8children, and so on) is also invalid. An expired capability is invalid. Revoking a capability never makes \
9its ancestors or unrelated capabilities invalid. Validity checks never turn an invalid capability into a \
10valid one."""
11
12assumptions = [
13 "Cryptographic identity: the signature or MAC binding a capability to its fields is sound. Crypto correctness is not proven here.",
14 "The capability graph is acyclic and parent links are recorded when a child is derived.",
15 "Time is supplied by the caller as a single monotone-enough 'now' value; clock correctness is not covered.",
16]
17
18semantic_types = ["Capability", "CapabilityGraph", "RevocationSet", "Time"]
19
20oracle_models = ["lean"]
21
22evidence_requirements = [
23 "positive corpus of valid capabilities staying valid after unrelated revocations",
24 "negative corpus of revoked, descendant-of-revoked, and expired capabilities that must be refused",
25 "deliberate mutant that skips descendant invalidation, which must not survive",
26 "existing implementation unit tests keep passing",
27]
28
29required_counterexamples = ["revoked_token_accepted", "descendant_of_revoked_accepted", "expired_token_accepted"]
30
31omega_takeover_condition = """
32Omega expresses revocation reachability and expiry as native propositions, accepts the positive corpus, \
33rejects the negative corpus, kills the required counterexample mutants, and emits a canonical proof/evidence \
34identity that the gates consume, with Lean absent."""
35
36[[positive_examples]]
37name = "sibling_unaffected"
38description = "Two children of one parent; one is revoked. The other remains valid."
39
40[[positive_examples]]
41name = "parent_unaffected"
42description = "A child is revoked. Its parent remains valid."
43
44[[negative_examples]]
45name = "revoked_itself"
46description = "A revoked token is refused."
47
48[[negative_examples]]
49name = "grandchild_of_revoked"
50description = "Parent revoked after a grandchild was derived. The grandchild is refused."
51
52[[negative_examples]]
53name = "expired"
54description = "Token with now greater than its valid_until is refused."
55
56[[counterexamples]]
57name = "revoked_token_accepted"
58description = "A token in the revoked set passes validation."
59
60[[counterexamples]]
61name = "descendant_of_revoked_accepted"
62description = "A token with a revoked ancestor passes validation."
63
64[[counterexamples]]
65name = "expired_token_accepted"
66description = "A token past its expiry passes validation."
67
68[[counterexamples]]
69name = "revocation_resurrected"
70description = "Re-deriving or re-issuing under an existing id clears a revocation."
71
72[[implementation_surfaces]]
73repo = "aien-dev/aienux"
74path = "crates/aienos-aegis/src/capability.rs"
75kind = "production"
76observed_at = "2ee61b4b158a385c5fcf2c925a625ac043babb21"
77note = "Rust: CapabilityGraph::revoke and CapabilityGraph::validate_token."
78
79[[implementation_surfaces]]
80repo = "aien-dev/aienux"
81path = "native/capability/aienos_capability.c"
82kind = "reference"
83observed_at = "2ee61b4b158a385c5fcf2c925a625ac043babb21"
84note = "C: state_revoke and cascade_revoke over generation slots. Grep-level read only; needs its own review before FORMAL-3."
85
86[[observations]]
87surface = "crates/aienos-aegis/src/capability.rs"
88text = """
89revoke(token_id) walks the recorded child map (a stack, no visited set, so it assumes a DAG) and inserts every \
90reached id, including the starting id, into a revoked set. It does not check that the starting id exists; revoking \
91an unknown id just records it. It is idempotent."""
92
93[[observations]]
94surface = "crates/aienos-aegis/src/capability.rs"
95text = """
96validate_token checks, in this order: own id in revoked set (TokenRevoked); every ancestor id reached by following \
97parent_id through the graph's token map is in the revoked set (TokenRevoked); now_utc > valid_until_utc (TokenExpired); \
98signature mismatch (InvalidSignature). The ancestor walk stops silently if an ancestor id is missing from the token map. \
99So revocation is enforced twice: eagerly by revoke's descendant walk and lazily by the ancestor walk at validation."""
100
101[[observations]]
102surface = "crates/aienos-aegis/src/capability.rs"
103text = """
104Because the revocation check precedes the signature check, a token with a forged signature but a revoked id reports \
105TokenRevoked, not InvalidSignature. Both are refusals. Expiry is inclusive: now == valid_until_utc is still valid."""
106
107[[observations]]
108surface = "crates/aienos-aegis/src/capability.rs"
109text = """
110validate_token validates only the token passed in plus revocation state of its ancestors. It does not re-check ancestors' expiry or \
111signatures. In the current derive rule a child's expiry equals its parent's, so an expired ancestor implies an expired child."""
112
113[[observations]]
114surface = "crates/aienos-aegis/src/capability.rs"
115text = """
116derive_child_token inserts into the token map under child_id without checking for an existing entry and does not clear \
117the 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."""
118
119[[observations]]
120surface = "native/capability/aienos_capability.c"
121text = """
122Grep-level only. The C authority revokes by cascade over slots (cascade_revoke) and uses generation slots for reuse; \
123its documented behavior is 'revoking an ancestor revokes the descendants'. Not audited line by line for this manifest."""
124
125[[observations]]
126surface = "PLAN.md section 9 versus code"
127text = """
128no divergence found for 'revocation rejects the revoked token', 'revocation invalidates descendants', 'expired capability is invalid' in the Rust code. \
129The C model differs structurally (generation slots, '>=' expiry) and is recorded under the attenuation manifest."""