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 / bootstrap / formal-oracles / lean / DISCREPANCIES.md

60 lines · 7649 bytes Raw Blame History Source

Rust versus C capability semantics (FORMAL-3 prep)

Observed on aien-dev/aienux main 2ee61b4. Read only. This note records what each implementation does. The Lean model in AienCap/Model.lean models the Rust code only.

TopicRust crates/aienos-aegis/src/capability.rsC native/capability/aienos_capability.c
AuthorityCapabilityScope::contains (typed scope, per kind rules), checked at line 280Rights bitmask. r->rights & ~auth->rights refuses with AIENOS_CAP_ERR_AMPLIFY (line 253). Privileged right is never delegable (line 254). Resource must be equal (line 252)
Child expiryNot an argument. Child gets parent expiry exactly (line 288)Child lease is clock + lease_ticks, chosen by caller. If parent expiry is nonzero, child must be nonzero and <= parent or ERR_AMPLIFY (lines 257 to 261). If parent expiry is 0 (no expiry) any child expiry is allowed
Expiry boundaryExpired only when now > valid_until (line 354). Equal is still validExpired when lease_expiry != 0 && clock >= lease_expiry (line 97). Equal is expired
DepthPer-token counter. Child depth = parent depth - 1 (line 287). Parent depth 0 refuses DelegationDepthExceeded (line 276)No counter. Absolute chain cap AIENOS_CAP_MAX_DEPTH = 8 (header line 23), enforced by ancestor_hops(...) >= AIENOS_CAP_MAX_DEPTH returning ERR_CHAIN (line 255). Delegation also needs the DELEGATE right (line 250)
Validity check orderrevoked, ancestor revoked (lines 345 to 352), expired, signatureState based slot validity with generation and cascade revoke (cascade_revoke), no signature
Revocationrevoke marks the token and all child_map descendants (line 319); validate_token also walks ancestorsRevokes live descendants by cascade over slots
Duplicate child idderive_child_token does not check child_id. self.tokens.insert(child_id, ...) at line 312 silently overwrites an existing token and child_map gets a second entry at line 313. The caller supplies child_idSlots are allocated by the authority (first free slot, generation counter), the caller does not choose the id
Holdernew_holder is not checked against the parent holderAuthority must equal parent reference (lines 244 to 246)

Consequence for the Lean model: the Rust "child expiry <= parent" and "child depth < parent depth" hold by construction (equality, and minus one). The C rules differ in kind. They are separate takeover items, not assumed equal. The overwrite behaviour affects identity uniqueness, not attenuation, and is not modelled (the model lets a newer token shadow an older one with the same id).

Receipt consistency (FORMAL-4)

Observed on aien-dev/aienux main 2ee61b4, crates/aienos-artifact/src/receipt.rs. Read only. The Lean model is AienReceipt/; it models validate, decode and encode (field level, offsets in AienReceipt/Layout.lean).

Finding: CanaryFailed decision is not tied to the CanaryFailed execution status

Code is stronger than the plan

As the manifest notes: Rejected also forces exit status 0, zero syscalls, zero object reads, zero denials, and result flags limited to RECLAIMED (lines 338 to 345). The Lean theorems prove the code's rules. rejected_arm is the full Rejected arm.

Abstractions (assumptions, not proofs)

SHA-256 nonce derivation is an arbitrary function nf (every theorem holds for all nf). Ed25519 is not modelled (verify is out of scope; validate does not check signatures). Digests are naturals, zero meaning all zero. Little-endian byte packing is assumed to be a per-field bijection. Integer width overflow is not modelled. Unknown flag bits are unrepresentable in the model; decode checks them on the raw word (flags < 8, rflags < 256). exit_status is an Int. Opaque digests that no rule reads are kept as one list.

Sequence identity and KV layout (FORMAL-6)

Observed on aien-dev/sovereign-core main dd1fe32 (PREFILL-E2E C8 merged, #154). Read only. Models: AienSeq/ (runtime SequenceArena) and AienKv/ (KvLayout).

Finding: two sequence arenas, different wrap policy

Finding: KV layout arithmetic is unchecked

Not covered (stated so nobody reads more into the proofs)