@massu/core 2.5.2 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/agents/massu-output-scorer.md +2 -2
  3. package/agents/massu-plan-auditor.md +1 -1
  4. package/commands/_shared-references/test-first-protocol.md +4 -4
  5. package/commands/_shared-references/verification-table.md +5 -5
  6. package/commands/massu-audit-deps.md +2 -2
  7. package/commands/massu-batch.md +3 -3
  8. package/commands/massu-checkpoint.md +7 -7
  9. package/commands/massu-ci-fix.md +1 -1
  10. package/commands/massu-cleanup.md +16 -16
  11. package/commands/massu-commit.md +7 -7
  12. package/commands/massu-create-plan.md +7 -7
  13. package/commands/massu-dead-code.md +3 -3
  14. package/commands/massu-debug/references/common-shortcuts.md +1 -1
  15. package/commands/massu-debug/references/investigation-phases.md +4 -4
  16. package/commands/massu-debug/references/report-format.md +2 -2
  17. package/commands/massu-deploy.md +1 -1
  18. package/commands/massu-deps.md +5 -5
  19. package/commands/massu-doc-gen.md +3 -3
  20. package/commands/massu-docs.md +6 -6
  21. package/commands/massu-estimate.md +3 -3
  22. package/commands/massu-golden-path/references/competitive-mode.md +2 -2
  23. package/commands/massu-golden-path/references/phase-1-plan-creation.md +1 -1
  24. package/commands/massu-golden-path/references/phase-2-implementation.md +2 -2
  25. package/commands/massu-golden-path/references/phase-4-commit.md +3 -3
  26. package/commands/massu-golden-path/references/phase-5-push.md +5 -5
  27. package/commands/massu-guide.md +3 -3
  28. package/commands/massu-hotfix.md +14 -14
  29. package/commands/massu-loop/references/checkpoint-audit.md +3 -3
  30. package/commands/massu-loop/references/iteration-structure.md +3 -3
  31. package/commands/massu-loop/references/loop-controller.md +5 -5
  32. package/commands/massu-loop/references/plan-extraction.md +4 -4
  33. package/commands/massu-loop/references/vr-plan-spec.md +3 -3
  34. package/commands/massu-loop-playwright.md +5 -5
  35. package/commands/massu-loop.md +1 -1
  36. package/commands/massu-new-feature.md +6 -24
  37. package/commands/massu-perf.md +1 -1
  38. package/commands/massu-plan.md +21 -21
  39. package/commands/massu-push-light.md +9 -9
  40. package/commands/massu-recap.md +1 -1
  41. package/commands/massu-refactor.md +8 -8
  42. package/commands/massu-release.md +3 -3
  43. package/commands/massu-review.md +1 -1
  44. package/commands/massu-rollback.md +6 -6
  45. package/commands/massu-scaffold-page.md +1 -1
  46. package/commands/massu-scaffold-router.md +1 -1
  47. package/commands/massu-status.md +9 -9
  48. package/commands/massu-tdd.md +2 -2
  49. package/commands/massu-test.md +13 -13
  50. package/commands/massu-verify-playwright.md +1 -1
  51. package/commands/massu-verify.md +20 -20
  52. package/dist/cli.js +1265 -876
  53. package/dist/hooks/auto-learning-pipeline.js +517 -56
  54. package/dist/hooks/classify-failure.js +495 -47
  55. package/dist/hooks/cost-tracker.js +65 -27
  56. package/dist/hooks/fix-detector.js +496 -47
  57. package/dist/hooks/incident-pipeline.js +72 -28
  58. package/dist/hooks/intent-suggester.js +65 -27
  59. package/dist/hooks/memory-recall.js +65 -27
  60. package/dist/hooks/post-edit-context.js +65 -27
  61. package/dist/hooks/post-tool-use.js +70 -29
  62. package/dist/hooks/pre-compact.js +65 -27
  63. package/dist/hooks/pre-delete-check.js +65 -27
  64. package/dist/hooks/pre-tool-use-gate.js +193 -37
  65. package/dist/hooks/quality-event.js +65 -27
  66. package/dist/hooks/rule-enforcement-pipeline.js +65 -27
  67. package/dist/hooks/security-gate.js +197 -38
  68. package/dist/hooks/session-end.js +68 -27
  69. package/dist/hooks/session-start.js +116 -61
  70. package/dist/hooks/user-prompt.js +65 -27
  71. package/docs/SECURITY.md +1 -1
  72. package/fragments/feature-components.md +15 -0
  73. package/fragments/feature-components.python.md +15 -0
  74. package/fragments/feature-components.typescript.md +15 -0
  75. package/package.json +6 -5
  76. package/patterns/testing-patterns.md +8 -8
  77. package/protocols/plan-implementation.md +2 -2
  78. package/protocols/verification.md +4 -4
  79. package/reference/lessons-learned.md +4 -4
  80. package/reference/vr-verification-reference.md +9 -9
  81. package/templates/aspnet/massu.config.yaml +2 -0
  82. package/templates/go-chi/massu.config.yaml +2 -0
  83. package/templates/multi-runtime/massu.config.yaml +4 -2
  84. package/templates/phoenix/massu.config.yaml +2 -0
  85. package/templates/python-django/massu.config.yaml +3 -1
  86. package/templates/python-fastapi/massu.config.yaml +3 -1
  87. package/templates/python-flask/massu.config.yaml +3 -1
  88. package/templates/rails/massu.config.yaml +4 -2
  89. package/templates/rust-actix/massu.config.yaml +2 -0
  90. package/templates/spring/massu.config.yaml +2 -0
  91. package/templates/swift-ios/massu.config.yaml +3 -1
  92. package/templates/ts-nestjs/massu.config.yaml +2 -0
  93. package/templates/ts-nextjs/massu.config.yaml +2 -0
@@ -453,7 +453,7 @@ it('should update order', () => {
453
453
  {
454
454
  "lint-staged": {
455
455
  "*.{ts,tsx}": [
456
- "npm run test -- --related --run",
456
+ "{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} -- --related --run",
457
457
  "npm run type-check",
458
458
  "npm run lint --fix"
459
459
  ]
@@ -465,16 +465,16 @@ it('should update order', () => {
465
465
 
466
466
  ```bash
467
467
  # Before starting work
468
- git pull origin main && npm install && npm run test
468
+ git pull origin main && npm install && {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
469
469
 
470
470
  # During development
471
- npm run test -- --watch
471
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} -- --watch
472
472
 
473
473
  # Before committing
474
- npm run test && npm run type-check && npm run lint
474
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} && npm run type-check && npm run lint
475
475
 
476
476
  # Before pushing
477
- npm run build
477
+ {{verify.build | default("(this stack declares no build step)")}}
478
478
  ```
479
479
 
480
480
  ---
@@ -558,11 +558,11 @@ it('should submit form', async () => {
558
558
  | Payment processing | E2E | `tests/e2e/critical/` |
559
559
 
560
560
  ```bash
561
- npm run test # All unit + integration tests
562
- npm run test -- --watch # Watch mode
561
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} # All unit + integration tests
562
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} -- --watch # Watch mode
563
563
  npm run test:e2e # E2E tests
564
564
  npm run type-check # TypeScript validation
565
- npm run build # Verify production build
565
+ {{verify.build | default("(this stack declares no build step)")}} # Verify production build
566
566
  ```
567
567
 
568
568
  ---
@@ -156,8 +156,8 @@ If plan says "Add to pages: A, B, C, D, E":
156
156
 
157
157
  ### Step 5: Run Build and Type Check
158
158
  ```bash
159
- npm run build # VR-BUILD
160
- npx tsc --noEmit # VR-TYPE
159
+ {{verify.build | default("(this stack declares no build step)")}} # VR-BUILD
160
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} # VR-TYPE
161
161
  ```
162
162
 
163
163
  ### Step 6: Complete Verification Template
@@ -15,9 +15,9 @@
15
15
  | VR-FILE | `ls -la [path]` | File exists | Claiming file created |
16
16
  | VR-GREP | `grep "[pattern]" [file]` | Match found | Claiming code added |
17
17
  | VR-NEGATIVE | `grep -rn "[old]" src/` | 0 matches | Claiming removal |
18
- | VR-BUILD | `npm run build` | Exit 0 | Claiming production ready |
19
- | VR-TYPE | `npx tsc --noEmit` | 0 errors | Claiming type safety |
20
- | VR-TEST | `npm test` | All pass | Claiming tested |
18
+ | VR-BUILD | `{{verify.build | default("(this stack declares no build step)")}}` | Exit 0 | Claiming production ready |
19
+ | VR-TYPE | `{{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}` | 0 errors | Claiming type safety |
20
+ | VR-TEST | `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}` | All pass | Claiming tested |
21
21
  | VR-DEPLOY | `./scripts/pre-deploy-check.sh` | All pass | Claiming deployable |
22
22
  | VR-SCHEMA | `SELECT ... FROM information_schema` | Matches expectation | Before DB operations |
23
23
  | VR-COUNT | `grep -c "[pattern]" [file]` | Expected count | Verifying all instances |
@@ -358,7 +358,7 @@ After any verification run, if issues found:
358
358
 
359
359
  **Verification (VR-TEST):**
360
360
  ```bash
361
- npm test
361
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
362
362
  # Expected: Exit 0, ALL tests pass
363
363
  # If ANY test fails, work is NOT complete
364
364
  ```
@@ -47,7 +47,7 @@
47
47
  - Application completely broken for all users
48
48
 
49
49
  **Root Cause:**
50
- - Did not run `npm run build` before pushing previous commit
50
+ - Did not run `{{verify.build | default("(this stack declares no build step)")}}` before pushing previous commit
51
51
  - Assumed partial checks (type-check, prevention tests) were sufficient
52
52
  - Did not analyze full import graph for client/server separation
53
53
  - Did not test production build locally before deploying
@@ -59,9 +59,9 @@
59
59
  - Zero users could access application
60
60
 
61
61
  **Lessons:**
62
- 1. **ALWAYS run `npm run build` before pushing** - No exceptions
62
+ 1. **ALWAYS run `{{verify.build | default("(this stack declares no build step)")}}` before pushing** - No exceptions
63
63
  2. **Trace client import chains** - Verify no server code imported
64
- 3. **Test production build locally** - Run `npm run build && npm start`
64
+ 3. **Test production build locally** - Run `{{verify.build | default("(this stack declares no build step)")}} && npm start`
65
65
  4. **ESLint warnings = deployment blockers** - Zero tolerance
66
66
  5. **Import chain analysis required** - Client components must not transitively import server code
67
67
  6. **Lazy-loading for external services** - Never instantiate at module load time
@@ -143,7 +143,7 @@ When encountering errors:
143
143
 
144
144
  ## Build Timeout Protocol
145
145
 
146
- If `npm run build` times out:
146
+ If `{{verify.build | default("(this stack declares no build step)")}}` times out:
147
147
 
148
148
  1. **DO NOT** assume it's just slow
149
149
  2. **DO NOT** skip to other checks
@@ -29,9 +29,9 @@
29
29
  | VR-FILE | `ls -la [path]` | File exists | Claiming file created | Missing files |
30
30
  | VR-GREP | `grep "[pattern]" [file]` | Match found | Claiming code added | Missing code |
31
31
  | VR-NEGATIVE | `grep -rn "[old]" src/` | 0 matches | Claiming removal | Leftover code |
32
- | VR-BUILD | `npm run build` | Exit 0 | Claiming production ready | Build failures |
33
- | VR-TYPE | `npx tsc --noEmit` | 0 errors | Claiming type safety | Type errors |
34
- | VR-TEST | `npm test` | All pass | Claiming tested | Test failures |
32
+ | VR-BUILD | `{{verify.build | default("(this stack declares no build step)")}}` | Exit 0 | Claiming production ready | Build failures |
33
+ | VR-TYPE | `{{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}` | 0 errors | Claiming type safety | Type errors |
34
+ | VR-TEST | `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}` | All pass | Claiming tested | Test failures |
35
35
  | VR-DEPLOY | `./scripts/pre-deploy-check.sh` | All pass | Claiming deployable | Deploy blockers |
36
36
  | VR-SCHEMA | `SELECT ... FROM information_schema` | Matches | Before DB operations | Schema mismatches |
37
37
  | VR-SCHEMA-PRE | `SELECT column_name...` | Columns exist | BEFORE writing ANY query | Wrong column names |
@@ -129,7 +129,7 @@ grep -rn "legacyPattern" src/ | wc -l
129
129
  **Purpose**: Verify code compiles for production deployment.
130
130
 
131
131
  ```bash
132
- npm run build
132
+ {{verify.build | default("(this stack declares no build step)")}}
133
133
  # Expected: Exit 0, "Compiled successfully"
134
134
  ```
135
135
 
@@ -145,7 +145,7 @@ npm run build
145
145
  **Purpose**: Verify zero TypeScript errors.
146
146
 
147
147
  ```bash
148
- NODE_OPTIONS="--max-old-space-size=8192" npx tsc --noEmit
148
+ NODE_OPTIONS="--max-old-space-size=8192" {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
149
149
  # Expected: 0 errors (no output)
150
150
  ```
151
151
 
@@ -166,7 +166,7 @@ npm run test:run
166
166
  npm run test:e2e
167
167
 
168
168
  # Specific test file
169
- npm test -- src/components/feature/__tests__/MyComponent.test.tsx
169
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} -- src/components/feature/__tests__/MyComponent.test.tsx
170
170
  ```
171
171
 
172
172
  **Expected Output**: All tests pass
@@ -279,12 +279,12 @@ grep "<MyComponent" src/app/**/page.tsx
279
279
 
280
280
  ```bash
281
281
  # Combined check
282
- grep "<MyComponent" src/app/feature/page.tsx && npm run build
282
+ grep "<MyComponent" src/app/feature/page.tsx && {{verify.build | default("(this stack declares no build step)")}}
283
283
 
284
284
  # Full integration verification
285
285
  grep "import.*MyComponent" src/app/feature/page.tsx && \
286
286
  grep "<MyComponent" src/app/feature/page.tsx && \
287
- npm run build
287
+ {{verify.build | default("(this stack declares no build step)")}}
288
288
  ```
289
289
 
290
290
  **Expected Output**: All checks pass
@@ -849,7 +849,7 @@ When running verifications, document results in this format:
849
849
  |---------|---------|----------|--------|--------|
850
850
  | VR-FILE | `ls -la component.tsx` | File exists | File exists | PASS |
851
851
  | VR-RENDER | `grep "<Component" page.tsx` | Match found | Match line 42 | PASS |
852
- | VR-BUILD | `npm run build` | Exit 0 | Exit 0 | PASS |
852
+ | VR-BUILD | `{{verify.build | default("(this stack declares no build step)")}}` | Exit 0 | Exit 0 | PASS |
853
853
  | VR-NEGATIVE | `grep "oldCode" src/` | 0 matches | 3 matches | **FAIL** |
854
854
 
855
855
  **Overall Status**: FAIL (VR-NEGATIVE failed)
@@ -31,6 +31,8 @@ paths:
31
31
  # — projects opt into it explicitly. Default to `.` so fresh `npx
32
32
  # massu init` doesn't fail on `paths.source 'src' does not exist`.
33
33
  source: .
34
+ # the .NET convention is a sibling test project; `dotnet test` discovers it
35
+ tests: Tests
34
36
  aliases: {}
35
37
 
36
38
  toolPrefix: massu
@@ -25,6 +25,8 @@ framework:
25
25
 
26
26
  paths:
27
27
  source: internal
28
+ # Go keeps `_test.go` files ALONGSIDE the code they test; `go test ./...` walks the tree
29
+ tests: internal
28
30
  aliases: {}
29
31
 
30
32
  toolPrefix: massu
@@ -37,6 +37,8 @@ framework:
37
37
 
38
38
  paths:
39
39
  source: apps
40
+ # pytest default discovery under the api app, matching paths.source apps
41
+ tests: apps/api/tests
40
42
  aliases:
41
43
  "@": apps
42
44
 
@@ -50,7 +52,7 @@ verification:
50
52
  python:
51
53
  test: cd apps/api && python3 -m pytest -q
52
54
  type: cd apps/api && python3 -m mypy .
53
- syntax: cd apps/api && python3 -m py_compile
55
+ syntax: cd apps/api && python3 -m compileall -q .
54
56
  lint: cd apps/api && python3 -m ruff check .
55
57
  typescript:
56
58
  test: cd apps/web && npm test
@@ -65,7 +67,7 @@ verification:
65
67
  swift:
66
68
  test: cd apps/ios && swift test
67
69
  type: cd apps/ios && swift build
68
- build: cd apps/ios && xcodebuild build
70
+ build: cd apps/ios && swift build -c release
69
71
  lint: cd apps/ios && swiftlint
70
72
 
71
73
  python:
@@ -25,6 +25,8 @@ framework:
25
25
 
26
26
  paths:
27
27
  source: lib
28
+ # `mix new` scaffolds test/ and `mix test` defaults to it
29
+ tests: test
28
30
  aliases: {}
29
31
 
30
32
  toolPrefix: massu
@@ -22,6 +22,8 @@ framework:
22
22
 
23
23
  paths:
24
24
  source: src
25
+ # pytest-django discovery under the declared source root
26
+ tests: src/tests
25
27
  aliases:
26
28
  "@": src
27
29
 
@@ -35,7 +37,7 @@ verification:
35
37
  python:
36
38
  test: cd src && python3 -m pytest -q
37
39
  type: cd src && python3 -m mypy .
38
- syntax: cd src && python3 -m py_compile
40
+ syntax: cd src && python3 -m compileall -q .
39
41
  lint: cd src && python3 -m ruff check .
40
42
 
41
43
  python:
@@ -22,6 +22,8 @@ framework:
22
22
 
23
23
  paths:
24
24
  source: app
25
+ # FastAPI's own testing guide puts tests/ at the project root
26
+ tests: tests
25
27
  aliases:
26
28
  "@": app
27
29
 
@@ -35,7 +37,7 @@ verification:
35
37
  python:
36
38
  test: cd app && python3 -m pytest -q
37
39
  type: cd app && python3 -m mypy .
38
- syntax: cd app && python3 -m py_compile
40
+ syntax: cd app && python3 -m compileall -q .
39
41
  lint: cd app && python3 -m ruff check .
40
42
 
41
43
  python:
@@ -23,6 +23,8 @@ framework:
23
23
 
24
24
  paths:
25
25
  source: app
26
+ # Flask's testing docs use a top-level tests/ package
27
+ tests: tests
26
28
  aliases:
27
29
  "@": app
28
30
 
@@ -36,7 +38,7 @@ verification:
36
38
  python:
37
39
  test: cd app && python3 -m pytest -q
38
40
  type: cd app && python3 -m mypy .
39
- syntax: cd app && python3 -m py_compile
41
+ syntax: cd app && python3 -m compileall -q .
40
42
  lint: cd app && python3 -m ruff check .
41
43
 
42
44
  python:
@@ -25,6 +25,8 @@ framework:
25
25
 
26
26
  paths:
27
27
  source: app
28
+ # Minitest is the Rails default and `bin/rails test` reads test/
29
+ tests: test
28
30
  aliases: {}
29
31
 
30
32
  toolPrefix: massu
@@ -35,9 +37,9 @@ rules: []
35
37
 
36
38
  verification:
37
39
  ruby:
38
- test: bundle exec rspec
40
+ test: bin/rails test
39
41
  type: bundle exec sorbet tc
40
- syntax: bundle exec ruby -c
42
+ syntax: find app lib -name '*.rb' -print0 | xargs -0 -n1 ruby -c > /dev/null
41
43
  lint: bundle exec rubocop
42
44
 
43
45
  ruby:
@@ -21,6 +21,8 @@ framework:
21
21
 
22
22
  paths:
23
23
  source: src
24
+ # Cargo reserves tests/ for integration tests; unit tests live in src/
25
+ tests: tests
24
26
  aliases:
25
27
  "@": src
26
28
 
@@ -25,6 +25,8 @@ framework:
25
25
 
26
26
  paths:
27
27
  source: src/main/java
28
+ # the Maven Standard Directory Layout, which surefire reads
29
+ tests: src/test/java
28
30
  aliases: {}
29
31
 
30
32
  toolPrefix: massu
@@ -20,6 +20,8 @@ framework:
20
20
 
21
21
  paths:
22
22
  source: Sources
23
+ # SwiftPM reserves Tests/ and `swift test` requires it
24
+ tests: Tests
23
25
  aliases:
24
26
  "@": Sources
25
27
 
@@ -33,5 +35,5 @@ verification:
33
35
  swift:
34
36
  test: swift test
35
37
  type: swift build
36
- build: xcodebuild build
38
+ build: swift build -c release
37
39
  lint: swiftlint
@@ -22,6 +22,8 @@ framework:
22
22
 
23
23
  paths:
24
24
  source: src
25
+ # the Nest CLI scaffolds test/ for e2e alongside co-located *.spec.ts
26
+ tests: test
25
27
  aliases:
26
28
  "@": src
27
29
 
@@ -22,6 +22,8 @@ framework:
22
22
 
23
23
  paths:
24
24
  source: src
25
+ # the convention create-next-app documents for colocated tests
26
+ tests: __tests__
25
27
  aliases:
26
28
  "@": src
27
29