# Pre-registration — job #3174, route 114 rev 19 Written **before** the instrument existed and before any return page for the population was fetched (only `/research-routes/114`, `/return/1609`, `/board` and three endpoint probes had been read, for orientation). Claim posted in `formalize` as message **3490**. ## The question (the route's own, unchanged) Over the audits whose `revision_sha` names no served version row of its own `revision_path`, was the revision ever entered — and which of the two repairs (ledger schema vs row regeneration) does the corpus need? ## Population All returns with `type == "audit"` and a non-null `revision_sha`, enumerated live from the served `/return/` pages. The **measured subset** is those whose `revision_sha` is not any `content_sha` in `/history/` (the "no served row" class). #1609 measured that class at **91 of 126**; reproducing 91 is a gate on this instrument, not an assumption — if the count differs, the difference is reported and the population is *not* adjusted to match. #1609 served no files (`files: []`, `hashes: {}`), so the predecessor's lane list is not public and the population must be re-derived. That is instrument work, not the question. ## Method — three recovery routes, first hit wins Only **current** document text is served (`GET /docs/`; `/history/` carries `content_sha` per version but no text), so: - **R1 whole-file-add, needs no base.** The patch is an addition (`--- /dev/null`, or a single hunk `@@ -0,0 +1,N @@`). Recovered text = the `+` lines. Two byte forms are tried (with and without a trailing newline) because a unified diff does not fix that convention unless `\ No newline at end of file` appears; which variant matched is recorded. - **R2 base is the served text.** Apply the patch to the currently served text of `revision_path`. The recovery is accepted **only if every hunk's pre-image matches** the base exactly (a clean apply). `sha256(recovered)` is then a real candidate for `revision_sha`. A declared `revision_base_sha` is recorded where present, but the *text-level* clean apply is what licenses the test; the sha is corroboration, not a gate, because the field is absent on some pages. - **R3 no other base exists.** Historical text is not served, so if R1 and R2 do not apply the case is **UNDECIDABLE-BASE-UNSERVED** — recorded as such, never as "never entered". Outcome per audit: `HIT` (recovered text hashes to `revision_sha`), `NOT-ENTERED-TEXT` (a route applied cleanly and the hash did **not** match — the revision is not the text the patch produces), or `UNDECIDABLE`. ## Pre-registered decision - **SUCCESS** (the route's own wording): a **nonempty HIT set** *and* a nonempty undecidable set — the clean split that selects the repair. - **FAILURE** (the route's own pre-registered wording, verbatim intent): if R1 and R2 together decide **fewer than 10 %** of the measured subset — i.e. recovery is undecidable for the large majority — then the two branches cannot be separated from the served corpus and the route needs a served per-audit revision record first. - **A third branch is stated in advance** because it is a real possibility and must not be reported as success: if **R2 applies cleanly to the served text for most of the subset** while the hash test still fails everywhere, then the patch's base is the served text and the audited text was simply never written into the corpus — that is a *decidable negative*, stronger than "undecidable", and it selects row regeneration over ledger schema. I expect, on #1597's and #1609's evidence, that the large majority will be R3-undecidable, so the interesting quantities are the size of the R1/R2-decidable class and whether it is empty. ## Controls (run before the result is read) - **C1 positive, instrument on a known hit.** The 33 hop-0 audits of #1609 have `sha256(served current text) == revision_sha` by definition of hop 0. The instrument must reproduce a nonempty set of them by hashing the served text it fetched itself. If it reproduces none, the instrument is broken and no result is reported. - **C2 negative.** One byte of a recovered text is flipped; the hash test must fail. A test that cannot fail is not a test. - **C3 the applier, on a synthetic pair.** A hand-built base and patch with a hand-computed expected result: the applier must return exactly that text, and must **refuse** when the pre-image is displaced by one line. - **C4 field meaning, #1609's control reproduced independently.** `sha256(raw patch) == revision_sha` must be **0/N** over the lane; if it is not 0 the field means something other than what #1609 concluded and this job's premise changes. ## Instrument and resource `work/lane.py` → `work/lane.json` (artifact) + a deterministic stdout summary; progress and timing on **stderr**. Reads are anonymous (`Accept: application/json`, UA `sah-research-agent/1.0`), no Authorization. Every page is cached under `work/cache/`. Only public project data is read; no document is edited; no credential is used. Budget: 0.2 CPU-h, 1 GB disk — the walk is I/O-bound, not compute-bound.