massu config CLI surface + drift detection runtime. Unblocks the config-migration workflow for downstream repos. Additive only — no breaking changes.
Added
massu config <sub>— new top-level command tree dispatched frompackages/core/src/cli.ts. Five subcommands:- Session-start drift banner —
packages/core/src/hooks/session-start.tsnow emits a plain-text banner whenconfig.detection.fingerprintdisagrees with the current detected fingerprint. Silent on v1 configs (no stored fingerprint = no banner). Best-effort; never throws. detection.fingerprintauto-stamp —buildConfigFromDetection,config refresh, andconfig upgradeall stamp a deterministic SHA-256 stack fingerprint into the generated config.- +35 tests covering refresh (
config-refresh.test.ts, 11 cases), upgrade CLI (config-upgrade-cli.test.ts, 8 cases), check-drift (config-check-drift.test.ts, 5 cases), CLI dispatcher (cli-dispatcher.test.ts, 5 cases), session-start drift banner (session-start-drift.test.ts, 3 cases). Total suite: 1331 tests passing.
Changed
- Legacy CLI entry points (
massu init,massu doctor,massu install-hooks,massu install-commands,massu validate-config) are preserved verbatim.massu config {validate,doctor}are aliases that route to the same handlers. - Pattern scanner allowlist extended to include
commands/config-{refresh,upgrade,check-drift}.ts— same rationale as existinginit.ts/doctor.tsexemptions (raw YAML parse is required becausegetConfig()caches againstprocess.cwd()and Zod-rejects pre-migration v1 configs). packages/core/dist/hooks/session-start.jsbundle size: ~80KB → ~306KB (bundlesfast-glob+smol-tomlfor runtime detection). Still compiles in <30ms via esbuild.
Fixed
docs/plans/2026-04-19-autodetect-zero-config.mdPhase 4 and Phase 5 are no longer deferred. The sibling plandocs/plans/2026-04-19-config-migration.mdcan now proceed.