Repository navigation
fix(push): keep a copy that holds a link of the member's, as pull does - #1918
Conversation
The pre-push sync replaced any copy matching an older team version, so a linked SKILL.md became a regular file holding v2 and the member's dotfile stopped being what the tool reads. Pull already keeps such a copy: the sync now asks the same question. Leaving the link alone is not enough on its own -- the copy then differs from what pull recorded, so the scan would offer it, and the push deletes the team's file or reverts the member's. The scan refuses it too, in pull's words. A new skill of the member's still pushes with its links left out (Tencent#993). Co-Authored-By: Claude Code <[email protected]>
|
A note on the local test record so it is not read as stronger than it is.
So: the code this PR changes is covered and green end to end; the full local suite is not something I can claim as passed. |
|
No findings in the specified PR diff. The PR description documents sufficient testing: failing-first regression tests, 155 passing unit tests, typecheck and lint, and a representative real-CLI world run confirming link preservation, ordinary skill synchronization, and pushing a new member-owned skill. Review was read-only; I did not run, build, or install PR code. |
STiFLeR7
left a comment
There was a problem hiding this comment.
Verified head fbb08f4 on native Windows with Node 24.11.0.
The three focused linked-file cases passed. Replacing only the two production files with their parent versions made the linked-SKILL.md preservation and push-scan exclusion regressions fail. The new-member-skill control still passed. Restoring the PR code returned all three cases to passing.
The full skills and pre-push-sync run had 153 passes and two failures. Both failures also occur with the parent production code: the existing one-file-skill fixture expects POSIX separators in its history mock, and the read-only-skill case exceeds its 15-second timeout on this Windows environment. The skills suite itself passed all 98 cases.
I read the four-file diff, callers, and membersLinkAt helper. The patch protects linked team-skill copies during synchronization and scanning while retaining new member-owned skills as push candidates. No blocking findings introduced by this diff were found.
My check uses unit tests and scratch files. I did not independently rerun the author's real-CLI world.
jeff-r2026
left a comment
There was a problem hiding this comment.
Validated PR #1918 at fbb08f4 integrated with main 2754311: npm ci --ignore-scripts, typecheck, lint, build, focused tests (src/tests/skills.test.ts, src/tests/pre-push-sync.test.ts, retry 0), and built CLI --version passed. Existing representative real-CLI records and review comments checked. Approved for squash as requested by jeffyxu.
Third of the five in #1880, the part that changes a member's files outside teamai: a linked
SKILL.mdbecomes a regular file. #1880 stays open for the self-mode leftovers.The bug
syncTeamUpdatesToLocalreplaced any copy matching an older team version. A member who keepsSKILL.mdin their dotfiles and links it into the delivered skill had the link replaced by a regular file holding the team's v2, so the tool then reads teamai's copy instead of the file the member maintains. Pull keeps that copy, in the wordsKept …: it is a link of yours, so teamai does not replace it.; the sync never asked.Keeping the link in the sync alone is not enough, which is why both halves are here. The copy then differs from what pull recorded, so
scanLocalForPushproposed it — and the push deletes the team's file for a folder skill, or reverts the member's file for a one-file skill, exactly as the issue records (skills/review/SKILL.md | 5 -----).The change
syncSkillsToLocalskips a skill whose copy holds a link of the member's (membersLinkAt), as pull does.scanLocalForPushleaves that copy out and names it once, in pull's sentence.Testing
Failing first, on
main:pre-push-sync.test.ts— the link became a regular file (isSymbolicLink()false).skills.test.ts—scanLocalForPushproposed the copy instead of[].The existing "replacing a linked copy without writing through it" case in
pre-push-sync.test.tsasserted the old intermediate decision; it now asserts what the issue asks for and what pull does. Its single-file sync assertions are unchanged.npx vitest run src/__tests__/skills.test.ts src/__tests__/pre-push-sync.test.ts— 155 passed.npm run typecheckandnpm run lintpass.Real CLI, world
20261117T064912-eb542c(built from this head). Team skillsreviewandgreetat v1, pulled; the member replacesreview/SKILL.mdwith a link to~/dotfiles/review.md, and adds their ownmineholding a link to~/notes.md; a teammate pushes v2 of both team skills. Thenteamai push --all:After:
review/SKILL.mdis still a symlink and~/dotfiles/review.mdstill holds v1;greet/SKILL.mdis at v2, so the sync still does its job for every other skill. The ledger's only leftovers arehome/dotfilesandproject/.claude/skills, which are the member's own data this repro creates and uninstall keeps on purpose, plus the known #1808 set.Not in this PR:
push --skillstill skips the scan's ownership refusals, the other half of the issue's third section. It needs one shared refusal list used by both the scan andpush --skill(a skill the CLI ships, one a workflow generated, a source-installed name, another source installation's copy, a member's link), which is a larger change than this one and shares no file with it.🤖 Generated with Claude Code