interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / argus / docs / ARGUS1_PLAN.md

159 lines · 10512 bytes Raw Blame History Rendered
1# ARGUS-1 (containment) execution plan
2
3Spec: native/argus/docs/ARGUS1_SPEC.md (pre-registered 2026-09-29 on feat/argus-1-spec, base a64bc55).
4Code held until ARGUS_PERFORMANCE_GATE passes (FAIL at a64bc55).
5Everything in C. No GPU use anywhere. Reports go to ~/workspace/argus-reports/<lane>.md.
6
7## 0. Preconditions (orchestrator; no ARGUS-1 code before all hold)
8
91. ARGUS-0 closed: integrator round 3 finished on feat/argus-0 (WIP be2814d is unverified),
10 ARGUS0_GATES.md written, draft PR open. Handoff rule: ARGUS-1 code only if all ARGUS-0 gates
11 pass; otherwise spec only.
122. DONE: authority observer hook 12add16 (feat/capability-observer) merged to aienos main
13 (d39dd5b); lane G bases on it.
143. Record the ARGUS-0 closing commit hash + its Spark bench numbers: this is G8's baseline.
154. Decisions D1-D5 answered (done 2026-09-29, spec section 0), then the spec commit (done).
165. ARGUS_PERFORMANCE_GATE: PASS-WITH-DOCUMENTED-LIMITS at omega cf6f45d (requires spare core;
17 unpinned FAIL). Was FAIL at a64bc55: R8 wall +6.2%.
18
19## 1. Lanes
20
21No two lanes touch the same production file. argus_abi.h is orchestrator-only.
22Worktrees: ~/workspace/aienos-argus1-<lane> on branches feat/argus-1-<lane>, cut from the spec
23commit (after the header commit). Omega lane: ~/workspace/omega-argus1-o.
24
25| Lane | Owner files | Needs | Where | Size |
26|---|---|---|---|---|
27| L0 orchestrator | argus_abi.h (v1.2), Makefile, docs/ARGUS1_SPEC.md, tests/test_argus_integration.c | preconditions | Mac | ~150 header lines |
28| B event/ring | argus_event.c, argus_ring.c, tests/test_argus_event.c, tests/fuzz_argus_event.c, tests/test_argus_ring.c | L0 header | Mac, then Spark (fuzz/TSan) | ~250 + 300 test |
29| D core | argus_core.c, argus_core.h, tests/test_argus_core.c, tests/test_argus_determinism.c | L0 | Mac, then Spark | ~80 + 150 test |
30| C contain (new) | argus_contain.c, argus_contain.h, tests/test_argus_contain.c | L0 (B for request encode) | Mac, then Spark | ~600 + 800 test |
31| E corpus | tests/stub_state.c, tests/stub_state.h (containment scenario generators) | L0 | Mac | ~300 |
32| G AEGIS gate (new) | native/capability/aienos_contain.c/.h, native/capability/tests/contain_test.c, native/capability/Makefile | observer hook; L0 for the layout twin | Mac, then Spark | ~500 + 600 test |
33| X bridge (new) | native/argus/bridge/argus_aegis_bridge.c/.h, tests/test_argus_containment_e2e.c | B, C, D, G | Spark (links the authority, pthread) | ~300 + 600 test |
34| H hostile | tests/test_argus_contain_hostile.c, docs/HOSTILE_REVIEW.md (containment section) | X | Spark | ~700 |
35| F perf + FP | tests/bench_argus_contain.c, docs/ARGUS1_GATES.md | X, H | Spark only, quiet | ~250 |
36| O Omega binding (optional) | omega src/runtime/rx_aegis_contain.c/.h + test (new files only) | G merged | Spark | ~250 |
37| A ADR amend | aien-architecture docs/adr/0017 §4, §5, §13, §16 | spec final | Mac | ~150 doc lines |
38
39### Lane briefs
40
41L0: Write the spec commit. Then header v1.2: kinds 90-93 + field conventions (spec §3); codes
4217-20, F_MAX 20, KIND_MAX 93; request struct append + ARGUS_CONTAIN_REQUEST_SIZE 152 +
43encode/decode/digest declarations; ArgusContainHealth; argus_core_incident declaration; table
44constants. Makefile targets for the new tests. After X: extend test_argus_integration.c with
45the G2/G6 end-to-end runs and GATE lines. Owns all merges and the final PR.
46
47B: Validate kinds 90-93 (status/outcome pairs, CRITICAL floor, CONSUMER iff kind in {80,90}).
48argus_ring_push refuses kind 90 (MALFORMED). Request encode/decode/digest (152 bytes, known
49answers). Extend the fuzz run to requests. Prove the ARGUS-0 event/chain vectors are unchanged.
50
51D: The core accepts kinds 90-93: validated, chained, counted, no shadow change; detectors never
52see them as triggers. Implement argus_core_incident(). Determinism test gains a recorded
53containment stream. Core state digest stays v3 (no new state).
54
55C: New module per spec §4: observe/propose API, pending 32 / recent 128 / window budget,
56state machine 4.1, proposal rules 4.2 (incl. the never-propose filter), codes 17-21, health,
57state digest. No authority include. Unit tests for every transition and every suppression.
58
59E: Corpus generators: finding storm (G5), 256-principal amplifier, cap-0 framing streams,
60table saturation, and a benign stream with healthy grant/revoke churn (G10). No production code.
61
62G: New AEGIS containment gate per spec §5 inside native/capability (authority file untouched):
63authorizer interface + table policy, REVOKE-only executor cap minted at create, protected
64list, request_id/decision_id rules, budget, secret-gated resolve, UNAVAILABLE for non-LIVE types,
65sink, lineage index fed by the observer (leaf check, I1), re-check before revoke. Test seams to
66disable the protected list (for G9's layer tests) and to mint a child between decide and execute. The layout twin
67AienosContainRequest + an offsetof test. Validate instruction count re-checked (179).
68
69X: The trusted glue per spec §6. The e2e tests for G3/G4/G6: real authority + observer + gate +
70ARGUS in one process, a single bridge thread, the order 90,91,4..,92 asserted. An offline
71chain checker (G6) as a test helper.
72
73H: Read-only hostile pass over spec + code first, then the G9 test list; each test labelled
74DEFENDED/EXPECTED-FAIL like ARGUS-0; HOSTILE_REVIEW.md containment section with verdicts.
75
76F: Take ~/workspace/.argus-bench.lock (flock); refuse to start while ~/workspace/.spark-quiet
77exists. Interleaved A/B x5 against the ARGUS-0 closing commit (G8). G10 over the benign corpus
78x9 and the recorded R7/R8/R9 streams. Write ARGUS1_GATES.md with every GATE line.
79
80O (optional, own gate O-G1): Bind AienosContainAuthorizer to Omega's policy faculty: a new
81rx_aegis_contain file calling rx_aegis_evaluate-style rules for containment, plus kind 93 on
82grant ESCALATE (closes ADR §16.4 in the runtime). Pinned to aienos via argus.lock like lane H.
83Follows the omega session rules (one merge + one heavy test at a time). May slip to ARGUS-2
84without blocking ARGUS-1.
85
86A: Amend ADR 0017: §4 chain now concrete (spec §1, §5); §5 sync table ratified, none wired;
87§13 ladder reconciled (see risks); §16.4 closed by kinds 91/93. Local commit only, push per D6.
88
89## 2. Ordering
90
91```
92wave 0 preconditions -> spec commit -> L0 header v1.2
93wave 1 B, D, C, E, G in parallel (C uses B's encode via the header declaration; stub until B lands)
94wave 2 merge B, D, C, E, G -> X bridge + e2e; O may start once G merges
95wave 3 H hostile, then F perf + FP (Spark, quiet), then L0 integration + G12 full run
96wave 4 A ADR amend; PR (aienos: argus + capability parts together, or gate as its own PR)
97```
98
99Gate-to-lane: G1 B+L0, G2 C+D+L0, G3/G4/G6 X, G5 C+E, G7 C+G, G8 F, G9 H, G10 F+E, G11 L0,
100G12 L0, G13 (invariants I1-I5) H+X.
101
102## 3. Mac vs Spark
103
104Mac (rsync + `make test`, arm64 clang): all unit work in waves 0-1 and plain `make test`.
105Spark: sanitizers (Linux-only `make sanitize`), TSan, the bridge (pthread + authority),
106hostile, all benches, the G10 runtime streams. Only while no .spark-quiet file exists, and under
107the bench lock. No GPU seat is used by any lane.
108
109## 4. Estimated size
110
111~4,500 lines total (about 1,900 production, 2,600 tests), 9 workers + the orchestrator,
1123-4 waves. The largest lanes are C and X.
113
114## 5. Risks
115
116- G-5 (no producer identity): a trusted producer can frame a principal and trigger a freeze
117 request. Bounded by "ask" policy + budget; closed only by producer attestation (later rung).
118- Only 1 of 10 containment types is live; reviewers may read "ARGUS-1 containment" as more.
119 Every SYNTH path carries the SYNTHETIC flag and the gates label it.
120- The authority itself allows an office-rights holder to revoke slot 0. The REVOKE-only
121 executor cap is the structural defence; G9 layer 3 must prove it.
122- The observer runs outside the table lock; multi-thread ordering is not guaranteed. The bridge
123 serializes on one thread; any other admin caller in the process can interleave (documented).
124- Revoke's observer snapshot is ~23 KB of stack: the bridge thread needs a normal stack.
125- G8 depends on a quiet Spark; the other session's omega runs can block it (do not wait: report
126 BLOCKED, not FAIL).
127- Ladder mismatch: brief §4 lists containment as ARGUS-2, brief §9 as ARGUS-1; ADR 0017 §13
128 puts ARGUS-1 = containment, ARGUS-3 = evidence, ARGUS-7 = Fabric, while the handoff says
129 producer attestation is ARGUS-3 and this task calls Fabric quarantine ARGUS-2. Lane A
130 reconciles §13 to one table; nothing in ARGUS-1 depends on the numbering.
131- H2 (omega producer redesign) is WIP and unverified; its numbers are not used as a baseline.
132
133## 6. Decisions
134
135Decided by Drake 2026-09-29 and encoded as binding invariants I1-I5 in ARGUS1_SPEC.md section 0,
136each with hostile tests in gate G13:
137
138- D1 DECIDED (I1): automatic action = revoking ONE ordinary, narrowly scoped capability from ONE
139 subject: a leaf (no live descendants), non-privileged cap of a non-privileged subject, on a
140 DETERMINISTIC finding for that exact (cap_id, generation). No cascades. Attributable,
141 generation-bound, receipted, recoverable by operator re-mint. Everything else waits for Drake.
142- D2 DECIDED: Drake is the "human" for ESCALATE; ARGUS-1 uses a test stub holding the owner
143 secret; unanswered requests expire until a real approval screen exists (later rung).
144- D3 DECIDED (I2): FreezePrincipal stays a synthetic stand-in until a real qualified suspension/
145 isolation primitive exists; nothing may imply a real freeze exists.
146- D4 DECIDED (I3): whole-system actions (shutdown, global quarantine, trust-root replacement,
147 mass revocation, whole-machine rollback, promotion/recovery authority) are never ARGUS actions;
148 operator/governance/AEGIS path only.
149- D5 DECIDED (I4): no synchronous blocking in ARGUS-1; the table is ratified as data only.
150- Extra rule (I5): ARGUS never expands its own authority; it uses only the pre-granted
151 REVOKE-only executor cap, and every use is independently auditable.
152- D6 OPEN: ADR 0017 push + PR to aien-architecture (the harness refused the worker's push before;
153 needs Drake's OK).
154- D7 OPEN: MachineId/Fabric identity. Until decided, machine quarantine and re-attestation stay
155 synthetic, and producer attestation cannot start.
156
157Orchestrator calls (not Drake): the gate lives in native/capability behind an authorizer
158interface (Omega cannot be linked from aienos); the gate ships in the same PR as argus or as
159its own capability PR; the Omega lane O stays optional.