Skip to the content.

A8 · abi+architest

internal/abi is the frozen wave-0 spine of fak — the one tree every fleet worker imports and no worker may edit except additively. It computes nothing numeric; what it provides is a structural contract: a closed, byte-stable set of wire enums (verdict kinds, status, outcome, taint, scope, ref-kind, fallback, the reason vocabulary) plus the FoldRank restrictiveness lattice that orders verdict folds. internal/architest is the machine-checker that proves the composition the rest of the proofs assume actually holds in the build: a layered package DAG with no upward imports, a subprocess-free hot path, and every most-restrictive-wins fold routed through abi.FoldRank. “Correct” for A8 is regime A (algebraic / structural): the defining invariants — a total fold order, a layered DAG, a frozen additive-only wire shape — are preserved, witnessed by round-trip / invariant / structural-contract tests, not numerical parity. All witnesses below ran green natively on the macOS fleet node (go1.26 darwin/arm64) on 2026-06-20.


Theorem 1 — every verdict-fold site orders by abi.FoldRank, a total order

THEOREM. Every internal package that folds a verdict chain most-restrictive-wins (kernel, kvmmu, recall, agent) orders that fold by abi.FoldRank, and FoldRank is a total function VerdictKind → int into a totally-ordered codomain — so no fold can silently order by raw VerdictKind value (which is a registration-block id, not a restrictiveness rank).

REGIME. A — structural contract / total order.

PROOF.

WITNESS.

go test ./internal/architest/ ./internal/abi/ -count=1 -timeout 120s \
  -run 'TestFoldSitesOrderByFoldRank|TestFoldRankOrdering' -v

PASS: TestFoldSitesOrderByFoldRank (0.00s) · PASS: TestFoldRankOrdering (0.00s).

VERDICT. PROVEN (2026-06-20).

DOS. bound at ship — gate added in c59bb28 test(architest): gate that every verdict-fold site orders by abi.FoldRank (fak architest); dos commit-audit / dos verify binding recorded at release.


Theorem 2 — the internal package graph is a layered DAG with no upward imports; the hot path has no os/exec

THEOREM. The internal package graph is a layered DAG — Go forbids import cycles (acyclicity), and the architest tier rule forbids any cross-package edge from a lower tier to a higher one (no upward imports). Additionally, no package on the live tool-call hot path (adjudicator, kernel, vdso, grammar, preflight, ctxmmu, ratelimit) imports os/exec.

REGIME. A — structural contract.

PROOF.

WITNESS.

go test ./internal/architest/ -count=1 -timeout 120s \
  -run 'TestNoUpwardImports|TestHotPathHasNoExec|TestEveryPackageDeclaresTier' -v

PASS: TestNoUpwardImports (0.01s) · PASS: TestHotPathHasNoExec (0.00s) · PASS: TestEveryPackageDeclaresTier (0.00s).

VERDICT. PROVEN (2026-06-20).

DOS. bound at ship — the layering + hot-path gates live in internal/architest/architest_test.go; dos commit-audit / dos verify binding recorded at release.


Theorem 3 — the frozen wave-0 ABI spine is stable (abi_test round-trips)

THEOREM. The closed-enum wire contract of the frozen wave-0 ABI (VerdictKind, Status, Outcome, TaintLabel, ShareScope, RefKind, FallbackClass, ABIMajor/ABIMinor, and the closed ReasonCode vocabulary) is stable: every closed value round-trips byte-identically against the committed golden, so any renumber/removal/repurpose fails the build; only appending a new value is allowed.

REGIME. A — round-trip / additive-only freeze.

PROOF.

WITNESS.

go test ./internal/abi/ -count=1 -timeout 120s \
  -run 'TestABIGoldenFreeze|TestClosedReasonVocabulary' -v

PASS: TestABIGoldenFreeze (0.00s) · PASS: TestClosedReasonVocabulary (0.00s).

VERDICT. PROVEN (2026-06-20).

DOS. bound at ship — the golden + freeze test live in internal/abi/abi_test.go and internal/abi/testdata/abi_v0.1.golden; dos commit-audit / dos verify binding recorded at release.