Repository navigation
Cover the scalar-root dispositions FILE guard end to end through runner.main (#964) - #980
Conversation
…er.main One end-to-end test beside the file's only existing `runner.main` test, same rig: `health/dispositions.yaml` rooted at a YAML scalar (`7`), asserting `runner.main(...)` returns 0 and writes its report. The guard is `scripts/doc_health/runner.py:768`'s `isinstance(_entries, list)` check, landed in round 4 of PR #945's bench (`5a8bba3e`, merged at `34bb5c71`). Neither existing malformed-dispositions test reaches it end to end: the file's only `runner.main` test sends a LIST root carrying malformed ENTRIES (the round-5 unhashable-key guard, a different branch); the family-level scalar-root test reaches a scalar root only through `promotion_fidelity.load_dispositions`, never through `runner.main`. Deleting the round-4 branch alone left the suite green while the abort still fired on every real aggregation run. Measured at `origin/main` `c521504c`: 22 passed before this test, 23 after. Mutation proof (working tree only, restored before this commit — nothing under `scripts/` moves): deleting the guard makes exactly this new test fail, the other 22 staying green — scripts/doc_health/runner.py:768: in main for d in _entries: E TypeError: 'int' object is not iterable refs #964 Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Sonnet 5 <[email protected]>
Reviewer's GuideAdds a regression test proving that File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 2 days and 21 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
Lane: openxfactory-1 (openXfactory-1) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
🟢 Approval recommended
The regression test covers the intended guard and passes successfully.
Pull request overview
Adds end-to-end regression coverage for scalar-rooted health/dispositions.yaml files.
Changes:
- Adds an integer-rooted YAML fixture.
- Verifies
runner.mainsucceeds and generates its report.
File summaries
| File | Description |
|---|---|
tests/doc-health/test_grandfather_dispositions.py |
Adds scalar-root runner.main coverage. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
Lane: openxfactory-1 (openXfactory-1) FREEZE
🤖 Generated with Claude Code |
|
Lane: openxfactory-1 (openXfactory-1) LANDING — lane openxfactory-1, session bc8479@Eagle, 2026-09-11T20:33:26Z, PR #980 into openxFactory main (scalar-root dispositions FILE guard covered end to end through runner.main; #964 closes by the merge; "land each when green") Guard at 2026-09-11T20:33:26Z on head |
…#966) NO CONFLICT. The merge brings openxFactory #980's fix into `scripts/doc_health/modified_block_currency.py`, which MOVES THE LINE THIS PACKET CITES: `promotion_fidelity.load_dispositions(ctx, FAMILY)` was line 2230 and is line 2236 at `d4d96cca`. Rather than carry a line number that a merge can rot, the three citations now name the FUNCTION (`fam_modified_block_currency`) and give the line with the sha it was measured at. RE-VERIFIED AT THIS TREE, not assumed: the sliced canon block is still lines 198-229 of `openspec/specs/doc-health/spec.md` and still sha256 91e9a13d1fb948b94da3668818ee4f655068807ca4a9a110de53508acbd85d53 on both sides of the delta; `#### Scenario: A finding is dispositioned` is still at spec line 2177 for `modified-block-currency`; `FAMILY = "modified-block-currency"` is still line 190. The late `#965` coordination recorded in `design.md` D5 was re-run after this merge as well, with the same result: no `report-stale-grandfather-dispositions` pull request exists. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>



Lane: openxfactory-1 (openXfactory-1)
The guard, and why it was uncovered
scripts/doc_health/runner.py:768carries a root-type guard,isinstance(_entries, list), on the unconditional read ofhealth/dispositions.yamlthat feedsreport.uncited_resolutionsonevery aggregation run. It was landed in round 4 of PR #945's review bench,
commit
5a8bba3e("Take Copilot's fourth round onhonour-grandfather-dispositions-in-ratified-provenance: a scalar-root
dispositions file is ignored, not fatal; reconcile the test counts"),
merged to
mainat34bb5c71— re-confirmed this session bygit blameon the live line and by
git log --merges | grep 945, not copied from theissue.
No test exercised it on the code path it changes. Re-measured against
tests/doc-health/test_grandfather_dispositions.pyatorigin/mainc521504c(22 tests, all passing): the file's onlyrunner.mainend-to-end test,
test_the_runners_own_read_survives_a_malformed_entry_end_to_end, sends alist-rooted file carrying malformed entries through
runner.main—that exercises the round-5 unhashable-key guard, a different branch. The
family-level scalar-root test,
test_a_malformed_dispositions_FILE_is_ignored_rather_than_aborting_the_run,reaches a scalar root, but only through
promotion_fidelity.load_dispositionsand the family directly, never through
runner.main. So deleting theround-4 branch alone left the suite green while the abort it removed would
still fire on every real aggregation run against a scalar-rooted file.
This PR adds one end-to-end test beside the existing
runner.maintest, inthe same rig: a
health/dispositions.yamlwhose root is a YAML scalar(the integer
7), assertingrunner.main(...)returns 0 and writes itsreport — the same two assertions the list-root test makes.
Filed as issue #964 at the archive of
honour-grandfather-dispositions-in-ratified-provenance(Copilot review 5178781132
on PR #945, 2026-09-11T12:47:41Z, suppressed by the review tool — it opened
no thread, so it was recorded on the issue rather than lost).
Counts, re-measured at
origin/mainc521504cgit stash):python3 -m pytest tests/doc-health/test_grandfather_dispositions.py -q→ 22 passed in 2.06s (exit 0).-k scalar_rooted_dispositions_FILE -v→ 1 passed, 22 deselected (exit 0).Mutation proof
Working tree only, never committed: deleted the
isinstance(_entries, list)guard at
scripts/doc_health/runner.py:768(for d in _entries:in placeof
for d in (_entries if isinstance(_entries, list) else []):), reran thetarget file, then restored (
git checkout -- scripts/doc_health/runner.py).sha256 of
runner.pybefore mutating and after restoring is identical(
434ebbede3ec7128c16b21c238e281e4989e4775ad91977037fab2aa5656f987), andgit status --porcelain -- scripts/is empty — nothing underscripts/moves in this PR.
Under the mutation:
1 failed, 22 passed(exit 1). The one failure isexactly the new test; the other 22 — including the existing list-root
runner.maintest — stay green, so this new test is the only one in thefile that catches this mutation. Verbatim:
Gates
python3 -m pytest tests/doc-health/test_grandfather_dispositions.py -q— 23 passed (exit 0), the target file, with this PR's diff applied, atorigin/mainc521504c.tests/under thepytest-suiterequired check, 20–27 min) is deliberately not re-run by hand in this PR: it is CI's job and the required check on this PR will carry it. This diff touches exactly one test file and adds one test function with no new fixtures, imports, or collection-time side effects, so it carries no expected interaction with the rest of the suite beyond the file gated above.doc-health.py,validate-sequenced-after.py,validate-scope-globs.py, OpenSpec validation) applies: this PR touches no governance doc, noopenspec/path, and no scope-glob-relevant file — one test file only.What this PR does NOT do
scripts/moves — the mutation above was made and reverted in the working tree only, never committed (git status --porcelain -- scripts/empty).honour-grandfather-dispositions-in-ratified-provenance, already ARCHIVED.record-immutabilityandgovern-archived-record-editsput that packet's own bytes beyond a plain fix, which is why this coverage gap was filed as issue doc-health: no runner.main end-to-end test covers the scalar-root dispositions FILE guard (runner.py:768, landed by #945's round-4 fix 5a8bba3e) — deleting the branch leaves the suite green #964 rather than folded into an archive edit. This PR is the whole discharge of that successor issue — a single test file, nothing else.README.md's OpenSpec Records narrative (which currently cites "22 new tests" for PR Ratify honour-grandfather-dispositions-in-ratified-provenance: an ARCHIVED record's grandfathered finding reports at info with its citation (Brett Heap, 2026-09-11) #945 and lists doc-health: no runner.main end-to-end test covers the scalar-root dispositions FILE guard (runner.py:768, landed by #945's round-4 fix 5a8bba3e) — deleting the branch leaves the suite green #964 among five filed-and-unclaimed successors): that block is a historical record of what Ratify honour-grandfather-dispositions-in-ratified-provenance: an ARCHIVED record's grandfathered finding reports at info with its citation (Brett Heap, 2026-09-11) #945 itself did and remains accurate as such; retrofitting it for a later successor's discharge is outside this PR's scope.Closes #964
refs #945, refs #939
🤖 Generated with Claude Code
Summary by Sourcery
Verify that runner.main safely handles scalar-rooted dispositions files during aggregation.
Enhancements:
Tests: