Skip to content

Guard every delete verdict in its own document, not just the preprint - #20

Open
aurascoper wants to merge 1 commit into
feat/slab-depth-geometryfrom
fix/ledger-guard-document-scope
Open

Guard every delete verdict in its own document, not just the preprint#20
aurascoper wants to merge 1 commit into
feat/slab-depth-geometryfrom
fix/ledger-guard-document-scope

Conversation

@aurascoper

Copy link
Copy Markdown
Owner

Stacked on #19. Base is feat/slab-depth-geometry rather than master because
preprint/wan_meeting_handout.tex and the HANDOUT-* ledger rows arrive in
9319d43, which is on that branch. Shares no files with #19's nine commits.

The hole

test_no_deleted_claim_survives_in_the_manuscript filtered on
claim_id.startswith("PP-") and read only the preprint. The ledger carries 59
delete verdicts across 17 documents; 34 are the manuscript's. The other 25 —
HANDOUT-01 and HANDOUT-02 among them — were guarded by a test that searched
a file those claims had never been in. For them it could not fail. Rule 1.

The fix

Scope comes from the document column each row already declares.
DOCUMENT_ALIASES maps the two preprint aliases and README to paths;
repository and correspondence are declared pseudo-documents. Renamed to
test_no_deleted_claim_survives_in_the_document_it_names, since it no longer
reads the manuscript alone.

test_every_deleted_claim_names_a_document_the_guard_can_read fails on any
other unreadable document, so a typo or a rename cannot retire a verdict in
silence. It caught correspondence on the first run.

Negative controls, both run

  • test_the_guard_detects_the_handout_claims runs the guard against the
    pre-correction handout at 9319d43 and requires HANDOUT-02 to be found.
  • Reintroducing heat/azide-killed biomass is standard in this literature into
    the working copy made the survivor test fail naming exactly that row; reverted.
  • The manuscript floor of 18 detections is unchanged, measured 20.

Coverage is still partial, and still named

HANDOUT-02's claim_text was a paraphrase nothing could match, and now quotes
the handout. HANDOUT-01 stays undetectable for a different reason: its claim is
an equation, and normalise_markup reduces X_{\max} to a bare x. A
prose-phrase guard cannot check a formula, so it is printed in the coverage
report as needing a human rather than counted as covered. Extending the
normaliser to keep maths would have moved the manuscript's detection floor for
one row.

One scope error found in the ledger while checking

HANDOUT-01's claim_text lumped the arithmetically-correct unit conversion
X_max = q_max * rho_dry together with the false implementation claim. Read
literally, the delete verdict said that equation had to vanish — but it is
still on page 3 deliberately, reframed under "Where the number would land" and
above the sentence saying there is no X_max in the code for it to enter. The
row now states its scope: the Langmuir term inside the box labelled THE SOLVER,
and the framing of the conversion as a bridge into it.

The ENFORCEMENT GAP, NAMED NOT CLOSED note on that row is corrected forward,
LEDGER-GUARD-03 added, and the stale "30 of 34" coverage claims updated in the
module docstring and README.md.

Known dependency

HANDOUT_COMMIT = "9319d43" pins a commit. Safe under this repository's merge
style — 5980dc5 is still reachable from master and #4#11 are merge commits —
but a squash-merge of #19 would turn that control into a skip, which rule 2 says
to read as uncovered surface rather than a pass.

Verification

cd calibration && ../coupling/.venv/bin/pytest -q tests — 362 passed, on this
branch's base.

🤖 Generated with Claude Code

https://claude.ai/code/session_01F4m1NqS1u9tuDRaqmNoQap

test_no_deleted_claim_survives_in_the_manuscript filtered on
claim_id.startswith("PP-") and read only the preprint, so all 25 `delete`
verdicts reached on other documents were carried by a test that searched a
file those claims had never been in. For them it could not fail: rule 1.

Scope now comes from the `document` column each row already declares.
DOCUMENT_ALIASES maps the two preprint aliases and README to paths;
`repository` and `correspondence` are declared pseudo-documents, and
test_every_deleted_claim_names_a_document_the_guard_can_read fails on any
other unreadable document so a typo or a rename cannot retire a verdict in
silence. Renamed the guard to ..._in_the_document_it_names, since it no
longer reads the manuscript alone.

Negative controls, both run:
  - test_the_guard_detects_the_handout_claims requires HANDOUT-02 to be
    found in the pre-correction handout at 9319d43.
  - Reintroducing "heat/azide-killed biomass is standard in this
    literature" into the working copy made the survivor test fail with
    exactly that row; reverted.
The manuscript floor of 18 detections is unchanged, measured 20.

HANDOUT-02's claim_text was a paraphrase nothing could match, and now
quotes the handout. HANDOUT-01 stays undetectable for a different reason:
its claim is an equation, and normalise_markup reduces LaTeX maths to a
bare `x`. It is printed in the coverage report as needing a human rather
than counted as covered.

Also fixes the scope HANDOUT-01 recorded. The boxed X_max = q_max*rho_dry
is still on page 3 deliberately, reframed under "Where the number would
land"; the row read as if that arithmetically-correct unit conversion had
to vanish. The verdict is on the Langmuir term inside the box labelled THE
SOLVER and on the framing of the conversion as a bridge into it.

The handout's own corrections: sorption node shows the shipping Henry term,
azide dropped as a metabolic control, "The bridge" heading requalified.

Ledger: LEDGER-GUARD-03 added; the "ENFORCEMENT GAP, NAMED NOT CLOSED"
note on HANDOUT-01 corrected forward. Stale "30 of 34" coverage claims
updated in the module docstring and README.

calibration: 362 passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4m1NqS1u9tuDRaqmNoQap

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1522ebd72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +280 to +282
unreadable = sorted({r["document"] for r in deleted_rows(rows)
if (lambda q: q is None or not q.is_file())(
document_path(r["document"]))}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Exempt generated artifacts from existence checks

On a fresh checkout, artifacts/ is gitignored and neither pilot JSON exists, so this new check always reports artifacts/pilot/openmc_nested_pilot_budget.json as unreadable; the broadened existence check below also rejects the missing verdict JSON. The calibration-unit workflow does not generate either artifact before running pytest, meaning the required calibration suite now fails consistently. Resolve these ledger rows through committed fixtures or otherwise distinguish generated outputs from missing source documents.

AGENTS.md reference: AGENTS.md:L129-L137

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant