From 7c30ea9669d441ddd9e38e9bfb50e19bcd36a6e3 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Tue, 29 Sep 2026 09:48:41 -0500 Subject: [PATCH] test(argus): close dependency direction check --- native/argus/Makefile | 17 +++++++++++++- native/argus/docs/ARGUS1_GATES.md | 24 ++++++++++++++++++++ native/argus/tests/check_argus1_symbols.sh | 25 +++++++++++++++++++++ native/argus/tests/test_argus_integration.c | 8 +++---- 4 files changed, 69 insertions(+), 5 deletions(-) create mode 100755 native/argus/tests/check_argus1_symbols.sh diff --git a/native/argus/Makefile b/native/argus/Makefile index c4a1ba32..d28d49ab 100644 --- a/native/argus/Makefile +++ b/native/argus/Makefile @@ -162,7 +162,19 @@ bench-contain: @echo "bench-contain: skipped (needs tests/bench_argus_contain.c + bridge + gate, lane F)" endif -test-argus1: test-contain test-e2e test-contain-hostile test-contain-fp +test-argus1: test-contain test-e2e test-contain-hostile test-contain-fp test-containment-authority test-contain-symbols + +# The AEGIS gate tests live with the capability authority; keep them in the +# one ARGUS-1 regression command so G12 cannot silently omit the authority path. +test-containment-authority: + $(MAKE) -C ../capability test-contain + +# G11/I4: low-level event/ring code and the authority must not depend upward on +# detection, containment, or the bridge. The gate has its own checks in the +# capability Makefile; this checks the other direction across the three objects. +test-contain-symbols: $(LIB) test-containment-authority + $(MAKE) -C ../capability out/aienos_capability.o + ./tests/check_argus1_symbols.sh $(OUT)/obj/argus_event.o $(OUT)/obj/argus_ring.o ../capability/out/aienos_capability.o # Linux only (called from `sanitize`): lane C unit test under ASan+UBSan, e2e under # ASan+UBSan and TSan, containment hostile under ASan+UBSan. Library sources are @@ -182,6 +194,7 @@ ifneq ($(and $(CHOSTILE_SRC),$(STACK_SRC)),) $(CC) $(CFLAGS) $(SANFLAGS_ASAN) $(STACK_INC) -pthread -o $(OUT)/test_argus_contain_hostile_asan $(CHOSTILE_SRC) $(STACK_SRC) tests/stub_state.c $(LIB_SRC) ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./$(OUT)/test_argus_contain_hostile_asan endif + $(MAKE) -C ../capability sanitize @echo "sanitize-argus1: done (targets whose sources are absent were skipped)" test: test-lanes test-integration test-hostile test-argus1 @@ -217,3 +230,5 @@ endif clean: rm -rf $(OUT) + +.PHONY: test-argus1 test-containment-authority test-contain-symbols sanitize-argus1 diff --git a/native/argus/docs/ARGUS1_GATES.md b/native/argus/docs/ARGUS1_GATES.md index cc053de6..1de095f9 100644 --- a/native/argus/docs/ARGUS1_GATES.md +++ b/native/argus/docs/ARGUS1_GATES.md @@ -49,3 +49,27 @@ The current hostile containment suite reports 103 checks, 0 failures. See the co section in `HOSTILE_REVIEW.md` for defended cases and limits. Correct-secret human resolve remains untested because the office secret is not exposed to the harness. Producer attestation and validator enforcement of reserved stream 16383 remain outside ARGUS-1. + +## G11 — synchronous policy and dependency direction: implementation check PASS + +The full `make test` integration run reports the sync table equal to its ratified mask: +`0x453e == 0x453e`. The dependency-direction check runs through +`make -C native/argus test-contain-symbols`; it inspects the event, ring, and capability +authority objects and reports `GATE ARGUS1_AUTHORITY_DIRECTION PASS`. The authority, event, +and ring objects have no references into detection, containment, the gate, or bridge. The +capability gate's own `contain-checks` also verifies the opposite direction. + +## G12 — regression and sanitizers: Linux PASS, Mac pending + +On the DGX Spark, `make -C native/argus test` and `make -C native/argus sanitize` both pass, +including the authority containment suite, ARGUS containment tests, bridge tests, and hostile +tests. The sanitizer run includes ASan/UBSan and TSan; the bridge TSan run passed. The separate +capability suite passes 664 checks in regular and ASan/UBSan builds. The registered Mac `make +test` run has not been performed, so G12 is not yet closed. + +## G13 — invariants I1–I5: partial, dependency G6 open + +`make -C native/capability test-contain` prints PASS for its implemented I1/I2/I3/I4/I5 +checks and reports 664 checks with 0 failures. I1.c/I1.d evidence correlation and I5.d's +observer-only independent audit still depend on the unimplemented G6 offline checker. G13 +therefore remains open until G6 is delivered and the full invariant set is rerun together. diff --git a/native/argus/tests/check_argus1_symbols.sh b/native/argus/tests/check_argus1_symbols.sh new file mode 100755 index 00000000..f148686f --- /dev/null +++ b/native/argus/tests/check_argus1_symbols.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $# -ne 3 ]]; then + echo "usage: $0 argus_event.o argus_ring.o aienos_capability.o" >&2 + exit 2 +fi + +bad=() +for object in "$@"; do + [[ -f "$object" ]] || { echo "missing object: $object" >&2; exit 2; } + while IFS= read -r symbol; do + symbol="${symbol#_}" + if [[ "$symbol" =~ ^(argus_detect_|argus_contain_|aienos_contain_|argus_aegis_bridge_) ]]; then + bad+=("$object -> $symbol") + fi + done < <(nm -u "$object" | awk 'NF {print $NF}') +done + +if ((${#bad[@]})); then + printf 'GATE ARGUS1_AUTHORITY_DIRECTION FAIL %s\n' "${bad[@]}" >&2 + exit 1 +fi + +printf 'GATE ARGUS1_AUTHORITY_DIRECTION PASS event/ring/authority have no upward detection, containment, or bridge references\n' diff --git a/native/argus/tests/test_argus_integration.c b/native/argus/tests/test_argus_integration.c index 02b01e2a..48e54e0b 100644 --- a/native/argus/tests/test_argus_integration.c +++ b/native/argus/tests/test_argus_integration.c @@ -1152,12 +1152,12 @@ static void gate_abi_v12(void) for (size_t i = 0; i < argus_hard_detector_count; i++) if (argus_hard_detectors[i].sync_allowed) mask |= 1u << argus_hard_detectors[i].id; int sync_ok = mask == ARGUS_SYNC_RATIFIED_MASK; - /* TODO(L0, G11 symbol half, after lanes C/G/X): nm check that argus_ring.o, argus_event.o and - * aienos_capability.o reference no symbol defined in argus_detect.o, argus_contain.o, - * aienos_contain.o or the bridge (I4). */ + /* G11 symbol direction is checked by check_argus1_symbols.sh from the + * test-argus1 target; this table half must agree with that result. */ /* TODO(L0, G12, wave 3): full `make test` + `make sanitize` on the Spark incl. test-argus1 * and sanitize-argus1; `make test` on the Mac. */ - /* TODO(L0, after X): G2 recorded-bridge-stream replay and G6 end-to-end runs with GATE lines. */ + /* TODO(L0): G6 needs an independent offline checker over a complete chain + * transcript plus authority observer records before evidence is auditable. */ gate("ARGUS1_ABI_V12_HEADER", kinds_ok && codes_ok && det_ok && pack_ok && sync_ok, "static: event 128 B + 17 v1.1 offsets pinned, request wire %u B (field sum), request v%u, ABI minor %u; " "kinds 90-93 above 81 distinct=%d; codes 17-21 above 16 distinct=%d; no detector raises 17-21=%d; "