@massu/core 0.9.2 → 1.0.0

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 (50) hide show
  1. package/dist/cli.js +10519 -1661
  2. package/dist/hooks/auto-learning-pipeline.js +99 -19
  3. package/dist/hooks/classify-failure.js +99 -19
  4. package/dist/hooks/cost-tracker.js +97 -11
  5. package/dist/hooks/fix-detector.js +99 -19
  6. package/dist/hooks/incident-pipeline.js +97 -11
  7. package/dist/hooks/post-edit-context.js +97 -11
  8. package/dist/hooks/post-tool-use.js +101 -20
  9. package/dist/hooks/pre-compact.js +97 -11
  10. package/dist/hooks/pre-delete-check.js +97 -11
  11. package/dist/hooks/quality-event.js +97 -11
  12. package/dist/hooks/rule-enforcement-pipeline.js +97 -11
  13. package/dist/hooks/session-end.js +97 -11
  14. package/dist/hooks/session-start.js +98 -12
  15. package/dist/hooks/user-prompt.js +98 -43
  16. package/package.json +13 -3
  17. package/reference/hook-execution-order.md +17 -25
  18. package/src/cli.ts +2 -1
  19. package/src/commands/doctor.ts +1 -29
  20. package/src/commands/init.ts +752 -216
  21. package/src/config.ts +168 -12
  22. package/src/detect/domain-inferrer.ts +142 -0
  23. package/src/detect/drift.ts +199 -0
  24. package/src/detect/framework-detector.ts +281 -0
  25. package/src/detect/index.ts +174 -0
  26. package/src/detect/migrate.ts +278 -0
  27. package/src/detect/monorepo-detector.ts +347 -0
  28. package/src/detect/package-detector.ts +728 -0
  29. package/src/detect/source-dir-detector.ts +264 -0
  30. package/src/detect/vr-command-map.ts +167 -0
  31. package/src/hooks/auto-learning-pipeline.ts +2 -2
  32. package/src/hooks/classify-failure.ts +2 -2
  33. package/src/hooks/fix-detector.ts +2 -2
  34. package/src/hooks/session-start.ts +1 -1
  35. package/src/hooks/user-prompt.ts +1 -21
  36. package/src/knowledge-indexer.ts +1 -1
  37. package/src/license.ts +1 -2
  38. package/src/memory-db.ts +0 -5
  39. package/src/memory-file-ingest.ts +6 -13
  40. package/src/tools.ts +0 -8
  41. package/templates/multi-runtime/massu.config.yaml +80 -0
  42. package/templates/python-django/massu.config.yaml +51 -0
  43. package/templates/python-fastapi/massu.config.yaml +50 -0
  44. package/templates/rust-actix/massu.config.yaml +38 -0
  45. package/templates/swift-ios/massu.config.yaml +37 -0
  46. package/templates/ts-nestjs/massu.config.yaml +43 -0
  47. package/templates/ts-nextjs/massu.config.yaml +43 -0
  48. package/README.md +0 -40
  49. package/src/claude-md-templates.ts +0 -342
  50. package/src/mcp-bridge-tools.ts +0 -458
@@ -0,0 +1,80 @@
1
+ # Massu AI Configuration — Multi-runtime template (Python + TypeScript + Rust + Swift)
2
+ # schema_version 2 — https://massu.ai/docs/getting-started/configuration
3
+
4
+ schema_version: 2
5
+
6
+ project:
7
+ name: "{{PROJECT_NAME}}"
8
+ root: auto
9
+
10
+ framework:
11
+ type: multi
12
+ primary: python
13
+ router: fastapi-router
14
+ orm: sqlalchemy
15
+ ui: nextjs
16
+ languages:
17
+ python:
18
+ framework: fastapi
19
+ test_framework: pytest
20
+ orm: sqlalchemy
21
+ source_dirs:
22
+ - apps/api
23
+ typescript:
24
+ framework: next
25
+ test_framework: vitest
26
+ ui: nextjs
27
+ source_dirs:
28
+ - apps/web
29
+ rust:
30
+ test_framework: cargo
31
+ source_dirs:
32
+ - apps/gateway
33
+ swift:
34
+ test_framework: xctest
35
+ source_dirs:
36
+ - apps/ios
37
+
38
+ paths:
39
+ source: apps
40
+ aliases:
41
+ "@": apps
42
+
43
+ toolPrefix: massu
44
+
45
+ domains: []
46
+
47
+ rules: []
48
+
49
+ verification:
50
+ python:
51
+ test: cd apps/api && python3 -m pytest -q
52
+ type: cd apps/api && python3 -m mypy .
53
+ syntax: cd apps/api && python3 -m py_compile
54
+ lint: cd apps/api && python3 -m ruff check .
55
+ typescript:
56
+ test: cd apps/web && npm test
57
+ type: cd apps/web && npx tsc --noEmit
58
+ build: cd apps/web && npm run build
59
+ lint: cd apps/web && npx eslint .
60
+ rust:
61
+ test: cd apps/gateway && cargo test
62
+ type: cd apps/gateway && cargo check
63
+ build: cd apps/gateway && cargo build
64
+ lint: cd apps/gateway && cargo clippy -- -D warnings
65
+ swift:
66
+ test: cd apps/ios && swift test
67
+ type: cd apps/ios && swift build
68
+ build: cd apps/ios && xcodebuild build
69
+ lint: cd apps/ios && swiftlint
70
+
71
+ python:
72
+ root: apps/api
73
+ exclude_dirs:
74
+ - __pycache__
75
+ - .venv
76
+ - venv
77
+ - .mypy_cache
78
+ - .pytest_cache
79
+ framework: fastapi
80
+ orm: sqlalchemy
@@ -0,0 +1,51 @@
1
+ # Massu AI Configuration — Python / Django template
2
+ # schema_version 2 — https://massu.ai/docs/getting-started/configuration
3
+
4
+ schema_version: 2
5
+
6
+ project:
7
+ name: "{{PROJECT_NAME}}"
8
+ root: auto
9
+
10
+ framework:
11
+ type: python
12
+ router: none
13
+ orm: django-orm
14
+ ui: none
15
+ languages:
16
+ python:
17
+ framework: django
18
+ test_framework: pytest
19
+ orm: django-orm
20
+ source_dirs:
21
+ - src
22
+
23
+ paths:
24
+ source: src
25
+ aliases:
26
+ "@": src
27
+
28
+ toolPrefix: massu
29
+
30
+ domains: []
31
+
32
+ rules: []
33
+
34
+ verification:
35
+ python:
36
+ test: cd src && python3 -m pytest -q
37
+ type: cd src && python3 -m mypy .
38
+ syntax: cd src && python3 -m py_compile
39
+ lint: cd src && python3 -m ruff check .
40
+
41
+ python:
42
+ root: src
43
+ exclude_dirs:
44
+ - __pycache__
45
+ - .venv
46
+ - venv
47
+ - .mypy_cache
48
+ - .pytest_cache
49
+ - migrations
50
+ framework: django
51
+ orm: django-orm
@@ -0,0 +1,50 @@
1
+ # Massu AI Configuration — Python / FastAPI template
2
+ # schema_version 2 — https://massu.ai/docs/getting-started/configuration
3
+
4
+ schema_version: 2
5
+
6
+ project:
7
+ name: "{{PROJECT_NAME}}"
8
+ root: auto
9
+
10
+ framework:
11
+ type: python
12
+ router: fastapi-router
13
+ orm: sqlalchemy
14
+ ui: none
15
+ languages:
16
+ python:
17
+ framework: fastapi
18
+ test_framework: pytest
19
+ orm: sqlalchemy
20
+ source_dirs:
21
+ - app
22
+
23
+ paths:
24
+ source: app
25
+ aliases:
26
+ "@": app
27
+
28
+ toolPrefix: massu
29
+
30
+ domains: []
31
+
32
+ rules: []
33
+
34
+ verification:
35
+ python:
36
+ test: cd app && python3 -m pytest -q
37
+ type: cd app && python3 -m mypy .
38
+ syntax: cd app && python3 -m py_compile
39
+ lint: cd app && python3 -m ruff check .
40
+
41
+ python:
42
+ root: app
43
+ exclude_dirs:
44
+ - __pycache__
45
+ - .venv
46
+ - venv
47
+ - .mypy_cache
48
+ - .pytest_cache
49
+ framework: fastapi
50
+ orm: sqlalchemy
@@ -0,0 +1,38 @@
1
+ # Massu AI Configuration — Rust / Actix-Web template
2
+ # schema_version 2 — https://massu.ai/docs/getting-started/configuration
3
+
4
+ schema_version: 2
5
+
6
+ project:
7
+ name: "{{PROJECT_NAME}}"
8
+ root: auto
9
+
10
+ framework:
11
+ type: rust
12
+ router: none
13
+ orm: none
14
+ ui: none
15
+ languages:
16
+ rust:
17
+ framework: actix-web
18
+ test_framework: cargo
19
+ source_dirs:
20
+ - src
21
+
22
+ paths:
23
+ source: src
24
+ aliases:
25
+ "@": src
26
+
27
+ toolPrefix: massu
28
+
29
+ domains: []
30
+
31
+ rules: []
32
+
33
+ verification:
34
+ rust:
35
+ test: cargo test
36
+ type: cargo check
37
+ build: cargo build
38
+ lint: cargo clippy -- -D warnings
@@ -0,0 +1,37 @@
1
+ # Massu AI Configuration — Swift / iOS template
2
+ # schema_version 2 — https://massu.ai/docs/getting-started/configuration
3
+
4
+ schema_version: 2
5
+
6
+ project:
7
+ name: "{{PROJECT_NAME}}"
8
+ root: auto
9
+
10
+ framework:
11
+ type: swift
12
+ router: none
13
+ orm: none
14
+ ui: none
15
+ languages:
16
+ swift:
17
+ test_framework: xctest
18
+ source_dirs:
19
+ - Sources
20
+
21
+ paths:
22
+ source: Sources
23
+ aliases:
24
+ "@": Sources
25
+
26
+ toolPrefix: massu
27
+
28
+ domains: []
29
+
30
+ rules: []
31
+
32
+ verification:
33
+ swift:
34
+ test: swift test
35
+ type: swift build
36
+ build: xcodebuild build
37
+ lint: swiftlint
@@ -0,0 +1,43 @@
1
+ # Massu AI Configuration — TypeScript / NestJS template
2
+ # schema_version 2 — https://massu.ai/docs/getting-started/configuration
3
+
4
+ schema_version: 2
5
+
6
+ project:
7
+ name: "{{PROJECT_NAME}}"
8
+ root: auto
9
+
10
+ framework:
11
+ type: typescript
12
+ router: rest
13
+ orm: none
14
+ ui: none
15
+ languages:
16
+ typescript:
17
+ framework: nestjs
18
+ test_framework: jest
19
+ router: rest
20
+ source_dirs:
21
+ - src
22
+
23
+ paths:
24
+ source: src
25
+ aliases:
26
+ "@": src
27
+
28
+ toolPrefix: massu
29
+
30
+ domains: []
31
+
32
+ rules:
33
+ - pattern: src/**/*.ts
34
+ language: typescript
35
+ rules:
36
+ - Use ESM imports, not CommonJS
37
+
38
+ verification:
39
+ typescript:
40
+ test: npm test
41
+ type: npx tsc --noEmit
42
+ build: npm run build
43
+ lint: npx eslint .
@@ -0,0 +1,43 @@
1
+ # Massu AI Configuration — TypeScript / Next.js template
2
+ # schema_version 2 — https://massu.ai/docs/getting-started/configuration
3
+
4
+ schema_version: 2
5
+
6
+ project:
7
+ name: "{{PROJECT_NAME}}"
8
+ root: auto
9
+
10
+ framework:
11
+ type: typescript
12
+ router: none
13
+ orm: none
14
+ ui: nextjs
15
+ languages:
16
+ typescript:
17
+ framework: next
18
+ test_framework: vitest
19
+ ui: nextjs
20
+ source_dirs:
21
+ - src
22
+
23
+ paths:
24
+ source: src
25
+ aliases:
26
+ "@": src
27
+
28
+ toolPrefix: massu
29
+
30
+ domains: []
31
+
32
+ rules:
33
+ - pattern: src/**/*.ts
34
+ language: typescript
35
+ rules:
36
+ - Use ESM imports, not CommonJS
37
+
38
+ verification:
39
+ typescript:
40
+ test: npm test
41
+ type: npx tsc --noEmit
42
+ build: npm run build
43
+ lint: npx eslint .
package/README.md DELETED
@@ -1,40 +0,0 @@
1
- # @massu/core
2
-
3
- AI Engineering Governance MCP Server — session memory, feature registry, code intelligence, and rule enforcement for AI coding assistants.
4
-
5
- ## Quick Start
6
-
7
- ```bash
8
- npx massu init
9
- ```
10
-
11
- This sets up the MCP server, configuration, and lifecycle hooks in one command.
12
-
13
- ## What is Massu?
14
-
15
- Massu is a source-available [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that adds governance capabilities to AI coding assistants like Claude Code. It provides:
16
-
17
- - **73 MCP Tools** — quality analytics, cost tracking, security scoring, dependency analysis, and more
18
- - **15 Lifecycle Hooks** — pre-commit gates, security scanning, intent suggestion, session management, and auto-learning pipeline
19
- - **3-Database Architecture** — code graph (read-only), data (imports/mappings), and memory (sessions/analytics)
20
- - **Config-Driven** — all project-specific data lives in `massu.config.yaml`
21
-
22
- ## Usage
23
-
24
- After `npx massu init`, your AI assistant gains access to all governance tools automatically via the MCP protocol.
25
-
26
- ```bash
27
- # Health check
28
- npx massu doctor
29
-
30
- # Validate configuration
31
- npx massu validate-config
32
- ```
33
-
34
- ## Documentation
35
-
36
- Full documentation at [massu.ai](https://massu.ai).
37
-
38
- ## License
39
-
40
- [BSL 1.1](https://github.com/massu-ai/massu/blob/main/LICENSE) — source-available. Free to use, modify, and distribute. See LICENSE for full terms.