Repository review โ€” 2026-08-31#

Snapshot: commit e5c7ac954 ("fsync durable delta log appends"), branch claude/main, reviewed 2026-08-31 06:00โ€“08:00 UTC+1. The tree moved during the review: three delta-log commits landed between 06:30 and 06:41 while it ran. Findings are pinned to e5c7ac954 unless dated otherwise. Method notes are inline; every score is labelled.

Scope requested: completeness, integrity, performance, standards compatibility, architecture, Lean usage โ€” with attention to the Shardborough persistent storage layer. Cross-checked against the Codex update gist of 2026-08-31.

Result summary#

1. Integrity#

1.1 Build state#

lake build in formal/lean4 fails at HEAD:

1.2 Shardborough proof coverage#

Proved (kernel-checked theorems):

Not proved:

1.3 Shardborough integrity mechanisms#

2. Standards compatibility#

2.1 F* engine (docs/test-results/latest.json, run 2026-08-31 05:13 UTC)#

All labelled "N pass, M fail (out of T)":

Area Score
SPARQL 1.1 (query, update, protocol, GSP, service, results) 631 pass, 0 fail (out of 631)
RDF 1.1 six syntaxes + rdf-mt 1030 pass, 0 fail, 1 unsupported (out of 1031)
RDF 1.2 syntax/eval 242 pass, 0 fail (out of 242)
RDF 1.2 canonicalization 82 pass, 0 fail (out of 82)
RDF 1.2 entailment (rdf-semantics) 41 pass, 3 fail, 3 skip (out of 47)
SPARQL 1.2 254 pass, 0 fail (out of 254)
RDFC-1.0 86 pass, 0 fail (out of 86)
SHACL core / SPARQL constraints 98 pass, 0 fail (out of 98) / 22 pass, 0 fail (out of 22)
ShEx 1182 pass, 0 fail (out of 1182)
JSON-LD (toRdf/expand/compact/flatten/fromRdf) 467/385/245/58/53 pass, 0 fail each
CSVW (csv2rdf/csv2json/validation) 270, 270, 281 pass; 0, 0, 1 fail
RIF Core 46 pass, 0 fail, 4 skip (out of 50)

Caveats on this record:

2.2 Lean engine#

The Lean runner lake exe l4w3c prints the same score grammar, but no Lean number reaches docs/test-results/. All Lean scores are hand- transcribed prose in formal/lean4/README.md and PORT_NOTES.md, with no regeneration mechanism and no CI. Latest full measurement 2026-08-25 (PORT_NOTES.md:13790-13798):

2.3 Differential oracle#

lake exe l4diff runs (dataset, query) pairs through the committed F* binary and the Lean evaluator. Last tally (2026-08-22): 712 agree, 18 disagree, 6 fstar-error, 0 lean-error, 395 skipped (out of 1131, including 500 generated cases). Of the sparql11 manifest it covers 236 of 631 entries (โ‰ˆ37%): UPDATE, Protocol, GSP, syntax-only, entailment- regime and SERVICE entries are all skipped. The shared comparator (Harness/Compare.lean) is a clause-for-clause port of the F* comparator, so it inherits the same leniencies rather than checking them.

2.4 Conformance coverage of Shardborough#

None. l4w3c and l4diff build in-memory Dataset values from manifest fixtures. No conformance path constructs a DatasetBackend over IBK2/SBM2 artifacts. The disk-backed path is exercised only by one-shot CLIs (l4block-*) with hand-typed queries and by the smoke scripts in tools/. A regression specific to the on-disk backend, the delta overlay, or manifest resolution is invisible to every conformance suite in the repository.

3. Performance#

4. Architecture#

5. Lean usage#

6. Completeness#

7. Hygiene#

  1. โœ… Done (009f2ab53, 07:06): maxUnderscoreRun_ge_best repaired via the monotone feedChars lemma. HEAD builds again.
  2. โœ… Partly done (009f2ab53): .github/workflows/verify-lean4.yml now gates lake build (re-checking all 2,884 theorems and 6,740 guards). Still open: confirm its first green run on GitHub Actions, and extend with l4w3c score regeneration into docs/test-results/ (Lean rows next to F* rows). Owner note, 2026-08-31: CI arrangements are migrating to a split-repository layout (factoidal-builds vs factoidal-core), so wire new gates with that destination in mind.
  3. ๐Ÿ”ด Tighten w3c_runner.ml row matching to equal-domain rows and re-run the SPARQL suites in both trees. Expect some published 631/0 numbers to drop. That is a measurement correction, not a regression; fix the exposed evaluator bugs after.
  4. โš ๏ธ Storage proofs, in order of leverage: decode (encode b) = some b for IBK2; the two Bytes.lean round-trips (and fix that file's header now); a determinism statement for SBM2. Then extend the BlockWireV0-style conditional scan theorem to IBK2.
  5. โš ๏ธ Run W3C SPARQL conformance through the disk path: give l4w3c a mode that packs each test's fixtures into IBK2/SBM2 in a temp directory and evaluates through DatasetBackend. This closes the conformance blind spot for Shardborough and turns the suite into a regression net for the storage frontier.
  6. Replace the List UInt8 decoder idiom with ByteArray-native offset slicing in the 11 affected files before the next scale-up benchmark; re-run the gene gate after.
  7. Wire the epoch guard through foldDeltaBatches and DeltaLogTool before building compaction; add the SHA-256/Merkle pair cross-check at manifest admission; totalize the two DeltaLog partial defs.
  8. ๐Ÿงน Hygiene pass: remove or relocate the root strays, delete the tracked junk files, add .gitignore entries (artifact-commit churn is resolved by the planned factoidal-builds/factoidal-core split โ€” owner, 2026-08-31), file the entry_jsoo.ml parse-error-swallowing bug, deduplicate the contradictory formal/lean4/README.md entries, and give docs/claude-rules/current-state.md a Lean section or a pointer to PORT_NOTES.md.