septum 0.1.0 → 0.1.2

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 (65) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +100 -100
  3. package/bin/septum.ts +4 -4
  4. package/package.json +63 -62
  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 +90 -90
  13. package/src/cli/commands/sync.ts +31 -31
  14. package/src/cli/index.ts +199 -178
  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 +66 -66
  18. package/src/core/boundary/evaluator.ts +210 -210
  19. package/src/core/config/loader.ts +84 -84
  20. package/src/core/config/schema.ts +39 -39
  21. package/src/core/database/client.ts +44 -132
  22. package/src/core/database/repositories/dependency.repository.ts +279 -279
  23. package/src/core/database/repositories/domain.repository.ts +198 -198
  24. package/src/core/database/repositories/file.repository.ts +99 -99
  25. package/src/core/database/repositories/meta.repository.ts +33 -33
  26. package/src/core/database/repositories/symbol.repository.ts +424 -424
  27. package/src/core/database/repository.ts +242 -242
  28. package/src/core/database/schema.ts +120 -0
  29. package/src/core/discovery/topology-detector.ts +418 -418
  30. package/src/core/ingestion/hasher.ts +5 -5
  31. package/src/core/ingestion/pipeline.ts +438 -438
  32. package/src/core/parser/boundary-tracker.ts +128 -128
  33. package/src/core/parser/extractors/base.ts +60 -60
  34. package/src/core/parser/extractors/frontend.ts +194 -194
  35. package/src/core/parser/extractors/go.ts +176 -176
  36. package/src/core/parser/extractors/laravel-semantic.ts +426 -426
  37. package/src/core/parser/extractors/mcp-cli-semantic.ts +199 -199
  38. package/src/core/parser/extractors/nestjs-semantic.ts +119 -119
  39. package/src/core/parser/extractors/php.ts +149 -149
  40. package/src/core/parser/extractors/python.ts +226 -226
  41. package/src/core/parser/extractors/registry.ts +49 -49
  42. package/src/core/parser/extractors/semantic-extractor.interface.ts +21 -21
  43. package/src/core/parser/extractors/typescript.ts +177 -177
  44. package/src/core/parser/tree-sitter.ts +39 -39
  45. package/src/core/resolver/call-graph-tracer.ts +668 -668
  46. package/src/core/resolver/module-resolver.ts +342 -323
  47. package/src/core/resolver/symbol-locator.ts +543 -405
  48. package/src/core/resolver/vertical-slice-tracer.ts +237 -236
  49. package/src/core/session/session-manager.ts +56 -56
  50. package/src/core/telemetry/telemetry.ts +86 -86
  51. package/src/index.ts +18 -18
  52. package/src/mcp/schemas.ts +68 -68
  53. package/src/mcp/server.ts +612 -602
  54. package/src/mcp/tools/check-boundary.ts +102 -102
  55. package/src/mcp/tools/get-domain-catalog.ts +91 -91
  56. package/src/mcp/tools/get-feature-context.ts +116 -116
  57. package/src/mcp/tools/get-symbol-hotspots.ts +49 -49
  58. package/src/mcp/tools/get-symbol-impact.ts +26 -26
  59. package/src/mcp/tools/get-symbol.ts +63 -63
  60. package/src/mcp/tools/locate-symbol.ts +74 -74
  61. package/src/mcp/tools/register-domain.ts +64 -64
  62. package/src/mcp/tools/trace-vertical-slice.ts +102 -102
  63. package/src/types/index.ts +296 -296
  64. package/src/version.ts +3 -0
  65. package/src/core/database/schema.sql +0 -92
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,100 +1,100 @@
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 feature status\|clear` | Manage active feature lease and editing scope |
65
- | `septum serve` | Launch stdio MCP server for AI coding agents |
66
-
67
- ---
68
-
69
- ## Core Capabilities & MCP Tools
70
-
71
- All tools expose typed schemas automatically via the Model Context Protocol:
72
-
73
- - **Whole-Project Telescope (`septum_get_domain_catalog`):** Returns macro architecture maps in < 400 tokens.
74
- - **Vertical Slice Tracer (`septum_trace_vertical_slice`):** Traces execution chains (*Ingress ➔ Validation ➔ Orchestration ➔ Domain ➔ Egress*) across frameworks.
75
- - **Pre-Flight Boundary Guard (`septum_check_boundary`):** Validates proposed edits and imports against bounded-context rules.
76
- - **Scope Locking (`septum_get_feature_context` / `septum_clear_feature_context`):** Locks active feature scope to eliminate context drift.
77
- - **Symbol & Blast Radius (`septum_locate_symbol`, `septum_get_symbol`, `septum_get_symbol_impact`):** Resolves call chains, signatures, and refactoring impact.
78
- - **God Function Detector (`septum_get_symbol_hotspots`):** Surfaces oversized functions/methods by physical lines-of-code.
79
- - **Dynamic Topology (`septum_register_domain`):** Registers or updates domains and boundary rules on-the-fly.
80
-
81
- ---
82
-
83
- ## Development & Contributing
84
-
85
- ```bash
86
- # Clone and install dependencies
87
- git clone https://github.com/shironim/septum.git
88
- cd septum
89
- bun install
90
-
91
- # Run test suite & build
92
- bun test
93
- bun run build
94
- ```
95
-
96
- ---
97
-
98
- ## License
99
-
100
- [MIT](LICENSE) © shironim
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 feature status\|clear` | Manage active feature lease and editing scope |
65
+ | `septum serve` | Launch stdio MCP server for AI coding agents |
66
+
67
+ ---
68
+
69
+ ## Core Capabilities & MCP Tools
70
+
71
+ All tools expose typed schemas automatically via the Model Context Protocol:
72
+
73
+ - **Whole-Project Telescope (`septum_get_domain_catalog`):** Returns macro architecture maps in < 400 tokens.
74
+ - **Vertical Slice Tracer (`septum_trace_vertical_slice`):** Traces execution chains (*Ingress ➔ Validation ➔ Orchestration ➔ Domain ➔ Egress*) across frameworks.
75
+ - **Pre-Flight Boundary Guard (`septum_check_boundary`):** Validates proposed edits and imports against bounded-context rules.
76
+ - **Scope Locking (`septum_get_feature_context` / `septum_clear_feature_context`):** Locks active feature scope to eliminate context drift.
77
+ - **Symbol & Blast Radius (`septum_locate_symbol`, `septum_get_symbol`, `septum_get_symbol_impact`):** Resolves call chains, signatures, and refactoring impact.
78
+ - **God Function Detector (`septum_get_symbol_hotspots`):** Surfaces oversized functions/methods by physical lines-of-code.
79
+ - **Dynamic Topology (`septum_register_domain`):** Registers or updates domains and boundary rules on-the-fly.
80
+
81
+ ---
82
+
83
+ ## Development & Contributing
84
+
85
+ ```bash
86
+ # Clone and install dependencies
87
+ git clone https://github.com/shironim/septum.git
88
+ cd septum
89
+ bun install
90
+
91
+ # Run test suite & build
92
+ bun test
93
+ bun run build
94
+ ```
95
+
96
+ ---
97
+
98
+ ## License
99
+
100
+ [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,62 +1,63 @@
1
- {
2
- "name": "septum",
3
- "version": "0.1.0",
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
- }
1
+ {
2
+ "name": "septum",
3
+ "version": "0.1.2",
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
+