Repository navigation
Conversation
Roadmap loading no longer hangs on a README.md link or stops at a chapter that cannot be listed or a page that cannot be read; the Lean index stops at #exit and records a name declared in several files; the graph ignores links in indented code; readers of skeleton reports and publication manifests refuse undecodable JSON with a message instead of a traceback; the audit knows irreducible_def; and the Pages build pins the renderer versions the lock file has. Part 1 of the split of #75.
A blind packet has the same bytes whichever command extracts it: one probe per root module, a compiled helper module, a v5 report keyed by root module with coherence checks, packets without author comments, a captured blueprint snapshot, and transactional output. Part 2 of the split of #75.
The compiled probe helpers are cached per toolchain, probes run in a pool, and a failing root module or declaration is reported without aborting the rest of the extraction. Part 3 of the split of #75.
Every page the site publishes is checked as published: raw HTML, link targets, attribute lists, Mermaid and stateful TeX are refused, render writes only allowed files and paths, and the site's MathJax runs with ui/safe and a fixed package set. check reports the same issues render refuses. Part 4 of the split of #75.
The autoform-readback/v1 card store (format, loader, record API, locked compare-and-swap publication) and the validator that holds model-written testimony to what the site and GitHub both show the same way. Part 5 of the split of #75.
review prepare, record and check, audit --review, and the CI review check: a bundle derived from fresh extraction binds each article's statement, cited passage, declarations and packets; review_approved records its hash and reads self-approved until a verifier authenticates it. Part 6 of the split of #75.
render --review shows each reviewed statement's packet, read-back cards and approval state, with per-card MathJax so no article formula can change a card. Part 7 of the split of #75.
Durable card writes (F_FULLFSYNC, directory flushes, leftover and interrupt warnings), rewrite hints for GitHub/site reading differences, and review record's pre-Lean checks, input size cap and advice for a gone article. Part 8 of the split of #75.
Review at d351cd9Verdict: Fold into #216 and #75. This is layer 8 of the statement-review stack (#212 -> #213 -> #214 -> #215 -> #216 -> #75 -> #217 -> #218 -> #219). It moves Fixes before merge
Optional
Landing
This was a static review: no tests were run locally. CI at this head: all 9 checks pass, on its stack base. Posted by PR swarm: PR Swarm Lead |
da2cac3 to
13a48e3
Compare
|
Closing as part of simplifying the #75 stack. Most of this layer was dropped: the F_FULLFSYNC and directory-flush durability, the GitHub rewrite hints (testimony is now plain text, so there is nothing to rewrite), the testimony size cap, the pre-Lean checks and the gone-article advice. The interrupt-safety pieces that still apply to the simpler card store moved into #216. The previous version of this layer is on branch |
This PR makes card publication fail early and say why. A testimony that GitHub reads differently from the site is refused with a rewrite that both read alike, not only the line. A card write is flushed to stable storage (
F_FULLFSYNCon macOS), its directory is flushed too, and a staging file it could not remove is named.review recordrefuses card conflicts, a stale hash, an unsafe card path, a platform that cannot publish, bad or oversized testimony and a gonearticle_idbefore it starts Lean, instead of after a full extraction. A review bundle that cannot be decoded is refused as unreadable instead of raising a traceback.What it adds
readback._github_hint(site, github, at), called from_github_errors: picks the rewrite for the first point where the two readings part (list numbering, nesting and markers, tables, fences, block quotes, rules,$...$placement,\(/\[, tildes, checkboxes, trailing backslashes, emphasis). Where no rule matches it says "no rewrite is known for this difference".skills/human-review/references/readback.mdnow says a refusal comes "with the line and a way to fix it".readback._flush(fd):F_FULLFSYNCwherefcntlhas it; plainfsynconly onENOTSUP,EOPNOTSUPP,ENOTTYorEINVAL. Any other error, such asEIO, fails the flush.readback._publish_card: flushes the staged file through_flush, then the card's directory afteros.replace; if only that directory flush fails, the card stays published and aRuntimeWarningsays so. A staging file_unlink_quietlycannot remove is named in theValueError, or in a warning after an interrupt._open_card_directorycalls_flush_new_directoryfor each directory it makes for a first card, flushing it into its parent; a failure there is a warning.__main__._review_record, before Lean:readback_conflicts([])refuses a platform that cannot publish;_record_snapshotreports a gonearticle_idthrough_record_selection_finding(review-selection-missing), with how to clear it; then_refuse_conflictruns on_planned_card, which builds the card throughplanned_readback. That refuses a card it would replace without--expected-card-hash, a stale hash, an unsafe existing card (link, directory, FIFO, over the card limit), and invalid or blank testimony._record_inputreads the testimony through_read_regular_file(path, 2 * TESTIMONY_MAX_BYTES + 1)and refuses one over 32 KiB, counting\r\nas one byte. It now returns(prepared, packet, testimony).review.load_review_bundle: a bundle nested past the decoder's recursion limit (RecursionError) or escaping a lone surrogate givesreview-bundle-invalid, naming the file. Before this layer the first raised a traceback and the second failed later as a hash mismatch or encode error.autoform_cli/README.md: the write contract (flushes, named leftovers, directory-flush warning), the record's pre-Lean card check, and the advice for a gonearticle_id._publish_cardhunk re-indents the write block into a nestedtry, so compare the messages, not the indentation.Review findings it answers
Item numbers are from the open-items comment on #75. None of #40's blockers is answered here: blocker 1 lands in #75, blocker 3 in #216, and blocker 2 in #75 and #219.
fsynconly whereF_FULLFSYNCis unsupported), 31f316ef (new directories flushed into their parents), d21e2085 (name the staging file an interrupt leaves).ValueError; its test lands here.article_idnamed with its fix, ahead of any card conflict, and a platform that cannot publish refused first: 766b262f, f25f485b, 5d99ded3, 79691ed4, 18b62b47, 3711f92b, d63c6843.Until the next layers land
review record --manifest) is not in this stack. Each card is its ownreview recordrun with its own extraction.Validation
Push run 38302766043 on
d351cd9apassedtest (3.10),test (3.13),real Lean (fixture toolchain)and the Windows inspection, subprocess, and publication hardening job.tests/test_readback_publication.py: 13 new tests (17 cases). They coverF_FULLFSYNCversusfsync, an I/O error that is not masked, the flush order of file, directory and new parent directories, the warnings, named leftover staging files, and five interrupt tests (an interrupt at any step leaves no lock or staging file).tests/test_readback_testimony.py: 2 new tests (61 cases). 60 testimonies are each refused with the expected hint and their rewrite is accepted; one checks the no-hint fallback. The list-numbering test now expects its hint.tests/test_review_cli.py: 13 new tests (30 cases): pre-Lean refusals (blank testimony, card conflict, stale hash, four unsafe card kinds, a platform withoutfcntl), gonearticle_idcases, undecodable bundles, and the testimony cap with CRLF.tests/test_readback.py: dropstest_an_interruption_before_the_rename_leaves_the_card_and_no_staging_file, now covered by the interrupt tests above.Stack