Repository navigation
T60: read the journal entry at the PR head, not the diff's added lines - #260
Conversation
A revision PR's entry already exists on the base, so `gh pr diff` holds only its changed lines and the entry's unchanged headings (`## What we tried`, `## Evidence`, `## What this does not establish`) read as missing — the false verdict seen on #259. The entry leg now reads the file the PR changes at its head commit, prints the source it used, and refuses an offline `--diff` of a revision by name instead of reporting its headings missing.
052e29e to
e8dc656
Compare
Head confirmed twice: The four cases, re-derived (my build, exit codes quoted)
Also re-derived as controls: an entry-creating The new source of truth: failure modes
Note 1 — the offline
|
The correctness review of #260 found the guard only fired when the diff created no markdown, so a diff that revised the entry *and* created another markdown file checked the created file and could print journal-gate: OK without reading the entry. Refuse whenever the diff names markdown it does not all create, and name both sets in the message.
Head confirmed twice: Note 1 — closedThe guard is now
No The guard is not over-broad: a pure revision The four cases, re-derived at
|
Fixes the false entry-leg verdict found while merging the revision PR #259 — no
Closes; this references that finding. Plainjournal --pr 259printed the roles OK and then failed withmissing ## What we tried / ## Evidence / ## What this does not establish, because the entry leg readgh pr diff's added lines and for a revision PR those three H2 headings are unchanged context lines. The headings are present in the entry onmain; the gate's own--entrysource already fixed it, so the defect was a misleading failure, not a broken entry.What changed
crates/gates/src/journal.rs--prentry leg now reads the entry as it exists at the PR's head commit: it takes the PR's changed files (gh pr view --json files,headRefOid), picks the entry markdown (thedocs/figures/<slug>/README.md/_posts/*.mdshape, or the only markdown file), and reads that path atheadRefOidthrough the contents API withAccept: application/vnd.github.raw. It printsentry source: <path> at the PR head <sha> (the entry as it exists at the head, not the diff's added lines). When it cannot tell which markdown file is the entry it refuses and names the candidates, so the remedy (--entry <path>) is immediate.--entry <path>behaves as before and still pins the source.--diffis an entry source only when it creates every markdown file it names; otherwise it is refused by name, because a diff that changes an existing entry cannot show that entry's headings (they are context lines). This covers both the pure revision (1changed,0created) and the mixed case the correctness review found (1changed,1created — the first cut of this fix checked the created file and could print OK without reading the entry). An entry-creating diff still works.docs/journal-pipeline.md: one paragraph recording the entry-creating vs revision-PR difference and the exact command for each, so a later agent does not rediscover it.Evidence (before → after)
Before, on base
006b8af:After (
549b7d6):Still failing — a gate that cannot fail is not a gate:
And the accepted offline form still passes:
Entry-creating PR #258 still reads through:
entry source: docs/figures/the-fly-brain-on-the-robot/README.md at the PR head f6a3bbc4c695 …→journal-gate: OK(0).cargo run --quiet -p qualia-gates -- journal --self-test→journal-gate: self-test OK - 36 checks(0).cargo run --quiet -p qualia-gates -- provenance→provenance: OK(0).