fix(upgrade): regenerate built-in SKILL.md when bundled template drifts (PROP-337 v1)#121
Open
fix(upgrade): regenerate built-in SKILL.md when bundled template drifts (PROP-337 v1)#121
Conversation
…ts (PROP-337 v1)
The non-destructive `migrateBuiltinSkills` only writes SKILL.md files
that don't already exist. When the inline template in
`installBuiltinSkills` is updated in a new release, existing installs
never see the new content — the fix lives only in fresh installs.
This adds `BuiltinSkillRegenerator` and a new
`migrateBuiltinSkillRegeneration` step that:
- Renders the bundled template into a tempdir by invoking
`installBuiltinSkills` (no refactor of the 1187-line function
needed).
- Records the SHA-256 of each installed skill in
`.instar/state/builtin-skill-fingerprints.json`.
- On each migrator run, compares on-disk hash against
fingerprint+bundled hash:
missing -> install
on-disk == bundled -> in sync (refresh fingerprint)
on-disk == fp -> safe regenerate, update fingerprint
else -> user-customized, preserve, seed fp on
first observe
- Custom skills are never enumerated, so they're untouchable.
7 unit tests cover install, idempotency, regenerate-on-template-bump,
preserve-user-customizations, first-observe seeding, and dry-run.
All 71 existing PostUpdateMigrator tests still pass.
PROP-337 — was chronic for 21 cycles. Citation: "Upgrade process does
not regenerate on-disk gate/skill files". v1 covers SKILL.md drift;
hooks already overwrite unconditionally so they're not in scope.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes Portal-tracked PROP-337 — chronic for 21 cycles. The non-destructive
migrateBuiltinSkillsonly writes SKILL.md files that don't already exist; when the inline template ininstallBuiltinSkillsis updated in a new release, existing installs never see the new content. The fix lives only in fresh installs, which is exactly the drift gap PROP-337 names.This adds
BuiltinSkillRegeneratorand a newmigrateBuiltinSkillRegenerationstep inPostUpdateMigratorthat:installBuiltinSkills(no refactor of the 1187-line function needed)..instar/state/builtin-skill-fingerprints.json.missing→ installon-disk == bundled→ in sync (refresh fingerprint)on-disk == fp→ safe regenerate, update fingerprintelse→ user-customized, preserve, seed fp on first observeHooks already overwrite unconditionally (verified) so they're out of scope for this PROP — the gap was SKILL.md drift only.
Test plan
PostUpdateMigratortests still pass.Cross-repo close-out
Portal-side
upstream-prop-watcheris registered against this branch (commit33c0c353, filesrc/core/BuiltinSkillRegenerator.ts). Once this PR merges tomain, the nextcycle-escalatorrun auto-flips PROP-337 toCOMPLETEDin Portal's evolution queue — closing the cross-repo loop the chronic detector kept reopening.🤖 Generated with Claude Code