Commit Graph

3 Commits

Author SHA1 Message Date
Trevin Chow cbe51b6860 fix(cleanup): restore ce-update in legacy flat-install allow-list
Reverts the ce-update removal from 547a41e9. ce-update is a current skill,
but Codex now installs it at the namespaced path
~/.codex/skills/compound-engineering/ce-update. The pre-namespaced flat
path ~/.codex/skills/ce-update is legitimately legacy and must remain in
EXTRA_LEGACY_ARTIFACTS_BY_PLUGIN["compound-engineering"].skills so
cleanupKnownLegacyCodexArtifacts() sweeps it on upgrade.

The invariant test in 547a41e9 had a false premise: it asserted no name in
EXTRA_LEGACY_ARTIFACTS.skills may match a current skill. That conflates
two hazards. STALE_SKILL_DIRS driving a fingerprint-based delete of a
just-installed skill IS a real invariant. EXTRA_LEGACY_ARTIFACTS.skills
driving flat-path cleanup is NOT — current skills whose install path moved
(namespacing, renaming) legitimately appear in that list. Narrow the
invariant test to STALE_SKILL_DIRS only and document the distinction.

Caught by @chatgpt-codex-connector in PR review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 18:06:24 -07:00
Trevin Chow 547a41e96f test(cleanup): guard against legacy registries shadowing current skills
Add an invariant test that fails when a name in STALE_SKILL_DIRS or in
EXTRA_LEGACY_ARTIFACTS_BY_PLUGIN["compound-engineering"].skills matches a
current directory under plugins/compound-engineering/skills/. If a retired
skill is ever re-added to the plugin, the stale registry entry would make
cleanupStaleSkillDirs() fingerprint-match the freshly-installed skill and
delete it on every install.

The test caught a pre-existing collision: ce-update was erroneously seeded
into the legacy artifacts list in #609 even though it has been a live skill
since #538. Remove it from the registry and flip the assertions in
plugin-legacy-artifacts.test.ts and cli.test.ts that were locking in the
buggy behavior (the CLI test was effectively asserting that cleanup would
move a user's live ce-update install into legacy-backup).

Export STALE_SKILL_DIRS so the invariant test can import it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 17:40:35 -07:00
Trevin Chow c2d60b47be refactor(install): prefer native plugin install across targets (#609)
Co-authored-by: John Cavanaugh <cavanaug@users.noreply.github.com>
2026-04-20 18:47:07 -07:00