Auto-detect on install; zero manual config; migration via migrateV1ToV2().
Breaking
schema_version: 2is now the default for every config generated bymassu init. Configs withoutschema_versionare interpreted asschema_version: 1and continue to load unchanged — no code changes required for existing projects, but new fields (framework.languages,verification,verification_types,detection.rules) only apply to v2 configs.framework.typeaccepts a new value"multi"for multi-runtime projects, withframework.primaryselecting the dominant language. Single-language projects still useframework.type: typescript | python | rust | ...exactly as before.- Legacy top-level
framework.router / .orm / .uikeys are mirrored fromframework.languages.<primary>on v2 configs. Readers that only consult the top-level keys keep working.
Added
- Auto-detection engine (
packages/core/src/detect/) — pure filesystem introspection across 8 languages (TypeScript, JavaScript, Python, Rust, Swift, Go, Java, Ruby), 9 manifest formats, and ~60 framework/ORM/test-framework signals. No network, no child processes, no database writes. massu initrewrite — detection-driven, zero manual YAML editing. Generatesschema_version: 2configs. New flags:--ci(non-interactive),--force(overwrite without prompt),--template <name>.- 7 project templates —
python-fastapi,python-django,ts-nextjs,ts-nestjs,rust-actix,swift-ios,multi-runtime. Greenfield mode skips detection. migrateV1ToV2(v1Config, detectionResult)pure function (packages/core/src/detect/migrate.ts) — lifts existing v1 configs to v2 while preserving every user override (rules, domains, canonical_paths, accessScopes, analytics, governance, security, team, conventions, etc.).computeFingerprintanddetectDrift(packages/core/src/detect/drift.ts) — SHA-256 fingerprint over normalizedDetectionResultplus a four-axis drift report (language set, per-language framework, manifest set, workspace set).verificationconfig block — per-language overrides for VR-TEST, VR-TYPE, VR-BUILD, VR-SYNTAX, VR-LINT.verification_typesconfig block — register custom VR-* types (e.g.,VR-IBKR-CONTRACT,VR-POLICY) with descriptions.detection.rulesconfig block — add project-specific framework signals or replace built-ins entirely withdetection.disable_builtin: true.- Monorepo detection — identifies
turbo,nx,lerna,pnpm,yarn,bazel,generic,single. Nested workspace support (e.g., turbo outer + pnpm inner). - Atomic config writes —
.tmpfile +renameSync; partial writes never persist. File permissions preserved on overwrite. - Post-init validation — every written config is re-read through Zod and filesystem-checked; invalid configs are rolled back.
- 61 new tests covering 11 fixture repos, 5 stale-config migration snapshots, and 6 drift scenarios.
- Documentation —
docs/auto-detection.mdx,docs/migration/v1-to-v2.mdx,docs/vr-types.mdx,docs/ci-drift-check.mdx,docs/error-handling.mdx.
Changed
massu initoutput now reports detected languages, frameworks, source dirs, and monorepo type explicitly rather than producing a generic TypeScript template.framework.typeshape extended to support multi-runtime viatype: multi+primary: <language>+languages: { <language>: { ... } }.- Pattern scanner allowlist extended to include
detect/monorepo-detector.ts(readspnpm-workspace.yaml, notmassu.config.yaml) andcommands/init.ts(validates the YAML it just wrote).
Fixed
- Stale configs where the declared language didn't match repo reality (multi-runtime stale-config regressions) now fail post-init validation and are rolled back instead of being silently written.
--cimode no longer silently overwrites existing configs — throws"massu init: config exists in --ci mode (no overwrite)". Use--forceto opt in.- Interactive overwrite prompt now defaults to NO (previously defaulted to YES on some terminals).
- Symlink-escape defense: detection filters out any file whose
realpathresolves outsideprojectRoot. - Secret-file exclusion:
.env,.env.,.pem,.key,.aws/,.ssh/,credentials.json,.p12,*.pfxare explicitly excluded from source-dir globbing.
Security
- New detection layer is network-free and database-free by contract. Verified by
grep -rn "better-sqlite3|getMemoryDb|getDataDb|child_process|spawn|execSync|fetch\(" packages/core/src/detect/ → 0 matches. - Atomic writes prevent partial config corruption on write failure.
- CI generalization scanner now runs on every PR to catch hardcoded project-specific data.