Conversation
…ing it (Tencent#822) Pull records the sha256 of the bytes it writes at each skill, rule and agent destination in the checkout's record (`delivered`), and the pre-push sync records its writes too. On a full sync, a copy that no longer matches the record is kept and named, with a warning when the team version moved since; push repeats that warning. Tombstone cleanup and the rules sweep keep an edited copy the same way. `--force` keeps edits, `--dry-run` prints `Would keep`, and `doctor` does not fail on a kept copy. Without a record (first pull on this version, a new worktree) pull overwrites as before.
Resolve pre-push-sync.ts against Tencent#857: the Copilot/Cursor render path records the copy it writes in delivered, so the next pull updates it.
…cal-edits # Conflicts: # CHANGELOG.md
|
No findings. The PR description documents sufficient testing, including a representative real-CLI end-to-end verification. Per instruction, I reviewed the diff only and did not run code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every full
teamai pullcopied skills, rules and agents over the local copy, so an edit the member had not pushed yet was lost without a word. Now pull keeps a copy the member changed since teamai delivered it, and names it with the next step.Pull records what it wrote. Each checkout record (
lastPullByWorkspace[<checkout>], and HOME's for the user scope) gains an optionaldeliveredmap: the sha256 of the bytes teamai last wrote at each skill, rule and agent path. Pull and the pre-push sync update it through the existing atomic state save. A copy counts as edited only when it has a record and no longer matches it. Comparing written bytes, rather than re-rendering the team file at an older revision, keeps the check correct across a renderer change such as #856's Cursormodelfield, for skills delivered through a submodule, and for a SKILL.md whose frontmatter pull repairs.Kept <path>: you changed it since teamai delivered it. Share it with `teamai push`, or delete it and run `teamai pull --force` to get the team version back.Kept <path>: you changed it, and the team version (<rel>) has changed since. Merge the team change into your copy and share it with `teamai push`, or delete your copy and run `teamai pull --force` to take the team version..mdcof the same rule updates. A skill directory is one unit: a change to any of its team files keeps the whole skill. Files only the member added are not recorded and do not count, and neither doesCONTRIBUTORS, matching what push compares.Kept <path>: the team removed <name>, but you changed this copy. Delete it when you no longer need it.--forcekeeps edits. It is the repair stepdoctorand several errors print, so it must not become a way to lose work. The steps saypull --forcebecause the pull that kept a copy has recorded the team revision, so a plain pull after it would printAlready syncedand restore nothing.--dry-runprintsWould keep <path>: you changed it since teamai delivered it.and writes nothing.The team changed <rel> since teamai delivered <path>; pushing replaces that change unless you merged it. Merge the team version first, or delete your copy and run `teamai pull --force`.The SessionStart pull is silent, so without this the member could miss pull's warning. It is a warning, not a hold, because the member may have merged the change already. The agent push hold's message now gives the same steps (it used to say pull replaces the copy).doctorno longer fails a rules or agents check, or points atpull --force, for a kept copy. Next to another problem it lists the copy aschanged by you (kept by pull).roles set,projects set,skill exclude) resets the other checkouts' records and now keeps theirdelivered, so their next pull still protects their edits.Not changed: a same-name copy teamai never delivered to that path is still overwritten.
teamai remove's rules refresh and local-agent installs still write without this check and record nothing. Step 3b and the inactive-namespace cleanups still compare with the team source. An older CLI that saves state dropsdelivered; the next pull on this version is then back in the no-record case. All of this is in the usage guide and indocs/designs/multi-project-management.md.Part of #822 (item 5).
Evidence
Tests before and after. Each new test fails without its change and passes with it:
delivered-copies.test.ts(new): the classification, including a fast-check property that pull keeps a copy only with a recorded file whose bytes are neither the record nor the team version.e2e/pull-keeps-edits-822.test.ts(new, 10 tests, against the built CLI with a skill directory, a rule delivered to Claude.mdand Cursor.mdc, and an agent rendered for Claude and Cursor):--force, and restored after deletion;--dry-run: names the kept copies, andstate.jsonand the files are unchanged;pre-push-sync.test.ts(rule and skill writes recorded),pull-namespace-override.test.ts(feat: one namespace model for every resource type (#707) #816 case), anddoctor-rules-delivery.test.ts(kept-copy label).expected 'echo one\n' to be 'echo mine\n'.npm run lint: 0 warnings.npx tsc --noEmit: clean.npm run build: OK.npx vitest run --maxWorkers=4on Node 22: 5176 passed, 1 skipped. 15 tests ingit-kind-reports.test.tsandgit-kind-learnings.test.tshit the 15 s timeout under the parallel run; both files pass on their own (31/31).E2E (
--config vitest.e2e.config.ts), 79 passed:pull-keeps-edits-822,push-sync-followups-823,push-stale-worktree-812,pull-new-worktree-807,doctor-delivery-cli,role-scoped-agents,project-scoped-delivery,import-mr-publish-823.e2e.test.ts,multi-project,scope-isolation-issue85,self-mode-worktrees-808androles-tags-pullalso pass.Real CLI, Claude,
gitprovider, local bare remote. Pull, edit the delivered rule and skill, a teammate changes both, pull again.Before (
a8ab8e00), the edits are gone:After (this branch):
Notes
origin/main(fix: prevent stale Copilot rules from reverting team updates #857, fix(review): print review reject/apply output in English (#836) #859, fix(learnings): publish what an older import --from-mr left in the checkout (#823) #838, then fix(iwiki): stop fetchAllPages from rejecting every space walk before it starts #849, fix(stats): split Windows cwds on the backslash in attributeRepo #858, fix(code-knowledge): keep tree-sitter grammars off V8's optimizing Wasm tier on Node 24 (#860) #861; onlyCHANGELOG.mdconflicted in the second merge). fix: prevent stale Copilot rules from reverting team updates #857's Copilot render in the pre-push rules sync now records what it writes indelivered, like the Cursor.mdcand verbatim writes, so a Copilot rule that push refreshed is updated by the next pull after a team change rather than kept as the member's edit. Covered inpre-push-sync.test.tsand in the fix: prevent stale Copilot rules from reverting team updates #857 e2e (copilot-pre-push-sync.test.ts: push refreshes, the team changes the rule,pullupdates it and prints noKept); both fail without the record. After the merge:npm run lint0 warnings,tscclean, full suite on Node 22 5248 passed / 1 skipped, build OK.Review notes
pull --force), and nothing is lost.