ltl-accumulator-verified/verification
mrwulf 6212aa1624 Round-7 F2: account for every constant the kernel sees
THE DEFECT, demonstrated by a reviewer with a working payload. The driver
surface is reported by an `#eval` inside Proofs/Inventory.lean. Anything
declared AFTER that command is in the compiled object file but does not exist
in the environment while the command runs, so the walk cannot see it. The
reviewer appended

    def bait : Nat := 0
    theorem bait.smuggled : forall n : Nat, n + 0 = n := ...

re-pinned, and ran the button. It printed "no axiom, no claim", the statement
digest was BYTE-IDENTICAL to the clean tree, and the run went green — while a
theorem with a real axiom cone sat in the environment. In neither walk: not
corpus, because an instrument is not corpus; not driver surface, because it
post-dates the emitter. In no allowlist. Pinned by nothing.

This repository also had no kernel-side scan at all. Its axiom gate was a
source-text grep, evadable by a leading space — which its own selftest case 12
already exploited.

THE FIX, ported from the ed25519 forks:

  · a kernel-side axiom-declaration gate that reads every compiled .olean via
    readModuleData. It sees what was actually stored, regardless of
    indentation, attributes, privacy, or where a declaration sits relative to
    any #eval. Membership self-derives from the manifest and the module count
    must match, so a deleted artifact cannot make the scan vacuous.
  · the ACCOUNTING IDENTITY, as set containment:

        every constant the kernel sees  in  corpus inventory  union  instrument surface

    The two walks read ENVIRONMENTS; the gate reads OBJECT FILES. What a walk
    cannot see because of where it sits in a file, the object file still holds.
    That asymmetry is the entire content of this fix.

    Compared as SETS deliberately. Counts cannot express the relation — an
    object file may hold two physical copies of one lazily-materialised
    equation lemma while an environment holds one constant per name — and
    arithmetic between those views misled the ed25519 version twice before it
    was stated as containment.

PLACEMENT differs from the forks, for a reason worth recording: there the
audit drivers are members of the compile manifest, so a gate beside the
compile phase finds them. Here AxiomCheck is compiled by Phase 3 and Inventory
by Phase 3b, so an earlier gate fails on a missing artifact — which it did,
correctly, on the first port. It runs inside Phase 3b, because the instruments
are exactly what it must see.

VERIFIED with the reviewer's own payload, which previously went green:

    ACCOUNTING FAILED: the kernel holds constants that neither walk accounts for:
      bait
      bait.smuggled

selftest_audit.sh: 14 attack cases -> 15. Note in the new case, because it
cost two iterations: `theorem bait.smuggled : True := trivial` does NOT
exercise this gate — Phase 1's stub audit greps for `: True :=` and catches it
first. Real defence in depth, but the naive payload never reaches the gate
under test, so the case uses the reviewer's original.

Two residues fixed while adding it, both the same shape: a case that was last
when written, leaving state the next case inherits. Case 13 restored
AxiomCheck.lean but not its pin; case 9 left its rogue gen file. Fixed at the
point of use so each case keeps testing what it tested before.

Button green (234 declarations across 11 modules, all accounted for),
15/15 self-test green, ATTESTATION GREEN with fidelity.
2026-08-02 02:51:55 +02:00
..
fidelity verification: bind statements and specification bodies (P1-a); un-stale the fidelity pin 2026-07-29 09:07:13 +02:00
gen/LTLAcc revision round 1: address both external reviews (GPT-5.6 + second Claude) 2026-07-11 22:53:47 +02:00
Proofs P2-b: close classes 9 and 15 — the instruments, and the places nothing looked 2026-07-31 14:18:40 +02:00
AUDIT-MANIFEST.txt verification: bind statements and specification bodies (P1-a); un-stale the fidelity pin 2026-07-29 09:07:13 +02:00
check.sh Round-7 F2: account for every constant the kernel sees 2026-08-02 02:51:55 +02:00
HARNESS.sha256 Round-7 F2: account for every constant the kernel sees 2026-08-02 02:51:55 +02:00
inventory-allowlist.txt Review round 4: F1* absorbed (lied-size boundary), acceptCons_sound, kit reproducibility 2026-07-12 15:07:57 +02:00
inventory_gate.sh Review round 3: environment-derived audit surface, self-contained kit 2026-07-12 00:32:18 +02:00
lean-guard L1+L2: hashing shapes, domain separation, MTH/Root/ConsRec with termination 2026-07-10 23:58:00 +02:00
lean-toolchain Review round 4: F1* absorbed (lied-size boundary), acceptCons_sound, kit reproducibility 2026-07-12 15:07:57 +02:00
run_bare.sh Round 5 (housekeeping): doc-consistency welded into the button; both round-4 approvals recorded 2026-07-15 09:40:20 +02:00
selftest-harness.sh verification: pin the harness, audit drivers and policy files (P1-c) 2026-07-29 20:13:21 +02:00
selftest_audit.sh Round-7 F2: account for every constant the kernel sees 2026-08-02 02:51:55 +02:00
selftest_statements.sh verification: bind statements and specification bodies (P1-a); un-stale the fidelity pin 2026-07-29 09:07:13 +02:00