Skip to content

check-one-div-per-subfile: allow a proof with its claim, a solution with its exercise - #1192

Merged
d-morrison merged 3 commits into
mainfrom
one-div-allow-proofs
Oct 23, 2026
Merged

d-morrison merged 3 commits into
mainfrom
one-div-allow-proofs

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Ezra, 2026-10-23, in the Semantic macro enforcement thread: "one exception to the one-div-per-file rule: proofs can go in the same file as their claims, and solutions can go with their exercises." Tracked in gha#1176.

The check no longer counts a top-level div whose class is proof, sol or solution, or whose id starts with prf- or sol-. Word-bounded, so proofreading and solid-a still count.

Tests: the old exercise-plus-solution case now passes; seven spellings of an attached div pass; five look-alikes still count; a second claim after a proof still counts. The old fixtures that used a solution as the second div now use an example. 67 tests pass.

Docs updated in the script, action.yml, the reference page and a changelog fragment. The old advice to put a solution in its own _sol file is removed.


Generated by Claude Code

… solution with its exercise

Ezra, 2026-10-23, gha#1176.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6MvQvUgPePB2ndiLAgpHs
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…ed attribute values

Review of gha#1192 found README, workflows table and the example stub still
describing the old _sol rule. The selftest's expected-failure fixture used a
solution as its second div, and the changelog fragment lacked a bullet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6MvQvUgPePB2ndiLAgpHs
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Review of PR #1192 at d2fe593

This is a confirming review. The prior round, posted 2026-10-23 on 87d9cf6, was Needs more work. The one commit since then, d2fe593, closes all four of its findings. I could not run the pytest suite because pytest is not installed in this environment, so the test results are unverified.

Prior findings

  • Stale _sol restatements. All three are fixed. README.md:79 and website/workflows.qmd:44 now read "a proof stays with its claim and a solution with its exercise". The examples/check-one-div-per-subfile.yml header now states the same exception. A repo-wide grep for _sol\b and _sol file finds only the historical fragment changelog.d/add-check-one-div-per-subfile.added.md:6 and unrelated test fixtures, which can stay.
  • ATTACHED_RE matching inside a quoted attribute value. This is fixed. The new QUOTED_RE blanks "..." and '...' values to "" before ATTACHED_RE runs (check-one-div-per-subfile.py:176-179). So title="a sol" and title='a proof' no longer exempt a div. The two negative cases are added to test_lookalike_div_still_counts, and the earlier .class and #prf-/#sol- forms are unaffected.
  • Changelog fragment. It is reformatted as a bullet with an indented continuation. This is cosmetic and harmless.
  • Selftest fixture. The _selftest.yml fixture was swapped from exr-a/sol-a to exm-a/exm-b. Under the new exemption the old fixture would no longer fail, so the "expecting a failure" step still discriminates.

Other checks

  • The merge commit 7950765 matches git's automatic merge of its parents. Its check-term-links changes (check-term-links: treat a line the diff also deletes as moved, not new #1187) are already on main and are not part of this PR.
  • No workflow_call inputs, permissions or jobs changed, so there is no tag-slide risk.
  • The diff adds no math, so the macro check does not apply.
  • I found no hallucinated symbols. The action.yml, script docstring and reference page wording is consistent with the code.

Verdict

Ready for merge. The NOT_CLEAN verdict from the prior round no longer stands, since the head commit addresses every finding it raised.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "d2fe593ee7582c1e1ddc21c0ffc87dd6e31edfbf",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "QUOTED_RE blanks quoted attribute values before ATTACHED_RE runs in scan_divs, so title=\"a sol\" no longer exempts a div, and the README, workflows table and example stub no longer state the old _sol rule.",
  "holistic_assessment": "Docs, selftest fixture and tests are in sync with the proof and solution exemption, with no workflow inputs or permissions changed; pytest could not be run in this environment."
}

Reviewed commit: d2fe593

Reviewed commit: d2fe593

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.7261 (review) — run

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

2026-10-23 10:14 UTC

@d-morrison
d-morrison merged commit 5e4bfc5 into main Oct 23, 2026
393 of 396 checks passed
@d-morrison
d-morrison deleted the one-div-allow-proofs branch October 23, 2026 10:13
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.

2 participants