Repository navigation
doc-health: stop uncited-resolution findings from echoing themselves - #519
Merged
Merged
Conversation
Mechanism: uncited_resolutions() stamps every finding it emits with resolution="contested" (the two-value taxonomy has no third option, and an uncited-resolution finding is not a mechanical auto-fixable defect). parse_previous folded EVERY class="contested" ranked-plan line into previous_contested regardless of family, including a family=uncited-resolution line. So once the ORIGINAL finding an uncited-resolution line cited was genuinely gone, the uncited-resolution finding about it read back as contested-and-vanished with no citation of its own, and was re-emitted forever: an uncited-resolution finding about an uncited-resolution finding, ad infinitum. The 2026-08-30 xFactory nightly carried 25 such rows -- exactly the 25 uncited-resolution findings of the 2026-08-26 baseline, echoing themselves, with zero documents behind any of them. Fix: exclude family=uncited-resolution from previous_contested in parse_previous (report.py). The ORIGINAL finding's key is already tracked under its own family's line and keeps demanding its citation; only the DERIVED echo's self-audit is removed. uncited-resolution stays in the regression-tracking key set (a persisting echo is still recognized as persisting, not misread as a fresh regression), and the finding's own resolution="contested" stamp and action text are unchanged. Why this fix and not re-classifying the finding as auto-fixable: the resolution-class taxonomy (doc-health spec, Requirement: Finding severity and regression handling) has exactly two values, and an uncited-resolution finding plainly is not a mechanical defect -- it is the ENFORCEMENT of the contested-finding rule for the twenty-two registered check families (doc-health.md "Check Families"), not itself one of them. It never appears in FAMILY_IDS/FAMILIES, so its own disappearance is not a fact about corpus state a second citation could discharge. The spec's general "a contested finding that disappears... must be emitted as a new error finding" scenario, read in that architecture, governs the 22 check families the mechanism protects, not the mechanism's own output. Tests (tests/doc-health/test_suite.py): three new cases pin (1) a previous uncited-resolution line, vanished and undispositioned, yields zero new findings, (2) a genuinely contested finding of ANOTHER family still raises exactly one uncited-resolution finding (regression guard), and (3) the finding uncited_resolutions() itself emits, round-tripped through render()/parse_previous(), never lands in previous_contested. Confirmed all three fail against the pre-fix code and pass after. Full suite: 1336 passed on unmodified origin/main (ec8be5a); 1339 passed on this branch (the 3 new tests above; no other test's outcome changed). Real-corpus proof (repo basename forced to 'openxFactory' via a detached git worktree, per issue #342): running scripts/doc-health.py --single-repo . --family location-conformance --previous-report <2026-08-26 baseline> before and after this change -- the count of family=uncited-resolution lines whose rule reads 'contested uncited-resolution finding resolved without citation' goes from 25 to 0; the 12 lines reading 'contested location-conformance finding resolved without citation' are byte-identical in both runs. Closes #515 Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
Pull request overview
This PR fixes an infinite-regression loop in doc-health where uncited-resolution findings could re-emit themselves forever after the original cited finding disappeared, by preventing family=uncited-resolution rows in a previous report from being treated as “contested upstream findings” during parse_previous().
Changes:
- Update
parse_previous()to excludefamily=uncited-resolutionfromprevious_contestedwhile still tracking it in the broaderkeysset. - Introduce
UNCITED_RESOLUTION_FAMILYconstant and use it consistently when emitting uncited-resolution findings. - Add regression tests covering the self-echo case and ensuring genuinely-contested upstream findings still produce
uncited-resolutionoutput.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/doc_health/report.py | Prevents uncited-resolution findings from being reclassified as contested upstream inputs, eliminating the self-echo loop. |
| tests/doc-health/test_suite.py | Adds targeted tests to reproduce the echo and verify the corrected parsing/emission behavior. |
Suppressed comments (1)
scripts/doc_health/report.py:312
- The docstring splits the identifier
UNCITED_RESOLUTION_FAMILYacross two lines inside backticks (UNCITED_RESOLUTION_/FAMILY), which reads like a typo and makes it harder to search for the constant name.
though it is written with `class="contested"`. See `UNCITED_RESOLUTION_
FAMILY` above for why: it is the enforcement of the rule for OTHER
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| file=sys.stderr) | ||
|
|
||
|
|
||
| # The family `uncited_resolutions` itself emits. Not a member of `FAMILY_IDS` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mechanism
scripts/doc_health/report.py::uncited_resolutions()stamps every finding it emits withresolution="contested"— correctly: the resolution-class taxonomy (doc-health spec) has exactly two values,auto-fixableorcontested, and an uncited-resolution finding is not a mechanicalauto-fixabledefect.parse_previous()then folded everyclass="contested"ranked-plan line intoprevious_contestedregardless of family — including afamily=uncited-resolutionline.So once the original finding an uncited-resolution line cited was genuinely gone, the uncited-resolution finding about it read back as contested-and-vanished with no citation of its own, and was re-emitted forever: an uncited-resolution finding about an uncited-resolution finding, ad infinitum. The 2026-08-30 xFactory nightly carried 25 such rows — exactly the 25 uncited-resolution findings of the 2026-08-26 baseline, echoing themselves, with zero documents behind any of them.
Fix chosen, and why
Exclude
family=uncited-resolutionfromprevious_contestedinparse_previous(narrowest of the two directions the issue offered). The original finding's key is already tracked under its own family's line and keeps demanding its citation — nothing is lost.uncited-resolutionstays in the regression-trackingkeysset (a persisting echo is still recognized as persisting, never misread as a fresh regression), and the finding's ownresolution="contested"stamp and action text are unchanged.I did not re-classify the finding as
auto-fixable(the other direction offered): it plainly is not a mechanical defect, andfamilies.FAMILY_RESOLUTION["uncited-resolution"] = CONTESTEDalready registers it as contested (though that entry turns out to be dead code today —uncited_resolutions()builds its Finding directly and never passes throughFAMILY_RESOLUTION, which only applies torun_suite's per-family output beforeuncited_resolutions()runs and appends its own).Spec check (did I silently override the contract?)
Read
docs/doc-health.mdandopenspec/specs/doc-health/spec.mdbefore deciding, per the issue's instruction to stop rather than silently change behavior if the spec makes the uncited-resolution finding itself require a disposition.openspec/specs/doc-health/spec.mdunder "Requirement: Finding severity and regression handling") is written over "a finding classifiedcontested" without an explicit self-exclusion, so read in isolation it is ambiguous about recursion.docs/doc-health.md's "Check Families" section runs exactly twenty-two named families, anduncited-resolutionis not one of them — it is never a member ofFAMILY_IDS/families.FAMILIES. It is the enforcement of the contested-finding rule for those 22 families, not a 23rd family subject to the rule itself. Every spec passage that discussesuncited-resolution(the promotion-fidelity, duplicate-packet, release-inventory-drift, modified-block-currency, client-identity-composition requirements) treats it exclusively as the downstream consequence of another family's contested resolution — never as a family whose own vanishing needs a citation.docs/doc-health.mditself never mentions "uncited-resolution", "cited", or "citation" anywhere — the rule is described only in the OpenSpec spec, so the task's conditional doc addition ("ifdocs/doc-health.mddescribes the uncited-resolution rule, add one sentence...") does not apply; nothing was added there.openspec/was not touched — the spec does not literally contradict this fix once read against its own family architecture.Tests (
tests/doc-health/test_suite.py)Three new cases, appended after the existing skip-family block:
test_a_vanished_uncited_resolution_finding_does_not_re_echo_itself— a previous report'suncited-resolutionline, absent from current and undispositioned, yields zero new findings.test_a_genuinely_contested_finding_of_another_family_still_fires— regression guard: a different family's genuinely contested, vanished, undispositioned finding still raises exactly oneuncited-resolutionfinding.test_an_emitted_uncited_resolution_finding_does_not_parse_as_contested— the findinguncited_resolutions()itself emits, round-tripped throughrender()/parse_previous(), never lands inprevious_contested, and a second run raises no further echo.Confirmed all three fail against the pre-fix code (verified via
git stash) and pass after. Full suite: 1336 passed on unmodifiedorigin/main(ec8be5a); 1339 passed on this branch (the 3 new tests; no other test's outcome changed).Real-corpus proof
Per issue #342,
--single-repo's repo key isPath(...).resolve().name, and.resolve()dereferences symlinks — so a symlink namedopenxFactorypointing elsewhere does not work. I used a detachedgit worktree add --detach <path>/openxFactory <ref>instead (a real checkout, correctly named, full git functionality forlocation-conformance's blob-checksum sub-check), once atorigin/main(before) and once at this branch's tip (after).Saved
health/reports/2026-08-26.md(from the xFactory aggregation repo) to the scratchpad and ran, in each worktree:family=uncited-resolutionlines whose rule reads "contested uncited-resolution finding resolved without citation"family=uncited-resolutionlines whose rule reads "contested location-conformance finding resolved without citation"Closes #515
🤖 Generated with Claude Code