Skip to content

fix(push): keep a copy that holds a link of the member's, as pull does - #1918

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
Walternater:fix/linked-skill-and-skill-refusals
Nov 21, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
Walternater:fix/linked-skill-and-skill-refusals

Conversation

@Walternater

Copy link
Copy Markdown
Collaborator

Third of the five in #1880, the part that changes a member's files outside teamai: a linked SKILL.md becomes a regular file. #1880 stays open for the self-mode leftovers.

The bug

syncTeamUpdatesToLocal replaced any copy matching an older team version. A member who keeps SKILL.md in 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 words Kept …: 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 scanLocalForPush proposed 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

Testing

Failing first, on main:

  • pre-push-sync.test.ts — the link became a regular file (isSymbolicLink() false).
  • skills.test.ts — scanLocalForPush proposed the copy instead of [].

The existing "replacing a linked copy without writing through it" case in pre-push-sync.test.ts asserted 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 typecheck and npm run lint pass.

Real CLI, world 20261117T064912-eb542c (built from this head). Team skills review and greet at v1, pulled; the member replaces review/SKILL.md with a link to ~/dotfiles/review.md, and adds their own mine holding a link to ~/notes.md; a teammate pushes v2 of both team skills. Then teamai push --all:

⚠ Kept …/.claude/skills/review/SKILL.md: it is a link of yours, so teamai does not replace it. Remove the link to receive skills/review from the team.
Found 1 resource(s) to push:
    1. [skills] mine (new)
⚠ Skipped notes.md in skills/mine: teamai does not push links to the team repo.
✔ Pushed branch teamai/push/TeamAI-World/20261117-145124

After: review/SKILL.md is still a symlink and ~/dotfiles/review.md still holds v1; greet/SKILL.md is at v2, so the sync still does its job for every other skill. The ledger's only leftovers are home/dotfiles and project/.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 --skill still 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 and push --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

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]>
@Walternater

Copy link
Copy Markdown
Collaborator Author

A note on the local test record so it is not read as stronger than it is.

npx vitest run (the whole suite) was stopped before its summary line, after ~100 minutes, with 3298 passing cases and no failures in the log. The suites this PR touches did run in full — skills.test.ts (98) and pre-push-sync.test.ts (57) — as did npm run typecheck and npm run lint. CI ran the whole suite across its shards, and all 17 checks pass.

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.

@jeff-r2026 jeff-r2026 self-assigned this Nov 18, 2026
@github-actions

Copy link
Copy Markdown

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 STiFLeR7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 jeff-r2026 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jeff-r2026
jeff-r2026 merged commit 2a79857 into Tencent:main Nov 21, 2026
20 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.

3 participants