Skip to content

Fix v1→v2 migration detection with marker-based checks#15

Merged
bguidolim merged 1 commit intomainfrom
fix/v1-v2-migration-detection
Feb 21, 2026
Merged

Fix v1→v2 migration detection with marker-based checks#15
bguidolim merged 1 commit intomainfrom
fix/v1-v2-migration-detection

Conversation

@bguidolim
Copy link
Collaborator

@bguidolim bguidolim commented Feb 21, 2026

Summary

  • Detect v1 (bash installer) files by checking for v2 markers — hooks must contain # --- mcs:hook-extensions ---, commands must contain <!-- mcs:managed -->. Absence triggers reinstall on mcs install.
  • Add bundled source comparison to SkillFreshnessCheck so updated skills in new binary versions are detected even when manifest-vs-installed hashes match.
  • Simplify doctor --fix to cleanup/migration/permissions only. Additive operations (install/register/copy) are now exclusively mcs install's responsibility to prevent inconsistent manifest state.

Test plan

  • swift build succeeds
  • swift test passes (201 tests)
  • mcs doctor on a v1 machine flags legacy hooks (FAIL), commands (WARN), and updated skills (WARN)
  • mcs doctor --fix only fixes permissions, does not install/replace files
  • mcs install on a v1 machine replaces legacy hooks and commands, prompts for branch prefix
  • After install, continuous learning fragment is injected into session_start.sh

- Add extension marker detection to HookCheck so v1 hooks (missing
  `# --- mcs:hook-extensions ---`) are flagged and replaced on install
- Add managed marker (`<!-- mcs:managed -->`) to command templates and
  CommandFileCheck so v1 commands trigger reinstall
- Add bundled source comparison to SkillFreshnessCheck so updated skills
  in new binary versions are detected even when manifest hashes match
- Simplify doctor --fix to cleanup/migration/permissions only; additive
  operations (install/register/copy) deferred to `mcs install` to avoid
  inconsistent manifest state
- Remove dead `fixAction` property from CommandCheck
- Add responsibility boundary documentation to CoreDoctorChecks header
@bguidolim bguidolim merged commit 1ffbf02 into main Feb 21, 2026
1 check passed
@bguidolim bguidolim deleted the fix/v1-v2-migration-detection branch February 21, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant