Files
Oz 4b3668c60a Fail closed on an incomplete regen; add regression tests
Review of the previous revision found that pruning by checking whether
a copied path existed under the temp dir failed open: if skills add
exited 0 without actually copying anything (e.g. a broken CLI run),
every warpdotdev/common-skills entry looked stale and got deleted,
while the one entry from another source survived. That result is
worse than the original bug and would auto-merge into warp and
warp-server.

Restructure the fix: regenerate the warpdotdev/common-skills portion
of the lock from scratch in a clean, unseeded temp directory instead
of seeding it with the existing lock and pruning what didn't reappear.
skills add can then only ever emit entries for skills it actually
finds, so nothing stale can survive the merge in the first place.
Entries from any other source are carried over from the existing lock
unmodified. As a backstop, fail closed with a non-zero exit and leave
the existing lock untouched if regenerating produces no
warpdotdev/common-skills entries at all while the existing lock has
some - that is a sign the run didn't discover or copy anything, not
that every skill vanished upstream.

Add scripts/tests/update_common_skills_lock_test.sh, a self-contained
regression suite that runs the real script against a fake npx
(scripts/tests/fake-bin/npx) modeling `skills add ... --copy`
deterministically from a local fixture directory, with no network
access. Covers a rename, a plain deletion, foreign-source
preservation, idempotence, and the fail-closed guard. Wire it into a
new CI workflow that runs on push to main and on every pull request.

Co-Authored-By: Warp Agent <agent@warp.dev>
2026-08-13 15:45:21 +00:00
..