Repository navigation
feat(doctor): resolve Depends-on through supersession chains, rename check to Superseded dependencies - #83
Merged
Conversation
The doctor dependency check flagged every Depends-on edge whose target had been superseded as an "Orphaned dependencies" info finding - but a dependency attached to a superseded atom is not orphaned: the supersede replaces the decision and carries it forward, dependencies included. On a production corpus (967 Lore-ids), 59 of 59 flagged edges resolved through supersession chains to live atoms; the corpus contained zero actually-dead edges. The check now walks supersession chains (own visited set; cycles and self-supersession terminate and keep the info finding; multi-hop chains resolve to the live head; side-branch-only targets stay silent) and flags only chains that dead-end, with the detail-line format unchanged. It renames to "Superseded dependencies" with the consistent ok message "No superseded dependencies found" - the word "orphaned" stays correct in lore stale's attention vocabulary (STALE_SIGNAL.ORPHANED_DEP is machine-stable and untouched; a guard test drives the real resolver through filterActive into the real staleness detector and proves the orphaned-dep signal still fires for the same edge). The README Supersedes trailer row gains the protocol-doc citation the resolution rule never had: "A supersede carries the decision forward, including dependencies on it"; the PROJECT_ARCHITECTURE check-list line follows. With this change the production corpus above goes from 59 info findings to a clean "No superseded dependencies found" overnight, with no corpus edits and the reference-resolution check byte-identical. CHANGELOG.md is untouched (maintainer surface). Lore-id: 35e10e6d Constraint: Info message and detail-line strings stay byte-identical; exit behavior and JSON check shape unchanged Constraint: Stale-side keeps 'orphaned-dep' as the machine-stable STALE_SIGNAL value and all its occurrences (staleness detector, constants, stale tests, guard test) Constraint: CHANGELOG.md stays out of the PR; the maintainer authors changelog entries Tested: Unit tests per chain shape: transferred, multi-hop, cycle, self-supersession, side-branch-only, dead-end, zero-finding ok; red-first on the renames; doctor/stale guard seam Tested: Full gate on Windows: 34 files / 520 tests (baseline 512 at main), +8 tests Tested: Live before/after on a production corpus: 59 dependency info lines collapse to zero; reference-resolution warning byte-identical Confidence: high Scope-risk: narrow
TommyC81
force-pushed
the
feat/doctor-chain-resolution
branch
from
November 7, 2026 13:52
4150e77 to
36c237e
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 dependency check now resolvesDepends-ontargets through supersession chains before flagging: an edge whose chain reaches a live atom is silent; only dead-end chains keep the info finding. The check renames from "Orphaned dependencies" to "Superseded dependencies" (ok message: "No superseded dependencies found"), and the README'sSupersedestrailer row gains the protocol-doc sentence for the rule: "A supersede carries the decision forward, including dependencies on it".lore staleand itsorphaned-depsignal are untouched.Resolves #82.
Implementation
One commit, whose message carries the full design story. It was built and gated as two slices before squashing. Chain resolution:
checkSupersededDependenciesreceives theSupersessionResolverand silences transferred edges - chain walk with its own visited set (cycles and self-supersession terminate and keep the info finding), multi-hop chains resolve to the live head, side-branch-only targets stay silent; info message, detail-line format, exit behavior, and JSON check shape are unchanged; a guard test pins the doctor/stale boundary by driving the real resolver throughfilterActiveinto the real staleness detector (mocked git client only) and asserting theorphaned-depsignal still fires for the same edge. Rename + docs: the check's name strings, JSDoc, comments, and module-local identifiers move to "Superseded dependencies"; the README trailer-table row and the PROJECT_ARCHITECTURE check-list line document the carries-forward expectation. Review polish was folded before squashing; the net diff does not touch CHANGELOG.md (maintainer surface).Design notes (pre-empting review questions)
lore stale's vocabulary (an attention signal: this dependency sits on a decision that was replaced and deserves re-review), which is whySTALE_SIGNAL.ORPHANED_DEPand every stale-side occurrence stay untouched. Doctor reports structure; a structurally carried-forward dependency is not a finding.Depends-onedges whose superseded target exists only on an unscanned side branch (its id set was not presence-gated); with chain resolution those are silent too, since the resolver's map covers exactly the scanned atoms. A dependency whose target is absent entirely was and remains outside this check (that is the reference-resolution check's business).nameis an output string; anything keying on the literal "Orphaned dependencies" needs a one-line update. Severity staysinfo, shape stays one check, order unchanged.stale.ts, the staleness detector, its tests, and two architecture-doc lines still say "orphaned" - that is the attention vocabulary and stays.Testing
34 files / 520 tests green on Windows (baseline 512 at main): +8 tests covering transferred silence, multi-hop resolution, cycle and self-supersession termination with the info line intact, side-branch silence, dead-end flagging, zero-finding ok output, and the doctor/stale guard.
Live before/after on a production corpus (967 Lore-ids, this repository's own lore corpus):
INFO Orphaned dependencies: 59 atom(s) depend on superseded atomsplus 59 detail lines; summary "1 warnings, 1 info".OK Superseded dependencies: No superseded dependencies found; summary "1 warnings". The reference-resolution warning is byte-identical before and after (that check is 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 doctordependency check - renamed from Orphaned dependencies to Superseded dependencies and now resolves Depends-on targets through supersession chains, so an edge transferred to a live successor atom is no longer flagged; the README trailer table now states the carries-forward expectation.