Skip to content

doc-health report: a skipped family that carries findings renders its rows and tally beneath the Skipped line (#902) - #905

Merged
brettheap merged 3 commits into
mainfrom
fix/report-skipped-family-carried-rows
Sep 10, 2026
Merged

brettheap merged 3 commits into
mainfrom
fix/report-skipped-family-carried-rows

Conversation

@brettheap

@brettheap brettheap commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-1 (openXfactory-1)

Renderer-only, plus its tests. Since #766 (PR #871 9c0e2cda) a family may answer with a Skip that CARRIES the findings its repositories had established before its question stopped being askable, and runner.run_suite extends result.findings with them while still recording the skip. Those findings reach the headline counts, the ranked plan and the previous-report diff — and reached nothing under the family's own ### <family> heading, because report.render's Findings-By-Family loop branched on the skip FIRST and made the Skipped: line the whole of the section.

Before / after — a carrying skip

Before (the whole section):

### release-tag-publication

Skipped: alpha: the published refs for contract-v2.0 could not be consulted

After:

### release-tag-publication

Skipped: alpha: the published refs for contract-v2.0 could not be consulted
- [warning] alpha:contracts/manifest.yaml — contract-v2.0 is declared and has no published annotated tag
- [info] alpha:contracts/releases/contract-v1.9.digests.yaml — contract-v1.9 is declared SPENT

The rows are the ones already in that report's ranked plan and headline counts. The section a reader opens to see what those counts are counting now carries them, which is what "Skipped families (never silently omitted)" promised: the family was named, its findings were not.

The tally

The per-class tally (families.FAMILY_SUMMARIES) turns on the FINDINGS rather than on the skip. An EMPTY skip still has none — zeros beside that line would claim a measurement nobody took, which is canon's skip rule ("cannot run", not "found nothing"). A CARRYING skip has one, because its findings ARE a measurement somebody took. No family in the estate today both has a FAMILY_SUMMARIES entry and can produce a carrying skip, so this arm changes no report written today; it is pinned so the first family that reaches that state renders correctly rather than silently.

Byte-identity for an empty skip

Two independent proofs, because the claim is the load-bearing one:

  1. Pinned by test. test_suite.py::test_an_empty_skip_renders_the_reason_alone_exactly_as_it_always_did asserts the family's whole section by EQUALITY against a literal captured from the renderer as this branch's base leaves it (b4270224), not re-derived from the code under test — the only form of that assertion that can catch the new branch leaking a line into the state it must not touch.
  2. Measured over the real corpus. python3 scripts/doc-health.py --single-repo . --as-of 2026-09-10 run on b4270224 and on this branch writes the same 349-line report, md5 34effd6b92f454fd70c0880704c50e9f both ways, with identical stderr. That run has five skipped families, none carrying.

Consumers of the section, checked (issue's item 2)

No consumer reads a skipped section as exactly one line, so nothing needed fixing — and the check is now a test rather than a claim (test_the_rows_beneath_a_skip_line_are_not_ranked_plan_rows):

  • the three lane inserts — insert_readiness_section, insert_derive_possibles_section, insert_neutrality_section — locate FINDINGS_BY_FAMILY_HEADING with report_text.index(...) and splice BEFORE it; not one reads a character past the heading. The test asserts the family's section comes back byte-identical through insert_readiness_section;
  • parse_previous / unparsed_plan_rows judge a line by PLAN_ROW_PREFIX (- severity=) and a per-family row begins - [, so a carried finding cannot become two ranked-plan rows or one unreadable one. Asserted with a carried error in the set on purpose: without one the key set is empty and that assertion would pass over a renderer that dropped every row;
  • ideation_dashboard.dashboard_refresh_lane.append_report_section appends at the end of the report.

Evidence

  • python3 -m pytest tests/doc-health -q → 1684 passed, 7 warnings (exit 0). Baseline before this change was 1681; the three added tests are the difference.
  • python3 scripts/doc-health.py --single-repo . → exit 0, report written, no error.

Out-of-surface residue (disclosed, not taken)

Two comments elsewhere state the old one-state skip rule in passing and are now imprecise about a carrying skip. Both are prose, nothing depends on them, and both are outside this PR's declared surface (scripts/doc_health/report.py + tests/doc-health/):

  • scripts/doc_health/__init__.py:215 (the RunResult.notes comment) — "a skipped family still has a basis to state and has no tally to state";
  • specs/022-modified-block-currency-reporting/contracts/report-section.md §§ 2 and 4 — the state table and the render contract say a skipped family's subtotal is NOT rendered. Still accurate for every state the modified-block-currency family can actually reach today (both its skip shapes are plain Skips); the third state is unreachable for it.

Closes #902

refs #766, refs #871

🤖 Generated with Claude Code

Summary by Sourcery

Show carried findings in skipped-family sections while preserving empty-skip output and validating downstream report consumers.

New Features:

  • Render findings beneath a family's Skipped: line when the skip carries findings.

Bug Fixes:

  • Prevent carried findings from being omitted from their family sections while remaining present in headline counts, ranked plans, and report diffs.
  • Preserve the existing reason-only rendering for empty skips.

Enhancements:

  • Determine family tallies from available findings so carrying skips receive accurate summaries without assigning measurements to empty skips.

Tests:

  • Add coverage for carrying-skip rendering, empty-skip byte identity, and compatibility with report consumers and lane section insertion.

brettheap and others added 2 commits September 10, 2026 12:21
… the Skipped line (#902)

Since #766 (PR #871) a family may answer with a `Skip` that CARRIES the
findings its repositories had established before its question stopped being
askable, and `runner.run_suite` extends `result.findings` with them while
still recording the skip. Those findings reach the headline counts, the
ranked plan and the previous-report diff — and reached nothing under the
family's own `### <family>` heading, because `render`'s Findings-By-Family
loop branched on the skip FIRST and made the `Skipped:` line the whole of
the section. A reader who opened that section to see what the counts were
counting found the family named and its findings not, which is the inverse
of the headline's own promise that a skipped family is "never silently
omitted".

The row loop is now unconditional and the two verdict lines keep their
existing conditions, so a family with no findings runs it zero times. The
per-class tally (`families.FAMILY_SUMMARIES`) turns on the FINDINGS instead
of on the skip: an EMPTY skip still has none, because zeros beside that line
would claim a measurement nobody took, and a CARRYING skip has one, because
its findings are a measurement somebody took.

An EMPTY skip is byte-identical. Proved empirically as well as by test:
`doc-health.py --single-repo .` over this repository (5 skipped families,
none carrying) writes the same 349-line report before and after, md5
34effd6b92f454fd70c0880704c50e9f both ways, stderr identical.

Consumers checked and unchanged: the three lane inserts
(`insert_readiness_section`, `insert_derive_possibles_section`,
`insert_neutrality_section`) locate `FINDINGS_BY_FAMILY_HEADING` and splice
BEFORE it, reading no character past the heading; `parse_previous` /
`unparsed_plan_rows` judge a line by `PLAN_ROW_PREFIX` (`- severity=`) and a
per-family row begins `- [`; `dashboard_refresh_lane.append_report_section`
appends at the end. Nothing reads a skipped section as exactly one line.

Refs #766, #871.

Lane: openxfactory-1
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…identity, and the section's consumers (#902)

`test_suite.py`, beneath the #766 group whose reader's half this is:

- a carrying skip's section asserted by EQUALITY, not by three `in` checks —
  what was wrong was the SHAPE of the section, so the reason first, the rows
  beneath it, and `No findings.` absent are one assertion. Driven through
  `run_suite` over the real carrying shape (`rtp._PartialSkip`), so the
  `(findings, skips)` pair rendered is the one the suite really produces.
- an empty skip's section asserted against a literal captured from the
  renderer as this branch's base leaves it, which is the only form of that
  assertion that can catch the new branch leaking a line into the state it
  must not touch.
- the consumers, checked rather than assumed: the ranked-plan grammar reads
  exactly one row per finding and no per-family row claims to be one, the
  key set is the carried findings' own, and `insert_readiness_section`
  returns the family's section byte-identical with the skip's rows intact
  behind it. A carried `error` is in the set on purpose — without one the
  key set is empty and that assertion would pass over a renderer that
  dropped every row.

`test_modified_block_currency_reporting.py`: the tally's third state, beside
the two skip tests that already pinned the first two. Those two are
untouched and still right about what they test; their docstrings now say
which state that is, since "skipped" stopped being one state. The renderer
is exercised directly here because no family in the estate today both has a
`FAMILY_SUMMARIES` entry and can produce a carrying skip — this family's two
skip shapes are plain `Skip`s and the one carrying shape belongs to a family
with no tally — and the docstring says so rather than leaving the reader to
discover it.

Refs #766, #871.

Lane: openxfactory-1
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 10, 2026 16:22

@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 8 hours and 8 minutes 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

@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates the documentation-health renderer so skipped families that carry previously established findings show their tally and rows beneath the skip reason, while empty skips retain their prior byte-identical output; focused tests cover rendering, suite integration, and downstream report consumers.

Sequence diagram for carrying skipped family report rendering

sequenceDiagram
    participant Runner as runner.run_suite
    participant Renderer as report.render
    participant Report as Family section
    Runner->>Renderer: findings and skips
    Renderer->>Renderer: group findings by family
    Renderer->>Report: render Skipped reason
    Renderer->>Report: render FAMILY_SUMMARIES from fam_findings
    Renderer->>Report: render carried finding rows
    Note over Report: Empty skips render only the reason
Loading

Flow diagram for rendering skipped family findings

flowchart TD
    A[Family result] --> B{Skipped?}
    B -->|No| C{Findings present?}
    B -->|Yes| D{Findings carried?}
    D -->|No| E[Render Skipped reason]
    D -->|Yes| F[Render Skipped reason]
    F --> G[Render family tally]
    G --> H[Render finding rows]
    C -->|Yes| I[Render tally and finding rows]
    C -->|No| J[Render No findings]
Loading

File-Level Changes

Change Details Files
Render findings beneath a family's skip line while preserving empty-skip behavior.
  • Distinguish empty skips from skips carrying findings when deciding whether to render family tallies.
  • Make the family finding-row loop unconditional so carried findings appear after the skip reason.
  • Keep empty skipped sections byte-identical and avoid rendering misleading zero tallies.
scripts/doc_health/report.py
Add renderer coverage for carrying and empty skipped-family states.
  • Verify a carrying skip renders its reason, tally, and finding rows in the expected order.
  • Assert an empty skip renders only its reason using an exact section literal.
  • Exercise real suite output for a carrying skip and preserve existing empty-skip semantics.
tests/doc-health/test_suite.py
tests/doc-health/test_modified_block_currency_reporting.py
Verify report consumers remain correct when skipped sections contain finding rows.
  • Confirm carried rows are not interpreted as ranked-plan rows or lost by previous-report parsing.
  • Check lane section insertion remains positioned before the findings-by-family section and preserves the family section.
tests/doc-health/test_suite.py

Assessment against linked issues

Issue Objective Addressed Explanation
#902 Update the Findings By Family renderer so a skipped family that carries findings renders its existing Skipped: line followed by the carried finding rows under the family's heading. ✅
#902 Render the per-class family tally for carrying skips, while continuing to omit the tally and preserve the existing byte-identical rendering for empty skips. ✅
#902 Verify that consumers of the Findings By Family section, including report diff parsing and lane section insertion, continue to behave correctly when skipped sections contain finding rows. ✅

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

@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 change is narrowly scoped to rendering logic, preserves empty-skip output, and is comprehensively pinned by targeted tests for both renderer behavior and known consumers.

Pull request overview

This PR fixes a doc-health report rendering gap where a family section would stop at the Skipped: line even when that skip carries findings (findings that already appear in headline counts / ranked plan / previous-report diffs). It updates the renderer to display carried findings (and per-family tally where applicable) beneath the skip reason, while preserving byte-identical output for empty skips, and adds regression tests to pin both behaviors and downstream consumers.

Changes:

  • Update report.render to render carried findings beneath a skipped family’s reason line and to compute per-family tallies based on presence of findings (not merely “skipped”).
  • Add suite-level tests covering: carrying-skip section shape, empty-skip byte identity, and consumer behaviors (ranked plan parsing and lane insert insertion points).
  • Add renderer-focused tests ensuring a tally block is rendered when a skip is present but findings exist, while empty skips still render no tally.
File summaries
File Description
scripts/doc_health/report.py Render carried findings (and tallies) under skipped family headings while preserving empty-skip output.
tests/doc-health/test_suite.py Add regression tests for carrying-skip section rendering, empty-skip byte identity, and downstream consumers.
tests/doc-health/test_modified_block_currency_reporting.py Add renderer tests for tally behavior under empty skip vs carried-findings skip scenarios.
Review details
  • Files reviewed: 3/3 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.

…e two assertions it always was (#902)

SonarCloud `python:S9073` on this PR, taken. `assert result.findings and
not result.skips` fails for two unrelated reasons — a fixture tree that
produced nothing, and a tree that skipped on its own — and reports neither,
which is the whole value of a precondition assertion. Two assertions with
their own messages instead. No behaviour changes and no other assertion in
the file moves.

`python3 -m pytest tests/doc-health -q` -> 1684 passed.

Lane: openxfactory-1
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 10, 2026 16:38

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 renderer change is small, behavior-preserving for empty skips, and is pinned by precise regression tests covering both the new carrying-skip state and key downstream consumers.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FREEZE — 2026-09-10T16:58Z. Head sha dd878df47fd76c907d9f16dd7765754f438c6504. Unresolved review threads: 0 of 0 (reviewThreads.totalCount == 0, GraphQL). No further commits from this lane without a new instruction.

Review outcomes

Codex — ABSENCE, refused on a usage limit. Verbatim, its whole reply to the single review request:

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.

One request was made and one refusal came back; the connector was not re-triggered. Recorded as ABSENCE, not as a clean bill.

Copilot — reviewed twice, both heads, no comments. Verbatim, on head dd878df4:

🟢 Approval recommended

The renderer change is small, behavior-preserving for empty skips, and is pinned by precise regression tests covering both the new carrying-skip state and key downstream consumers.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

And on head d5cde4b7 before the fix commit: "🟢 Approval recommended … The change is narrowly scoped to rendering logic, preserves empty-skip output, and is comprehensively pinned by targeted tests for both renderer behavior and known consumers. Comments generated: 0".

Sourcery — ABSENCE, refused on a budget limit. Verbatim:

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

(It still posted an unsolicited Reviewer's Guide; that carries no findings. Its check reports SKIPPED.)

SonarCloud — one finding, TAKEN. python:S9073 MAJOR, "Split this composite assertion into separate assertions", tests/doc-health/test_modified_block_currency_reporting.py:680-682. Taken in dd878df4: assert result.findings and not result.skips fails for two unrelated reasons and reports neither, so it is now two assertions with their own messages. Re-analysis on the new head returns 0 open issues and the Quality Gate passes.

Checks on dd878df4

check state
SonarCloud Code Analysis SUCCESS
clearing-dispatch-gate SUCCESS
lane-line SUCCESS
merge-master-approval SUCCESS
openreposhape-pin SUCCESS
openspec-cli-pin SUCCESS
release-tag-gate SUCCESS
signed-execution-chain-gate SUCCESS
wallet-validation SUCCESS
Sourcery review SKIPPED (budget refusal above)
pytest-suite IN_PROGRESS at freeze — not yet decided, stated rather than assumed

pytest-suite was still running when the bounded bench window closed. Locally on this exact tree: python3 -m pytest tests/doc-health -q → 1684 passed, 7 warnings, exit 0 (baseline before this change was 1681; the three added tests are the difference), and python3 scripts/doc-health.py --single-repo . exits 0 with the report written and no error.

Byte-identity, measured

doc-health.py --single-repo . --as-of 2026-09-10 run on the branch base b4270224 and on this branch writes the same 349-line report, md5 34effd6b92f454fd70c0880704c50e9f both ways, with identical stderr. That run carries five skipped families, none of them carrying findings — which is the state every report in health/reports/ is in today.

Landing is the orchestrator's act; this lane has posted no LANDING and merged nothing.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

LANDING PROVENANCE 2026-09-10T17:04:17Z — head dd878df4, on Brett Heap's blanket word of 2026-09-10 ~15:3xZ, verbatim "do the batch, land each when green". Guard on live values: six required checks SUCCESS (lane-line, openspec-cli-pin, pytest-suite, release-tag-gate, signed-execution-chain-gate, wallet-validation); closingIssuesReferences = [902] exactly; 0 unresolved threads; main's newest decided pytest-suite = success; no other-lane unpaired LANDING into openxFactory main; no openspec/changes/ file touched, so no Rule 6 window. mergeStateStatus BLOCKED = the code-owner-review ruleset that never clears on the author's own account; admin merge with provenance (B2 pattern). Merge = merge commit; #902 closes by it.

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