septum 0.1.3 → 0.1.5

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 (74) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +105 -102
  3. package/bin/septum.ts +4 -4
  4. package/package.json +63 -63
  5. package/src/cli/commands/check.ts +161 -161
  6. package/src/cli/commands/hook.ts +188 -188
  7. package/src/cli/commands/ingest.ts +29 -29
  8. package/src/cli/commands/init.ts +211 -211
  9. package/src/cli/commands/locate.ts +61 -61
  10. package/src/cli/commands/query.ts +64 -64
  11. package/src/cli/commands/serve.ts +5 -5
  12. package/src/cli/commands/slice.ts +48 -90
  13. package/src/cli/commands/sync.ts +31 -31
  14. package/src/cli/commands/topology.ts +119 -0
  15. package/src/cli/index.ts +210 -199
  16. package/src/cli/templates/hooks.ts +75 -75
  17. package/src/cli/templates/rules.ts +38 -38
  18. package/src/cli/templates/skill.ts +69 -69
  19. package/src/core/boundary/evaluator.ts +232 -210
  20. package/src/core/config/loader.ts +97 -97
  21. package/src/core/config/schema.ts +39 -39
  22. package/src/core/database/client.ts +44 -44
  23. package/src/core/database/repositories/dependency.repository.ts +366 -349
  24. package/src/core/database/repositories/domain.repository.ts +218 -198
  25. package/src/core/database/repositories/environment.repository.ts +207 -0
  26. package/src/core/database/repositories/file.repository.ts +116 -106
  27. package/src/core/database/repositories/meta.repository.ts +33 -33
  28. package/src/core/database/repositories/symbol.repository.ts +443 -424
  29. package/src/core/database/repository.ts +264 -255
  30. package/src/core/database/schema.ts +34 -1
  31. package/src/core/discovery/topology-detector.ts +486 -486
  32. package/src/core/ingestion/hasher.ts +5 -5
  33. package/src/core/ingestion/pipeline.ts +584 -535
  34. package/src/core/parser/behavioral-analyzer.ts +119 -0
  35. package/src/core/parser/boundary-tracker.ts +288 -128
  36. package/src/core/parser/extractors/base.ts +62 -61
  37. package/src/core/parser/extractors/frontend.ts +194 -194
  38. package/src/core/parser/extractors/go.ts +229 -176
  39. package/src/core/parser/extractors/laravel-semantic.ts +1039 -585
  40. package/src/core/parser/extractors/mcp-cli-semantic.ts +199 -199
  41. package/src/core/parser/extractors/nestjs-semantic.ts +119 -119
  42. package/src/core/parser/extractors/php.ts +153 -149
  43. package/src/core/parser/extractors/python.ts +228 -226
  44. package/src/core/parser/extractors/registry.ts +70 -70
  45. package/src/core/parser/extractors/semantic-extractor.interface.ts +21 -21
  46. package/src/core/parser/extractors/typescript.ts +181 -177
  47. package/src/core/parser/schema/providers/laravel-migration-provider.ts +215 -0
  48. package/src/core/parser/schema/providers/prisma-schema-provider.ts +89 -0
  49. package/src/core/parser/schema/schema-provider-registry.ts +43 -0
  50. package/src/core/parser/schema/schema-provider.interface.ts +33 -0
  51. package/src/core/parser/tree-sitter.ts +41 -41
  52. package/src/core/resolver/call-graph-tracer.ts +666 -668
  53. package/src/core/resolver/module-resolver.ts +408 -342
  54. package/src/core/resolver/symbol-locator.ts +543 -543
  55. package/src/core/resolver/vertical-slice-tracer.ts +301 -252
  56. package/src/core/session/session-manager.ts +56 -56
  57. package/src/core/telemetry/telemetry.ts +86 -86
  58. package/src/core/topology/environment-detector.ts +860 -0
  59. package/src/core/topology/types.ts +83 -0
  60. package/src/index.ts +21 -18
  61. package/src/mcp/schemas.ts +578 -238
  62. package/src/mcp/server.ts +875 -656
  63. package/src/mcp/tools/check-boundary.ts +171 -152
  64. package/src/mcp/tools/get-domain-catalog.ts +145 -121
  65. package/src/mcp/tools/get-environment-topology.ts +141 -0
  66. package/src/mcp/tools/get-feature-context.ts +212 -116
  67. package/src/mcp/tools/get-symbol-hotspots.ts +60 -49
  68. package/src/mcp/tools/get-symbol-impact.ts +28 -26
  69. package/src/mcp/tools/get-symbol.ts +65 -63
  70. package/src/mcp/tools/locate-symbol.ts +171 -190
  71. package/src/mcp/tools/register-domain.ts +68 -64
  72. package/src/mcp/tools/register-feature.ts +100 -0
  73. package/src/mcp/tools/trace-vertical-slice.ts +74 -103
  74. package/src/types/index.ts +335 -299
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 shironim
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shironim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,102 +1,105 @@
1
- # Septum
2
-
3
- > **Deterministic Bounded-Context & Anti-Poisoning Architecture Guard for AI Coding Agents.**
4
-
5
- [![Runtime: Bun](https://img.shields.io/badge/Runtime-Bun-black?logo=bun)](https://bun.sh)
6
- [![Protocol: Model Context Protocol](https://img.shields.io/badge/Protocol-MCP-green)](https://modelcontextprotocol.io/)
7
- [![Database: SQLite WAL](https://img.shields.io/badge/Database-SQLite%20(bun:sqlite)-003B57?logo=sqlite)](https://sqlite.org/)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
9
-
10
- Septum stops **context poisoning** in AI coding agents. It indexes your codebase into an embedded SQLite SSOT (`.septum/septum.db`), enforces strict bounded-context domains, and intercepts unauthorized cross-domain edits before they hit disk.
11
-
12
- ---
13
-
14
- ## Installation
15
-
16
- Install Septum globally using [Bun](https://bun.sh):
17
-
18
- ```bash
19
- bun add -g septum
20
- ```
21
-
22
- > **Note:** You can also run commands on-the-fly without global installation using `bunx septum <command>`.
23
-
24
- ---
25
-
26
- ## Quick Start
27
-
28
- ### 1. Initialize in Any Project
29
-
30
- ```bash
31
- septum init
32
- # or zero-install via bunx:
33
- bunx septum init
34
- ```
35
- *Auto-detects project topology (Monorepos, Laravel, Next.js, Go, NestJS), registers domains, and ingests AST symbols into `.septum/septum.db`.*
36
-
37
- ### 2. Connect to AI Agent (MCP Server)
38
-
39
- Add Septum to your MCP client (`mcp.json` or `claude_desktop_config.json`):
40
-
41
- ```json
42
- {
43
- "mcpServers": {
44
- "septum": {
45
- "command": "septum",
46
- "args": ["serve"]
47
- }
48
- }
49
- }
50
- ```
51
- *(Or use `"command": "bunx", "args": ["septum", "serve"]` if running without global installation).*
52
-
53
- ---
54
-
55
- ## CLI Reference
56
-
57
- | Command | Description |
58
- |---|---|
59
- | `septum init` | Detect topology, scaffold boundary guards, and build initial catalog |
60
- | `septum ingest` | Full AST re-indexing into `.septum/septum.db` |
61
- | `septum sync` | Fast incremental delta sync (< 15ms) for modified files |
62
- | `septum check --strict` | CI/CD gate: verify boundary integrity & fail on violations |
63
- | `septum query [domain]` | Inspect domain catalog, archetypes, and public signatures |
64
- | `septum locate <query>` | Locate symbol, class, interface, method, or error source |
65
- | `septum slice <route\|intent>` | Trace end-to-end vertical execution slice for route/intent |
66
- | `septum feature status\|clear` | Manage active feature lease and editing scope |
67
- | `septum serve` | Launch stdio MCP server for AI coding agents |
68
-
69
- ---
70
-
71
- ## Core Capabilities & MCP Tools
72
-
73
- All tools expose typed schemas automatically via the Model Context Protocol:
74
-
75
- - **Whole-Project Telescope (`septum_get_domain_catalog`):** Returns macro architecture maps in < 400 tokens.
76
- - **Vertical Slice Tracer (`septum_trace_vertical_slice`):** Traces execution chains (*Ingress ➔ Validation ➔ Orchestration ➔ Domain ➔ Egress*) across frameworks.
77
- - **Pre-Flight Boundary Guard (`septum_check_boundary`):** Validates proposed edits and imports against bounded-context rules.
78
- - **Scope Locking (`septum_get_feature_context` / `septum_clear_feature_context`):** Locks active feature scope to eliminate context drift.
79
- - **Symbol & Blast Radius (`septum_locate_symbol`, `septum_get_symbol`, `septum_get_symbol_impact`):** Resolves call chains, signatures, and refactoring impact.
80
- - **God Function Detector (`septum_get_symbol_hotspots`):** Surfaces oversized functions/methods by physical lines-of-code.
81
- - **Dynamic Topology (`septum_register_domain`):** Registers or updates domains and boundary rules on-the-fly.
82
-
83
- ---
84
-
85
- ## Development & Contributing
86
-
87
- ```bash
88
- # Clone and install dependencies
89
- git clone https://github.com/shironim/septum.git
90
- cd septum
91
- bun install
92
-
93
- # Run test suite & build
94
- bun test
95
- bun run build
96
- ```
97
-
98
- ---
99
-
100
- ## License
101
-
102
- [MIT](LICENSE) © shironim
1
+ # Septum
2
+
3
+ > **Deterministic Bounded-Context & Anti-Poisoning Architecture Guard for AI Coding Agents.**
4
+
5
+ [![Version: 0.1.5](https://img.shields.io/badge/Version-0.1.5-blue)](package.json)
6
+ [![Runtime: Bun](https://img.shields.io/badge/Runtime-Bun-black?logo=bun)](https://bun.sh)
7
+ [![Protocol: Model Context Protocol](https://img.shields.io/badge/Protocol-MCP-green)](https://modelcontextprotocol.io/)
8
+ [![Database: SQLite WAL](https://img.shields.io/badge/Database-SQLite%20(bun:sqlite)-003B57?logo=sqlite)](https://sqlite.org/)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
10
+
11
+ Septum stops **context poisoning** in AI coding agents. It indexes your codebase into an embedded SQLite SSOT (`.septum/septum.db`), enforces strict bounded-context domains, and intercepts unauthorized cross-domain edits before they hit disk.
12
+
13
+ ---
14
+
15
+ ## Installation
16
+
17
+ Install Septum globally using [Bun](https://bun.sh):
18
+
19
+ ```bash
20
+ bun add -g septum
21
+ ```
22
+
23
+ > **Note:** You can also run commands on-the-fly without global installation using `bunx septum <command>`.
24
+
25
+ ---
26
+
27
+ ## Quick Start
28
+
29
+ ### 1. Initialize in Any Project
30
+
31
+ ```bash
32
+ septum init
33
+ # or zero-install via bunx:
34
+ bunx septum init
35
+ ```
36
+ *Auto-detects project topology (Monorepos, Laravel, Next.js, Go, NestJS), registers domains, and ingests AST symbols into `.septum/septum.db`.*
37
+
38
+ ### 2. Connect to AI Agent (MCP Server)
39
+
40
+ Add Septum to your MCP client (`mcp.json` or `claude_desktop_config.json`):
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "septum": {
46
+ "command": "septum",
47
+ "args": ["serve"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+ *(Or use `"command": "bunx", "args": ["septum", "serve"]` if running without global installation).*
53
+
54
+ ---
55
+
56
+ ## CLI Reference
57
+
58
+ | Command | Description |
59
+ |---|---|
60
+ | `septum init` | Detect topology, scaffold boundary guards, and build initial catalog |
61
+ | `septum ingest` | Full AST re-indexing into `.septum/septum.db` |
62
+ | `septum sync` | Fast incremental delta sync (< 15ms) for modified files |
63
+ | `septum check --strict` | CI/CD gate: verify boundary integrity & fail on violations |
64
+ | `septum query [domain]` | Inspect domain catalog, archetypes, and public signatures |
65
+ | `septum locate <query>` | Locate symbol, class, interface, method, or error source |
66
+ | `septum slice <route\|intent>` | Trace end-to-end vertical execution slice for route/intent |
67
+ | `septum topology [action]` | Inspect 6-layer environment topology plane & distributed nodes |
68
+ | `septum feature status\|clear` | Manage active feature lease and editing scope |
69
+ | `septum serve` | Launch stdio MCP server for AI coding agents |
70
+
71
+ ---
72
+
73
+ ## Core Capabilities & MCP Tools
74
+
75
+ All tools expose typed schemas automatically via the Model Context Protocol:
76
+
77
+ - **Self-Aware Environment Topology (`septum_get_environment_topology`):** Maps and verifies the 6-layer production architecture (Edge/WAF, Gateway/Web Server, Host, Runtime, Storage/Cache, Telemetry) and distributed entities with cross-layer invariants.
78
+ - **Whole-Project Telescope (`septum_get_domain_catalog`):** Returns macro architecture maps in < 400 tokens.
79
+ - **Omni-Trigger Vertical Slice Tracer (`septum_trace_vertical_slice`):** Traces execution chains across HTTP routes, queue jobs, console commands, and event listeners (*Ingress ➔ Validation ➔ Orchestration ➔ Domain ➔ Egress*).
80
+ - **Pre-Flight Boundary Guard (`septum_check_boundary`):** Validates proposed edits and imports against bounded-context rules.
81
+ - **Scope Locking (`septum_get_feature_context` / `septum_clear_feature_context`):** Locks active feature scope to eliminate context drift.
82
+ - **Symbol & Blast Radius (`septum_locate_symbol`, `septum_get_symbol`, `septum_get_symbol_impact`):** Resolves call chains, signatures, and refactoring impact.
83
+ - **God Function & Nesting Detector (`septum_get_symbol_hotspots`):** Surfaces oversized functions/methods ranked by physical lines, cyclomatic nesting depth, and composite risk score.
84
+ - **Dynamic Topology (`septum_register_domain`):** Registers or updates domains and boundary rules on-the-fly.
85
+
86
+ ---
87
+
88
+ ## Development & Contributing
89
+
90
+ ```bash
91
+ # Clone and install dependencies
92
+ git clone https://github.com/shironim/septum.git
93
+ cd septum
94
+ bun install
95
+
96
+ # Run test suite & build
97
+ bun test
98
+ bun run build
99
+ ```
100
+
101
+ ---
102
+
103
+ ## License
104
+
105
+ [MIT](LICENSE) © shironim
package/bin/septum.ts CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bun
2
- import { runCLI } from "../src/cli/index.ts";
3
-
4
- runCLI(process.argv);
1
+ #!/usr/bin/env bun
2
+ import { runCLI } from "../src/cli/index.ts";
3
+
4
+ runCLI(process.argv);
package/package.json CHANGED
@@ -1,63 +1,63 @@
1
- {
2
- "name": "septum",
3
- "version": "0.1.3",
4
- "description": "Deterministic Bounded-Context, Structural File Catalog & Anti-Poisoning Partition for AI Agents",
5
- "type": "module",
6
- "main": "src/index.ts",
7
- "bin": {
8
- "septum": "./bin/septum.ts"
9
- },
10
- "engines": {
11
- "bun": ">=1.1.0"
12
- },
13
- "scripts": {
14
- "start": "bun run bin/septum.ts",
15
- "serve": "bun run bin/septum.ts serve",
16
- "ingest": "bun run bin/septum.ts ingest",
17
- "sync": "bun run bin/septum.ts sync",
18
- "check": "bun run bin/septum.ts check",
19
- "test": "bun test",
20
- "build": "bun build ./bin/septum.ts --compile --outfile dist/septum",
21
- "typecheck": "tsc --noEmit"
22
- },
23
- "dependencies": {
24
- "@modelcontextprotocol/sdk": "^1.5.0",
25
- "web-tree-sitter": "^0.24.0",
26
- "yaml": "^2.7.0",
27
- "zod": "^3.24.2"
28
- },
29
- "license": "MIT",
30
- "repository": {
31
- "type": "git",
32
- "url": "git+https://github.com/shironim/septum.git"
33
- },
34
- "homepage": "https://github.com/shironim/septum#readme",
35
- "bugs": {
36
- "url": "https://github.com/shironim/septum/issues"
37
- },
38
- "keywords": [
39
- "mcp",
40
- "model-context-protocol",
41
- "bounded-context",
42
- "architecture",
43
- "ai-agent",
44
- "tree-sitter",
45
- "clean-architecture",
46
- "domain-driven-design",
47
- "codebase-catalog",
48
- "antigravity"
49
- ],
50
- "files": [
51
- "bin",
52
- "src",
53
- "README.md",
54
- "LICENSE"
55
- ],
56
- "devDependencies": {
57
- "@types/bun": "latest",
58
- "@types/node": "^22.13.4",
59
- "tree-sitter-wasms": "^0.1.13",
60
- "typescript": "^5.7.3"
61
- }
62
- }
63
-
1
+ {
2
+ "name": "septum",
3
+ "version": "0.1.5",
4
+ "description": "Deterministic Bounded-Context, Structural File Catalog & Anti-Poisoning Partition for AI Agents",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "bin": {
8
+ "septum": "./bin/septum.ts"
9
+ },
10
+ "engines": {
11
+ "bun": ">=1.1.0"
12
+ },
13
+ "scripts": {
14
+ "start": "bun run bin/septum.ts",
15
+ "serve": "bun run bin/septum.ts serve",
16
+ "ingest": "bun run bin/septum.ts ingest",
17
+ "sync": "bun run bin/septum.ts sync",
18
+ "check": "bun run bin/septum.ts check",
19
+ "test": "bun test",
20
+ "build": "bun build ./bin/septum.ts --compile --outfile dist/septum",
21
+ "typecheck": "tsc --noEmit"
22
+ },
23
+ "dependencies": {
24
+ "@modelcontextprotocol/sdk": "^1.5.0",
25
+ "web-tree-sitter": "^0.24.0",
26
+ "yaml": "^2.7.0",
27
+ "zod": "^3.24.2"
28
+ },
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/shironim/septum.git"
33
+ },
34
+ "homepage": "https://github.com/shironim/septum#readme",
35
+ "bugs": {
36
+ "url": "https://github.com/shironim/septum/issues"
37
+ },
38
+ "keywords": [
39
+ "mcp",
40
+ "model-context-protocol",
41
+ "bounded-context",
42
+ "architecture",
43
+ "ai-agent",
44
+ "tree-sitter",
45
+ "clean-architecture",
46
+ "domain-driven-design",
47
+ "codebase-catalog",
48
+ "antigravity"
49
+ ],
50
+ "files": [
51
+ "bin",
52
+ "src",
53
+ "README.md",
54
+ "LICENSE"
55
+ ],
56
+ "devDependencies": {
57
+ "@types/bun": "latest",
58
+ "@types/node": "^22.13.4",
59
+ "tree-sitter-wasms": "^0.1.13",
60
+ "typescript": "^5.7.3"
61
+ }
62
+ }
63
+