aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / argus / docs / HOSTILE_REVIEW.md
| 1 | # ARGUS-0 hostile review (lane G) |
| 2 | |
| 3 | Reviewer: lane G (hostile). Date: 2026-09-28. **Re-verdicted by the integrator, |
| 4 | round 2 (2026-09-29)** after lanes B `58d5a99`, D `57a7bea`, E `a33c1e0` were merged |
| 5 | into `feat/argus-0` on top of the ABI rules commit `4cd73cc` (`b6c782a`). |
| 6 | **Re-verdicted again by the integrator, round 3 (2026-09-29)** after the ABI v1.1 lane |
| 7 | (`92277dd`, header `398cfb9`) was merged and rulings (a) and (c) were applied. |
| 8 | |
| 9 | ## Status after integrator round 3 (final for ARGUS-0) |
| 10 | |
| 11 | Result on the Spark (see `docs/ARGUS0_GATES.md` for commit and command): **63 tests: |
| 12 | 58 defended, 3 expected-fail, 2 N/A-v1, 0 xpass, 0 unexpected, exit 0.** |
| 13 | |
| 14 | What changed in round 3: |
| 15 | - ABI v1.1 merged: stream id in flag bits 2-15, sequence streams keyed by |
| 16 | (machine_id, stream, CONSUMER); cap 0 is the authority OFFICE capability (a real |
| 17 | slot, checked like any other) and "no capability" is `ARGUS_CAP_NONE`; |
| 18 | CAPABILITY_USE_SUMMARY (kind 81) with MAX generation in cap_generation and MIN |
| 19 | generation in world_generation (64-bit, header `398cfb9`); per-store World shadows (8). |
| 20 | Validate now also rejects a summary whose MIN (world_generation) is above its MAX |
| 21 | (cap_generation); object_id is left unchecked for forward compatibility. |
| 22 | - Test harness follows v1.1: `ev0()` sends `cap_id = ARGUS_CAP_NONE`; every |
| 23 | `use(0, ...)` that meant "no capability" is now `use(ARGUS_CAP_NONE, ...)`; the World |
| 24 | shadow is read per store (`world(view, 0, &w)`). |
| 25 | - `zero_machine_id_escapes_attribution` now passes only for the right reason: it |
| 26 | requires code 7 (MACHINE_IDENTITY_MISMATCH). Under v1.1 a use of cap 0 would have |
| 27 | "passed" through code 1 (forged: cap 0 never granted), which would hide a regression |
| 28 | in the zero-machine rule. Checked: the finding is code 7. |
| 29 | - Ruling (a), G-20: "loud once" now holds for EVERY shadow table (machines, leases, |
| 30 | providers, artifacts, worlds), not only producers. First overflow of a table = |
| 31 | ERR_FULL + one CRITICAL TELEMETRY_LOSS; later overflows of that table = ERR_FULL, no |
| 32 | finding, counted in `tables_full` and `events_not_applied`. The latch is per table, so |
| 33 | one saturated table does not silence another. ARGUS-1 turns a saturated table into a |
| 34 | ContainmentRequest (state is bounded by design). Tests: `machine_table_exhaustion_hides_quarantine` |
| 35 | and `lease_table_exhaustion` now also assert the quiet, counted second overflow; new |
| 36 | test `every_table_loud_once` (providers, artifacts, worlds in one core). |
| 37 | - Ruling (c): `sequence_gap_unflagged` is N/A-v1 (gaps are legitimate ring refusals; |
| 38 | exempt from the exit code); `replay_evades_by_rekeying_stream` (machine_id variant) |
| 39 | is EXPECTED-FAIL under G-5 (no producer identity in v1). |
| 40 | |
| 41 | ### Remaining open after round 3 (ABI v1 limits) |
| 42 | |
| 43 | | # | Sev | Section | Status | What is still possible | |
| 44 | |---|---|---|---|---| |
| 45 | | 1 | HIGH | G-5 | OPEN, ABI v1 limit (EXPECTED-FAIL `unattributed_grant_masks_forged_use`) | No producer identity: anything that can push can announce a GRANTED that makes its own later use look legitimate. Mitigated only by the v1 trust boundary (push reachable only from AEGIS/runtime code). Producer attestation is ARGUS-3. | |
| 46 | | 2 | MEDIUM | G-21 under G-5 | WEAK, ABI v1 limit (EXPECTED-FAIL `replay_evades_by_rekeying_stream`, ruling c) | A byte replay with a different machine_id is a new sequence stream and escapes the replay check. Same root as #1. | |
| 47 | | 3 | LOW | G-9 | WEAK, ABI v1 limit (EXPECTED-FAIL `provider_substitution_escapes_quarantine`) | A quarantined provider that reappears under a new digest is clean. | |
| 48 | | 4 | LOW | G-21 / G-8 / G-20 | WEAK, bounded, loud once per table | Streams beyond the 256-entry producer table are replay-blind; a machine beyond the 64-entry table cannot carry a quarantine (its use is still code 7); any full table stops mirroring new entries (one CRITICAL, then counted). | |
| 49 | | 5 | LOW | G-12 | WEAK, unchanged | Two opaque 32-byte slots can carry a secret; the guard must be producer-side. | |
| 50 | | 6 | LOW | G-17 | WEAK, unchanged | The ring is SPSC by contract only; a second producer loses events silently. | |
| 51 | | 7 | N/A-v1 | G-6 | documented limitation (N/A-v1 `sequence_gap_unflagged`, ruling c) | A stream jumping from 1 to 100 with no drop report is not a finding. | |
| 52 | | 8 | N/A-v1 | G-7 | documented limitation (N/A-v1 `critical_self_label_starves_security`) | Low-value kinds self-labelled CRITICAL can fill the ring and starve SECURITY. | |
| 53 | |
| 54 | Verdict counts after round 3 (26 sections): **DEFENDED 20, WEAK 4, OPEN 1, N/A-v1 1** |
| 55 | (OPEN: G-5; WEAK: G-9, G-12, G-17, G-21; N/A-v1: G-6). Changes from round 2: G-20 |
| 56 | WEAK -> DEFENDED (ruling a); G-6 OPEN -> N/A-v1 (ruling c); G-21 OPEN -> WEAK (its |
| 57 | remaining open variant is the G-5 limit, ruling c; the overflow residue is bounded). |
| 58 | |
| 59 | ## Status after integrator round 2 (superseded by round 3 above) |
| 60 | |
| 61 | Tests: `tests/test_argus_hostile.c`, now part of `make test` (built from `out/libargus.a` |
| 62 | only; the exit code counts). Each prints `HOSTILE <name> PASS|FAIL`. Three modes: |
| 63 | expected-defended (a FAIL is UNEXPECTED and fails the build), EXPECTED-FAIL (a known |
| 64 | open item, reported, does not fail the build), and N/A-v1 (an attack ABI v1 accepts by |
| 65 | design; reported, exempt from the exit code). |
| 66 | |
| 67 | Result on the Spark (gcc, aarch64) and on the MacBook (Apple clang 17, macOS 26.6), and |
| 68 | under ASan+UBSan on the Spark: **62 tests: 57 defended, 4 expected-fail, 1 N/A-v1, |
| 69 | 0 xpass, 0 unexpected, exit 0.** |
| 70 | |
| 71 | Attribution rule for "fixed in": the commit whose component holds the logic that now |
| 72 | defends the test (validate/ring = B `58d5a99`, core apply/lifecycle/tables = D `57a7bea`, |
| 73 | detectors = E `a33c1e0`, ABI rules/codes/table sizes = `4cd73cc`). It was checked by |
| 74 | rebuilding the hostile test with one lane reverted to `4cd73cc` at a time: the tests that |
| 75 | fall back to FAIL are that lane's. Tests marked "D + E" pass if either lane is present. |
| 76 | |
| 77 | Rulings applied to the test file in round 2 (orchestrator): |
| 78 | - `ev0()` sends each kind at `argus_event_min_class(kind)` (SECURITY for an unknown |
| 79 | kind); tests that relied on a weaker class were written before the class floor existed. |
| 80 | - Code 16 (MALFORMED_EVENT) is an accepted defended outcome where validate now rejects |
| 81 | first (`cap_id_out_of_range_use_is_forged`, `effect_kind_mislabelled`, |
| 82 | `replay_rekeyed_by_consumer_flag`). |
| 83 | - INFORMATIONAL/AUDIT ring floods use the non-v1 kind `0x7FFF`: no v1 kind has an |
| 84 | INFORMATIONAL floor (design fact), and the ring is transport with no floor for an |
| 85 | unknown kind. |
| 86 | - `critical_self_label_starves_security` is N/A-v1: producers are inside the trusted |
| 87 | boundary in v1 and may strengthen a class (the table is a floor, not a ceiling). |
| 88 | - `world_skip_flagged` rollback case is World 1, 2, 1. `world_repeat_silent` is |
| 89 | re-scoped: a repeat with the same generation and digest is idempotent and silent |
| 90 | (RULED); a repeat with a different digest must be code 9. **ADR 0017 row 9 must be |
| 91 | amended** to read "repeated a generation with a different digest". |
| 92 | - Table-exhaustion tests fill the new sizes exactly and overshoot them (machines 64, |
| 93 | producers 256, incidents 256, leases 256; a lease test was added). Producer overflow |
| 94 | follows the RATIFIED rule: the first untracked event returns ERR_FULL with one CRITICAL |
| 95 | TELEMETRY_LOSS, later ones return OK and are counted in `producers_untracked`. |
| 96 | - `zero_machine_id_escapes_attribution` sends flags 0: the zero-machine rule exempts |
| 97 | SYNTHETIC and CONSUMER events, which is what the old test sent. |
| 98 | - `replay_evades_by_rekeying_stream` was split: the CONSUMER-flag variant is now |
| 99 | defended (code 16, new test `replay_rekeyed_by_consumer_flag`); the machine_id variant |
| 100 | keeps the old name and stays EXPECTED-FAIL. |
| 101 | - Fixed a test bug: `state_digest_sensitive_to_every_table` variant 7 turned an |
| 102 | ADMITTED into a REJECTED without raising its class to the CRITICAL floor, so the |
| 103 | variant was rejected as malformed and did not test the artifact table. |
| 104 | |
| 105 | ### Remaining open in ARGUS-0 |
| 106 | |
| 107 | | # | Sev | Section | Status | What is still possible | |
| 108 | |---|---|---|---|---| |
| 109 | | 1 | HIGH | G-5 | OPEN, ABI v1 limit (EXPECTED-FAIL `unattributed_grant_masks_forged_use`) | No producer identity: anything that can push can announce a GRANTED that makes its own later use look legitimate. Mitigated only by the v1 trust boundary (push reachable only from AEGIS/runtime code). Producer attestation is ARGUS-3. | |
| 110 | | 2 | MEDIUM | G-21 | OPEN, no ruling (EXPECTED-FAIL `replay_evades_by_rekeying_stream`) | A byte replay with a different machine_id is a new sequence stream and escapes the replay check. Same root as #1. | |
| 111 | | 3 | MEDIUM | G-20 | WEAK, no ruling, found in round 2 (no test) | Only the producer table got the "loud once" rule. Every event beyond a full machine (64), lease (256), provider (32) or artifact (256) table still returns ERR_FULL with its own CRITICAL TELEMETRY_LOSS (measured: 6 extra JOINED = 6 CRITICAL; same for leases, providers, artifacts). Machine and lease tables never free, so once full this is a per-event CRITICAL amplifier. | |
| 112 | | 4 | MEDIUM | G-6 | OPEN, no ruling (EXPECTED-FAIL `sequence_gap_unflagged`) | A stream jumping from 1 to 100 with no drop report is not a finding (the core documents "gaps are not findings"). | |
| 113 | | 5 | LOW | G-9 | WEAK, ABI v1 limit (EXPECTED-FAIL `provider_substitution_escapes_quarantine`) | A quarantined provider that reappears under a new digest is clean: no provider identity continuity in v1 (registry is N/A-ARGUS-0). | |
| 114 | | 6 | LOW | G-21 / G-8 | WEAK, bounded | Streams beyond the 256-entry producer table are replay-blind (loud once, counted); the 65th machine's quarantine cannot be recorded (loud, and its use is still code 7). | |
| 115 | | 7 | LOW | G-12 | WEAK, unchanged | Two opaque 32-byte slots can carry a secret; the guard must be producer-side. | |
| 116 | | 8 | LOW | G-17 | WEAK, unchanged | The ring is SPSC by contract only; a second producer loses events silently. | |
| 117 | | 9 | N/A-v1 | G-7 | documented limitation (N/A-v1 `critical_self_label_starves_security`) | Low-value kinds self-labelled CRITICAL can fill the ring and starve SECURITY. | |
| 118 | |
| 119 | Verdict counts after round 2 (26 sections): **DEFENDED 19, WEAK 4, OPEN 3, N/A-v1 0** |
| 120 | as whole-section verdicts (OPEN: G-5, G-6, G-21; WEAK: G-9, G-12, G-17, G-20). Sub-items |
| 121 | that are N/A-v1 or N/A-ARGUS-0 are marked inside their sections (G-2, G-7, G-9, G-10, |
| 122 | G-15, G-21). See each section's "Round 2" line. |
| 123 | |
| 124 | ### Ranked list as first found (at `e16ba31`), with round-2 status |
| 125 | |
| 126 | | # | Sev | Section | One line (as found) | Round 2 | |
| 127 | |---|---|---|---|---| |
| 128 | | 1 | CRITICAL | G-5 OPEN | No producer identity: any holder of the ring (or caller of ingest) sets principal, outcome, machine_id, class and even the CONSUMER ("ARGUS itself") flag. | CONSUMER flag and class floor DEFENDED (`58d5a99`); producer identity OPEN (ABI v1 limit) | |
| 129 | | 2 | CRITICAL | G-3 OPEN | A replayed or forged GRANTED at the same generation revives a REVOKED shadow slot; byte-exact replays are flagged and then applied anyway. | DEFENDED (`57a7bea` code 13, anomalous events not applied; `a33c1e0` code 14) | |
| 130 | | 3 | HIGH | G-8 OPEN | Quarantine laundering: REMOVED then JOINED; self-announced TRUSTED; zero machine_id escapes; machine table full drops the quarantine. | DEFENDED (`57a7bea` tombstones, trust down only, table 64; `a33c1e0`: code 15 on trust escalation, code 7 on a zero machine_id); table limit WEAK, bounded | |
| 131 | | 4 | HIGH | G-4 OPEN | Future generation use unflagged; forged REVOKED at UINT64_MAX poisons a slot forever. | DEFENDED (`a33c1e0`, `57a7bea`) | |
| 132 | | 5 | HIGH | G-20 OPEN | Free CRITICAL amplifiers: cap_id >= 256, 33rd producer, 17th machine, forged TELEMETRY_DROPPED. | cap_id and forged drop DEFENDED (`58d5a99`); producer overflow RATIFIED (`57a7bea`); per-event amplifier remains on machine/lease/provider/artifact overflow: WEAK | |
| 133 | | 6 | HIGH | G-13 OPEN | Incident table fills with junk; saturation invisible in health. | DEFENDED (`57a7bea`: table 256, `incidents_untracked` in health; still no eviction) | |
| 134 | | 7 | HIGH | G-7 WEAK / G-6 OPEN | Class not bound to kind: security event lost as INFORMATIONAL; junk labelled CRITICAL starves SECURITY. | lost-as-INFORMATIONAL DEFENDED (`58d5a99`); CRITICAL self-label N/A-v1 (ruled) | |
| 135 | | 8 | HIGH | G-26 OPEN | Second LEASE_CREATED rewrites a live lease. | DEFENDED (`57a7bea` not applied; `a33c1e0` code 6) | |
| 136 | | 9 | MEDIUM | G-21 OPEN | UINT64_MAX sequence poison; rekeyed replays; producer table never frees. | poison DEFENDED (`58d5a99`); CONSUMER rekey DEFENDED (`58d5a99`); machine_id rekey OPEN; overflow RATIFIED, replay-blind beyond 256 WEAK | |
| 137 | | 10 | MEDIUM | G-10 OPEN | TRUST_CHANGED before JOINED bricks a machine; JOINED declares its own trust. | DEFENDED (`57a7bea`, `a33c1e0`) | |
| 138 | | 11 | MEDIUM | G-15 OPEN | Flagged World skip still adopted; UINT64_MAX freezes World tracking. | DEFENDED (`57a7bea`); repeat RULED idempotent, ADR row 9 to amend | |
| 139 | | 12 | MEDIUM | G-24 OPEN | Mislabelled effect kind; EVIDENCE under READ-only. | DEFENDED (`58d5a99` validate, code 16; `a33c1e0` detector 8) | |
| 140 | | 13 | MEDIUM | G-6 OPEN | Sequence gaps undetected; malformed events leave no evidence. | malformed evidence DEFENDED (`57a7bea` code 16); gaps OPEN, no ruling | |
| 141 | | 14 | MEDIUM | G-14 OPEN | Policy/runtime digests never checked; INTEGRITY_VIOLATION ignored. | DEFENDED at announcement level (`a33c1e0`: digest overwrite and INTEGRITY_VIOLATION raise code 5, sync 0) | |
| 142 | | 15 | MEDIUM | G-2 WEAK | Self-reports yield sync-eligible FREEZE_PRINCIPAL against any principal. | DEFENDED (`a33c1e0`: uncorroborated self-reports sync 0, containment NONE) | |
| 143 | | 16 | LOW | G-9 WEAK | Provider substitution; never-discovered provider use. | undiscovered use DEFENDED (`a33c1e0`); substitution WEAK, ABI v1 limit | |
| 144 | | 17 | LOW | G-12 WEAK | Two opaque 32-byte slots could carry a secret. | unchanged, WEAK | |
| 145 | | 18 | LOW | G-17 WEAK | SPSC by contract only. | unchanged, WEAK | |
| 146 | |
| 147 | ## Original review (lane G, at `e16ba31`) |
| 148 | |
| 149 | Code reviewed: `argus_abi.h`, `argus_event.c`, `argus_ring.c`, `argus_core.c`, |
| 150 | `argus_detect.c`, plus ADR 0017 (aien-architecture branch `docs/adr-0017-argus`) and |
| 151 | `native/capability/aienos_capability.h`. Line numbers in the sections below are for |
| 152 | `e16ba31` and are historical. Original results: 60 tests, 27 defended, 33 expected-fail, |
| 153 | 0 unexpected. Original verdict counts: DEFENDED 8, WEAK 5, OPEN 13. |
| 154 | |
| 155 | Original bottom line: the substrate mechanics are sound (the ring never blocks, drop |
| 156 | accounting is exact, the core is deterministic and snapshot-safe, the state digest covers |
| 157 | every shadow field) but ARGUS-0 believed every field of every event and applied events it |
| 158 | had itself flagged as replays. The mandatory header changes below were adopted in |
| 159 | `4cd73cc` (items 1 to 6; item 6's reporter identity is ARGUS-1 ABI v2) and implemented in |
| 160 | the three lane commits. |
| 161 | |
| 162 | ## Header changes I consider mandatory before a hostile gate can pass |
| 163 | |
| 164 | 1. **Consumer voice separated from the wire.** `argus_event_validate` rejects |
| 165 | `ARGUS_FLAG_CONSUMER` on any kind other than `TELEMETRY_DROPPED`, and the core raises |
| 166 | TELEMETRY_LOSS only for CONSUMER-flagged drops (better: a separate |
| 167 | `argus_core_ingest_drops()` entry so pushed events can never carry that flag). |
| 168 | 2. **Bounds in the ABI.** Add `ARGUS_CAP_MAX` (= `AIENOS_CAP_MAX`, 256) and make |
| 169 | `cap_id >= ARGUS_CAP_MAX` MALFORMED (or a FORGED finding), never ERR_FULL. |
| 170 | 3. **Kind to minimum class table** in the header, enforced by validate and by |
| 171 | `argus_ring_push` (e.g. CAPABILITY_*, CREDENTIAL_*, MACHINE_TRUST_CHANGED, WORLD_COMMITTED |
| 172 | >= SECURITY; FORGED_CAPABILITY, INTEGRITY_VIOLATION, SIGNATURE_FAILURE, STALE_GENERATION |
| 173 | = CRITICAL; nothing informational may claim CRITICAL). |
| 174 | 4. **Health exposes saturation.** `ArgusCoreHealth` gains `incidents_untracked`, |
| 175 | `producers_untracked`, and a per-table `table_full` count. Appending fields changes the |
| 176 | struct, so do it now, before any consumer depends on it. |
| 177 | 5. **Replay/anomaly semantics.** Replace the convention "the core reports a |
| 178 | repeat/decrease as SEQUENCE_ANOMALY and still applies the event" with "an anomalous |
| 179 | event is detected but never applied", and state that a GRANTED whose generation is not |
| 180 | strictly greater than the shadow's generation for that slot is never applied (and is a |
| 181 | finding). Same for REVOKED of a never-granted slot at an unseen generation. |
| 182 | 6. **Machine lifecycle conventions.** REMOVED keeps a tombstone (trust and quarantine |
| 183 | survive rejoin); TRUST_CHANGED for an unknown machine is a finding and creates nothing; |
| 184 | JOINED initial trust is capped at OBSERVED. Longer term the event needs a reporter |
| 185 | identity distinct from the subject machine (ARGUS-1 ABI v2). |
| 186 | |
| 187 | Items 1 to 5 are small; without them the ARGUS-0 hard invariants can be disabled by a |
| 188 | single event. |
| 189 | |
| 190 | --- |
| 191 | |
| 192 | ## G-1 ARGUS minting authority accidentally: DEFENDED |
| 193 | |
| 194 | **Round 2:** unchanged. The suggested `nm -u` on every ARGUS object is now the ARGUS_MEMORY integration gate (5 objects, 0 forbidden imports). |
| 195 | |
| 196 | As found at `e16ba31`: |
| 197 | |
| 198 | Tried: looked for any path from `native/argus` to `aienos_cap_mint`, the admin handle, |
| 199 | `aienos_cap_authorize`, or the office secret. |
| 200 | Evidence: no ARGUS source includes `aienos_capability.h`; `argus_detect.h` mirrors five |
| 201 | constants only (`argus_detect.h:20-26`); lane D's `check-core-symbols` restricts |
| 202 | `argus_core.o` imports to four ARGUS calls plus `mem*` (`lane_d.mk`). The ABI has no |
| 203 | admin, view, or secret type. |
| 204 | Test: the hostile test binary links without `libaienos_capability.a`; any `aienos_cap_*` |
| 205 | reference from ARGUS objects fails the link. Add `nm -u` on all ARGUS objects to the |
| 206 | integration gate (currently only `argus_core.o` is checked). |
| 207 | |
| 208 | ## G-2 ARGUS-to-AEGIS confused deputy: DEFENDED (containment action N/A-ARGUS-0) |
| 209 | |
| 210 | **Round 2:** DEFENDED by `a33c1e0`: a finding derived only from a self-report (kinds 60-63) carries `sync_allowed 0` and containment NONE unless the shadow corroborates it for the same principal. `reported_forgery_names_arbitrary_victim` PASS. ARGUS-1 AEGIS must still bind any freeze to the principal a reporting producer may speak for. |
| 211 | |
| 212 | As found at `e16ba31`: |
| 213 | |
| 214 | Tried: can a Finding or ContainmentRequest act as authority, and can an attacker aim one? |
| 215 | Evidence: `ArgusContainmentRequest` is a type with no consumer in ARGUS-0 (ADR 0017 §4, |
| 216 | "ARGUS-0 defines the request type only"): the action path is **N/A-ARGUS-0**. But the |
| 217 | findings that will feed it are aimable today. Detector 1 fires on `kind == |
| 218 | FORGED_CAPABILITY` with any outcome and no shadow check (`argus_detect.c:134-135`) and |
| 219 | emits CRITICAL, `sync_allowed=1`, FREEZE_PRINCIPAL with `principal` copied from the event |
| 220 | (`:145`, `:103`); the same holds for detector 2 on STALE_GENERATION (`:169-170`) and |
| 221 | detector 5 on SIGNATURE_FAILURE (`:242`). ADR §5 says sync-eligible refusal must rest on |
| 222 | a deterministic hard invariant; a producer's say-so about a third principal is hearsay. |
| 223 | Test: `reported_forgery_names_arbitrary_victim` (EXPECTED-FAIL): one FORGED_CAPABILITY |
| 224 | event naming principal 1 yields a sync-eligible FREEZE_PRINCIPAL finding. |
| 225 | Fix: findings derived only from a self-reported kind carry `sync_allowed=0`; ARGUS-1 AEGIS |
| 226 | must bind any freeze to the principal that the reporting producer is authorized to speak for. |
| 227 | |
| 228 | ## G-3 Capability replay: DEFENDED |
| 229 | |
| 230 | **Round 2:** DEFENDED by `57a7bea` (GRANTED applies only when UNSEEN or strictly above the shadow generation, otherwise AUTHORITY_REPLAY code 13; anomalous events are detected but not applied) and `a33c1e0` (SUBJECT_MISMATCH code 14 on use by another principal). PASS: `grant_replay_revives_revoked`, `exact_replay_still_applied`, `use_by_other_subject_unflagged`. |
| 231 | |
| 232 | As found at `e16ba31`: |
| 233 | |
| 234 | Tried: replay a GRANTED after REVOKED; replay byte-exact; use by another principal. |
| 235 | Evidence: `apply_cap` only ignores a generation strictly lower than stored |
| 236 | (`argus_core.c:387`); an equal-generation GRANTED overwrites a REVOKED slot as LIVE |
| 237 | (`:399-404`). No detector examines GRANTED events (`argus_detect.c:122-125` says so). |
| 238 | The core's sequence check flags a replay (`:583`) but by header convention the event is |
| 239 | still applied (`argus_abi.h` conventions; `argus_core.c:597`). Detector 3 then sees LIVE. |
| 240 | Separately, the shadow stores the granted subject (`:400`) but no detector compares it with |
| 241 | the event principal on use. |
| 242 | Tests (all EXPECTED-FAIL): `grant_replay_revives_revoked`, `exact_replay_still_applied`, |
| 243 | `use_by_other_subject_unflagged`. DEFENDED neighbours: `revoked_use_flagged`, |
| 244 | `revoked_use_denied_is_quiet`. |
| 245 | |
| 246 | ## G-4 Stale generation acceptance: DEFENDED |
| 247 | |
| 248 | **Round 2:** DEFENDED: `future_generation_use_unflagged` PASS (`a33c1e0`, a generation above the shadow is FORGED), `revoke_gen_max_poisons_slot` PASS (`57a7bea`, REVOKED of an unseen slot is code 13 and creates nothing). |
| 249 | |
| 250 | As found at `e16ba31`: |
| 251 | |
| 252 | Tried: lower, higher, and extreme generations. |
| 253 | Evidence: lower generation with outcome OK is caught (`argus_detect.c:174`), DEFENDED. |
| 254 | Higher-than-ever-granted is not: detector 1 checks only UNSEEN (`:140`), detector 2 only |
| 255 | `<` (`:174`), so a reference ARGUS never saw minted passes if the slot exists. A REVOKED |
| 256 | for an unseen slot is created at whatever generation it claims (`argus_core.c:388-398`); |
| 257 | at UINT64_MAX every later real GRANTED is ignored as stale (`:387`) and every real use |
| 258 | yields REVOKED_CAPABILITY_USED CRITICAL + STALE_GENERATION HIGH, permanently. |
| 259 | Tests: `future_generation_use_unflagged` (EXPECTED-FAIL), `revoke_gen_max_poisons_slot` |
| 260 | (EXPECTED-FAIL), `stale_generation_use_flagged` (PASS). |
| 261 | |
| 262 | ## G-5 Event forgery: OPEN (ABI v1 limit; validation parts DEFENDED) |
| 263 | |
| 264 | **Round 2:** the pure-validation parts are DEFENDED by `58d5a99`: CONSUMER only on TELEMETRY_DROPPED, and a producer TELEMETRY_DROPPED is rejected (`forged_telemetry_dropped`, `consumer_flag_accepted_from_wire` PASS); class floor per kind. Producer identity stays OPEN as an ABI v1 limit, documented in the header (`4cd73cc`: push reachable only from AEGIS/runtime code inside the trusted process; attestation is ARGUS-3). `unattributed_grant_masks_forged_use` stays EXPECTED-FAIL on purpose. |
| 265 | |
| 266 | As found at `e16ba31`: |
| 267 | |
| 268 | Tried: who can call `argus_ring_push` / `argus_core_ingest`, and what binds the fields. |
| 269 | Evidence: anyone with the ring pointer may push (`argus_ring.c:126`); push checks only the |
| 270 | class byte (`:130`). The event has no producer field; the ADR's "producer copies the |
| 271 | authority's result" is trust, not verification. `argus_event_validate` accepts |
| 272 | `ARGUS_FLAG_CONSUMER` from anyone (`argus_event.c:81`), and the core treats any |
| 273 | TELEMETRY_DROPPED as a real loss report regardless of flag or outcome |
| 274 | (`argus_core.c:601-605`). A GRANTED with a zero machine_id triggers nothing, so any pusher |
| 275 | can pre-announce grants that make its own later uses look legitimate. |
| 276 | Tests (EXPECTED-FAIL): `forged_telemetry_dropped`, `consumer_flag_accepted_from_wire`, |
| 277 | `unattributed_grant_masks_forged_use`. |
| 278 | Note: full producer authentication is out of ARGUS-0 scope, but items 1 and 3 of the |
| 279 | mandatory list close the parts that are pure validation. |
| 280 | |
| 281 | ## G-6 Event omission: N/A-v1 (gaps; ruling c, round 3) |
| 282 | |
| 283 | **Round 3:** ruled N/A-v1 (ruling c): sequence gaps are legitimate in v1 (ring refusals leave them by design; the drop report travels on the consumer stream). `sequence_gap_unflagged` is N/A-v1, exempt from the exit code. Every other G-6 item stays DEFENDED. |
| 284 | |
| 285 | **Round 2:** `malformed_event_leaves_no_evidence` PASS (`57a7bea`: MALFORMED_EVENT code 16 raised by the core, with the event digest); `security_event_lost_as_informational` PASS (`58d5a99`: a revocation cannot be labelled INFORMATIONAL, validate and ring refuse it). Sequence gaps remain undetected by design of the current core ("gaps are not findings"); `sequence_gap_unflagged` stays EXPECTED-FAIL, no ruling yet. |
| 286 | |
| 287 | As found at `e16ba31`: |
| 288 | |
| 289 | Tried: can a producer drop events without ARGUS noticing? |
| 290 | Evidence: the sequence check detects repeats and decreases only (`argus_core.c:360`); |
| 291 | a jump from 1 to 100 is silent although the header promises streams "strictly increasing |
| 292 | from 1" and refusals are separately counted, so a gap without a matching |
| 293 | TELEMETRY_DROPPED is detectable in principle. A malformed event returns before the |
| 294 | sequence check and before `argus_chain_extend` (`:571-574`, chain at `:610`): it is only |
| 295 | `events_rejected++`. A security event mislabelled INFORMATIONAL is dropped and reported |
| 296 | as an INFORMATIONAL drop, which by design raises nothing (`:601-603`). |
| 297 | Tests (EXPECTED-FAIL): `sequence_gap_unflagged`, `malformed_event_leaves_no_evidence`, |
| 298 | `security_event_lost_as_informational`. |
| 299 | |
| 300 | ## G-7 Telemetry saturation: DEFENDED (CRITICAL self-label N/A-v1) |
| 301 | |
| 302 | **Round 2:** `security_event_lost_as_informational` PASS (`58d5a99`). `critical_self_label_starves_security` is N/A-v1 by ruling: producers are inside the trusted boundary and may strengthen a class. Drop reports are now always CRITICAL by design (`58d5a99`). The flood tests use the non-v1 kind 0x7FFF for INFORMATIONAL/AUDIT (no v1 kind has an INFORMATIONAL floor). |
| 303 | |
| 304 | As found at `e16ba31`: |
| 305 | |
| 306 | Tried: INFORMATIONAL flood vs SECURITY; CRITICAL overflow accounting; drain correctness. |
| 307 | Evidence (DEFENDED): watermarks 50/75/90/100% (`argus_ring.c:67-77`); refusal is counted |
| 308 | per class, CRITICAL overflow is sticky (`:133-141`); `drain_drops` exchanges exactly what it |
| 309 | reports and preserves the rest when `max` is small (`:197-217`); drop events bypass the ring. |
| 310 | Weakness: the class is the producer's claim. Nothing binds kind to class, so the watermark |
| 311 | policy protects only honest labels (see G-6 for the silent-loss direction). Also, once any |
| 312 | CRITICAL overflow occurred, every later drop report is labelled CRITICAL (`:202-203`); |
| 313 | harmless to the core (it reads object_id) but noisy for anything keyed on class. |
| 314 | Tests: PASS `info_flood_cannot_starve_security`, `critical_overflow_accounting`, |
| 315 | `drain_partial_preserves_pending`, `attempt_conservation`; EXPECTED-FAIL |
| 316 | `critical_self_label_starves_security`, `security_event_lost_as_informational`. |
| 317 | |
| 318 | ## G-8 Quarantine bypass: DEFENDED (table limit WEAK, bounded) |
| 319 | |
| 320 | **Round 3:** unchanged verdict. `zero_machine_id_escapes_attribution` now requires code 7 itself (it sends `ARGUS_CAP_NONE`; under v1.1 a cap-0 use would have passed through code 1 instead). The machine-table overflow follows ruling (a): loud once, then quiet and counted. |
| 321 | |
| 322 | **Round 2:** DEFENDED: `quarantine_laundered_by_remove_rejoin` (`57a7bea`, REMOVED leaves a tombstone), `quarantined_machine_self_upgrades` (D + E: trust moves only down, upward is code 15 and ignored), `zero_machine_id_escapes_attribution` (`a33c1e0`: a live event with a zero machine_id is code 7; SYNTHETIC/CONSUMER are exempt), `machine_table_exhaustion_hides_quarantine` (`57a7bea`: table 64; the 65th JOINED is refused loudly and its later use is still code 7). Residual WEAK: a machine beyond the table cannot carry a quarantine. |
| 323 | |
| 324 | As found at `e16ba31`: |
| 325 | |
| 326 | Tried: rediscovery, rejoin, trust ordering, table limits, anonymity. |
| 327 | Evidence: provider rediscovery never clears quarantine (`argus_core.c:502`), DEFENDED. |
| 328 | Machines: MACHINE_REMOVED deletes the entry (`:462-471`); the next JOINED creates a fresh |
| 329 | machine (`:480-487`) and detector 7 sees an unknown machine joining, which is not a |
| 330 | finding (`argus_detect.c:295-296`). Lifecycle kinds are exempt from detector 10 |
| 331 | (`:405-407`), and TRUST_CHANGED is applied from any sender (`argus_core.c:492`), so a |
| 332 | quarantined machine may send its own QUARANTINED -> TRUSTED. An all-zero machine_id is |
| 333 | "not attributed" and skips detectors 7 and 10 (`argus_detect.c:290`, `:407`). With 16 |
| 334 | machines joined, a quarantine for the 17th is dropped with ERR_FULL (`argus_core.c:478`). |
| 335 | Tests: PASS `quarantined_machine_use_flagged`, `provider_rediscovery_keeps_quarantine`; |
| 336 | EXPECTED-FAIL `quarantine_laundered_by_remove_rejoin`, `quarantined_machine_self_upgrades`, |
| 337 | `zero_machine_id_escapes_attribution`, `machine_table_exhaustion_hides_quarantine`. |
| 338 | |
| 339 | ## G-9 Provider identity substitution: WEAK (ABI v1 limit; registry N/A-ARGUS-0) |
| 340 | |
| 341 | **Round 2:** `undiscovered_provider_use_unflagged` PASS (`a33c1e0`). `provider_substitution_escapes_quarantine` stays EXPECTED-FAIL: ABI v1 has no provider identity continuity. |
| 342 | |
| 343 | As found at `e16ba31`: |
| 344 | |
| 345 | Evidence: provider id = evidence_digest (`argus_abi.h` PROVIDER_* convention). No |
| 346 | provider registry exists in C (ADR §14.4), so stable identity is **N/A-ARGUS-0**. But |
| 347 | PROVIDER_CHANGED is ignored by the core (`argus_core.c:556`, default) and no detector, so a |
| 348 | quarantined provider re-appearing under a new digest is clean; PROVIDER_USED of a |
| 349 | never-discovered provider is not a finding (`argus_detect.c:396-403`). |
| 350 | Tests (EXPECTED-FAIL): `provider_substitution_escapes_quarantine`, |
| 351 | `undiscovered_provider_use_unflagged`. |
| 352 | |
| 353 | ## G-10 Machine identity spoofing (the 32-byte provisional slot): DEFENDED (spoofing a joined machine accepted in v1) |
| 354 | |
| 355 | **Round 2:** the code bugs are DEFENDED: `trust_before_join_bricks_machine` (`57a7bea`: TRUST_CHANGED on an unknown machine creates nothing), `join_declares_own_trust` (D + E: JOINED capped at OBSERVED, code 15). Spoofing a joined machine's id remains accepted by design of the provisional slot. |
| 356 | |
| 357 | As found at `e16ba31`: |
| 358 | |
| 359 | Evidence: the slot is opaque and producer-claimed (`argus_abi.h:21-22`, ADR §14.3), so |
| 360 | spoofing a joined machine is undetectable by design; that part is accepted. The code bugs |
| 361 | on top are not accepted: TRUST_CHANGED for an unknown machine creates an entry with |
| 362 | `joined_sequence 0` (`argus_core.c:476-487`, `:492`); the machine's real JOINED is then |
| 363 | ignored as a rejoin (`:489-490`), so it can never be "joined" and every event it sends is |
| 364 | MACHINE_IDENTITY_MISMATCH (`argus_detect.c:298`). JOINED takes its initial trust from its |
| 365 | own `object_id` (`argus_core.c:484`), so a joiner can declare itself TRUSTED. The pre-join |
| 366 | TRUST_CHANGED is at least reported (unknown machine), so pre-seeding trust is detected. |
| 367 | Tests: EXPECTED-FAIL `trust_before_join_bricks_machine`, `join_declares_own_trust`; PASS |
| 368 | `trust_preseed_skips_observation` (detected, not prevented). |
| 369 | |
| 370 | ## G-11 Credential metadata leakage: DEFENDED |
| 371 | |
| 372 | **Round 2:** unchanged. |
| 373 | |
| 374 | As found at `e16ba31`: |
| 375 | |
| 376 | Evidence: lease shadow keeps id, subject, 64-bit scope, state, sequence only |
| 377 | (`argus_abi.h:259-265`); findings carry principal, cap ref, machine_id and event digest |
| 378 | (`argus_abi.h:199-213`), never scope or lease contents. No credential material has a field. |
| 379 | Test: covered structurally by `event_has_only_two_32byte_slots`; lease integrity is G-26. |
| 380 | |
| 381 | ## G-12 Secret leakage into event payload: WEAK |
| 382 | |
| 383 | **Round 2:** unchanged; the guard must be producer-side. |
| 384 | |
| 385 | As found at `e16ba31`: |
| 386 | |
| 387 | Tried: any 32-byte field that could carry the authority's 32-byte office secret. |
| 388 | Evidence: exactly two 32-byte fields exist, `machine_id` (off 64) and `evidence_digest` |
| 389 | (off 96). Both are opaque and unvalidated. `machine_id` is copied verbatim into every |
| 390 | finding (`argus_core.c` `core_finding`, `argus_detect.c:106-107`), into the producer table |
| 391 | and into the state digest records; `evidence_digest` into artifact/provider/world/policy |
| 392 | shadows. A producer bug that passes the office secret where a digest is expected would be |
| 393 | propagated and chained forever; nothing in ARGUS can tell the difference. The README's |
| 394 | "no event field is secret-sized except digests" is true only if machine_id counts as a |
| 395 | digest; it is not one today. |
| 396 | Test: `event_has_only_two_32byte_slots` (PASS: no third slot appears). The real guard |
| 397 | must be producer-side: machine_id := SHA-256(domain || identity), evidence_digest only from |
| 398 | `sha256_*`, plus the existing grep gate extended to producer code that fills events. |
| 399 | |
| 400 | ## G-13 Incident table poisoning: DEFENDED (no eviction) |
| 401 | |
| 402 | **Round 2:** DEFENDED by `57a7bea`: table 256 and `incidents_untracked` in `ArgusCoreHealth`. The test now overshoots 256 junk pairs and requires the real incident to be delivered and the saturation to be visible in health. Still no eviction (a CRITICAL cannot displace HIGH junk). |
| 403 | |
| 404 | As found at `e16ba31`: |
| 405 | |
| 406 | Tried: 64 slots, key (principal, code), severity >= HIGH. |
| 407 | Evidence: principal is attacker-chosen; SIGNATURE_FAILURE (any outcome, no state) yields |
| 408 | HIGH (`argus_detect.c:242`). 64 such events with distinct principals fill the table |
| 409 | (`argus_core.c:327-348`); further incidents go to `incidents_untracked` (`:340`), which |
| 410 | `argus_core_health` does not return (`:761-774`; `incidents_open` = `n_incidents`, `:771`). |
| 411 | The real finding is still delivered to the caller, so it is hidden from the health summary, |
| 412 | not from the finding stream. With 12 principals x 12 codes = 144 legitimate pairs the table |
| 413 | can saturate without an attacker. No eviction: CRITICAL cannot displace HIGH junk. |
| 414 | Test: `incident_table_poisoning` (EXPECTED-FAIL: health does not change after a real |
| 415 | CRITICAL incident once the table is full). |
| 416 | |
| 417 | ## G-14 Policy-digest mismatch: DEFENDED (announcement level) |
| 418 | |
| 419 | **Round 2:** DEFENDED by `a33c1e0`: POLICY_CHANGED / RUNTIME_BUILD_CHANGED over a stored digest and any INTEGRITY_VIOLATION raise code 5 (HIGH, sync 0, containment NONE). `policy_digest_overwrite_silent`, `integrity_violation_report_ignored` PASS. Comparing a running policy with the announced one is still undefined in v1 (no event carries the in-use digest). |
| 420 | |
| 421 | As found at `e16ba31`: |
| 422 | |
| 423 | Evidence: `op_policy_digest` / `op_runtime_digest` exist (`argus_core.c` ops) but no |
| 424 | detector calls them; `argus_detect_run` does not even require them non-null. POLICY_CHANGED |
| 425 | and RUNTIME_BUILD_CHANGED from any sender overwrite the expected digest (`:550`, `:554`). |
| 426 | None of the 12 finding codes covers "running policy differs from announced policy", and no |
| 427 | event kind carries the in-use digest to compare against, so the invariant is undefined. |
| 428 | INTEGRITY_VIOLATION (kind 60) reaches no detector and produces nothing. |
| 429 | Tests (EXPECTED-FAIL): `policy_digest_overwrite_silent`, `integrity_violation_report_ignored`. |
| 430 | Fix: either declare policy mismatch out of ARGUS-0 scope in the ADR and stop storing the |
| 431 | digests, or route INTEGRITY_VIOLATION to a finding and define which event carries the |
| 432 | in-use policy digest. |
| 433 | |
| 434 | ## G-15 Provenance spoofing (WORLD_COMMITTED): DEFENDED (forged digest at prior+1 N/A-ARGUS-0) |
| 435 | |
| 436 | **Round 2:** DEFENDED by `57a7bea`: a flagged commit is not adopted (`world_inconsistent_commit_adopted` PASS). Rollback case now World 1, 2, 1 (`world_skip_flagged` PASS). Repeat RULED idempotent: same generation and digest is silent, a different digest is code 9 (`world_repeat_silent` re-scoped, PASS). ADR 0017 row 9 must be amended accordingly. |
| 437 | |
| 438 | As found at `e16ba31`: |
| 439 | |
| 440 | Evidence: skip, rollback and same-generation conflict are detected (`argus_detect.c:367-370`), |
| 441 | DEFENDED. A forged digest at exactly prior+1 is undetectable with one source |
| 442 | (**N/A-ARGUS-0**: needs a second attestation). The bug: the core adopts any higher |
| 443 | generation even when detector 9 fired (`argus_core.c:542-546`), so after one forged skip the |
| 444 | shadow follows the attacker and the next legitimate commit is the one flagged; a commit at |
| 445 | UINT64_MAX leaves no successor and freezes World tracking. The first commit after start is |
| 446 | accepted at any generation (restart gap, ARGUS-3). ADR §3 row 9 says a repeated generation |
| 447 | is a finding; the detector treats same-digest repeats as idempotent. |
| 448 | Tests: PASS `world_skip_flagged`, `world_same_generation_conflict_flagged`; EXPECTED-FAIL |
| 449 | `world_inconsistent_commit_adopted`, `world_repeat_silent`. |
| 450 | |
| 451 | ## G-16 Recursive containment storms: DEFENDED |
| 452 | |
| 453 | **Round 2:** unchanged. |
| 454 | |
| 455 | As found at `e16ba31`: |
| 456 | |
| 457 | Evidence: drop reports are handed to the consumer directly and never re-enter the ring |
| 458 | (`argus_ring.c` header comment, `:190-219`); the core emits findings, never events; a |
| 459 | TELEMETRY_DROPPED yields exactly one TELEMETRY_LOSS (`argus_core.c:601-605`), and lane E |
| 460 | never raises it. No loop exists in ARGUS-0. ARGUS-1 must keep containment results out of |
| 461 | the ring, or loss -> finding -> request -> event can cycle. |
| 462 | Test: `drop_report_does_not_recurse` (PASS). |
| 463 | |
| 464 | ## G-17 ARGUS deadlock / SPSC misuse: WEAK |
| 465 | |
| 466 | **Round 2:** unchanged. The threaded integration test now also runs under TSan (`make sanitize`), clean, but it uses one producer as the contract says. |
| 467 | |
| 468 | As found at `e16ba31`: |
| 469 | |
| 470 | Evidence: the ring has no locks and never waits (`argus_ring.c:126-146`); the core is |
| 471 | single-threaded with no locks: deadlock is impossible. Multi-producer misuse is not guarded: |
| 472 | two producers load the same `head` (`:131`) and write the same slot, losing one event with |
| 473 | no counter and no finding. The contract is documentation only. |
| 474 | Test that would prove it: lane B's TSAN harness with two producer threads must report a |
| 475 | race (not expressible deterministically against the header API; not in the hostile file). |
| 476 | Fix options: a producer-id word in the ring checked on push (debug builds), or MPSC via |
| 477 | fetch-add reservation. |
| 478 | |
| 479 | ## G-18 ARGUS crash preventing AIEN progress: DEFENDED |
| 480 | |
| 481 | **Round 2:** unchanged. |
| 482 | |
| 483 | As found at `e16ba31`: |
| 484 | |
| 485 | Evidence: with no consumer, push returns ERR_FULL immediately at the class limit and |
| 486 | counts it (`argus_ring.c:133-141`). There is no liveness signal: a dead consumer is only |
| 487 | visible when someone drains; if the ring memory dies with ARGUS, the gap is never recorded |
| 488 | (restart reconstruction is ARGUS-3, ADR §13). |
| 489 | Test: `push_never_blocks_without_consumer` (PASS, 100,000 pushes, 16 accepted, rest counted). |
| 490 | |
| 491 | ## G-19 Backpressure freezing the runtime: DEFENDED |
| 492 | |
| 493 | **Round 2:** unchanged. |
| 494 | |
| 495 | As found at `e16ba31`: |
| 496 | |
| 497 | Evidence: same as G-18; there is no blocking path, no allocation, no syscall on push |
| 498 | (`argus_ring.c:1-12`). Covered by the same test. |
| 499 | |
| 500 | ## G-20 DoS by intentionally generating security events: DEFENDED (round 3, ruling a: loud once per table) |
| 501 | |
| 502 | **Round 3:** DEFENDED. Ruling (a) applied in `argus_core.c`: every shadow table (machines 64, leases 256, providers 32, artifacts 256, World stores 8) reports its FIRST overflow as ERR_FULL + one CRITICAL TELEMETRY_LOSS and every later overflow of the same table as ERR_FULL with no finding, counted in `tables_full` and `events_not_applied` (per-table latch, so one full table cannot mask another). No per-event CRITICAL amplifier remains. Residue (WEAK, bounded, listed under G-21/G-8): a full table stops mirroring new entries; ARGUS-1 turns that into a ContainmentRequest. Tests: `machine_table_exhaustion_hides_quarantine`, `lease_table_exhaustion` (both now assert the quiet, counted second overflow), new `every_table_loud_once`. |
| 503 | |
| 504 | **Round 2:** `cap_id_out_of_range_is_critical_loss` PASS (`58d5a99`: cap_id >= ARGUS_CAP_MAX is malformed, code 16, never ERR_FULL); `forged_telemetry_dropped` PASS (`58d5a99`); `producer_table_exhaustion` PASS against the RATIFIED rule (`57a7bea`: first untracked event ERR_FULL + one CRITICAL loss, later ones OK + `producers_untracked`). Found in round 2, no ruling yet: the "loud once" rule covers only the producer table. Each event beyond a full machine (64), lease (256), provider (32) or artifact (256) table still returns ERR_FULL with its own CRITICAL TELEMETRY_LOSS (probe: 6 extra JOINED = 6 CRITICAL, same for the other three tables), and the machine and lease tables never free. `machine_table_exhaustion_hides_quarantine` and `lease_table_exhaustion` assert only that the first overflow is loud. |
| 505 | |
| 506 | As found at `e16ba31`: |
| 507 | |
| 508 | Tried: the cap_id >= 256 path and every other ERR_FULL path. |
| 509 | Evidence: `argus_event_validate` accepts any cap_id (`argus_event.c:73-83`); GRANTED or |
| 510 | REVOKED with cap_id >= 256 returns ERR_FULL from `apply_cap` (`argus_core.c:383-384`) and the |
| 511 | core adds a CRITICAL TELEMETRY_LOSS (`:606-607`), mis-labelling a forged reference as |
| 512 | ARGUS's own evidence gap, at the attacker's chosen principal (feeds G-13). Same amplifier |
| 513 | from the 33rd producer stream (`:368`), the 17th machine (`:478`), and a forged |
| 514 | TELEMETRY_DROPPED (G-5). The ingest return code ERR_FULL on each of these tells an |
| 515 | integrator "ARGUS is saturated" when it is not. A USED with cap_id >= 256 is correctly |
| 516 | FORGED (`argus_detect.c:140`). |
| 517 | Tests: EXPECTED-FAIL `cap_id_out_of_range_is_critical_loss`, `producer_table_exhaustion`, |
| 518 | `forged_telemetry_dropped`; PASS `cap_id_out_of_range_use_is_forged`. |
| 519 | |
| 520 | ## G-21 Sequence-anomaly abuse: WEAK (machine_id rekey = G-5 ABI v1 limit; restart handling N/A-ARGUS-0) |
| 521 | |
| 522 | **Round 3:** ruling (c): the machine_id rekey (`replay_evades_by_rekeying_stream`) is EXPECTED-FAIL under G-5 (no producer identity in v1). v1.1 keys streams by (machine_id, stream id, CONSUMER), all sender-chosen, so the same limit covers a stream-id rekey. Streams beyond the 256-entry producer table stay replay-blind (loud once, counted). Section verdict WEAK. |
| 523 | |
| 524 | **Round 2:** `sequence_high_water_poison` PASS (`58d5a99`: sequence UINT64_MAX is malformed). CONSUMER-flag rekey DEFENDED (`58d5a99`, new test `replay_rekeyed_by_consumer_flag`). machine_id rekey stays OPEN (`replay_evades_by_rekeying_stream` EXPECTED-FAIL, no ruling; same root as G-5). Producer table 256 with the ratified overflow rule; streams beyond it stay replay-blind (WEAK, counted). |
| 525 | |
| 526 | As found at `e16ba31`: |
| 527 | |
| 528 | Evidence: stream key = (machine_id, CONSUMER bit) (`argus_core.c:354-375`), both chosen by |
| 529 | the sender, so a replay escapes by flipping either. One event at UINT64_MAX raises the |
| 530 | high-water mark to the top with no finding; every later event on that stream is an anomaly |
| 531 | forever (no epoch field; producer restart does the same, which is **N/A-ARGUS-0** until |
| 532 | ARGUS-3 defines restart). The producer table (32) is never freed, not even on |
| 533 | MACHINE_REMOVED; beyond it, streams are not tracked at all. Anomalous events are applied |
| 534 | (G-3). Wraparound itself cannot happen (64-bit, never reached honestly). |
| 535 | Tests: PASS `sequence_replay_flagged`; EXPECTED-FAIL `sequence_high_water_poison`, |
| 536 | `replay_evades_by_rekeying_stream`, `producer_table_exhaustion`. |
| 537 | |
| 538 | ## G-22 Determinism breakers: DEFENDED |
| 539 | |
| 540 | **Round 2:** unchanged. |
| 541 | |
| 542 | As found at `e16ba31`: |
| 543 | |
| 544 | Tried: caller buffer size, memory contents, snapshot copies, uninitialised memory, |
| 545 | detector truncation. |
| 546 | Evidence: findings are collected in an internal scratch and state is applied regardless of |
| 547 | the caller's `cap` (`argus_core.c:612-625`); encoding is field-by-field (`argus_event.c` |
| 548 | `encode_raw`), so struct padding never reaches a digest; `ArgusEvent` and `ArgusFinding` |
| 549 | have no padding; the core holds no pointers; the magic word rejects uninitialised memory; |
| 550 | `argus_detect_run` stops at the first overflow, giving a prefix of the full result. |
| 551 | No clock, no allocation, no global mutable state in core or detectors. |
| 552 | Tests (PASS): `same_stream_same_output`, `buffer_size_does_not_change_state`, |
| 553 | `snapshot_copy_equivalent`, `uninitialized_core_rejected`, `detect_run_prefix_under_small_cap`. |
| 554 | |
| 555 | ## G-23 State digest collisions: DEFENDED (fragile) |
| 556 | |
| 557 | **Round 2:** unchanged. Test bug fixed: variant 7 now sends REJECTED at its CRITICAL floor, so it actually reaches the artifact table. |
| 558 | |
| 559 | As found at `e16ba31`: |
| 560 | |
| 561 | Tried: two different states hashing equal via the fake-event packing. |
| 562 | Evidence: every field of every shadow table is written into a record |
| 563 | (`argus_core.c:659-758`); each table has its own kind and `code` tag; the header record |
| 564 | carries all table counts; values fit their record fields without truncation. So the |
| 565 | encoding is injective and collisions reduce to SHA-256. Fragilities: (a) the event chain and |
| 566 | the state digest use the same construction from the same zero start; they are separated only |
| 567 | because the state digest's first record has sequence 0, which validate rejects for real |
| 568 | events. The core comment claiming the records "pass argus_event_validate" is false for that |
| 569 | reason. Add an explicit domain tag. (b) Machine records follow insertion order, so the same |
| 570 | set of machines joined in a different order hashes differently: fine for replay |
| 571 | determinism, wrong if the digest is ever compared across independently built cores. |
| 572 | Tests (PASS): `state_digest_sensitive_to_every_table`, `state_digest_domain_separated`. |
| 573 | |
| 574 | ## G-24 Effect-class bypass (found during review): DEFENDED |
| 575 | |
| 576 | **Round 2:** `effect_kind_mislabelled` PASS (`58d5a99`: EXTERNAL_EFFECT_* with effect_class != EXTERNAL is malformed, code 16); `evidence_write_with_read_only_right` PASS (`a33c1e0`). |
| 577 | |
| 578 | As found at `e16ba31`: |
| 579 | |
| 580 | Evidence: detector 8 decides from the producer's `effect_class` byte, not the kind: an |
| 581 | EXTERNAL_EFFECT_COMMITTED with `effect_class NONE` and no capability passes |
| 582 | (`argus_detect.c:327-328`). Only EXTERNAL vs RIGHT_EFFECT is checked (`:331-332`), although |
| 583 | ADR §3 row 8 says "beyond what the capability's rights permit": an EVIDENCE (durable) write |
| 584 | under a READ-only capability passes. |
| 585 | Tests: EXPECTED-FAIL `effect_kind_mislabelled`, `evidence_write_with_read_only_right`; |
| 586 | PASS `external_effect_without_right_flagged`. |
| 587 | |
| 588 | ## G-25 Artifacts (found during review): DEFENDED |
| 589 | |
| 590 | **Round 2:** unchanged. |
| 591 | |
| 592 | As found at `e16ba31`: |
| 593 | |
| 594 | Evidence: rejection is sticky (`argus_core.c:450-456`); ADMITTED needs outcome OK and code 0 |
| 595 | (`:530`); activation of a non-admitted digest is CRITICAL (`argus_detect.c:218-225`). ADR row 4 |
| 596 | "an admitted digest changed" cannot be expressed because the artifact is keyed by its |
| 597 | digest; it needs an artifact id field (ARGUS-4). |
| 598 | Test: `artifact_rejection_sticky` (PASS). |
| 599 | |
| 600 | ## G-26 Credential lease re-creation hijack (found during review): DEFENDED |
| 601 | |
| 602 | **Round 2:** DEFENDED (D + E): a LEASE_CREATED on a known lease id is not applied (`57a7bea`, lease ids never reused) and is code 6 (`a33c1e0`). `lease_recreate_hijacks_subject` PASS. New `lease_table_exhaustion` PASS (256 leases, the 257th refused loudly). |
| 603 | |
| 604 | As found at `e16ba31`: |
| 605 | |
| 606 | Evidence: `apply_lease` overwrites subject and scope of any non-revoked lease on a second |
| 607 | CREATED (`argus_core.c:427-431`); detector 6 then compares the use against the attacker's |
| 608 | subject and scope. Revocation is sticky (DEFENDED). |
| 609 | Tests: EXPECTED-FAIL `lease_recreate_hijacks_subject`; PASS `lease_other_subject_flagged`. |
| 610 | |
| 611 | ## Test index (round 3) |
| 612 | |
| 613 | 63 tests. Expected-defended, PASS (58): every test not listed below, including the |
| 614 | round-3 addition `every_table_loud_once`. |
| 615 | |
| 616 | EXPECTED-FAIL (3): `unattributed_grant_masks_forged_use` (G-5, ABI v1 limit), |
| 617 | `replay_evades_by_rekeying_stream` (G-21 machine_id variant, under G-5, ruling c), |
| 618 | `provider_substitution_escapes_quarantine` (G-9, ABI v1 limit). |
| 619 | |
| 620 | N/A-v1 (2, exempt from the exit code): `critical_self_label_starves_security` (G-7), |
| 621 | `sequence_gap_unflagged` (G-6, ruling c). |
| 622 | |
| 623 | Rewritten in round 3: `zero_machine_id_escapes_attribution` (code 7 required), |
| 624 | `machine_table_exhaustion_hides_quarantine` and `lease_table_exhaustion` (second |
| 625 | overflow quiet + counted), `world_inconsistent_commit_adopted` (per-store World read), |
| 626 | and every test using `ev0()`/`use()` without a capability (`ARGUS_CAP_NONE`). |
| 627 | |
| 628 | ## Test index (round 2) |
| 629 | |
| 630 | Expected-defended, PASS (57): every test not listed below, including the round-2 |
| 631 | additions `replay_rekeyed_by_consumer_flag` and `lease_table_exhaustion`. |
| 632 | |
| 633 | EXPECTED-FAIL (4), each documented above: `unattributed_grant_masks_forged_use` (G-5, ABI |
| 634 | v1 limit), `provider_substitution_escapes_quarantine` (G-9, ABI v1 limit), |
| 635 | `sequence_gap_unflagged` (G-6, no ruling), `replay_evades_by_rekeying_stream` (G-21, |
| 636 | machine_id variant, no ruling). |
| 637 | |
| 638 | N/A-v1 (1, exempt from the exit code): `critical_self_label_starves_security` (G-7). |
| 639 | |
| 640 | Flipped from EXPECTED-FAIL to expected-defended in round 2 (28): |
| 641 | grant_replay_revives_revoked, exact_replay_still_applied, future_generation_use_unflagged, |
| 642 | use_by_other_subject_unflagged, revoke_gen_max_poisons_slot, |
| 643 | cap_id_out_of_range_is_critical_loss, effect_kind_mislabelled, |
| 644 | evidence_write_with_read_only_right, reported_forgery_names_arbitrary_victim, |
| 645 | forged_telemetry_dropped, consumer_flag_accepted_from_wire, sequence_high_water_poison, |
| 646 | producer_table_exhaustion, quarantine_laundered_by_remove_rejoin, |
| 647 | quarantined_machine_self_upgrades, join_declares_own_trust, trust_before_join_bricks_machine, |
| 648 | machine_table_exhaustion_hides_quarantine, zero_machine_id_escapes_attribution, |
| 649 | undiscovered_provider_use_unflagged, lease_recreate_hijacks_subject, |
| 650 | world_inconsistent_commit_adopted, world_repeat_silent, policy_digest_overwrite_silent, |
| 651 | integrity_violation_report_ignored, incident_table_poisoning, |
| 652 | malformed_event_leaves_no_evidence, security_event_lost_as_informational. |
| 653 | |
| 654 | Some tests were rewritten, not only flipped (see "Rulings applied" at the top): |
| 655 | cap_id_out_of_range_use_is_forged, effect_kind_mislabelled, producer_table_exhaustion, |
| 656 | machine_table_exhaustion_hides_quarantine, zero_machine_id_escapes_attribution, |
| 657 | world_skip_flagged, world_repeat_silent, incident_table_poisoning, |
| 658 | info_flood_cannot_starve_security, drain_partial_preserves_pending, |
| 659 | security_event_lost_as_informational, critical_self_label_starves_security, |
| 660 | state_digest_sensitive_to_every_table. |
| 661 | |
| 662 | ## Test index (original, at `e16ba31`) |
| 663 | |
| 664 | PASS today (27): stale_generation_use_flagged, revoked_use_flagged, |
| 665 | revoked_use_denied_is_quiet, cap_id_out_of_range_use_is_forged, |
| 666 | external_effect_without_right_flagged, sequence_replay_flagged, |
| 667 | quarantined_machine_use_flagged, trust_preseed_skips_observation, |
| 668 | provider_rediscovery_keeps_quarantine, lease_other_subject_flagged, world_skip_flagged, |
| 669 | world_same_generation_conflict_flagged, artifact_rejection_sticky, |
| 670 | info_flood_cannot_starve_security, critical_overflow_accounting, |
| 671 | drain_partial_preserves_pending, attempt_conservation, push_never_blocks_without_consumer, |
| 672 | drop_report_does_not_recurse, same_stream_same_output, buffer_size_does_not_change_state, |
| 673 | snapshot_copy_equivalent, uninitialized_core_rejected, detect_run_prefix_under_small_cap, |
| 674 | state_digest_sensitive_to_every_table, state_digest_domain_separated, |
| 675 | event_has_only_two_32byte_slots. |
| 676 | |
| 677 | EXPECTED-FAIL today (33): grant_replay_revives_revoked, exact_replay_still_applied, |
| 678 | future_generation_use_unflagged, use_by_other_subject_unflagged, revoke_gen_max_poisons_slot, |
| 679 | cap_id_out_of_range_is_critical_loss, effect_kind_mislabelled, |
| 680 | evidence_write_with_read_only_right, reported_forgery_names_arbitrary_victim, |
| 681 | forged_telemetry_dropped, consumer_flag_accepted_from_wire, |
| 682 | unattributed_grant_masks_forged_use, sequence_high_water_poison, sequence_gap_unflagged, |
| 683 | replay_evades_by_rekeying_stream, producer_table_exhaustion, |
| 684 | quarantine_laundered_by_remove_rejoin, quarantined_machine_self_upgrades, |
| 685 | join_declares_own_trust, trust_before_join_bricks_machine, |
| 686 | machine_table_exhaustion_hides_quarantine, zero_machine_id_escapes_attribution, |
| 687 | provider_substitution_escapes_quarantine, undiscovered_provider_use_unflagged, |
| 688 | lease_recreate_hijacks_subject, world_inconsistent_commit_adopted, world_repeat_silent, |
| 689 | policy_digest_overwrite_silent, integrity_violation_report_ignored, |
| 690 | incident_table_poisoning, malformed_event_leaves_no_evidence, |
| 691 | security_event_lost_as_informational, critical_self_label_starves_security. |
| 692 | |
| 693 | Some EXPECTED-FAIL tests encode a judgment the integrator may reject (for example |
| 694 | `unattributed_grant_masks_forged_use` cannot pass without producer identity, and |
| 695 | `world_repeat_silent` depends on whether the ADR or the detector is right). Flipping one |
| 696 | to a documented accepted risk is fine; deleting it silently is not. |
| 697 | |
| 698 | ## Post-review note (2026-09-29): RX_ARGUS_CONSUMER_CPU |
| 699 | |
| 700 | Added after this review (omega `feat/argus-producer`, fix `ec87160`, measured in speed |
| 701 | round 2 at `cf6f45d`), so no hostile test above covers it. It is a new configuration |
| 702 | surface: an environment variable that chooses where the omega ARGUS consumer thread runs. |
| 703 | - Values: `auto` (default: pin to the online CPUs outside the process affinity mask; unpinned |
| 704 | if the mask already covers every CPU), `none` (never pin), or an explicit CPU list (pin |
| 705 | exactly there). |
| 706 | - Who can set it: whoever sets the process environment of the omega runtime, i.e. the |
| 707 | operator who starts it. The agent does not set it, and no ARGUS event, finding or ring |
| 708 | message can change it. |
| 709 | - Worst case of a hostile or wrong value: a slowdown (the consumer shares a core with the |
| 710 | workload; measured R8 +5.3% unpinned vs +3.9% with a spare core) or the consumer running |
| 711 | unpinned. It never changes correctness or detection: events are never dropped or sampled |
| 712 | because of placement, and any refusal, loss or late event still shows up in the |
| 713 | refused/lost/late counters, which remain the evidence. |
| 714 | - It cannot widen ARGUS's authority: it only moves a thread between CPUs; ARGUS still mints, |
| 715 | grants and revokes nothing. Note that `auto` deliberately places the consumer outside the |
| 716 | CPU mask the operator gave the process (see PERFORMANCE_GATE limits in `ARGUS0_GATES.md`). |
| 717 | |
| 718 | ## ARGUS-1 containment hostile review (lane H) |
| 719 | |
| 720 | Reviewer: lane H. Date: 2026-09-29. Scope: the ARGUS containment state, AEGIS gate, |
| 721 | capability observer bridge, and the live revoke path on `main` after PRs #167 and #168. |
| 722 | The gate's own invariant suite remains `native/capability/tests/contain_test.c`; this |
| 723 | section records cross-layer hostile cases from `tests/test_argus_contain_hostile.c`. |
| 724 | |
| 725 | On DGX Spark, `make -C native/argus test-contain-hostile` passed (103 checks, 0 failures). |
| 726 | The cases verify: a changed request digest is denied without revocation; a target minted |
| 727 | while the observer is detached cannot receive an automatic revoke; an automatic grant can |
| 728 | execute once and a second attempt is refused; replaying the same request ID is denied; the |
| 729 | office capability remains live when targeted; a synthetic machine quarantine is not |
| 730 | performed automatically; fabricated or unmatched decisions are reported; execution before |
| 731 | approval is reported; and a claimed DONE without its matching authority revoke is reported. |
| 732 | These are pass/fail tests; no expected-fail case is hidden from the test exit code. |
| 733 | |
| 734 | | Attack | Verdict | Boundary | |
| 735 | |---|---|---| |
| 736 | | Change request bytes after computing the digest | DEFENDED | Gate compares the canonical request digest before deciding. | |
| 737 | | Submit an unobserved capability as a revoke target | DEFENDED | Gate escalates because observer lineage cannot verify the target. | |
| 738 | | Execute one grant twice | DEFENDED | First call revokes once; the second is refused and cannot revive or re-revoke it. | |
| 739 | | Replay the same request ID | DEFENDED | Monotonic request IDs reject the duplicate. | |
| 740 | | Aim revoke at the office capability | DEFENDED | Protected-target rules deny it; office capability remains live. | |
| 741 | | Ask the live gate to quarantine a machine | DEFENDED, synthetic only | Request escalates and cannot execute without human resolution; no machine-quarantine mechanism is wired. | |
| 742 | | Send an unmatched decision receipt | DEFENDED | Containment reports code 17. | |
| 743 | | Send DONE before any GRANT | DEFENDED | Containment reports code 18. | |
| 744 | | Claim DONE after GRANT without an observed revoke | DEFENDED | Containment reports code 19; the real capability remains live. | |
| 745 | |
| 746 | Remaining limits: a correct office-secret resolution cannot be exercised because the |
| 747 | authority does not expose the office secret to this test harness; the bridge's |
| 748 | automatic revoke path is covered by the end-to-end test. Stream 16383 remains a reserved |
| 749 | convention, not a validator-enforced restriction. ARGUS-1 still trusts the in-process |
| 750 | observer/bridge caller and does not add producer authentication. |