septum 0.1.4 → 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 (67) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +105 -105
  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 -48
  13. package/src/cli/commands/sync.ts +31 -31
  14. package/src/cli/index.ts +210 -210
  15. package/src/cli/templates/hooks.ts +75 -75
  16. package/src/cli/templates/rules.ts +38 -38
  17. package/src/cli/templates/skill.ts +69 -69
  18. package/src/core/boundary/evaluator.ts +232 -210
  19. package/src/core/config/loader.ts +97 -97
  20. package/src/core/config/schema.ts +39 -39
  21. package/src/core/database/client.ts +44 -44
  22. package/src/core/database/repositories/dependency.repository.ts +366 -349
  23. package/src/core/database/repositories/domain.repository.ts +218 -198
  24. package/src/core/database/repositories/file.repository.ts +116 -106
  25. package/src/core/database/repositories/meta.repository.ts +33 -33
  26. package/src/core/database/repositories/symbol.repository.ts +443 -443
  27. package/src/core/database/repository.ts +264 -260
  28. package/src/core/database/schema.ts +153 -153
  29. package/src/core/discovery/topology-detector.ts +486 -486
  30. package/src/core/ingestion/hasher.ts +5 -5
  31. package/src/core/ingestion/pipeline.ts +584 -535
  32. package/src/core/parser/boundary-tracker.ts +288 -288
  33. package/src/core/parser/extractors/base.ts +62 -62
  34. package/src/core/parser/extractors/blade.ts +158 -158
  35. package/src/core/parser/extractors/frontend.ts +194 -194
  36. package/src/core/parser/extractors/go.ts +229 -180
  37. package/src/core/parser/extractors/laravel-semantic.ts +1039 -901
  38. package/src/core/parser/extractors/mcp-cli-semantic.ts +199 -199
  39. package/src/core/parser/extractors/nestjs-semantic.ts +119 -119
  40. package/src/core/parser/extractors/php.ts +153 -153
  41. package/src/core/parser/extractors/python.ts +228 -228
  42. package/src/core/parser/extractors/registry.ts +70 -70
  43. package/src/core/parser/extractors/semantic-extractor.interface.ts +21 -21
  44. package/src/core/parser/extractors/typescript.ts +181 -181
  45. package/src/core/parser/tree-sitter.ts +41 -41
  46. package/src/core/resolver/call-graph-tracer.ts +666 -668
  47. package/src/core/resolver/module-resolver.ts +408 -342
  48. package/src/core/resolver/path-resolver.ts +147 -147
  49. package/src/core/resolver/symbol-locator.ts +543 -543
  50. package/src/core/resolver/vertical-slice-tracer.ts +301 -285
  51. package/src/core/session/session-manager.ts +56 -56
  52. package/src/core/telemetry/telemetry.ts +86 -86
  53. package/src/index.ts +21 -21
  54. package/src/mcp/schemas.ts +578 -286
  55. package/src/mcp/server.ts +875 -716
  56. package/src/mcp/tools/check-boundary.ts +171 -152
  57. package/src/mcp/tools/get-domain-catalog.ts +145 -121
  58. package/src/mcp/tools/get-feature-context.ts +212 -116
  59. package/src/mcp/tools/get-symbol-hotspots.ts +60 -59
  60. package/src/mcp/tools/get-symbol-impact.ts +28 -26
  61. package/src/mcp/tools/get-symbol.ts +65 -63
  62. package/src/mcp/tools/locate-symbol.ts +171 -190
  63. package/src/mcp/tools/register-domain.ts +68 -64
  64. package/src/mcp/tools/register-feature.ts +100 -0
  65. package/src/mcp/tools/trace-vertical-slice.ts +74 -48
  66. package/src/types/index.ts +335 -315
  67. package/src/version.ts +3 -3
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,105 +1,105 @@
1
- # Septum
2
-
3
- > **Deterministic Bounded-Context & Anti-Poisoning Architecture Guard for AI Coding Agents.**
4
-
5
- [![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-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
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.4",
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
+