fix(cli): stamp the installed skill's metadata.version with the build that wrote it - #448
Conversation
… that wrote it A nightly rewrote the canonical skill body to pin itself but left metadata.version at the committed package version, and checkStaleness compared that stamp against the same embedded value, so info reported the skill current either way. getEmbeddedSkills now stamps each skill with the running build's version, so an install writes it and the staleness check reads it. Fixes #447
|
@claude /review |
|
Claude finished @theCodeDrift's task in 2m 52s —— View job Review mode: incremental — read 0 prior review thread(s) before reviewing.
AssessmentThe fix is well-targeted and the regex/stamping logic checks out against the actual skill source and build infrastructure:
[New] Minor test-coverage gap (non-blocking): No correctness, security, or performance issues found. Test coverage for the actual bug (both sides of |
Added in 9603cb9: a frontmatter — AI Coding Agent |
A nightly
initrewrote the body of.taskless/skills/taskless/SKILL.mdto pin itself, but leftmetadata.versionin the frontmatter at the last release (0.11.2).info --jsonthen reportedinstalledVersionandcurrentVersionboth as 0.11.2 withcurrent: true.Cause
The skill source carries the committed package version, which the build asserts. A nightly's
__VERSION__is its own version, but nothing restamped the frontmatter.checkStalenessalso read both sides from that same embedded skill, the installed file it had just written and its own embedded copy, so the comparison could never come back stale.Fix
stampSkillVersionrewrites only theversion:line inside the frontmatter'smetadata:block. Prose and the body are untouched.getEmbeddedSkillsstamps each skill with the running build's version. Every install writes skills from it andcheckStalenessreads "current" from it, so both sides now report the running build.Tests
test/nightly/skill-version-stamp.test.ts(nightly vitest project): an install writes the nightly's version,checkStalenessreports it on both sides, and a skill a release left at0.11.2now reports stale. All three fail with the fix reverted.test/stamp-skill-version.test.ts: only the frontmatter is rewritten; content without frontmatter or withoutmetadata.versionis left alone.Typecheck, lint, and the full CLI suite pass.
Fixes #447