Repository navigation
feat(doctor): split reference resolution by trailer severity, resolve through the all-refs index - #81
Merged
Merged
Conversation
Two problems fixed in the doctor reference check. First, ids were resolved against the scanned atom set only, so a reference to an atom living on an unscanned side branch false-dangled even though lore trace resolves it; ids now resolve through the shared all-refs Lore-id index (built only when a scanned atom actually carries a reference id; all refs, HEAD-preferred - the same semantics as trace and validate). If the index cannot be built, exactly one 'Reference resolution (skipped)' warning is reported and the run continues. Second, the single lumped check conflated severity classes: dangling Supersedes/Depends-on (review-blocking) and dangling Related (informational) surfaced identically, so the summary count could not serve as a gate signal. The check splits into 'Reference resolution (supersedes/depends-on)' at warning status (always present, ok message verbatim) and 'Reference resolution (related)' at info status, emitted only with findings and omitted entirely - check and text line both - for a clean corpus. Detail-line format is unchanged; the exit contract stays errors-only (a three-severities guard pins 1/1/1 with exit 1 from the error alone). The real-git side-branch integration suite proves cross-branch acceptance end-to-end; its dependency bag carries a default SupersessionResolver, which is runtime-inert here and keeps the suite green once the companion dependency-check change adds its resolver requirement. CHANGELOG.md is untouched (maintainer surface). Lore-id: 2ea23fa2 Constraint: Warning-class ok message stays verbatim 'All references resolve'; detail-line format unchanged Constraint: Skipped-policy contract byte-stable: exactly one skipped warning, fixed message, neither split check appears, check order unchanged Constraint: Info check omitted entirely (JSON and text) when empty; exit contract errors-only Constraint: CHANGELOG.md stays out of the PR; the maintainer authors changelog entries Tested: Unit tests per class combination, index-failure policy pins, three-severities exit guard, real-git side-branch integration suite; red-first on the split cycles Tested: Full gate on Windows: 35 files / 524 tests (baseline 512 at main), +12 tests Tested: Combined-tree verification with the companion commit-validation and chain-resolution changes: 578/578 across 37 files Confidence: high Scope-risk: narrow
TommyC81
force-pushed
the
feat/doctor-ref-severity
branch
from
November 7, 2026 13:52
b8ec995 to
3ba3a70
Compare
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.
Summary
lore doctor's reference check splits by trailer severity.Reference resolution (supersedes/depends-on)keeps warning status, is always present, and keeps the verbatim ok message;Reference resolution (related)is info-status and appears only with findings - a clean corpus omits it entirely, in JSON and in text. Reference ids now resolve through the shared all-refs Lore-id index, so references to atoms living on unscanned side branches no longer false-dangle (doctor andlore tracenow agree). An index that cannot be built yields exactly oneReference resolution (skipped)warning and the run continues.Resolves #80.
Implementation
One commit, whose message carries the full design story. It was built and gated as two slices before squashing, plus review fixes folded in. Index adoption:
checkReferencesResolveresolves ids through the all-refs index; side-branch references resolve; findings, exit behavior, and JSON shape unchanged; a real-git integration suite covers the side-branch scenario (hermetic temp-dir repo). Severity split: the check returns two checks; the warning class keeps its contract byte-for-byte, the info class is finding-gated; the index-failure path keeps the skipped-policy contract (exactly one skipped warning, neither split check appears, check order unchanged); unit tests pin every class combination plus a three-severities guard (a rejecting config loader drives errors/warnings/info to 1/1/1 and exit 1 from the error alone). Review fixes folded: the index-failure test asserts order + count instead of pinning the companion rename PR's check literal, and the integration-test dependency bag carries a defaultSupersessionResolver(runtime-inert here, required once the companion change lands).Design notes (pre-empting review questions)
Related? The trailer carries no decision semantics; a deadRelatedlink inconveniences navigation, it does not break structure. Doctor's job is to make severity mean something; the commit-msg validator keeps its warning (attention vocabulary) and the companion commit-gate PR blocks both classes at creation time (prevention vocabulary).name/statuspair.Orphaned dependencies->Superseded dependencies) merges in either order without touching this suite. The real-git integration test constructs a full production-shaped dependency bag (including a defaultSupersessionResolver, pre-existing on main and runtime-inert here), so it keeps passing once the companion chain-resolution change adds its resolver requirement. The only cross-PR conflict is one test-harness hunk, resolved mechanically. No CHANGELOG coupling: no PR in this family touches CHANGELOG.md.runDoctorFormattedseam (text-formatter and rejecting-loader injection); all existingrunDoctorcall sites are unchanged.Testing
35 files / 524 tests green on Windows (baseline 512 at main): +12 tests across both commits (index adoption integration suite + class-combination units + three-severities guard + skipped-policy pins).
Live before/after on a production corpus (~967 Lore-ids, this repository's own lore corpus):
WARNING Reference resolution: 16 broken reference(s) found(15Related+ 1Supersedeslumped).WARNING Reference resolution (supersedes/depends-on): 1 broken reference(s) foundandINFO Reference resolution (related): 15 broken related reference(s) found- the summary reads1 warnings, 2 infoand the warning count finally means structural damage. The dependency check is byte-identical before and after (untouched here).Changelog (maintainer surface)
This PR deliberately does not touch CHANGELOG.md; changelog entries are the maintainer's surface. Suggested line if wanted:
lore doctorreference check severity split - danglingSupersedes/Depends-onreferences report under a dedicated warning-status check while danglingRelatedreferences report under an info-status check that appears only with findings; ids resolve through the shared all-refs Lore-id index, and an index that cannot be built yields one skipped warning check.