- 0. Provenance of this plan
- 1. The answer in one page
- 2. Ground truth, per repository
- 3. The invariants, restated honestly
- 4. Architecture
- 5. What else must be created, per repository
- 6. The proof ladder
- 7. The empirical gate (before bigger work)
- 8. The ultracode engineering session
- 9. Decisions for the owner
- 10. Beyond this repository
- 11. What changed in the README’s story
squeakwell recovers damaged datasets by scattering fragments across VeriSimDB’s
eight modalities and letting them cross-check and reconstruct each other.
VeriSimDB is the required underlying database. This document answers four
questions: what is the fastest route down the proof pathways, what is the
fastest engineering route, what else has to be created across the estate, and
how an ultracode engineering session should be run. It replaces the aspirational
wording in README.adoc where the two disagree.
What this plan rests on, so nothing here is taken for more than it is:
-
Six reader agents read squeakwell, verisimdb (Rust crates and
formal/.v), vcl-ut, echo-types, tropical-types and the estatestandards/mathesis policy, citing file and line. Four design agents each produced a full architecture. Three judges scored them under the elegance, dependability/privacy and speed/testability lenses. Fourteen adversarial refuters attacked the proposed theorem ladder; twelve claims were refuted *as packaged and repaired, two survived. The repaired statements are the ones recorded here. -
Verified by running:
cargo check -p verisim-octad -p verisim-drift -p verisim-normalizersucceeds (165 crate units, about 37 s warm cache);vcltotal-parsebuilds standalone (2 s); thevclt-gatebinary certifiesDECLARE … WHERE … = $1 LIMIT 1at level 6 andNORMALISE 'e' FROM AUTHORITATIVE DOCUMENTat level 4, rejectsEFFECTS { Write }at L0, and spawns in about 3 ms; squeakwell builds and passes its 23 tests. -
Not verified by running: no Rocq/Coq, Agda, Lean, Idris2, Creusot, Isabelle or podman is installed in the planning environment. Every statement about a proof is from reading the source. Per
standards/3-practice/PROOF-POLICY.adocsection 5, every proof row for squeakwell is therefore OPEN until a prover actually runs.
Engineering route (fastest honest path to a working recovery).
Build squeakwell as a compiler from fragments to a certified VCL transition
program, with a local-first pure kernel in front of it. Fragments are typed
and classified in-process (guarded fill, pure resolve, the lexicographic
measure), contradictions are held locally, and only agreed values are lowered
to a running verisim-api over its real routes. Every round is printed as a
canonical .vcl script, every statement is certified by the vclt-gate binary
before it is executed, every executed line becomes a provenance record on the
entity’s hash chain, and the loop re-synthesises from the server’s own drift
report until the program is empty. This is Architecture D with Architecture A’s
kernel grafted in (section 4). Two of three judges chose D; the third chose B
and its grafts are the upstream asks in section 5. The MVP needs no change in
verisimdb or vcl-ut; everything on its critical path exists today.
Proof pathway (fastest honest path to a first mechanised result). Do not try to prove the README’s five invariants: one is false (drift is not monotone under fill), two are vacuous as written (determinism as reflexivity, termination as "or `max_iterations`"), one belongs to vcl-ut (the ratchet) and one conflates a provable identity fact with an unprovable oracle claim. Prove the repaired statements in section 3 in this order:
-
Rung 0 (today, Rust): property tests for the resolve-kernel laws, guarded fill, and the lexicographic measure, with the mandatory counter-model test that finds a case where conflicts rise after fill.
-
Rung 1 (hours, Rocq):
verisimdb/formal/Recovery.v: guarded fill, normalise, identity preservation, the counter-model to drift monotonicity, and lexicographic progress with the hypotheses the refuters showed are needed (conflict_sym, winner-relative conflict count). -
Rung 2 (one to two sessions, Agda):
echo-types/proofs/agda/EchoPartialSection.agda, the join-semilattice of partial sections thatverisimdb/formal/CROSS-REPO-MAP.adocalready flags as the one missing abstraction. The Rocq file then becomes an instantiation, as the owner’s standing directive requires. -
Rung 3 (hours each, Lean): the two small tropical-types lemmas that survived refutation: the free-monoid residue measure and the reachability grade with its monotonicity facts.
-
Rung 4 (after the kernel exists, Creusot): purity and permutation invariance of the Rust resolve kernel, and the export postcondition.
-
Rung 5 (after the wire format is stable, Idris2): the engineering contract for the program IR, journal and gate request/response.
What else must be created: section 5 lists it per repository. The largest
single item is the echo-types module; the most valuable upstream ask is a
propose/apply pair on verisimdb’s normalizer that carries a
RepairJustification, because today the server picks the repair target itself.
Decisions only the owner can take: section 9. The default arm is labelled in each.
| Item | State on 2026-11-05 |
|---|---|
Rust |
About 640 lines; |
VeriSimDB client |
|
Tests |
23 pass (8 e2e, 5 property-style with hand-rolled cases, 10 unit), all against the stubs. No proptest crate. Benches exercise stubs. |
Proofs |
None. No |
Templates |
About 60 unrendered |
CI |
Dogfood Gate K9 check failed on |
| Item | Finding (file and line as read) |
|---|---|
Partial octads |
First-class. |
Drift as a library |
|
Regeneration |
|
Conflict resolution |
|
API |
|
Defaults |
Auth disabled ( |
|
octad = ident × (modality → option mval); |
|
|
|
Scores are clamped to [0,1]; |
Cross-repo map |
Every foundation theorem is mapped to an echo-types module; the one flagged missing abstraction is the join-semilattice of partial sections. |
-
Every level L0–L10 is a predicate over a
Statement(plusOctadSchema) or aTransition; none mentions a value or an octad. "Data that passes level N" is a category error. The honest claim is: the reintroduction statement for entity e is gate-admissible at level k, and e’s populated fields are schema-bound. -
From VCL text only L0–L6 are reachable (issue #25, fail-closed). Transitions have a hard ceiling of 4 (
Transition.idr183-185) and do not check modality presence:NORMALISE e FROM AUTHORITATIVE TENSORon a tensor-less entity is admissible. Exit 0 is not "repair justified". -
The
vclt-gatebinary is the frozen v1 seam; verisimdb’s Elixir executor already calls it. Linkingvcltotal-parseas a crate bypasses the trusted seam (its Rust decider carries no proofs). Use the binary; use the crate only as a test oracle. -
Epistemic.idrline 149 discards the atom insatisfies (PAtom _), andPBelievesevaluates identically toPKnows; no module imports the Kripke semantics. Any L10 story built on it today is vacuous.
-
echo-types:
Echo f y := Σ x. f x ≡ yand the finite fibre-count, decidability and no-section lemmas are mechanised,--safe --without-K, zero postulates. At recon time (2026-11-05) there was no partial-section or multi-witness layer andEchoTruncation.agdawas unwired fromAll.agda(dead code under the repo’s own discipline). Update 2026-11-09: all three gaps are closed by echo-types PR #370 (merged 2026-11-10):EchoPartialSection.agda(R3/R9 theory),EchoFibreIntersection.agda(R8) andEchoTruncationwired intoAll.agda/Smoke.agda; seePROOF-STATUS.adoc. Not echo-types work: the drift bridge R17 is a Rocq lemma for verisimdbDrift.v(ASSUMED, not yet stated); R11 is a planned Creusot proof of the Rust resolve kernel, to live in squeakwell (OPEN: no Creusot source yet), and the f64 confidence statement needs the quantisation layer noted under R6/R7 (R18 is the separate Kripke-world conjecture, gated on vcl-utEpistemic.idr). Retracted and gated: the graded comonad, the cone universal property, any 2-categorical shape, EI-2 (gate G-001). Hard limit the theory itself states: any fibre-determined functional is witness-blind, so a confidence score may rank fibres but never choose a member of one. -
tropical-types:
Resource.Closuredefines the Kleene starmatStarparametrically over anyResourceAlgebrawith monotonicity,I ⊑ A*and a bound certificate, instantiated atMinMax(bottleneck) andMinPlus(product on quantised −log confidence). It proves no walk semantics; that exists only in Isabelle, over naturals, for max-plus and min-plus, and the Isabelle status is self-contradictory inside the repo. Carriers are ℕ-based: a quantisation layer is needed for f64 confidence.hub_ceilingis overList TransportClassand does not transfer literally.
First-party Rust behaviour is verified with Creusot, never a parallel model. Idris2 carries API, ABI and wire-format contracts. Theory lives in Agda as source of truth, rechecked in Rocq and Lean. Existing Rocq proofs of theory are target-only evidence until an Agda source exists and the statements are compared. Status vocabulary: PROVEN, PROVEN-WITH-AXIOMS, TESTED (with bounds), ASSUMED, OPEN; a row is only as strong as its weakest dependency. Python is banned with no exceptions, which rules out any ML regenerator the README alludes to. squeakwell has no row in the mathesis catalogue because it has no proof files of its own.
| Invariant (README) | Verdict | Repaired statement | Home |
|---|---|---|---|
MonotonicConvergence
|
False. Runnable witness: a Document-only octad reports
|
Progress on a lexicographic measure `mu(o) = ( |
missing |
, nconflicts o)`
over naturals: |
Rocq |
IdentityPreservation
|
Split. The identity half is a three-line induction over the existing
|
|
Rocq |
DeterministicResolution
|
Vacuous (reflexivity). The Rust is order-dependent: LWW takes the
caller’s last element; |
A pure Rust kernel |
Creusot on |
TypeRatchetSoundness
|
Belongs to vcl-ut, and is Statement-indexed, not data-indexed. Holds by
constructor shape; the projection function is unwritten. Transitions have no
level index at all ( |
|
Idris2 |
TerminationGuarantee
|
Vacuous (satisfied by |
Well-foundedness of |
Same file as Progress. |
"Never export corrupt data" (PROOF-NEEDS) |
Not statable over |
At fragment granularity: let |
_T`, i.e. `e : Echo restrict_T (obs |
_T) |
Agda |
Scores are 1–10 from the three judges (elegance E, dependability/privacy D, speed-to-first-recovery S). All four honour the hard requirement that VeriSimDB is the underlying database.
| Option | E | D | S | Decisive finding |
|---|---|---|---|---|
A. Library-coupled: verisim crates in-process, server at export |
7/7/6 |
6/7/7 |
5/5/5 |
Best offline testability and data minimisation; but re-implements two
private server semantics (computability flags, hash embedding) with no
compile-time tie, and |
B. Server-driven: every fragment is an octad in verisim-api |
8/7/8 |
7/5/8 |
4/4/3 |
Cleanest separation and the strongest form of the requirement; but the MVP is blocked on six upstream route additions, has zero offline test surface, and writes every raw and contradictory value to an unauthenticated, all-interfaces server before any review. |
C. Hybrid with the session dogfooded as an octad |
5/6/5 |
6/5/6 |
4/4/5 |
The |
D. Compiler: fragments → certified VCL program → lowered to REST |
7/8/7 |
7/7/8 |
5/6/8 |
Dissolves the README’s category error (the certified object is a statement), replay is a testable WAL-style property, fail-closed round abort on a missing gate, values never enter statement text. Weaknesses: verisimdb executes none of the lifecycle verbs, so the lowering is a second semantics guarded only by replay tests; NORMALISE lowering is intent-lossy today; round-0 lowers all fragments before review unless A’s classification is grafted in front. |
Per estate doctrine 15 the most elegant correct long-term option is the default arm, and it must be labelled: D with A’s kernel in front (default arm). Named here as the compiler route.
-
From D: the program IR and canonical printer, the gate client on the frozen binary seam, the lowering with bindings and statement-hash provenance, the round-based journal with
replayanddiff, intent/effect reconciliation, round abort onGateUnavailable. -
From A: local-first fragment typing, the pure resolve kernel with its law tests, guarded fill, the lexicographic measure and the mandatory counter-model test,
quality: Option<f64>that isNonewhen nothing is computable, the constructor that refuses verisimdb’sSummaryRegenerator, the id-map written before any dependent write. -
From C: the fibre trichotomy (size 0/1/n) as the export gate with confidence as ranking only, and the
verifysubcommand that rebuilds status from the id-map and the server alone. -
From B: the upstream asks (section 5.1), filed with measured numbers from the MVP run rather than argued.
Why not B outright, although one judge preferred it: its MVP cannot run
without verisimdb changes the squeakwell owner does not control, and it has no
offline test surface, which is exactly what an ultracode session needs to
validate within one sitting. Why not A outright: it duplicates private server
semantics and its --allow-offline switch reintroduces fail-open. The compiler
route keeps the server as the only drift authority and keeps squeakwell’s own
code to typing, synthesis, lowering and journalling.
Alternatives rated for the record (elegance/correctness first, then dependability):
-
D-only (no local kernel, lower everything at round 0): most elegant on paper, loses on privacy and on recovery power until verisimdb grows
propose/apply. Second. -
A-only: dependable offline, slower to a first recovery, duplicates semantics. Third.
-
B: correct end state for the server, but blocked. Fourth today, first once section 5.1 lands upstream; the compiler route converges to it.
fragments (CSV, JSON, embeddings, provenance, versions)
│
▼
┌──────────────┐ typing: entity keys, OctadSchema fields, presence vectors,
│ src/fragments│ candidate lists per field, damage mask
└──────┬───────┘
▼
┌──────────────┐ pure kernel (A graft): guarded fill with deterministic
│ src/kernel │ regenerators, resolve(policy, frags) -> winner + justification,
│ fill/resolve│ mu = (|missing|, nconflicts), fibre trichotomy, review queue
│ measure │ (no network, proptest laws, Creusot targets)
└──────┬───────┘
▼
┌──────────────┐ round-N.vcl: DECLARE / ASSERT / NORMALISE … WHERE … = $n
│ src/program │ params-N.json carries the values; canonical printer;
│ IR + synth │ requested level ≤ 6 by construction
└──────┬───────┘
▼
┌──────────────┐ vclt-gate binary (pinned commit), stdin JSON, 2 s timeout,
│ src/gate │ exit 0 → execute, 1 → review, 2 → abort the round
└──────┬───────┘ certs-N.jsonl with the gate's commit hash
▼
┌──────────────┐ REST plan on real routes: POST /octads, PUT /octads/{id},
│ src/lower │ POST /normalizer/trigger/{id}, POST /provenance/{id}/record
│ │ (event keyed by SHA-256 of the statement), presence pre-check,
└──────┬───────┘ intent/effect reconciliation → effects-N.jsonl
▼
┌──────────────┐ GET /drift/entity/{id} (computable flags), GET after PUT,
│ verisim-api │ GET /provenance/{id}/verify; fixed threshold, `le` boundary
└──────┬───────┘
▼
re-synthesise next round until the program is empty, or NotConverged
Journal on disk: session.json, bindings.json (symbolic name → UUID, written
before any dependent write), round-N.vcl, params-N.json, certs-N.jsonl,
effects-N.jsonl, review-N.vcl. Everything the user will read contains ids,
hashes, counts, levels and exit codes, never recovered values.
Crash between create and binding: a crash after POST /octads succeeds but
before bindings.json is written would leave an unbound octad and a resume
could create a duplicate. The binding is therefore written in two phases: an
intent record (deterministic entity key, also placed in
OctadRequest.metadata) before the POST, and a confirmation with the UUID
after it. On resume an unconfirmed intent is reconciled by searching the
server for its metadata key before any new create; once the client-chosen id
item in section 5.1 lands, the intent phase collapses into POST /octads/{id}.
T14 carries this as a done-when.
For each entity e squeakwell emits one DECLARE <mod>.<field> FROM OCTAD 'e'
WHERE <mod>.<field> = $n LIMIT 1 per populated field and, for each repair, a
NORMALISE 'e' FROM AUTHORITATIVE <mod>. The gate verdict on those statements
is what squeakwell reports: gate_level 6 means the field names resolve in the
recovered schema and the statement shape passes L0–L6; 4 means the transition
is admissible. It says nothing about the values (they travel in $n), L2 is
near-vacuous on parsed input, and L7–L10 are reported as not expressible from
text (vcl-ut #25), never as achieved. Phase 5 is re-scoped from "levels 7–10"
to: fixpoint reached, gate-admissible at 6/4, provenance chain verifies, server
drift agrees with local expectation. Repaired values themselves are unverified
until the server can return modality content (GET /octads/{id}/full).
-
Fail-closed. Remove every
.ok()on client calls;recoverrefuses to start withoutGET /health; a missing or timed-out gate aborts the round before any network effect; no offline switch forrecover. -
No silent green. Raw
verisim-driftcalculators are never used without a computable flag;qualityisOption<f64>; server-dependent tests skip with a message, never pass, when the server or gate is absent. -
Integrity and provenance. GET after every PUT (the server under-reports presence on update); one provenance record per executed statement keyed by its SHA-256;
GET /provenance/{id}/verifybefore export; the server’s actor string is client-supplied, so the chain is tamper-evident, not authenticated. Flags, counts and statement-hash provenance do not verify the value aNORMALISErepair produced: repaired values stay unverified untilGET /octads/{id}/fullexists upstream (section 5.1); until then export labels themderivedand the plan says so. -
Privacy. Fragments, params and the review queue stay in the workdir; only agreed, singleton-fibre values are lowered; bind the recovery server to loopback or the podman network, enable auth, build the persistent image with a retention policy; the FNV hash-embedding is a content fingerprint and is labelled non-semantic.
-
Security of the gate seam. Spawn
vclt-gateby absolute pinned path, no shell, stdin JSON only; record its commit hash in every certificate. -
Licensing. squeakwell, verisimdb and
vcltotal-parseare MPL-2.0; echo-types carries an AGPL-3.0-or-later text inLICENSES/that must be checked before any Agda is vendored; pin every git dependency by revision. -
Language policy. No Python, Go or TypeScript anywhere, including regenerators: only deterministic regeneration ships.
| Item | Why | Size |
|---|---|---|
|
Today the server picks the target itself and commits on call; the certified program’s justification is advisory. This is the single most valuable ask; file it with the measured intent/effect disagreement rate from the MVP. |
M (~150 LOC + handler) |
Client-chosen id: |
Deterministic keys and crash-resume; today journal loss orphans UUIDs. |
S (~40 LOC) |
|
A recovery engine must read witness values; today only flags and counts come back. |
S (~80 LOC) |
Octad-aware drift as a library ( |
Raw calculators read absence as zero drift; the honest layer is private. |
M (~450 LOC relocation) |
Deterministic Document→Graph (parse the |
The only Graph-recovery paths that can exist without ML; today none exist. |
S (~120 LOC) |
Pure value-level resolve kernel ( |
The Coq merge laws have no Rust counterpart; |
S (~80 LOC) |
|
Adaptive thresholds make convergence a moving target; proofs have no entity linkage. |
S–M |
|
No |
150–250 lines Rocq |
-
weaken/weakenStarinLevels.idr(rung for the ratchet; additive). -
Additive
RepairJustificationconstructors:LastWriterandReconstructed Modality Residuewithdata Residue = Unique | Finite Nat | Unbounded(mirrorsFiberSize-fin; a nat grade doubles as the tropical bottleneck loss). Reopens no theorem; wire tags 3 and 4; one conformance fixture each. Validate withidris2 --build verification/proofs/vclut-core.ipkg. -
Fix
Epistemic.idrline 149 (atom discarded) and separatePBelievesfromPKnows; a Transition-indexed certificate is the prerequisite for the L10 conjecture in section 6. -
Gate batching (reserved
schema_version) and exporting the schema-JSON builder from the library; today it lives only in the binary.
Update 2026-11-17: EchoPartialSection.agda, EchoFibreIntersection.agda
and the EchoTruncation wiring landed in echo-types #370 (shapes as recorded
in PROOF-STATUS.adoc; the merge is a resolver-parametric algebra, not a join
for the information order). Still open from this list: the Kleene fixpoint on
Fin 8 (the merged EchoPartialSection.agda has guarded fill and its
inflationarity, but no fixpoint lemma; the nine-round fixpoint is mechanised
in Rocq as R10), the generic fibre-blind lemma and the EchoRecovery
audience record.
-
proofs/agda/EchoPartialSection.agda(250–400 lines):PartialSection P := (b : B) → Maybe (P b)overEchoDisplayed.Displayed;Defined/dom; pointwise information order with refl/trans (antisymmetry only under the funext parameter);resolveJointhrough the exactmcombinetable; conditionaljoin-comm/assoc/idem;restrictwith idempotence and compose-as-meet;restrict-fibre-char; guarded fill as inflationary operator; Kleene fixpoint onFin 8. Same OPTIONS header as siblings, zero postulates, wired intoAll.agdaand pinned inSmoke.agda. -
EchoFibreIntersection.agda(60–120 lines): binary narrowing as a funext-free one-liner, theFin nform by induction;narrow-shrinks. -
Done in #370: wire
EchoTruncation.agdaintoAll.agda. Open: add the generic one-linefibre-blindlemma (today only thecollapse : Bool → ⊤instance exists). -
An
EchoRecoveryaudience record in theEchoProvenancepattern, over fragment positions and the accepted setT.
-
Resource/HubCeiling.lean:factor_le,zero_bot,join_bound,lsum_bound, and the star corollary under an explicitIsStarhypothesis; discharged atMinMaxandMinPlus, notMaxPlus. -
reachGrade (A) (S) (m) := lsum allFins n).filter S |>.map (matStar A · mwithreachGrade_mono_mat,reachGrade_mono_set(needs a newlsum_filter_mono) andone ⊑ reachGrade A S mwhenS m. -
The generic
weightedResidueMeasure(free-monoid homomorphism; onlyone_mulandmul_assocare used). -
Reconcile the self-contradictory Isabelle status and add an Isabelle CI job or an explicit "unverified" banner. Walk semantics for
matStarin Lean is a large item and is not on squeakwell’s critical path.
-
Add a squeakwell row to the mathesis catalogue once a proof file exists.
-
A
PROOF-STATUS.adocledger in squeakwell with every row OPEN, prover home per policy, and the dependency rows (verisim-api routes, vclt-gate contract) as ASSUMED with pinned commits. -
No
DATA-FORMAT-ROUTINGdocument exists instandards; do not cite one.
The task graph in section 8 is the list. The items that are not features:
re-target the client to real routes; remove the fail-open .ok()`s; make the
stub return `NotImplemented rather than printing "recovery complete"; resolve
the remaining placeholders; either delete src/interface/ffi or make
build.zig reference files that exist; rewrite PROOF-NEEDS.adoc to the
policy split; fix the one clippy warning; add proptest as a dev-dependency or
stop calling the hand-rolled tests property tests.
Rungs are ordered fastest-first. "Status" is the status after adversarial refutation. Every row is OPEN in the ledger until the named prover runs.
| Rung | Statement (repaired form) | Builds on | Home | Effort |
|---|---|---|---|---|
R0 |
Proptest laws: resolve comm/assoc/idem under the chosen kernel,
permutation invariance (expected to FAIL for caller-order LWW and the fp
Merge strategy, PASS for ModalityPriority with a total tie-break); fill never
overwrites an observed value on content modalities; |
— |
squeakwell |
hours |
R1 |
|
|
vcl-ut Idris2 |
hours |
R2 |
|
|
verisimdb Rocq |
hours |
R3 |
Guarded fill is inflationary on the six content modalities; audit modalities move by chain prefix |
|
Agda source, Rocq recheck |
half a day |
R4 |
Counter-model theorem: |
|
Rocq |
hours |
R5 |
|
|
tropical-types Lean |
hours |
R6 |
Element lemma |
|
tropical-types Lean |
half a day |
R7 |
|
|
tropical-types Lean |
half a day |
R8 |
Multi-witness narrowing: binary one-liner, |
|
echo-types Agda |
half a session |
R9 |
Permutation-invariance of |
|
Rocq corollary + Agda twin |
one day |
R10 |
Lexicographic progress and ≤ 9-step termination with explicit
|
|
Agda source, Rocq and Lean rechecks |
1–2 days |
R11 |
Purity and permutation invariance of the Rust resolve kernel as Creusot
|
|
squeakwell Creusot |
1–2 days incl. toolchain |
R12 |
Observation fidelity at fragment granularity: exported `e : Echo restrict_T (obs |
_T) |
|
Agda record + Creusot export postcondition |
one session |
R13 |
Review-queue completeness over the enumerated candidate fibre:
|
|
Agda + Creusot queue predicate |
one session |
R14 |
Fibre-blind functionals are constant on the fibre (generic one-line
|
|
echo-types Agda |
hours |
R15 |
Reintroduction-statement grading: |
|
Idris2 wire contract in squeakwell |
small-medium |
R16 |
Additive |
|
vcl-ut Idris2 |
small |
R17 |
Bridge: |
|
Rocq, status ASSUMED |
hours |
R18 |
Conjecture: the enumerated candidate fibre as the Kripke world set
for a Transition-indexed L10 certificate; unstatable until |
|
research |
Prover homes per policy. Theory (R3, R8, R9, R10, R12, R13, R14) is Agda
source of truth in echo-types, rechecked in Rocq inside verisimdb/formal/ and
in Lean; engineering contracts (R1, R15, R16) are Idris2; first-party Rust
behaviour (R11, the export postcondition, the queue predicate) is Creusot.
Rocq files that exist before the Agda source are target-only evidence.
Alternative proof paths, rated (elegance and correctness first, then dependability):
-
Agda-first exactly as above (default arm). Most elegant: one abstraction closes both the CROSS-REPO-MAP gap and squeakwell’s progress theorem. Slowest to a first green light because Agda is not installed anywhere in the estate’s CI for this repo.
-
Rocq-first (
Recovery.vbefore the Agda module, cross-documented as instantiation-first per the standing directive’s second clause). Fastest mechanised result (hours oncecoqcexists,nix shell nixpkgs#coqis the cheapest route). Loses only the policy’s source-of-truth ordering, which the directive explicitly allows when noted. -
Lean-first via tropical-types (R5–R7). Lightest toolchain (
elan
lake build, no Mathlib). Proves the confidence algebra, not the recovery invariants; good second track in parallel, not a substitute. -
TLA+ or Alloy model of the fixpoint loop. Cheap and finds counter-models fast, but it is a parallel model, which PROOF-POLICY forbids as a substitute for Creusot on the Rust; acceptable as a design-time oracle only.
-
Property tests only (R0) and stop. Dependable and immediate; leaves every ledger row TESTED with bounds, never PROVEN. The floor, not the plan.
Each experiment has a metric and a pass criterion; results go into
docs/EXPERIMENTS.adoc with run counts. Server-dependent experiments skip with
a message when SQUEAKWELL_VERISIM_URL or SQUEAKWELL_VCLT_GATE is unset.
| Id | Experiment | Pass criterion |
|---|---|---|
E1 |
Gate throughput: spawn |
p95 ≤ 50 ms; 1,000 statements ≤ 60 s; else draft the batching escalation to vcl-ut |
E2 |
Absence honesty: raw |
raw returns 0.0 (documented
hazard reproduced); squeakwell |
E3 |
Kernel laws: resolve comm/assoc/idem and permutation invariance (10,000 cases); guarded fill never overwrites, ` |
missing |
` non-increasing (10,000); lex progress and ≤ 9 steps (1,000 runs); the counter-model search finds ≥ 1 case where conflicts rise after fill |
0 violations; ≥ 1 counter-model found (the test fails if none is found) |
E4 |
Ground truth on |
expected numbers declared up front: all graph-dropped entities recovered by ASSERT from the other source; the server path repairs the graph/document-inconsistent ones (and the direction mismatch is logged); deleted titles and contradicted bodies land in review; zero fabricated values |
E5 |
Replay determinism: the same journal against two fresh persistent servers |
flags, counts, computable scores and chain lengths agree modulo UUID and timestamps; local FNV embedding equals the server’s bit-for-bit |
E6 |
Gate honesty: 100 % of DECLAREs at 6, NORMALISEs at 4; |
all as stated |
E7 |
One session, multi-agent, pipelined. Agents own files, not phases; every task
has a done_when that is a command or a grep. Phases: honest baseline
(sequential, one agent), kernel and fixtures (parallel), program, gate,
client (parallel), lowering and loop (sequential), tests, benches, docs
(parallel), upstream filings and proof skeletons (parallel, background).
Cutoff: the session ends when E1–E7 are recorded, whatever their verdict; a
red experiment is a result, not a failure of the session.
Agent roles: one kernel agent (fill, resolve, measure, R0 tests), one program agent (IR, printer, synthesis, golden text), one seam agent (gate client, verisim client, lowering), one fixture agent (damaged-small, ground truth, damage manifest), one proof-skeleton agent (Recovery.v draft, EchoPartialSection.agda draft, Program.idr, Creusot annotations, all marked "not run here"), one docs and filings agent, and a verifier agent that only runs the experiments and refuses to pass anything it did not run.
| Id | Task | Depends on | Repo | Parallel |
|---|---|---|---|---|
T01 |
Honest baseline: this plan, the honesty commit, clippy warning,
|
— |
squeakwell |
no |
T02 |
Engine stub honesty: |
T01 |
squeakwell |
yes |
T03 |
Fixture |
— |
squeakwell |
yes |
T04 |
|
— |
squeakwell |
yes |
T05 |
|
T03 |
squeakwell |
yes |
T06 |
|
T01 |
squeakwell |
yes |
T07 |
|
T01 |
squeakwell |
yes |
T08 |
|
T06, T07 |
squeakwell |
no |
T09 |
|
— |
squeakwell |
yes |
T10 |
|
T04, T09 |
squeakwell |
yes |
T11 |
|
T04 |
squeakwell |
yes |
T12 |
|
T05, T08, T09 |
squeakwell |
no |
T13 |
|
T10, T11, T09 |
squeakwell |
no |
T14 |
|
T13 |
squeakwell |
no |
T15 |
|
T12, T13, T14 |
squeakwell |
no |
T16 |
|
T15 |
squeakwell |
no |
T17 |
|
T16 |
squeakwell |
no |
T18 |
Benches: E1 gate throughput, E7 cold build; replace stub benches |
T10, T14 |
squeakwell |
yes |
T19 |
Upstream issues with file:line evidence and E1/E4 numbers: verisimdb
(propose/apply, create-with-id, |
T17, T18 |
elsewhere |
yes |
T20 |
|
T06 |
verisimdb |
yes |
T21 |
Done in echo-types #370: |
T06 |
echo-types |
yes |
T22 |
|
T14 |
squeakwell |
yes |
T23 |
Creusot contracts on |
T08, T16 |
squeakwell |
yes |
T24 |
Close-out: README/EXPLAINME rewritten to the compiler route with measured numbers; naming ADR stub; STATE.a2ml; mathesis pointer |
T17, T18, T19 |
squeakwell |
no |
Critical path: T01 → T06/T07 → T08 → T12 → T13 → T14 → T15 → T16 → T17 → T24. Everything else runs beside it.
-
No agent may mark a ledger row above OPEN unless it ran the prover and names its version.
-
No test counts as passed if it skipped.
-
The session report lists E1–E7 with numbers, the measured intent/effect agreement rate, the review-queue contents on the fixture, and every file:line the upstream issues cite.
Decided by the owner on 2026-11-05 through the selector. The default arm per doctrine 15 is marked; where the owner departed from it, the departure is recorded with its consequence.
-
Coupling arm: the compiler route (D with A’s kernel). Default arm, accepted. Option B-first would have waited on six verisimdb routes; A-only would have duplicated two private server semantics; C added session mapping and a privacy leak channel for no recovery power.
-
Proof source of truth: Agda first in echo-types. Default arm, accepted.
EchoPartialSection.agdalands first;verisimdb/formal/Recovery.vis its instantiation and the statements are compared per PROOF-POLICY section 3. Consequence: the first mechanised result waits on an Agda toolchain being installed where agents run (section 10); the R0 property tests are the interim evidence. -
vcl-ut extension: Option 2, a
RECOVERverb with an evidence slot. Departure from the default arm (additiveRepairJustificationconstructors). The owner chose the verb. Consequence:TRecover SubjectRef RepairJustification (Maybe Expr) SafetyLevelandGrammar.Verb VRecoverreopen the totality cases intransitionEvidence,transitionLevel,transitionVerb,subjectsDistinct,decTransition,enc_transitionand the gate’stransition_shape;certifiedSubjectsDistinctsurvives iftransitionAdmissiblekeeps its conjunctive shape. The evidence slot givesRECOVER e WHERE drift < $1the L4 injection-polarity check that NORMALISE lacks. A rung above 4 still needs a new decider and soundness lemma in theTransition.idrreflection style (for exampleresidueBounded). The additiveResidueconstructors of Option 1 ride inside the same change as the justification payload, so Option 2 strictly contains Option 1. The upstream issue (section 10) is filed as Option 2 with this list of reopened cases; until it lands, squeakwell lowersRECOVERlines toNORMALISE FROM AUTHORITATIVEand records the downgrade in the certificate log. -
The L10 conjecture: parked behind the three vcl-ut fixes it needs; squeakwell’s epistemic output is labelled Believes (KD45) until a completeness argument for the enumeration exists.
-
Name:
squeakwellis kept. The "Octad-Recover" working title is retired; the README’s naming table stays as the record of the alternatives considered. -
Zig FFI:
src/interface/ffiis deleted. A one-paragraph README records that an Idris2 ABI must exist before a C-ABI bridge means anything.
Issues to file once the MVP numbers exist (T19), one per line:
-
verisimdb: normalizer
propose/applywithRepairJustification; client id on create;GET /octads/{id}/fulland the update under-report; drift as a library; Document→Graph and Semantic→Graph regenerators; value-level resolve kernel and theAutoMergedoc/code mismatch; fixed-threshold config andleboundary;formal/Recovery.vand theNormalizer.vfunctorisation; the CROSS-REPO-MAP rows that cite unwired echo-types modules; auth-on and loopback defaults for recovery deployments. -
vcl-ut:
weaken; theRECOVERverb with evidence slot (owner’s choice, Option 2, carrying theResiduepayload);Epistemic.idrline 149 and Believes/Knows; batching; exported schema-JSON builder; register squeakwell as a gate consumer. -
echo-types: done in #370:
EchoPartialSection,EchoFibreIntersection,EchoTruncationwiring. Open: generic fibre-blind lemma;EchoRecoveryrecord; check the AGPL text inLICENSES/before any vendoring. -
tropical-types:
HubCeiling.lean;reachGradeandlsum_filter_mono; genericweightedResidueMeasure; reconcile the Isabelle status and add a CI job or banner. -
standards: a note in PROOF-POLICY that
verisimdb/formal/*.vis target-only evidence for recovery theory until the Agda source lands. -
mathesis: catalogue row for squeakwell once a proof file exists.
-
Toolchains where agents and CI run:
coqc,agdawith stdlib,elan/lake,idris2, Creusot with Why3; record each insetup.sh,guix.scmand the container, or record their absence in the ledger.
-
"Data that passes all 10 levels is formally verified as recovered" becomes "the reintroduction statements for e are gate-admissible at level k (≤ 6)".
-
"Drift converges monotonically to zero" becomes "the lexicographic measure decreases; drift is observed, never the criterion, and can rise during fill".
-
"Idris2 type kernel with proofs of monotonicity and determinism" becomes "no proofs yet; the repaired statements and their prover homes are in section 3 and 6; the ledger is `PROOF-STATUS.adoc`".
-
"NER and embeddings via ML" becomes "deterministic regeneration only; Document→Vector is a hash fingerprint labelled non-semantic".
-
Phase 5 becomes the fixpoint-plus-gate-plus-provenance criterion.