# Audit: `research/qc/questions.js` — the displayed verdict now comes from the NEWEST note, and a shared id reads MIXED when its records disagree on the verdict **Caveat first.** No mathematics and no question status changes. This is the registry generator: one display rule and one conflict rule, both inside `summarise()`. It changes which record's text an index row prints, and when a row is marked `MIXED`; it does not adjudicate any disagreement, and it never invents a verdict. Builds on **audit #238** (pending, `research/qc/questions.js`, revision `c357a9fb…`), which fixed the generator's Windows path filters and added the `registry-drift` check. The served file is `e5890d25…`; the base of this patch is served + #238 = `c357a9fb…`; this revision is `1d2d785e…`. Both patches are supplied so the integrator can apply in either order. ## 1. The defect `research/qc/questions.js` renders `research/QUESTIONS.md` from the notes' `` blocks. Several notes may share one id, and the generator resolved that by taking **the last note in path order**: ```js const last = g[g.length - 1].block; // path order, not chronology, not authority ``` That is not a ranking, and it is not claimed to be — but it silently decides which record's text the index prints, and it can print the *older* one. Job #609 found the served case: `Q-rho-maximal-law` has two notes, both `PARTIAL`, whose verdicts disagree. `rho-maximal-law.md` (2026-08-18/19/20) says the weakest sufficient form is "**model-dependent and undecided**"; `rho-exact-z31-01.md` (2026-08-28) says it is "**now measured against rather than undecided**". Path order puts `rho-maximal-law.md` last (`rho-exact-` < `rho-max-`), so the index printed the older text and listed the newer note only as a link. Same defect class as the row-26 finding in job #587; #149 proposed the rule change and no one implemented it. The *status* cell had the same narrowness from the other side: it read `MIXED` only when the notes disagreed on the **status**. Two notes agreeing on `PARTIAL` and disagreeing on the verdict — the row-40 case — printed a single status and one arbitrary verdict. ## 2. The change Two rules in `summarise()`, plus the export of the choice and the generated preamble. **(a) The displayed verdict comes from the newest note.** `fileLastDates()` reads the last-commit date of every file under `research/` in **one cached `git log` call** — the same log the parity gate in the same file already reads for first-commit dates — and `pickNewest(group, dates, rel)` chooses. Three properties are deliberate: * **A file git does not know counts as new**, which is the parity gate's own convention two functions above ("an untracked note is new"). * **The last-in-path-order rule survives as the tiebreak** inside the newest-dated set, so the choice stays deterministic and nothing changes for equal dates. * **With no dates at all the result is byte-for-byte the old rule**, which is what keeps the selftest fixture (no git) and any exported corpus on the old behaviour. `pickNewest` is a **pure function** and is exported: the date map is an argument, so the rule can be checked without git. **(b) A shared id reads `MIXED` when its records disagree on the status OR on the verdict.** * statuses differ → `MIXED (statuses differ: a.md: PARTIAL; b.md: ANSWERED)` (the old cell, now naming the axis); * statuses agree, verdicts differ → `MIXED (verdicts differ across N records)`. The second form keeps the cell short: the `records` column already carries every note as a link, and for the largest group (`Q-varE-limit`, 8 notes) listing eight identical statuses would have been noise. The generated preamble and the file's header comment are updated to say both. The rule is still **not authority**: an accepted review of an older note outranks a newer one, and the preamble says so. ## 3. What it does, measured Run against the served corpus as mirrored in the 2026-09-10 checkout (554 ids, 581 notes — both unchanged): * **17 of the 18 shared ids change.** 11 rows newly read `MIXED (verdicts differ across N records)`; 6 already read `MIXED` and now name the axis. The regenerated index differs by **34 added / 30 removed lines in 20 hunks** (`index-change.diff`); the rest is the 4-line preamble. * **`Q-rho-maximal-law` becomes `MIXED (verdicts differ across 2 records)`** — the reader is now sent to both notes instead of being shown one arbitrarily (`index-change.diff`, and `index-revised-mirror.md` lines 196 and 723 for the before/after). * **`registry-drift` goes from 0 to 17 findings** — exactly the changed rows. That is the check working: the regenerated index is what the new rule produces, so `research/QUESTIONS.md` must be regenerated and committed with this revision, or the gate stays red. The fast gate exits 0 either way. * **The selftest is byte-identical before and after** (`diff selftest-base.out selftest-revised.out` is empty; both exit 1 on the mirror with "30 case(s) wrong", which is pre-existing in the 2026-09-10 checkout and not caused by this change — said plainly because a green gate is not claimed here). ## 4. The check that verifies the rule without git The mirror has **one commit**, so every file's last-commit date is the same 2026-09-10 and the newest-note half cannot be exercised through `fileLastDates()` there. That is why the choice is pure. `pick-newest-check.js` drives `pickNewest` on **real groups from the corpus** with an injected date map, 9 assertions, instant, no compute: ``` node pick-newest-check.js # from the repository root ``` * the real `Q-rho-maximal-law` group: with 2026-08-28 > 2026-08-19 it picks `rho-exact-z31-01.md` (the newest), not `rho-maximal-law.md` (the path-order last); * **and flipping the dates flips the choice — the check is not one-way**; * equal dates keep the old last-in-path-order pick, deterministically; * an empty date map reproduces the old rule exactly; * a single undated note is treated as newest (the parity gate's convention); * a real 3-note group (`Q-quadpoint-transplant`): the newest date wins wherever it sits in path order. Captured output: `pick-newest-check.out`. ## 5. What else this revision requires * **Regenerate and commit `research/QUESTIONS.md`** in the same change: `node research/qc.js --index`. Until then `registry-drift` names all 17 rows. A mirror- generated index is **not** in this return: the 2026-09-10 checkout is behind the served state, so shipping its output would overwrite current rows. `index-revised-mirror.md` is an illustration of the rule's effect, not a document to commit. * **`registry-check.py`** (job #587, return #230) compares the served row's status cell against the notes' own statuses, so it must take the same concession: a shared row reading `MIXED` is agreement on status plus disagreement on the verdict, not a status conflict. One condition. Not shipped here; named so the tool is not left silently wrong. * **A first-commit-to-last-commit subtlety**: `fileAddDates()` (the parity gate) and `fileLastDates()` (this rule) are separate calls over the same log. Merging them into one read is possible and not done here — two cached calls of ~1 s each at gate time is cheaper than a shared helper that both call sites must thread through. ## 6. Falsifiers * **The rule picks wrong if the repo's real git dates for a shared id do not discriminate.** In the mirror they do not (one commit), and then the row falls back to path order — so the newest-note half may be a no-op on `Q-rho-maximal-law` in the real repo too. The MIXED marking does not depend on the date source and still holds: the reader is sent to both records. Falsifier: a shared id whose notes are committed on the same day and whose displayed verdict is still the one to trust. * **The MIXED rule is wrong if `verdicts differ` is not a disagreement worth flagging** — it fires on 17 of 18 shared ids, so it is closer to "a shared id is always MIXED" than to a contradiction test. That is a deliberate choice: the index cannot tell "the later note extends the earlier" from "the later note contradicts it", and it should not pretend to. Falsifier: a shared id whose two verdicts are materially the same statement, where MIXED now overstates a conflict. Note the tolerance the rule keeps: identical verdict text prints a single status (`Q-doctor`-style single-id rows are unaffected; exactly one shared id has identical verdicts). * **The change is not safe if any consumer parses the status cell as a status.** Anything reading column 3 of `QUESTIONS.md` must accept `MIXED (…)`; it already had to, for the status-conflict case. ## Sources * `research/qc/questions.js` served, sha256(LF) `e5890d255bfeabc026d60c2c34db066752b1e2d1b57a5cb3d16607ed9ea786b6`; base (served + #238) `c357a9fbf3dc256a0a20f5f070827b4bc8bb58e409d13168ca24520e787fd10e`; this revision `1d2d785efde04af26a5531f2375bc0f2d705f6a9600634aac162660d0712206f`. * The served corpus as mirrored in the 2026-09-10 checkout: 554 question ids, 581 notes, one commit (`596e8add…`). * Returns cited: **#238** (this file, pending), **#149** (proposed the rule change), **#230**/#245 (the registry sweep that found row 40), **#609** (job). ## Files | file | what it is | |---|---| | `questions-newest-rule.patch` | the audit patch, `-p1`, against served + #238 (80 added / 20 removed lines) | | `questions-full-served-to-revised.patch` | the same change against the **served** file, if #238 lands first or is rejected | | `questions.revised.js` | the full revised file (sha256 `1d2d785e…`) | | `pick-newest-check.js`, `pick-newest-check.out` | the rule check: 9 assertions on real groups, injected dates | | `index-change.diff` | the regenerated index, base vs revised (the observable effect) | | `index-revised-mirror.md` | that regenerated index — illustration only, do not commit | | `drift-findings.txt` | the 17 `registry-row-stale` findings the revision produces until regeneration | | `mkpatch.py` | builds both patches, applies each to a synthetic tree, asserts both reproduce the revised file |