Skip to content

fix(push): send kept skill edits back and place new resources by active projects (#1020, #1021) - #1022

Merged
jeff-r2026 merged 20 commits into
Tencent:mainfrom
SaulMoro:fix/push-active-namespaces
Oct 12, 2026
Merged

jeff-r2026 merged 20 commits into
Tencent:mainfrom
SaulMoro:fix/push-active-namespaces

Conversation

@SaulMoro

@SaulMoro SaulMoro commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1020. Closes #1021.

Summary

Rule: A delivered local copy is resolved against every current same-named team skill: the shared root, all active namespaces, and shadowed or inactive copies. Each local copy remains its own candidate until its recorded origin is proven. Push candidates are keyed by that destination, so edits with different proven destinations are both retained. Flags never prove origin. --skill <path> selects the exact local copy after resolving ~ and symlinks; the skill is named after the directory a symlink points to, and messages name the path as given. New, never-delivered skills keep the current name-based deduplication and placement behavior.

When multiple edited copies prove the same destination, the newest mtime remains the selected copy; on equal mtimes the tool listed first in toolPaths keeps it. A different-content copy left out is named with its path; identical content produces no warning.

Delivered-copy case status scan push --all
Shared-root edit, then a same-named active namespace appears Resolve and retain the root destination Push back to the shared root
Two tools, two proven destinations Retain one candidate per destination Push both destinations
Two tools, same proven destination, different content Keep newest mtime and warn with the copy left out Push the winner and warn
Two tools, same proven destination, identical content Keep one candidate without warning Push once without warning
Requested copy Same-named copy in another tool --skill result
Proven None Select the requested path and send it to its proven team origin.
Proven Pushable Select the requested path and send it to its proven team origin.
Proven Skipped Select the requested path and send it to its proven team origin.
Skipped: no proven origin None Warn with the requested path; push nothing for it.
Skipped: no proven origin Pushable Warn with the requested path; do not fall back to the other copy.
Skipped: no proven origin Skipped Warn with the requested path; push nothing for it.
Not pushable: missing path or SKILL.md None Report that the requested path is not a skill; push nothing for it.
Not pushable: missing path or SKILL.md Pushable Report that the requested path is not a skill; do not fall back to the other copy.
Not pushable: missing path or SKILL.md Skipped Report that the requested path is not a skill; push nothing for it.

R8 — open-PR identity. After the scan, a push item is identified by its type plus its team destination (relativePath). A new, never-delivered resource has no destination until placement, and the scan keeps one per name, so it is identified by name. Every pending record has stored relativePath since records were introduced, so records written by earlier versions match the same way. No migration is needed.

Open PR for svc-b/foo Scan has Result (fresh or earlier-version record)
none svc-a/foo / svc-b/foo / both One new PR with every scanned destination
exists svc-a/foo New PR for svc-a/foo; the svc-b/foo PR is untouched and stays recorded
exists svc-b/foo Update the svc-b/foo PR in place
exists both (either order) Update the svc-b/foo PR; new PR for svc-a/foo

R9 — one copy, one team destination, decided once. A copy's destination comes from its proof: a delivery record, or an open-PR record. Without proof, it is the destination the team tree gives it. The decision is made in one place: resolveDestination (src/resources/skills.ts). The skills scan calls it once per local copy, before copies from several tools are merged, and push --skill <path> calls it for a copy the scan did not return. Both read the team tree through the same readTeamSkillIndex. Its order is delivery record (R1–R7), then open-PR records (openPrDestinations), then team tree. Callers only word why a copy with no destination is left out; --skill also refuses a name it would otherwise pick among several team skills, and asks for --role. Every later step reads that destination and none re-derives it: cross-tool candidate dedup, open-PR matching, pruning, the conflict check, grouping, and the namespace for the write.

Copy Destination Effect
Delivery record proves an origin That origin Unchanged (R1–R7)
New skill whose open PR recorded a destination not yet on the team repo The PR's destination, even after a same-named team skill appears elsewhere and the scan calls the copy an edit of it The copy stays a new skill there and updates its PR; the other skill is not touched
Anything else What the scan resolves Unchanged
Several tools edit copies that resolve to one destination One candidate, recorded or not Newest mtime wins and the copy left out is named. If any copy proves the destination, it stays proven, so --role/--project cannot move it
One tool's new skill awaits review at skills/platform/foo; another tool holds an edited, delivered copy of a newly shared skills/foo Two destinations, decided before the merge Two candidates: the open PR is updated at skills/platform/foo, and the shared-skill edit goes to its own PR. Neither is dropped, whichever is newer

Several open PRs for one name. An open-PR record proves a destination only when it is the only one: a copy teamai never delivered, whose name open PRs hold at more than one destination absent from the team repo, has no proven destination. It fails closed, like an unproven origin.

Open-PR destinations for the name push --all push --skill <path>
One That PR's destination; the PR is updated Same
Several, no selector The copy is left out. The warning names each destination and branch, and the teamai push --skill <path> --role <ns> run that picks one. The records stay, so the next run holds it back again Exit 2 naming each PR
Several, explicit namespace matches one That PR is updated; the other is untouched That PR is updated; the other is untouched
Several, explicit namespace matches none The new namespace is the destination; existing PRs are untouched The new namespace is the destination; existing PRs are untouched

The existing selectors name namespaces only; they cannot select a shared-root PR when another same-name destination is open. An open-PR record's destination is read from its relativePath, which every record has. The optional namespace field is never the only source; records written by earlier versions lack it, and where the two disagree the path wins, because the path is what the PR's branch holds. Every reader derives it the same way, through recordedNamespace. A record at the shared root is a destination like any namespace: reusing its PR keeps the resource there, and placement does not move it.

Open-PR record Active project now resolves Update of that PR writes
skills/svc-a/foo, with or without namespace platform skills/svc-a/foo
rules/foo.md (shared root) platform rules/foo.md

Paths:

  • SkillsHandler.scanLocalForPush keeps all current same-named paths for origin proof and emits delivered candidates under their proven team destination.

  • status and push --all use that scanner. Pending-push retention reads the full scan output.

  • --skill selects by canonical local path. Its force-construction path checks the requested copy against all current team counterparts; createSkillPushItem excludes any recorded copy without a proven origin.

  • Open-PR readers: planPushGroups (reuse grouping), partiallySelectedEntries, findPendingForItem (the preview's "awaiting review" line), pendingNamespaceFor (reuseRecordedDestinations), and the conflict check all match via isRecordedItem.

  • Readers of a record's destination namespace all call recordedNamespace(recorded): pendingNamespaceFor, resolveDestination and the --skill path, the conflict check, the shared-root guard for placed rules and agents, and the rule and agent scans that recognise a pending placement. reuseRecordedDestinations returns the resources it settled, shared root included, and placeNewResources skips them in both the real run and --dry-run.

  • prunePendingPushes keeps a record while any item of its name is scanned. That is a superset of destination matches. A record kept longer is used only through isRecordedItem, while one dropped early would open a duplicate PR, for example after --role moves the scanned path.

  • New-skill deduplication in the scan stays by name (R7). Every edit candidate is keyed by its resolved team destination, whether or not that copy has a delivery record (R9). A proven copy that loses on mtime passes its proof to the winner.

  • resolveDestination gives a copy with no delivery record, and with an open-PR record of its name whose destination is absent from the team repo, that record's destination; the copy is new there. This runs before the team tree is consulted, so a same-named team skill elsewhere, at the shared root or in an inactive namespace, cannot take the copy over. The merge of copies from several tools is keyed by that destination. From then on isRecordedItem matches the copy by name, as it does for any new item. The conflict check, the preview, grouping, partial selection and reuseRecordedDestinations all read that one destination. A record whose destination exists on the team repo is an edit and still matches by path only (R8).

  • --skill on a copy the scan did not return calls resolveDestination, passing the namespace from --role or --project. It resolves the path with realpath first for the skill name, validation and pushed files. Delivery records are found by comparing real paths, then the lexical path pull wrote is passed to resolveDestination; scan-item matching also compares canonical paths.

  • Pending records are pruned in two steps around the scan, because the scan reads them and the presence rule reads the scan. Before the scan, dropClosedPendingPushes drops records whose branch is gone from origin. After it, prunePendingPushes applies the unchanged name-keyed presence rule (see above). Together they keep exactly the records the single prune kept. A copy that takes a record's destination keeps its name, so its record survives. A copy left out for several open PRs stays in the scan with a skipReason, as blocked agents already do, and push drops it before selection with that warning, so both records survive too.

  • teamai status scans without open-PR records, so its listing is unchanged.

  • Rule and agent scans read pending placements by name. That is their proof: a root copy and its namespaced placement share only a name. The shared-root guard for a placed rule or agent keeps its outcome, which is to leave the copy out and leave the open PR untouched. It never writes to another destination.

  • A never-delivered copy whose name has several open-PR destinations is skipped when no selector resolves it. The skills scan receives --role, or the namespace resolved from --project, so it updates a matching PR without warning. If the explicit namespace matches none of the open records, it places the copy in that namespace and leaves the open PRs untouched.

Limits: resolveDestination reads the clone push has just pulled. When that pull fails, every step of the scan reads the previous pull's tree, so they still agree with each other. teamai status does not read open-PR records and still lists such a copy as an edit of the shared skill. It writes nothing.

History proof uses git log --first-parent for the current path lifetime. Git's first-parent mode includes each merge's diff against its first parent, and --no-renames treats renamed paths as separate lifetimes. A shallow clone may prove less history, never more.

Evidence

  • Scanner regression table covers all four R7 cases. The two-tool, distinct-destination case also runs through the built CLI with push --all; both team paths appear on the pushed branch.
  • src/__tests__/e2e/push-active-namespaces.test.ts verifies both destinations from two tools in the real CLI.
  • R8, real CLI (push-active-namespaces.test.ts, "updates the open PR of one destination and opens another"): push the svc-b edit (branch 1 is recorded), then edit both copies and push --all.
    Before (built at the previous head): the preview lists svc-a/a-skill as awaiting review on branch 1, and only one push branch exists afterwards, so the svc-a edit is dropped.
    After: branch 1 holds only skills/svc-b/a-skill/SKILL.md, including the second edit, and a new branch holds only skills/svc-a/a-skill/SKILL.md.
  • R9, real CLI, scenario from the issue flow: a new foo is pushed to platform, a teammate adds a shared-root skills/foo, then the member edits foo and runs push --all.
    Before (built at 2cfbd95):
    1. [skills] foo (modified)
    teamai/push/member/…534: skills/platform/foo/SKILL.md
    teamai/push/member/…536: skills/foo/SKILL.md      <- teammate's shared skill overwritten
    
    After (built at 9265e84):
    1. [skills] foo (new)
       to:   skills/platform/foo
       awaiting review: branch teamai/push/member/…544
    Updating existing PR instead of creating a new one
    teamai/push/member/…544: skills/platform/foo/SKILL.md
    
  • Record without a namespace field, real CLI: a new foo is pushed while platform is active, the record is rewritten as an earlier version stored it ({"type":"skills","name":"foo","relativePath":"skills/platform/foo"}), the member switches to svc-a, edits foo, and runs push --all.
    Before (built at 9265e84):
    1. [skills] foo (new)
       awaiting review: branch teamai/push/member/…348
    Updating existing PR instead of creating a new one: teamai/push/member/…348
    [skills] foo → skills/svc-a/foo
    teamai/push/member/…348: skills/svc-a/foo/SKILL.md      <- open PR moved to svc-a
    
    After (built at 4c55090):
    1. [skills] foo (new)
       awaiting review: branch teamai/push/member/…356
    Updating existing PR instead of creating a new one: teamai/push/member/…356
    teamai/push/member/…356: skills/platform/foo/SKILL.md
    
  • One tool's new skill awaiting review and another tool's edit of a newly shared same-named skill, real CLI. Claude and Codex are enabled. A new foo is pushed from Claude to platform, and a teammate adds a shared-root skills/foo. Codex holds a delivered copy of it (written with its delivery record, as pull records one) and edits it; Claude's foo gets a second edit, and the Codex edit is newer. Then push --all.
    Before (built at 4c55090):
    ⚠ [skills] Skipped foo at …/.claude/skills/foo: another edited copy for skills/foo has newer content.
        1. [skills] foo (modified)
    teamai/push/member/…845: skills/platform/foo/SKILL.md []            <- pending edit dropped
    teamai/push/member/…847: skills/foo/SKILL.md [Codex edit]
    
    After (built at 941e47a):
        1. [skills] foo (new)
           to:   skills/platform/foo
           awaiting review: branch teamai/push/member/…852
        2. [skills] foo (modified)
    ℹ Updating existing PR instead of creating a new one: teamai/push/member/…852
    teamai/push/member/…852: skills/platform/foo/SKILL.md [Second edit]
    teamai/push/member/…854: skills/foo/SKILL.md [Codex edit]
    
  • Several open PRs for one name, real CLI. A new foo is pushed from Claude to platform, edited and pushed with --role svc-a (a second PR). Codex gets its own foo, and Claude's gets a third edit. Then push --all.
    Before (built at 941e47a):
    ⚠ [skills] Skipped foo at …/.codex/skills/foo: another edited copy for skills/svc-a/foo has newer content.
        1. [skills] foo (new)
           to:   skills/svc-a/foo
    ℹ Updating existing PR instead of creating a new one: teamai/push/member/…214
    teamai/push/member/…214 @ 24f308e → 6dc48fb: skills/svc-a/foo/SKILL.md [Second edit Third edit]   <- collapsed onto the newer PR
    
    After (built at f91d0516): the no-selector run still exits 2 naming both PRs. With --skill <path> --role svc-a, the scan emits no ambiguity warning and updates only the svc-a PR. With --skill <path> --role svc-b, it creates a new branch at skills/svc-b/foo and leaves both existing PR tips unchanged.
  • --skill through a symlink, real CLI: alias → elsewhere/my-skill, outside every tool directory, with platform active. At 951b0bce, the alias name failed validation. At f91d0516, push --all --skill <alias> pushed skills/platform/my-skill; the alias was not used as the skill name.
  • Symlinked skills directory, real CLI: pull recorded .claude/skills/a-skill, which resolves to skills-store/a-skill. After switching from svc-a to svc-b, 951b0bce previewed skills/svc-b/a-skill; f91d0516 previews and pushes skills/svc-a/a-skill, leaving the svc-b skill untouched. The fixture remote accepts the branch push but uses an invalid example URL for PR creation, so that final API step reports an error.
  • --skill on a copy the scan left out, real CLI: Claude's foo awaits review at skills/platform/foo, and Codex holds an older copy of its own. push --all --skill .codex/skills/foo warns that the scan skipped that copy for the newer one, then lists to: skills/platform/foo, updates the open PR, and the branch holds the Codex copy. The result is the same at 941e47a and at 951b0bc; this round moved that path onto resolveDestination without changing its result.
  • R9 table: push-active-namespaces.test.ts, "push gives each local copy one team destination, whatever its scan status". Each row targets one site and runs through the built CLI and a real git remote:
    Site Row At 2cfbd95
    Candidate dedup Recorded Claude edit, newer than an unrecorded Codex edit of the same team skill: one write, Claude content, Codex copy named Both written; Codex content won by tool order
    Candidate dedup + flag --role platform with the newer copy unrecorded, in each tool order: newest content lands at the proven skills/svc-a/a-skill Relocated to skills/platform/a-skill
    Candidate dedup, open PR vs delivered copy Claude's foo awaits review at skills/platform/foo; Codex's delivered copy of a new shared skills/foo is edited; Codex newer, then Claude newer: the open branch holds only skills/platform/foo with Claude's edit, and one new branch holds only skills/foo with Codex's At 4c55090: one copy dropped as "another edited copy for skills/foo" in both orders
    Open-PR matching, pruning, grouping, write namespace Scenario above: only the open branch, updated with the edit at skills/platform/foo; skills/foo untouched Second PR overwrote skills/foo
    Preview (findPendingForItem) --dry-run lists to: skills/platform/foo and awaiting review Listed as a modified root skill
    Conflict check --role svc-a reports the collision with skills/platform/foo, opens skills/svc-a/foo, and leaves the open PR as it was No collision reported
    Partial selection --skill on one of the open PR's two skills warns Only part of … and pushes skills/platform/foo Pushed skills/foo
    Open-PR record before team tree A teammate later adds the pending name only in an inactive namespace, or in two legacy namespaces: the open branch is updated at skills/platform/foo, and the teammate's files on it are untouched At 4c55090: skipped (and in legacy mode warned as several team skills), record pruned
    --skill force path, open PR --skill on the older Codex copy the scan left out: the open branch is updated at skills/platform/foo with the Codex copy, as push --all lists it Passes at 941e47a too; guards the move onto resolveDestination
    Several open PRs, push --all PRs at skills/platform/foo and skills/svc-a/foo, copies in Claude and Codex: both branch tips unchanged, one warning per copy naming both PRs, same again on a second run At 941e47a: Claude's copy written onto the newer PR
    Several open PRs, --skill no selector Exits 2 naming both PRs; both tips unchanged Already passed at 951b0bc; row adds coverage
    Several open PRs, explicit matching namespace --skill --role svc-a updates only that PR with no ambiguity warning At 951b0bc, the scan warned about the ambiguity before force construction
    Several open PRs, explicit namespace not recorded --skill --role svc-b and push --all --role svc-b create a new branch at skills/svc-b/foo; both existing tips unchanged At 951b0bc, the scan warned about the ambiguity instead
    Several open PRs, --skill --role --role svc-a, and --role platform: only that PR is updated, the other tip unchanged Pass at 941e47a too (the flag reached that PR)
    --skill symlink (in "push --skill sends a skill…") A link to an unscanned my-skill pushes skills/platform/my-skill, nothing named alias At 941e47a: pushed skills/platform/alias
    Reuse (pendingNamespaceFor) Skill pushed with --role svc-a, record without namespace, active project switched to platform: the open branch is updated in place at skills/svc-a/foo At 9265e84: branch rewritten to skills/platform/foo
    Reuse + placement, shared root Rule pushed to rules/foo.md with no active project, record without namespace, active project switched to platform: the open branch is updated in place at rules/foo.md At 9265e84: branch rewritten to rules/platform/foo.md
  • R8 table: push-pending-pr.test.ts runs {open PR none / exists} × {scan svc-a, svc-b, both in each order} × {current record, record with only type/name/relativePath} through push(). It asserts the branch each destination lands on and the saved records.

Merge Danger

Door: two-way

No delivery-record or pending-record format changes; existing pending records are read as they are. An open-PR record without namespace gives its namespace through its path.

Blast Radius: push

For two edited copies of one proven destination, newest mtime remains the existing choice; a different-content copy left out is now warned about. New, never-delivered skills keep name-based deduplication and placement.

Tests: At merge head 6a0ee5a0c32dbfe178bef04f4643efa991ee92b9, npx tsc --noEmit, npm run lint, npx vitest run (401 files passed, 1 skipped; 8,656 passed, 19 skipped), npm run build, and npm run test:e2e -- src/__tests__/e2e/push-active-namespaces.test.ts (87 passed) passed. npx vitest run commands-reference -u passed (1 test; no generated diff). A built-CLI temp-HOME run pulled a delivered skill, kept its edit after switching from svc-a to svc-b, then push --all showed the edit targeting skills/svc-a/kept-skill and a new skill targeting skills/svc-b/new-skill; the pushed branch contained both. The CLI exited 1 after successfully pushing because the local-path remote in this fixture is not a valid hosted PR URL; the branch contents were verified directly.

…he first directory holding its name

The force-constructed item took the first namespace directory, in directory
order, that held the skill's name, so an unchanged svc-a copy pushed with
--skill overwrote skills/archive/<name>. It now uses the same recorded-origin
rule as the scan, and asks for --role when several namespaces hold a name it
never delivered.
@jeff-r2026 jeff-r2026 self-assigned this Oct 10, 2026
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/resources/skills.ts:603 ignores inactive copies whenever an active namespace contains the same skill name. After switching from svc-a to svc-b, an edited copy originally delivered from svc-a is therefore classified as svc-b and overwrites skills/svc-b/<name> instead of returning to svc-a.
  • [P1 blocking] src/resources/skills.ts:400 guesses the sole candidate even when its history does not match the delivery record. If the original skill was deleted and an unrelated inactive namespace later adds the same name, pushing the retained edit overwrites that unrelated skill. A recorded copy should only resolve when exactly one history match exists.
  • [P1 blocking] src/push.ts:173 treats configured active projects as providing no namespaces when manifest/projects.yaml is absent. A new rule then falls back to rules/<name>.md, sharing it with everyone; this should fail closed just like an active project missing from an existing manifest.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for a runtime behavior change.

…hout the projects manifest

- Compare a delivered copy with every inactive namespace holding its name,
  also when an active namespace has one too, so an edit made before a switch
  goes back to the namespace it came from.
- Resolve a recorded copy only when its recorded version matches exactly one
  team skill; a lone same-named skill that replaced a deleted one is skipped
  with a warning, and `push --skill` asks for --role.
- Look up the delivery record of `push --skill` under the real path pull
  records it by.
- Stop placing a new resource when projects are active but the team repo has
  no manifest/projects.yaml, instead of sending it to the shared root.
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/resources/skills.ts:373 still fails open when active projects cannot be resolved. With projects: [svc-b] and a missing manifest/projects.yaml (or unknown project ID), a newly created local skill whose name exists under skills/svc-a/ enters legacy unfiltered scanning, is classified as a modification, and overwrites the unrelated svc-a skill instead of exiting 2. The unresolved project state must also prevent this scan path from treating every namespace as active.

Resolved

  • The three previously reported scenarios are fixed in the current diff: active/inactive duplicate origin selection, lone nonmatching history fallback, and new-rule placement when the projects manifest is absent.

Testing

  • The PR description includes sufficient real-CLI/e2e evidence for this runtime behavior change.

A delivered skill whose record matches no single same-named team skill is
skipped wherever those skills are, an open PR is reused only for the same
destination, push --skill ties a never-delivered copy only to a skill this
directory receives, and unresolved active projects stop a push without
--role or --project before anything is scanned.
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/resources/delivered-copies.ts:177 searches the entire path history across deletion boundaries. If skills/svc-a/foo was delivered, deleted, then recreated at the same path as an unrelated skill, the old recorded hash still matches history and push overwrites the recreated skill.
  • [P1 blocking] src/resources/skills.ts:817 classifies a retained delivered edit as new when its original team skill was deleted and no same-named copy currently exists. A normal push then silently relocates/resurrects it under the active project or role instead of rejecting the now-unproven origin.

Resolved

  • The exact previously reported duplicate-origin, nonmatching replacement at another path, and unresolved-project scan scenarios are fixed.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.

@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/push.ts:1459 can bypass the new origin validation for --skill. If the requested delivered copy is skipped because its origin was deleted/recreated, but another configured tool contains a pushable skill with the same basename, the name-only match selects that other copy before force construction. teamai push --skill <requested-path> then pushes the wrong local directory and may overwrite an unrelated current team skill instead of rejecting the requested copy.

Resolved

  • All previously reported origin-selection, history-boundary, deleted-origin, and unresolved-project scenarios are fixed in the current diff.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.

@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/resources/skills.ts:646 drops shadowed current copies from origin resolution. If a member edits shared-root foo, then an active skills/svc-b/foo is added, pull keeps the edit, but push replaces the root candidate with svc-b and tests the delivery record only against that copy. It then skips the valid edit instead of returning it to skills/foo. Origin proof must consider every current same-named copy, including shadowed root and additional active namespaces.
  • [P1 blocking] src/resources/skills.ts:826 still collapses candidates from all tools by skill name. If Claude retains an edited svc-a/foo while Codex receives and edits svc-b/foo, both have proven distinct origins, but the newer mtime replaces the other foo candidate. push --all silently pushes only one edit; candidates must be keyed by proven origin/destination rather than basename alone.

Resolved

  • The previously reported --skill wrong-copy fallback is fixed: selection now requires the canonical requested source path and does not fall back by basename.
  • The earlier origin-history, deleted/recreated path, and unresolved-project findings remain resolved.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.

@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/resources/skills.ts:854 now emits multiple skill items with the same type/name but different destinations, while open-PR bookkeeping still keys resources only by type:name. If svc-b/foo already has an open PR and the next scan includes edits for both svc-a/foo and svc-b/foo, planPushGroups claims the shared skills:foo key and silently omits one edit, or the conflict check opens a duplicate PR. Pending identity must include the proven destination.

Resolved

  • The previously reported shadowed-root origin resolution and two-tool candidate deduplication issues are fixed in the current diff.
  • Earlier origin-history, deleted/recreated path, unresolved-project, and exact --skill selection findings remain resolved.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.

A scan can carry same-named skills for two namespaces. Open-PR bookkeeping
keyed records by type and name, so an open PR for one destination claimed
the other's edit (dropping it) or the conflict check opened a duplicate PR.
Records are now matched by their recorded destination, and a new resource
by name. Pruning keeps a record while its name is still scanned.

The skip warning for an undelivered copy of a name several namespaces hold
now names the `push --skill <path> --role <ns>` run that sends it; the scan
never sees --role. The mtime-order scanner test sets the file mtime, which is
what decides the newest copy.
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/utils/pending-push.ts:37 loses an open PR’s destination when a new same-named team skill appears elsewhere. For example, while a new skills/svc-b/foo awaits review, a teammate adds shared-root skills/foo; the next scan classifies the retained local copy as a modified root skill, so it no longer matches the pending svc-b record and a new PR overwrites the unrelated shared skill. Pending destination must disambiguate this copy even after its scan status changes from new to modified.
  • [P1 blocking] src/resources/skills.ts:855 keys modified candidates by destination only when that particular copy has a delivery record. If two tools edit the same unique team skill but only one has a record—for example, one was delivered normally and the other predates records or was copied manually—the scanner emits both candidates for the same destination. push --all then writes them sequentially, silently choosing tool order rather than the newest mtime.

Resolved

  • The previously reported open-PR collision between two already-proven destinations is fixed: pending matching now distinguishes modified items by relativePath.
  • Earlier origin-history, deleted/recreated path, unresolved-project, exact --skill, shadowed-root, and cross-tool destination findings remain resolved.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.

A new skill awaiting review kept its open PR only while the scan called it
new. Once a teammate added a same-named shared-root skill, the scan resolved
the copy to that skill as an edit, the open-PR record no longer matched, and a
new PR overwrote the shared skill. The copy now takes the destination its open
PR recorded, once, before flags and every later step read it.

Edits of one team skill from several tools were one candidate only when each
copy had a delivery record; otherwise both were written in tool order. Every
edit is now keyed by the destination it resolves to, so the newest copy wins
and the other is named. A destination one copy proves stays proven whichever
copy wins, so --role or --project cannot move it.
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/utils/pending-push.ts:168 returns only the optional recorded namespace instead of deriving it from relativePath. For an older pending record containing relativePath: skills/platform/foo but no namespace, if foo remains absent from the default branch and the active project later resolves to svc-a, the branch is reused but placement moves the resource to skills/svc-a/foo, force-pushing the existing PR to the wrong destination. Reuse must recover platform from the recorded path.

Resolved

  • All findings from the earlier review passes are resolved in the current diff.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.

A record written before the namespace field existed carries only its path.
Reusing its branch fell through to placement, which force-pushed the PR to
whatever namespace the active project now resolves. Every reader derives the
recorded namespace from relativePath, and a resource whose open PR decided
its destination, the shared root included, is no longer placed again.
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/resources/skills.ts:856 deduplicates copies using the destination inferred from the current team tree before adoptOpenPrDestinations applies open-PR provenance. For example, if Claude’s foo awaits review at skills/platform/foo, then Codex receives and edits a newly added shared skills/foo, both copies initially resolve to skills/foo and one is discarded. push --all can therefore omit the pending platform edit or push its content over the shared skill. Pending destinations must be applied before cross-tool candidate deduplication.

Resolved

  • The findings from the earlier review passes are fixed in the current diff.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for a runtime behavior change.
  • Per instruction, I reviewed the diff without running or building PR code.

An open PR's destination was applied after the scan had already merged copies
from several tools by the destination the team tree gave them. A new skill
awaiting review in one tool and another tool's edit of a newly shared skill of
the same name both resolved to the shared skill, and one was dropped: push
either lost the pending edit or sent it over the shared skill.

The skills scan now decides each copy's destination once, before any merge, in
order of proof: delivery record, open-PR record, team tree. Records whose
branch is gone are dropped before the scan; the scan-presence rule still runs
after it.
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/utils/pending-push.ts:64 assigns every same-named local copy to the newest absent open-PR destination. After creating separate platform/foo and svc-a/foo PRs—an explicitly supported conflict flow—two tools can retain different foo copies; the next unflagged push --all collapses both onto the newer PR, and the newer-mtime copy can overwrite that branch with content intended for the other destination. Multiple pending destinations must remain distinct or be treated as ambiguous.
  • [P1 blocking] src/push.ts:1484 does not canonicalize a force-constructed --skill path. If /tmp/alias is a symlink to an unscanned /real/my-skill, the command derives the name alias, searches for team skill alias, and pushes skills/<namespace>/alias instead of the documented symlink target my-skill. Resolve the path before deriving the name and constructing the item.

Resolved

  • The previously reported pending-destination-before-deduplication issue is fixed in the current diff.
  • Earlier origin-history, namespace resolution, exact-copy selection, and destination identity findings remain resolved.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.
  • Per instruction, I reviewed the diff without running or building PR code.

Lift resolveDestination to module level so the skills scan and
push --skill share one order of proof: delivery record, open-PR
record, team tree. A new skill whose name awaits review at several
destinations is held back with a warning instead of joining the newest
PR; --skill <path> --role <ns> picks one. --skill follows a symlink
before naming the skill.
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/push.ts:1503 looks up delivery hashes using the canonical realpath, although pull records paths using the configured lexical destination. If .claude/skills is a symlink, an unchanged delivered svc-a/foo can lose its origin after switching to svc-b; explicit --skill then classifies it as svc-b/foo and overwrites that unrelated skill.
  • [P2 non-blocking] src/push.ts:1441 still validates the symlink alias basename before resolving its target. A valid target such as my-skill cannot be pushed through an alias containing spaces or other characters invalid in resource names, despite the new behavior naming skills after the target directory.
  • [P2 non-blocking] src/resources/skills.ts:760 cannot select a shared-root destination when several open PRs exist for one name. After PRs are opened for both skills/foo and skills/svc-a/foo, unflagged --skill is ambiguous while --role can only match svc-a; there is no way to update the root PR without first closing another PR.
  • [P2 non-blocking] src/push.ts:1368 does not pass an explicit --role into the skills scan. In the documented multiple-open-PR flow, push --skill <path> --role svc-a first warns that the copy was skipped and tells the user to run the command already being executed, before force construction subsequently pushes it.

Resolved

  • The findings from all earlier review passes are fixed in the current diff.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change.
  • Per instruction, I reviewed the diff without running or building PR code.

@github-actions

Copy link
Copy Markdown

Findings

  • [P2 non-blocking] src/resources/skills.ts:762 still provides no selector for a shared-root PR when another same-named namespaced PR exists. With open PRs for skills/foo and skills/svc-a/foo, an unflagged --skill exits as ambiguous, while --role can select only svc-a or create another namespace. The root PR cannot be updated until the other PR is closed.

Resolved

  • The prior symlink delivery-record lookup, alias validation, explicit-role scan warning, and wrong-copy fallback findings are fixed in the current diff.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime change; the final commit changes only the English and Chinese member guides.

@github-actions

Copy link
Copy Markdown

Findings

  • [P2 non-blocking] src/resources/skills.ts:762 still cannot select a shared-root open PR when another same-named namespaced PR exists. With pending PRs for skills/foo and skills/svc-a/foo, no selector is ambiguous, while --role/--project can only match a namespace; the root PR cannot be updated until the other PR is closed.

Resolved

  • The previously reported blocking origin-resolution, history-boundary, symlink, pending-identity, and cross-tool deduplication issues are fixed in the current diff.

Testing

  • The PR description provides sufficient real-CLI/e2e evidence for this runtime behavior change. Per instruction, I did not run or build the PR code.

@jeff-r2026
jeff-r2026 merged commit 0ae8d0f into Tencent:main Oct 12, 2026
14 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
…ve projects (Tencent#1020, Tencent#1021) (Tencent#1022)

* fix(push): send kept skill edits back and place new resources by active projects (Tencent#1020, Tencent#1021)

* fix(push): keep a kept skill's namespace under --role/--project, and warn only for an edited ambiguous copy

* fix(push): tell a kept skill's origin by its recorded version, and leave unedited copies out

* fix(push): resolve a --skill copy by its recorded origin instead of the first directory holding its name

The force-constructed item took the first namespace directory, in directory
order, that held the skill's name, so an unchanged svc-a copy pushed with
--skill overwrote skills/archive/<name>. It now uses the same recorded-origin
rule as the scan, and asks for --role when several namespaces hold a name it
never delivered.

* fix(push): trust only a recorded match for a kept skill, and stop without the projects manifest

- Compare a delivered copy with every inactive namespace holding its name,
  also when an active namespace has one too, so an edit made before a switch
  goes back to the namespace it came from.
- Resolve a recorded copy only when its recorded version matches exactly one
  team skill; a lone same-named skill that replaced a deleted one is skipped
  with a warning, and `push --skill` asks for --role.
- Look up the delivery record of `push --skill` under the real path pull
  records it by.
- Stop placing a new resource when projects are active but the team repo has
  no manifest/projects.yaml, instead of sending it to the shared root.

* fix(push): send a resource only where its origin or namespace is proven

A delivered skill whose record matches no single same-named team skill is
skipped wherever those skills are, an open PR is reused only for the same
destination, push --skill ties a never-delivered copy only to a skill this
directory receives, and unresolved active projects stop a push without
--role or --project before anything is scanned.

* fix(push): constrain unproven namespace selection

* fix(push): preserve recorded skill origins across push paths

* fix(push): reject delivered skills without a live origin

* test(push): cover merge-based skill lifetimes

* fix(push): honor exact --skill path selection

* fix(push): retain edits by proven skill origin

* fix(push): match open PRs by destination, not by skill name

A scan can carry same-named skills for two namespaces. Open-PR bookkeeping
keyed records by type and name, so an open PR for one destination claimed
the other's edit (dropping it) or the conflict check opened a duplicate PR.
Records are now matched by their recorded destination, and a new resource
by name. Pruning keeps a record while its name is still scanned.

The skip warning for an undelivered copy of a name several namespaces hold
now names the `push --skill <path> --role <ns>` run that sends it; the scan
never sees --role. The mtime-order scanner test sets the file mtime, which is
what decides the newest copy.

* fix(push): keep one team destination per local skill copy

A new skill awaiting review kept its open PR only while the scan called it
new. Once a teammate added a same-named shared-root skill, the scan resolved
the copy to that skill as an edit, the open-PR record no longer matched, and a
new PR overwrote the shared skill. The copy now takes the destination its open
PR recorded, once, before flags and every later step read it.

Edits of one team skill from several tools were one candidate only when each
copy had a delivery record; otherwise both were written in tool order. Every
edit is now keyed by the destination it resolves to, so the newest copy wins
and the other is named. A destination one copy proves stays proven whichever
copy wins, so --role or --project cannot move it.

* fix(push): read an open PR's destination from its recorded path

A record written before the namespace field existed carries only its path.
Reusing its branch fell through to placement, which force-pushed the PR to
whatever namespace the active project now resolves. Every reader derives the
recorded namespace from relativePath, and a resource whose open PR decided
its destination, the shared root included, is no longer placed again.

* fix(push): decide each skill copy's destination before merging copies

An open PR's destination was applied after the scan had already merged copies
from several tools by the destination the team tree gave them. A new skill
awaiting review in one tool and another tool's edit of a newly shared skill of
the same name both resolved to the shared skill, and one was dropped: push
either lost the pending edit or sent it over the shared skill.

The skills scan now decides each copy's destination once, before any merge, in
order of proof: delivery record, open-PR record, team tree. Records whose
branch is gone are dropped before the scan; the scan-presence rule still runs
after it.

* fix(push): decide a skill copy's destination in one place

Lift resolveDestination to module level so the skills scan and
push --skill share one order of proof: delivery record, open-PR
record, team tree. A new skill whose name awaits review at several
destinations is held back with a warning instead of joining the newest
PR; --skill <path> --role <ns> picks one. --skill follows a symlink
before naming the skill.

* fix(push): preserve skill origin through linked paths

* docs(push): clarify open-PR namespace selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants