feat(proofs): Evidence Mode foundations — Agda library + golden vectors (#7) - #78
Merged
Merged
Conversation
…icts (#7) ## Summary Lands the formal-foundations layer of Evidence Mode: what a residual, an evidence-refined candidate set, a warrant token and a presence verdict *are*, and a proof that the verdict computation the server routes and the residual explorer run decides exactly the candidate semantics. Closes the gap the reference explorer's own footer admits ("separately tested JavaScript, no proved extraction correspondence"). ## Changes - `MetaManifold/Evidence/{Prelude,Residual,Echo,Warrant,Signed,Decision}.agda` — L0 abstract semantics (Candidate fibres; Holds quantifies over ALL candidates; actual-world honesty; epi-does-not-give), L1 the signed finite model 'signed-integer-v1' as ℕ offsets with enumeration proved sound + complete, L2 verdicts computed and proved correct (entailed/refuted/unresolved/inconsistent), the five reference presets as computed proved terms. - `All.agda` imports the six new modules (CI reachability gate). - `reject/IdentificationWithoutUniqueness.agda` — negative control: reporting an identified value from a mere presence verdict must not type-check. - `README.md` — module table rows + stdlib-free note (Evidence.* uses only Agda.Builtin.*, so it checks under any Agda ≥ 2.6.4.3). ## Verification - All six modules type-check clean (Agda 2.7.0.1, --safe --without-K, exit 0, no output). - check-proofs.sh guard logic replicated on all 17 modules: no postulates/holes/escape flags; --safe --without-K pragma present. - reject control fails with `fst (fst c) != 8` as its EXPECT line states. - `scripts/check-spdx.sh`: OK. - Full All.agda run needs the estate toolchain (Agda 2.6.4.3 + stdlib 2.1); the Evidence half is stdlib-free by construction. Issue tracking: See also: #7 Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
## Summary 546 golden cases (13 residuals × 7 noise bounds × 3 views × 2 zero-assumptions) that pin the signed finite model's answers — candidate counts, presence verdicts, identified values — as data, so Agda, Julia and TypeScript can be bound to one truth instead of three agreeing-by-accident implementations. ## Changes - `scripts/gen_evidence_vectors.py` — the durable encoding of the explorer semantics (validation, candidate enumeration, decide, identify); regenerates the JSON byte-identically. - `proofs/vectors/evidence_vectors.json` — the generated pin; all four verdicts and both identification outcomes covered, plus the five reference presets. ## Verification - Regeneration diff: identical (546 cases). - Fields anchored in Decision.agda: candidate_count ↔ length, presence ↔ decide + the four theorems, identified_values ↔ values. Issue tracking: See also: #7 Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Companion to verification-plan.md for the evidence library: the layer table (abstract semantics → signed finite model → decision procedures → implementation seam), the four verdict theorems, the golden-vector theorem-to-test map, and what is deliberately not proved (server/UI code, beyond-the-grid, funext, general extraction). Issue tracking: See also: #7 Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
arena-ai-coding-agent
Bot
requested a review
from hyperpolymath
as a code owner
September 26, 2026 15:31
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
hyperpolymath
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First slice of #7 (Full Evidence Mode): the formal foundations. What a residual, an evidence-refined candidate set, a warrant token and a presence verdict are — proved, executable inside Agda, and pinned across implementations.
The reference explorer's own footer admits its signed JavaScript model has no proved extraction correspondence with any proof. This PR closes exactly that gap:
Evidence.Residual,Echo,Warrant):Candidate observe r E = Σ W ((observe w ≡ r) × E w);Holdsquantifies over all candidates, not the case's chosen witness;actual-world-soundis the honesty boundary (a warranted claim about candidates says nothing about reality until the actual world is shown admissible);Echo/AvecFibrefibre semantics with the total-space factorisation (the licence for storing rows as(observed, witnesses)pairs);Warrant/Epi/SoundWarrantwithepi-does-not-give— a warrant token is not truth, proved by countermodel.Evidence.Signed):signed-integer-v1as ℕ offsets, so every predicate is decidable and the model runs inside Agda; enumeration proved sound (listed ⇒ satisfies) and complete (satisfies ∧ b ≤ 6 ⇒ listed).Evidence.Decision): the exact computation the server routes and the residual explorer run, proved to decide the candidate semantics:entailed⇒ Present holds;refuted⇒ Absent holds;unresolved⇒ neither (explicit witnesses both ways);inconsistent⇒ no inhabited case — an empty candidate set does not make claims vacuously true. The five reference presets land as computed, proved terms (e.g.present-without-identification: presence without a value).proofs/vectors/evidence_vectors.json, regenerate withscripts/gen_evidence_vectors.py) covering all four verdicts and both identification outcomes, for Julia and bun test stacks to consume so Agda/Julia/TS are bound to one truth.Negative control:
reject/IdentificationWithoutUniqueness.agda— reporting an identified value from a mere presence verdict (the UI bug Evidence Mode exists to prevent) must fail to type-check, and does.Changes
proofs/agda/MetaManifold/Evidence/— six new stdlib-free modules (onlyAgda.Builtin.*, so they check under any Agda ≥ 2.6.4.3)proofs/agda/MetaManifold/All.agda,proofs/agda/README.md— suite integrationproofs/agda/reject/IdentificationWithoutUniqueness.agda— new negative controlscripts/gen_evidence_vectors.py+proofs/vectors/evidence_vectors.json— the golden-vector pindocs/formal/evidence-verification.md— layering, verdict theorems, theorem-to-test map, and what is deliberately not provedVerification
--safe --without-K.check-proofs.shguard logic replicated locally on all 17 modules: no postulates/holes/escape flags; pragma present.-- EXPECT:line states.scripts/check-spdx.sh: OK (327 files).All.agdasuite check runs in CI under the estate pin (Agda 2.6.4.3 + stdlib 2.1); the Evidence half is stdlib-free by construction, so toolchain drift cannot affect it.Scope note
The UI layer of #7 (avec_fibre editor, fibre visualizer, residual explorer, warrant editor, provenance logging, DANGER banner) follows in later stacks on top of these foundations. Refs #7.
Note on CI
File-based workflows have been failing repo-wide with
startup_failuresince 2026-09-25 (diagnosed in #76 as settings/platform-side). If checks show that, it is unrelated to this change.