Skip to content

refactor(sync): share one orphan-link rule between prune and the dashboard - #937

Merged
runkids merged 1 commit into
mainfrom
runkids/shared-orphan-link-rule
Nov 17, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/shared-orphan-link-rule

Conversation

@runkids

@runkids runkids commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Follow-up to #914. No issue.

Summary

The dashboard's Sync page predicted which orphan links sync removes with its own copy of prune's rule. Codex caught that copy drifting in #914, and a review after the merge found two cases where it still disagreed.

Behavior change (dashboard preview only):

Orphan link Sync does Preview before Preview now
Recorded, cannot be followed (a loop, or a destination that cannot be read) removes it nothing prune
Target cannot be resolved at all keeps it, with a warning prune, if recorded nothing

Prune itself is unchanged: same removals, same warning text, same dry-run lines.

Checks

  • make check in a devcontainer: exit 0.
  • TestComputeTargetDiff_ListsRecordedLinkThatCannotBeFollowed fails on main (items = []) and passes here.
  • TestOrphanLinkVerdict covers the rule's rows: a link into the source or outside it, live or broken, recorded, unrecorded or forced.

Not run: UI tests, website build, and the Windows runbook. No UI or docs file changed.

Not covered:

  • The CLI diff still lists no orphan links in merge mode.
  • Agent diffs still list every orphan agent link as removed, though agent prune keeps live external ones. Agents use a different rule.
  • doctor splits broken links with OwnsLink, so a broken external link the manifest records as a copy is reported as "did not create" while prune removes it.
  • The dashboard preview has no Force input, so it never shows what --force would remove.
  • The unresolvable-target row has no test; I found no portable way to make such a link.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

…board

The Sync page predicted which orphan links sync would remove with its
own copy of prune's rule. The copy had already drifted once (#914), and
it still disagreed in two cases: prune treats a link it cannot follow,
such as a loop, as broken, while the page only counted a missing
destination; and prune keeps a link whose target it cannot read.

The decision now lives in sync.OrphanLink. Prune and the dashboard diff
both call it, so a later change to the rule reaches both. Prune's
results, warnings and dry-run text are unchanged. LinksIntoSource, added
for the dashboard's copy, is no longer needed and is removed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T04:57:58.080074Z 71f1267 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 5b249b6 into main Nov 17, 2026
9 checks passed
@runkids
runkids deleted the runkids/shared-orphan-link-rule branch November 17, 2026 05:10
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.

1 participant