Skip to content

fix(diff): list only what sync prunes, and have doctor follow it - #942

Merged
runkids merged 1 commit into
mainfrom
runkids/previews-match-prune
Nov 17, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/previews-match-prune

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

Closes #939
Closes #940
Closes #941

Summary

Three previews disagreed with what sync does to a link that no skill or agent maps to. Each now asks the function prune itself uses.

Where Before Now
Agent diff, CLI and dashboard (#939) every orphan link listed as a removal only links agent sync prunes: merge mode, and broken or pointing into the source
CLI diff, merge-mode skills (#940) no orphan links listed links sync.OrphanLink says prune removes, as Orphan
doctor broken links (#941) "did not create, kept" unless OwnsLink "broken symlink" and skillshare sync when sync would prune it
  • prunableLink is exported as sync.PrunableLink; sync.PrunesAgentLink adds the mode check. Both agent diffs now receive the agents source.
  • doctor treats an empty source as "every entry is an orphan". Only a failed discovery or an invalid filter turns the new check off.
  • diff.md and its four translations describe the merge-mode orphan links.

Checks

  • make check in a devcontainer: exit 0.
  • Run by hand in a container with an isolated HOME:
    • diff listed Orphan alpha, brk.md, old.md and not the live external agent link; sync --all pruned exactly those three; diff then reported in sync.
    • With a recorded copy replaced by a broken link, doctor reported 1 broken symlink: alpha for the removed skill and did not create, kept: gamma for the current one, in copy and merge mode; sync pruned alpha and kept gamma.
  • New tests: TestComputeAgentDiff_ListsOnlyOrphanLinksSyncPrunes (includes a relative link and copy mode), TestComputeAgentTargetDiff_KeepsLiveLinkToAnotherLocation, TestDiffListsOrphanLinkThatSyncPrunes, TestCheckBrokenSymlinksFollowsWhatSyncPrunes (merge and copy).

Not run: website build, UI tests, the Windows runbook.

Not covered:

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 — three issues, one concern: a preview must match what sync prunes

Three previews disagreed with what sync does to a link no skill or
agent maps to.

The agent diff, in the CLI and the dashboard, listed every orphan link
as a removal. Agent sync prunes a link only in merge mode, and only when
it is broken or points into the source, so a live link to another
location was listed forever. Both diffs now ask the function prune uses.

The CLI diff listed no orphan links at all for merge-mode skills, so a
skill removed from the source showed nothing until sync pruned its
link. It now lists the links sync.OrphanLink says prune removes.

doctor called a broken link "did not create, kept" whenever OwnsLink was
false. Prune also removes a broken link under a name the manifest
records in any form once no skill maps to it, so doctor told the user to
delete by hand a link that sync removes. It now reports those as broken
and suggests sync. An empty source counts as "every entry is an orphan";
only a failed discovery turns the check off.

Closes #939
Closes #940
Closes #941
@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-17T05:33:54.968093Z ffcd9d9 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 7af9224 into main Nov 17, 2026
9 checks passed
@runkids
runkids deleted the runkids/previews-match-prune branch November 17, 2026 05:39
runkids added a commit that referenced this pull request Nov 17, 2026
…944)

Without file-link privilege (Windows without Developer Mode) merge mode
copies agents and tracks the copies it wrote. A file a tool already had
with the same bytes as the source was not tracked, so it was kept, and
--force kept it too: the identical-content check ran before the force
check. init's "kept local agents: X (sync agents --force replaces them)"
then named a file --force could never take over, on every run.

With --force the file is now recorded as skillshare's, so later syncs
update it. Without --force nothing changes.

Also: the five-name cap written twice is one helper, sync.ListNames,
and doctor.md says when a recorded broken link is reported as a broken
symlink (the behavior from #942).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant