Skip to content

feat(doctor): resolve Depends-on through supersession chains, rename check to Superseded dependencies - #83

Merged
Ian-stetsenko merged 1 commit into
mainfrom
feat/doctor-chain-resolution
Nov 9, 2026
Merged

Ian-stetsenko merged 1 commit into
mainfrom
feat/doctor-chain-resolution

Conversation

@TommyC81

@TommyC81 TommyC81 commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

lore doctor's dependency check now resolves Depends-on targets 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's Supersedes trailer row gains the protocol-doc sentence for the rule: "A supersede carries the decision forward, including dependencies on it". lore stale and its orphaned-dep signal 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: checkSupersededDependencies receives the SupersessionResolver and 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 through filterActive into the real staleness detector (mocked git client only) and asserting the orphaned-dep signal 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)

  • Why "superseded" and not "orphaned"? The dependency is not abandoned - the supersede carries it forward. "Orphaned" is the right word in lore stale's vocabulary (an attention signal: this dependency sits on a decision that was replaced and deserves re-review), which is why STALE_SIGNAL.ORPHANED_DEP and every stale-side occurrence stay untouched. Doctor reports structure; a structurally carried-forward dependency is not a finding.
  • Intended behavior delta worth naming in review: baseline flagged Depends-on edges 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).
  • JSON consumers: the check name is an output string; anything keying on the literal "Orphaned dependencies" needs a one-line update. Severity stays info, shape stays one check, order unchanged.
  • Why no "names the live successor" detail line: the flagged case is now exclusively a dead-end chain - there is no live successor to name. The detail-line format is byte-identical for that case.
  • Changelog: none - CHANGELOG.md is the maintainer's surface and this PR does not touch it.
  • Stale-side vocabulary deliberately remains: 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):

  • Before: INFO Orphaned dependencies: 59 atom(s) depend on superseded atoms plus 59 detail lines; summary "1 warnings, 1 info".
  • After: 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 doctor dependency 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.

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
TommyC81 force-pushed the feat/doctor-chain-resolution branch from 4150e77 to 36c237e Compare November 7, 2026 13:52
@Ian-stetsenko
Ian-stetsenko merged commit de69def into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lore doctor flags dependencies that supersession chains resolve to live atoms - and calls them "orphaned"

2 participants