Skip to content

fix(uninstall): keep repos installed into a tracked repo's legacy group - #900

Merged
runkids merged 2 commits into
mainfrom
runkids/fix-legacy-group-nested-repos
Nov 14, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/fix-legacy-group-nested-repos

Conversation

@runkids

@runkids runkids commented Nov 14, 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 #898

What changed

inLegacyRepoGroup (internal/install/metadata.go) no longer treats an entry whose directory is a tracked repo (_-prefixed basename, such as team/_b) as a legacy member of _team. #880 applied this guard only in unlinkedWith. It now lives in the shared rule, so these all use the same definition:

  • checkout uninstall (RemoveByNames);
  • its trash copy (Extract);
  • declaration-only removal;
  • unlink.

Why

With _team checked out and team/_b only declared (for example, its clone failed on this machine), skillshare uninstall _team -g also removed team/_b's record and audit acceptances. Since #880, reconcile keeps declarations without a checkout but cannot recreate a removed one, so the next push dropped team/_b on every machine. Only trash restore _team brought it back.

Limitation

A legacy record (an old record that names its group but not its full path) of a skill whose own name starts with _ is now treated as an independent repo and kept. #880 already makes this trade-off for unlink and declaration-only removal, and lists it under Limitations.

Verification

  • New TestRemoveByNames case "repo installed into the legacy group stays": failed against the old matcher (kept [], want [team/_b]) and passes with the fix.

  • E2E in an ssenv with the real CLI and local git repos:

    1. install file://…/a --track --name team -g
    2. install file://…/b --track --into team -g
    3. Move team/_b's checkout away.
    4. uninstall _team -g --force

    The old code dropped team/_b from .metadata.json; the fix keeps it.

  • make check in the devcontainer passed (exit 0). It ran on fix(reconcile): keep tracked repo declarations this machine has not cloned #880's head, whose tree is identical to the main this branch starts from.

  • go test ./internal/install ./internal/uninstall ./internal/server passed.

Not run: Windows, website build (no docs change; no doc describes this rule).

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

Uninstalling the _team checkout matched every tracked entry grouped as
"team", so a repo installed with --into team (team/_b) lost its record
and audit acceptances too. Since #880 keeps declarations that have no
checkout on this machine, reconcile could no longer restore that record,
and the next push removed it on every machine; only trash restore of
_team brought it back.

#880 already excluded _-prefixed repo directories from the legacy match
for unlink and declaration-only removal. Move that guard into
inLegacyRepoGroup so checkout uninstall and its trash copy follow the
same rule.

Fixes #898
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-14T05:46:05.183487Z 60a0b38 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 58ccb2b into main Nov 14, 2026
9 checks passed
@runkids
runkids deleted the runkids/fix-legacy-group-nested-repos branch November 15, 2026 17:52
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.

uninstall of a tracked repo also removes independent nested declarations such as team/_b

1 participant