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>
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>