Skip to content

Cover the scalar-root dispositions FILE guard end to end through runner.main (#964) - #980

Merged
brettheap merged 1 commit into
mainfrom
fix/964-scalar-root-runner-main-test
Sep 11, 2026
Merged

brettheap merged 1 commit into
mainfrom
fix/964-scalar-root-runner-main-test

Conversation

@brettheap

@brettheap brettheap commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-1 (openXfactory-1)

The guard, and why it was uncovered

scripts/doc_health/runner.py:768 carries a root-type guard,
isinstance(_entries, list), on the unconditional read of
health/dispositions.yaml that feeds report.uncited_resolutions on
every aggregation run. It was landed in round 4 of PR #945's review bench,
commit 5a8bba3e ("Take Copilot's fourth round on
honour-grandfather-dispositions-in-ratified-provenance: a scalar-root
dispositions file is ignored, not fatal; reconcile the test counts"),
merged to main at 34bb5c71 — re-confirmed this session by git blame
on the live line and by git log --merges | grep 945, not copied from the
issue.

No test exercised it on the code path it changes. Re-measured against
tests/doc-health/test_grandfather_dispositions.py at origin/main
c521504c (22 tests, all passing): the file's only runner.main
end-to-end test,
test_the_runners_own_read_survives_a_malformed_entry_end_to_end, sends a
list-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_dispositions
and the family directly, never through runner.main. So deleting the
round-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.main test, in
the same rig: a health/dispositions.yaml whose root is a YAML scalar
(the integer 7), asserting runner.main(...) returns 0 and writes its
report — 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/main c521504c

  • Before (file unmodified, via git stash): python3 -m pytest tests/doc-health/test_grandfather_dispositions.py -q → 22 passed in 2.06s (exit 0).
  • After (this PR's diff applied): same command → 23 passed in 0.31s (exit 0).
  • The new test alone: -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 place
of for d in (_entries if isinstance(_entries, list) else []):), reran the
target file, then restored (git checkout -- scripts/doc_health/runner.py).
sha256 of runner.py before mutating and after restoring is identical
(434ebbede3ec7128c16b21c238e281e4989e4775ad91977037fab2aa5656f987), and
git status --porcelain -- scripts/ is empty — nothing under scripts/
moves in this PR.

Under the mutation: 1 failed, 22 passed (exit 1). The one failure is
exactly the new test; the other 22 — including the existing list-root
runner.main test — stay green, so this new test is the only one in the
file that catches this mutation. Verbatim:

tests/doc-health/test_grandfather_dispositions.py:478: in test_the_runners_own_read_survives_a_scalar_rooted_dispositions_FILE_end_to_end
    rc = _runner.main(["--repo-root", str(agg),
scripts/doc_health/runner.py:768: in main
    for d in _entries:
E   TypeError: 'int' object is not iterable

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, at origin/main c521504c.
  • The full repository suite (tests/ under the pytest-suite required 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.
  • No other gate script in this repo's validator set (doc-health.py, validate-sequenced-after.py, validate-scope-globs.py, OpenSpec validation) applies: this PR touches no governance doc, no openspec/ path, and no scope-glob-relevant file — one test file only.

What this PR does NOT do

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:

  • Add end-to-end coverage confirming scalar-rooted health/dispositions.yaml files do not abort runner.main aggregation runs.

Tests:

  • Extend grandfather-dispositions coverage with a runner.main test for scalar YAML roots, asserting successful execution and report generation.

…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]>
Copilot AI lite review requested due to automatic review settings September 11, 2026 20:17
@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a regression test proving that runner.main ignores a scalar-rooted health/dispositions.yaml instead of raising during aggregation, with the target test file now passing all 23 tests.

File-Level Changes

Change Details Files
Add end-to-end coverage for scalar-root dispositions files through the runner aggregation path.
  • Create a real aggregation fixture with health/dispositions.yaml rooted at the scalar 7.
  • Invoke runner.main with the ratified-provenance family and assert successful execution and report creation.
  • Exercise the runner-owned dispositions read, complementing existing family-level and list-root coverage.
tests/doc-health/test_grandfather_dispositions.py

Assessment against linked issues

Issue Objective Addressed Explanation
#964 Add an end-to-end test that writes a scalar-rooted health/dispositions.yaml into a real aggregation root and invokes runner.main. ✅
#964 Verify that runner.main handles the scalar-root dispositions file without aborting, returns 0, and writes its report. ✅
#964 Ensure the test specifically detects removal of the existing scalar-root type guard, while leaving the landed implementation unchanged. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@brettheap
brettheap marked this pull request as ready for review September 11, 2026 20:17

@sourcery-ai sourcery-ai 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.

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.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)
@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI 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.

🟢 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.main succeeds 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.

@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FREEZE

  • Head: d7688ac94b49f53389c77a742c401098395f3414. Confirmed equal to origin/fix/964-scalar-root-runner-main-test by git fetch origin followed by git ls-remote origin refs/heads/fix/964-scalar-root-runner-main-test, matched against local git rev-parse HEAD.
  • Commits on this branch over main: exactly one — d7688ac9 "Cover the scalar-root dispositions FILE guard end to end through runner.main".
  • Review threads: 0 (reviewThreads(first:50).totalCount via GraphQL = 0; no inline review comments on the PR either).
  • Copilot: review 5183086332, submitted 2026-09-11T20:19:22Z, state COMMENTED, verbatim verdict: "🟢 Approval recommended — The regression test covers the intended guard and passes successfully." "Comments generated: 0", "Review effort level: Lite". Nothing to bench.
  • Codex: usage-limit reply, verbatim: "You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings." Recorded as ABSENCE per lane doctrine; no review obtained.
  • closingIssuesReferences: [964] exactly (re-verified via GraphQL just before this comment).
  • Required-check rollup: PENDING — every check pass (SonarCloud Code Analysis, clearing-dispatch-gate, lane-line, openreposhape-pin, merge-master-approval, openspec-cli-pin, release-tag-gate, signed-execution-chain-gate, wallet-validation) except pytest-suite = pending (the required 20-27 min suite, still running) and Sourcery review = skipping (the known non-gating stub). Pending pytest-suite is expected and fine at this point.

🤖 Generated with Claude Code

@brettheap

Copy link
Copy Markdown
Contributor Author

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 d7688ac9: six required checks SUCCESS; closingIssuesReferences = [964]; 0 unresolved threads; no closing-keyword form in any branch commit message; main's newest decided pytest-suite = success; no other-lane unpaired LANDING into openxFactory main. mergeStateStatus BLOCKED = the code-owner-review ruleset that never clears on the author's own account; admin merge on Brett Heap's recorded words. Merge = merge commit.

@brettheap
brettheap merged commit d4d96cc into main Sep 11, 2026
13 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

LANDED — lane openxfactory-1, 2026-09-11T20:33:53Z, PR #980 → d4d96cc (openxFactory main; #964 closed by the merge; admin merge commit on 'land each when green'; Rule 6 window closed)

brettheap added a commit that referenced this pull request Sep 11, 2026
…#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants