@dimassetoid/septum-mcp 0.2.1 → 0.5.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.
- package/README.md +46 -45
- package/package.json +8 -6
- package/src/cli/commands/check.ts +41 -26
- package/src/cli/commands/hook.ts +77 -105
- package/src/cli/commands/init.ts +35 -9
- package/src/cli/commands/stats.ts +33 -0
- package/src/cli/commands/sync-progress.ts +71 -0
- package/src/cli/commands/sync.ts +35 -9
- package/src/cli/hook-payload.ts +43 -0
- package/src/cli/index.ts +15 -51
- package/src/cli/scaffold/harness-config.ts +48 -8
- package/src/cli/templates/hooks.ts +51 -27
- package/src/cli/templates/rules.ts +34 -49
- package/src/cli/templates/skill.ts +46 -35
- package/src/core/boundary/audit.ts +383 -0
- package/src/core/boundary/evaluator.ts +299 -178
- package/src/core/boundary/staged-auditor.ts +188 -34
- package/src/core/config/domain-ownership.ts +47 -0
- package/src/core/config/domain-registration.ts +141 -0
- package/src/core/config/loader.ts +82 -54
- package/src/core/config/schema.ts +24 -46
- package/src/core/database/client.ts +2 -0
- package/src/core/database/repositories/dependency.repository.ts +326 -543
- package/src/core/database/repositories/domain.repository.ts +48 -4
- package/src/core/database/repositories/file.repository.ts +10 -0
- package/src/core/database/repositories/symbol.repository.ts +97 -259
- package/src/core/database/repository.ts +138 -24
- package/src/core/database/schema.ts +28 -33
- package/src/core/discovery/declarative-routes.ts +69 -0
- package/src/core/discovery/framework-detector.ts +149 -0
- package/src/core/discovery/navigation.ts +269 -0
- package/src/core/discovery/topology-detector.ts +153 -170
- package/src/core/errors.ts +19 -0
- package/src/core/ingestion/pipeline.ts +378 -212
- package/src/core/parser/behavioral-analyzer.ts +26 -22
- package/src/core/parser/boundary-tracker.ts +15 -0
- package/src/core/parser/extractors/base.ts +16 -4
- package/src/core/parser/extractors/csharp.ts +9 -5
- package/src/core/parser/extractors/django-routing.ts +163 -0
- package/src/core/parser/extractors/django-semantic.ts +400 -516
- package/src/core/parser/extractors/elysia-semantic.ts +172 -496
- package/src/core/parser/extractors/express-semantic.ts +195 -398
- package/src/core/parser/extractors/fastapi-semantic.ts +182 -399
- package/src/core/parser/extractors/fastify-semantic.ts +216 -732
- package/src/core/parser/extractors/flask-semantic.ts +92 -388
- package/src/core/parser/extractors/go-routing.ts +344 -0
- package/src/core/parser/extractors/go-semantic.ts +210 -508
- package/src/core/parser/extractors/go.ts +6 -3
- package/src/core/parser/extractors/graphql-entrypoint.ts +146 -0
- package/src/core/parser/extractors/hono-semantic.ts +132 -530
- package/src/core/parser/extractors/java.ts +7 -5
- package/src/core/parser/extractors/laravel-routing.ts +263 -0
- package/src/core/parser/extractors/laravel-semantic.ts +169 -333
- package/src/core/parser/extractors/manifest-helpers.ts +64 -0
- package/src/core/parser/extractors/mcp-cli-dispatch.ts +268 -0
- package/src/core/parser/extractors/mcp-cli-semantic.ts +84 -336
- package/src/core/parser/extractors/nestjs-semantic.ts +238 -510
- package/src/core/parser/extractors/nextjs-semantic.ts +164 -0
- package/src/core/parser/extractors/php-ast-helpers.ts +51 -0
- package/src/core/parser/extractors/php.ts +17 -1
- package/src/core/parser/extractors/python-route-ast.ts +249 -0
- package/src/core/parser/extractors/python.ts +9 -8
- package/src/core/parser/extractors/registry.ts +28 -5
- package/src/core/parser/extractors/route-prefixes.ts +43 -0
- package/src/core/parser/extractors/ruby.ts +10 -7
- package/src/core/parser/extractors/rust.ts +35 -17
- package/src/core/parser/extractors/semantic-extractor.interface.ts +3 -1
- package/src/core/parser/extractors/symfony-routing.ts +114 -0
- package/src/core/parser/extractors/symfony-semantic.ts +75 -262
- package/src/core/parser/extractors/typescript-bindings.ts +333 -0
- package/src/core/parser/extractors/typescript-compiler-fallback.ts +380 -0
- package/src/core/parser/extractors/typescript-fallback.ts +207 -0
- package/src/core/parser/extractors/typescript-route-context.ts +58 -0
- package/src/core/parser/extractors/typescript.ts +36 -216
- package/src/core/parser/implementation-fingerprint.ts +97 -0
- package/src/core/parser/language-capabilities.ts +23 -7
- package/src/core/parser/schema/providers/laravel-migration-provider.ts +77 -51
- package/src/core/parser/schema/schema-provider-registry.ts +1 -3
- package/src/core/parser/schema/schema-provider.interface.ts +2 -1
- package/src/core/parser/semantic-revision.ts +3 -0
- package/src/core/parser/static-string.ts +51 -0
- package/src/core/parser/wasm-loader.ts +6 -2
- package/src/core/resolver/ast-method-tracer.ts +230 -0
- package/src/core/resolver/call-graph-helpers.ts +72 -0
- package/src/core/resolver/call-graph-tracer.ts +375 -311
- package/src/core/resolver/dependency-analysis.ts +593 -0
- package/src/core/resolver/import-candidates.ts +120 -0
- package/src/core/resolver/import-evidence.ts +88 -0
- package/src/core/resolver/import-resolver.ts +162 -181
- package/src/core/resolver/interpretation-inputs.ts +65 -0
- package/src/core/resolver/languages/go.ts +103 -0
- package/src/core/resolver/languages/managed.ts +200 -0
- package/src/core/resolver/languages/python.ts +133 -0
- package/src/core/resolver/languages/ruby.ts +40 -0
- package/src/core/resolver/languages/rust.ts +127 -0
- package/src/core/resolver/languages/shared.ts +74 -0
- package/src/core/resolver/module-resolver.ts +18 -7
- package/src/core/resolver/path-resolver.ts +6 -3
- package/src/core/resolver/polyglot-slice-tracer.ts +197 -0
- package/src/core/resolver/slice-catalog.ts +94 -0
- package/src/core/resolver/slice-format.ts +22 -0
- package/src/core/resolver/slice-selection.ts +237 -0
- package/src/core/resolver/symbol-impact.ts +477 -0
- package/src/core/resolver/symbol-locator.ts +82 -15
- package/src/core/resolver/vertical-slice-tracer.ts +57 -278
- package/src/core/resources/ignore.ts +21 -1
- package/src/core/resources/limits.ts +2 -1
- package/src/core/resources/source-files.ts +143 -20
- package/src/core/resources/source-inventory.ts +55 -0
- package/src/core/resources/work-queue.ts +167 -4
- package/src/core/retrieval/context-page.ts +116 -0
- package/src/core/retrieval/context.ts +457 -0
- package/src/core/retrieval/resolution-warnings.ts +21 -0
- package/src/core/retrieval/source-context.ts +448 -0
- package/src/core/retrieval/symbol-details.ts +453 -0
- package/src/core/retrieval/symbol-evidence.ts +97 -0
- package/src/core/retrieval/typescript-references.ts +293 -0
- package/src/core/retrieval/universal-context.ts +182 -0
- package/src/core/telemetry/summary.ts +114 -0
- package/src/core/telemetry/telemetry.ts +225 -37
- package/src/index.ts +0 -3
- package/src/mcp/formatters/compact-text.ts +439 -0
- package/src/mcp/resources-and-prompts.ts +253 -0
- package/src/mcp/schemas/boundary.ts +145 -0
- package/src/mcp/schemas/map.ts +250 -0
- package/src/mcp/schemas/shared.ts +52 -0
- package/src/mcp/schemas/slice.ts +60 -0
- package/src/mcp/schemas/symbol.ts +268 -0
- package/src/mcp/schemas.ts +5 -1105
- package/src/mcp/server.ts +263 -597
- package/src/mcp/tool-catalog.ts +331 -0
- package/src/mcp/tools/boundary.ts +69 -4
- package/src/mcp/tools/map.ts +126 -0
- package/src/mcp/tools/slice.ts +101 -3
- package/src/mcp/tools/symbol.ts +480 -26
- package/src/mcp/ui/app-client.ts +899 -0
- package/src/mcp/ui/app.html +478 -0
- package/src/mcp/workflow-playbooks.ts +181 -0
- package/src/mcp/workspace-boundary.ts +50 -0
- package/src/mcp/workspace-manager.ts +102 -18
- package/src/mcp/workspace-watcher.ts +38 -19
- package/src/types/index.ts +47 -53
- package/src/cli/commands/topology.ts +0 -161
- package/src/core/database/repositories/environment.repository.ts +0 -207
- package/src/core/parser/schema/providers/prisma-schema-provider.ts +0 -90
- package/src/core/session/session-manager.ts +0 -107
- package/src/core/topology/environment-detector.ts +0 -973
- package/src/core/topology/types.ts +0 -83
- package/src/mcp/tools/check-boundary.ts +0 -387
- package/src/mcp/tools/domain.ts +0 -40
- package/src/mcp/tools/feature.ts +0 -67
- package/src/mcp/tools/get-domain-catalog.ts +0 -226
- package/src/mcp/tools/get-environment-topology.ts +0 -138
- package/src/mcp/tools/get-feature-context.ts +0 -224
- package/src/mcp/tools/get-symbol-hotspots.ts +0 -54
- package/src/mcp/tools/get-symbol-impact.ts +0 -64
- package/src/mcp/tools/get-symbol.ts +0 -175
- package/src/mcp/tools/locate-symbol.ts +0 -196
- package/src/mcp/tools/register-domain.ts +0 -75
- package/src/mcp/tools/register-feature.ts +0 -110
- package/src/mcp/tools/trace-vertical-slice.ts +0 -80
|
@@ -2,7 +2,7 @@ export const SEPTUM_HOOKS_CONFIG = {
|
|
|
2
2
|
"septum-boundary-guard": {
|
|
3
3
|
"PreToolUse": [
|
|
4
4
|
{
|
|
5
|
-
"matcher": "write_to_file|replace_file_content|multi_replace_file_content|Write|Edit|MultiEdit",
|
|
5
|
+
"matcher": "write_file|edit_file|write_to_file|replace_file_content|multi_replace_file_content|Write|Edit|MultiEdit|NotebookEdit",
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
@@ -12,31 +12,21 @@ export const SEPTUM_HOOKS_CONFIG = {
|
|
|
12
12
|
],
|
|
13
13
|
},
|
|
14
14
|
],
|
|
15
|
-
"PostToolUse": [
|
|
16
|
-
{
|
|
17
|
-
"matcher": "write_to_file|replace_file_content|multi_replace_file_content|Write|Edit|MultiEdit",
|
|
18
|
-
"hooks": [
|
|
19
|
-
{
|
|
20
|
-
"type": "command",
|
|
21
|
-
"command": "sh -c 'ROOT=\"$(pwd -P)\"; for d in .gemini .claude .codex opencode .agents; do if [ -f \"$ROOT/$d/hooks/septum-post-write.sh\" ]; then exec \"$ROOT/$d/hooks/septum-post-write.sh\" \"$@\"; fi; done; exit 0'",
|
|
22
|
-
"timeout": 15,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
15
|
},
|
|
28
16
|
};
|
|
29
17
|
|
|
30
18
|
export const SEPTUM_PRE_WRITE_SCRIPT = `#!/usr/bin/env sh
|
|
31
|
-
# Septum
|
|
32
|
-
#
|
|
19
|
+
# Septum candidate import policy hook
|
|
20
|
+
# Passes supported edit payloads to the CLI before the client writes them
|
|
33
21
|
|
|
34
22
|
ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd -P)"
|
|
35
|
-
if [ ! -f "$ROOT_DIR/.septum/septum.db" ]; then
|
|
23
|
+
if [ ! -f "$ROOT_DIR/.septum/septum.db" ] && [ ! -f "$ROOT_DIR/septum.config.json" ]; then
|
|
36
24
|
exit 0
|
|
37
25
|
fi
|
|
38
26
|
|
|
39
|
-
|
|
27
|
+
export SEPTUM_HOOK_ROOT="$ROOT_DIR"
|
|
28
|
+
|
|
29
|
+
# Invoke the available Septum CLI hook command
|
|
40
30
|
if command -v bun >/dev/null 2>&1 && [ -f "$ROOT_DIR/bin/septum.ts" ]; then
|
|
41
31
|
exec bun run "$ROOT_DIR/bin/septum.ts" hook pre-write "$@"
|
|
42
32
|
elif command -v septum >/dev/null 2>&1; then
|
|
@@ -55,21 +45,55 @@ export const SEPTUM_POST_WRITE_SCRIPT = `#!/usr/bin/env sh
|
|
|
55
45
|
# Syncs modified AST into SQLite SSOT after file mutations
|
|
56
46
|
|
|
57
47
|
ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd -P)"
|
|
58
|
-
if [ ! -f "$ROOT_DIR/.septum/septum.db" ]; then
|
|
48
|
+
if [ ! -f "$ROOT_DIR/.septum/septum.db" ] && [ ! -f "$ROOT_DIR/septum.config.json" ]; then
|
|
59
49
|
exit 0
|
|
60
50
|
fi
|
|
61
51
|
|
|
62
|
-
#
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
# Sync always belongs to the workspace containing this generated wrapper.
|
|
53
|
+
cd "$ROOT_DIR" || exit 1
|
|
54
|
+
mkdir -p "$ROOT_DIR/.septum" 2>/dev/null || true
|
|
55
|
+
|
|
56
|
+
LOCK_DIR="$ROOT_DIR/.septum/sync.lock"
|
|
57
|
+
PENDING_FILE="$ROOT_DIR/.septum/sync.pending"
|
|
58
|
+
|
|
59
|
+
# Mark workspace as needing sync so an active lock holder coalesces burst edits
|
|
60
|
+
: > "$PENDING_FILE" 2>/dev/null || true
|
|
61
|
+
|
|
62
|
+
# Recover stale lock if holder PID is no longer alive
|
|
63
|
+
if [ -d "$LOCK_DIR" ] && [ -f "$LOCK_DIR/pid" ]; then
|
|
64
|
+
LOCK_PID="$(cat "$LOCK_DIR/pid" 2>/dev/null)"
|
|
65
|
+
if [ -n "$LOCK_PID" ] && ! kill -0 "$LOCK_PID" 2>/dev/null; then
|
|
66
|
+
rm -rf "$LOCK_DIR" 2>/dev/null || true
|
|
67
|
+
fi
|
|
71
68
|
fi
|
|
72
69
|
|
|
70
|
+
# Non-blocking lock acquisition: if another background sync is active, exit 0
|
|
71
|
+
if ! mkdir "$LOCK_DIR" 2>/dev/null; then
|
|
72
|
+
exit 0
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
run_septum_sync() {
|
|
76
|
+
if command -v bun >/dev/null 2>&1 && [ -f "$ROOT_DIR/bin/septum.ts" ]; then
|
|
77
|
+
bun run "$ROOT_DIR/bin/septum.ts" sync >/dev/null 2>&1
|
|
78
|
+
elif command -v septum >/dev/null 2>&1; then
|
|
79
|
+
septum sync >/dev/null 2>&1
|
|
80
|
+
elif [ -f "$ROOT_DIR/node_modules/.bin/septum" ]; then
|
|
81
|
+
"$ROOT_DIR/node_modules/.bin/septum" sync >/dev/null 2>&1
|
|
82
|
+
elif command -v bunx >/dev/null 2>&1; then
|
|
83
|
+
bunx septum sync >/dev/null 2>&1
|
|
84
|
+
fi
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# Trigger coalesced background incremental sync
|
|
88
|
+
(
|
|
89
|
+
trap 'rm -rf "$LOCK_DIR" 2>/dev/null || true' EXIT INT TERM
|
|
90
|
+
while [ -f "$PENDING_FILE" ]; do
|
|
91
|
+
rm -f "$PENDING_FILE" 2>/dev/null || true
|
|
92
|
+
run_septum_sync
|
|
93
|
+
done
|
|
94
|
+
) >/dev/null 2>&1 &
|
|
95
|
+
echo "$!" > "$LOCK_DIR/pid" 2>/dev/null || true
|
|
96
|
+
|
|
73
97
|
exit 0
|
|
74
98
|
`;
|
|
75
99
|
|
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
export const SEPTUM_RULES_TEMPLATE = `#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## 3. Dependency Validation & Static Boundary Checks
|
|
38
|
-
|
|
39
|
-
1. **Pre-Validate Proposed Module Imports:**
|
|
40
|
-
Before adding new cross-module dependencies, validate whether the dependency direction conforms to the architecture:
|
|
41
|
-
\`\`\`json
|
|
42
|
-
septum_boundary({
|
|
43
|
-
"file_path": "src/modules/order/service.ts",
|
|
44
|
-
"proposed_imports": ["../billing/service"],
|
|
45
|
-
"feature_key": "optional_feature_key"
|
|
46
|
-
})
|
|
47
|
-
\`\`\`
|
|
48
|
-
2. **Verify Against Circular Dependencies and Boundary Leaks:**
|
|
49
|
-
Run \`septum_boundary({ scope: "staged" })\` or \`septum_boundary({ scope: "all" })\` prior to committing changes. If the check returns \`rejected\` (due to \`forbidden_dependency\`, \`disallowed_dependency\`, \`touchpoint_violation\`, or \`circular_dependency\`), refactor the import hierarchy to preserve clean dependency inversion.
|
|
1
|
+
export const SEPTUM_RULES_TEMPLATE = `# Septum: static code navigation and boundary checks
|
|
2
|
+
|
|
3
|
+
Use Septum to inspect indexed declarations, imports, domains and supported entrypoints. Its SQLite database stores extracted static evidence. Read freshness, coverage, diagnostics and omissions before relying on a result.
|
|
4
|
+
|
|
5
|
+
## Tool routing
|
|
6
|
+
|
|
7
|
+
| Task | Tool | Result |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Find domains and files | \`septum_map({action: "catalog", detail_level: "compact"})\` | Domain/file navigation, directed import relationships, static entrypoints and index health |
|
|
10
|
+
| Inspect a declaration | \`septum_symbol({action: "locate", query: "<name>"})\` | Indexed coordinates, declaration reference, candidates or suggestions |
|
|
11
|
+
| Read implementation and supporting declarations | \`septum_symbol({action: "context", query: "<name>", file_path: "<path>"})\` | Deep TypeScript context or bounded source inspection, according to the selected mode |
|
|
12
|
+
| Inspect potential consumers | \`septum_symbol({action: "impact", query: "<name>"})\` | Import dependents, supported static call sites and inferred caller hints |
|
|
13
|
+
| Inspect an entrypoint | \`septum_slice({query: "<route or handler>", max_depth: 5})\` | Static catalog match and related nodes with relationship evidence |
|
|
14
|
+
| Check proposed imports | \`septum_boundary({scope: "file", file_path: "<path>", proposed_imports: [...]})\` | Proposal decision and diagnostics under configured domain rules |
|
|
15
|
+
| Check the Git index | \`septum_boundary({scope: "staged"})\` | Boundary analysis using frozen staged source and interpretation files |
|
|
16
|
+
|
|
17
|
+
## Reading and acting on results
|
|
18
|
+
|
|
19
|
+
- Start with map when the relevant domain/file is unknown. Follow \`dependencies\`, \`entrypoints\`, \`health\` and \`next\`. Full detail expands navigation selection; use symbol for declaration bodies.
|
|
20
|
+
- Narrow ambiguous declarations with \`file_path\` or a returned \`symbol_ref\`. A found indexed declaration can still have stale or unavailable source.
|
|
21
|
+
- Choose \`context_mode: "deep"\` for supported TypeScript reference context. Choose \`context_mode: "source"\` for bounded source inspection. On the source path, \`include_source: false\` requests signature/dependency details.
|
|
22
|
+
- Deep-context \`budget_bytes\` controls response serialization. Source-mode line limits are a different contract. A setting is not a guarantee of task completeness.
|
|
23
|
+
- Continue deep context with the returned \`continuation\` and unchanged selection/options. Inspect omission accounting and diagnostics.
|
|
24
|
+
- Before changing a public contract, inspect impact and the relevant consumers. Read \`inbound_callers_complete\` and the limits of \`inbound_callers\`; static caller evidence requires application checks.
|
|
25
|
+
- Proposal approval does not audit existing imports. Use all/domain/staged scopes for their corresponding audits.
|
|
26
|
+
- \`unknown\` is not approval. \`rejected\` reports detected violations such as \`forbidden_dependency\`, \`disallowed_dependency\` or \`circular_dependency\`. \`approved\` concerns only the evaluated static scope.
|
|
27
|
+
- Slice confidence describes query-to-catalog matching. Imports do not prove calls; related nodes do not establish execution order or runtime dispatch.
|
|
28
|
+
- If tools are unavailable or evidence is incomplete, inspect relevant source directly and verify the behavior with appropriate project checks.
|
|
29
|
+
|
|
30
|
+
## Language and workspace scope
|
|
31
|
+
|
|
32
|
+
Declaration extraction and import resolution have separate language-specific limits. Python, Go, Rust, Ruby, Java and C# resolve supported local/manifest patterns; dynamic configuration, conditional builds, binary classpaths and runtime loading can remain unresolved or unsupported. Set \`workspace_path\` explicitly when selecting among repositories.
|
|
33
|
+
|
|
34
|
+
Generated client hooks need client enablement and a matching tool payload. Their presence does not prove that an edit was intercepted.
|
|
50
35
|
`;
|
|
@@ -1,51 +1,62 @@
|
|
|
1
|
-
export const
|
|
2
|
-
name: septum
|
|
3
|
-
description:
|
|
1
|
+
export const USE_SEPTUM_SKILL_TEMPLATE = `---
|
|
2
|
+
name: use-septum
|
|
3
|
+
description: >-
|
|
4
|
+
Inspect backend declarations, imports, domain boundaries and supported static entrypoints with Septum MCP. Use for code navigation, consumer inspection and proposed/staged import checks; inspect coverage and freshness before using results to plan edits.
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
#
|
|
7
|
+
# use-septum
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Septum indexes selected source declarations, imports, domain ownership and static entrypoints. It returns static evidence and diagnostics. It does not run the analyzed application or provide a complete runtime caller graph.
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Select the tool
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
All 4 tools default to \`format: "text"\` (token-efficient compact markdown summary); pass \`format: "json"\` when structured JSON is required.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
| Need | Request | Read from the result |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Workspace/domain/file navigation | \`septum_map\`, \`action: "catalog"\`, \`detail_level: "compact"\`, optional \`domain\`/\`file_filter\`/\`format\` | \`submodules\` + aggregated dependencies (for large domains >25 files), files/anchors, directed \`dependencies\`, static \`entrypoints\`, \`health\`, \`next\` |
|
|
18
|
+
| Domain policy registration | \`septum_map\`, \`action: "register"\`, \`domain\`, \`root\`, dependency lists | Recorded policy, \`policy_owner\` and any ingestion result |
|
|
19
|
+
| Declaration lookup | \`septum_symbol\`, \`action: "locate"\`, \`query\` | Indexed coordinates, \`symbol_ref\`, token/camelCase-ranked suggestions and retrieval freshness |
|
|
20
|
+
| TypeScript reference context | \`septum_symbol\`, \`action: "context"\`, \`context_mode: "deep"\`, optional \`max_depth\` (1–4, default 2) | True hop-ordered (\`hop 0→1→2\`, direct local/imported callees & contracts first) source/contracts, diagnostics, accounting and continuation |
|
|
21
|
+
| Source/signature inspection | \`septum_symbol\`, \`action: "context"\`, \`context_mode: "source"\` | Source slice or signature/dependency details and source status |
|
|
22
|
+
| Potential consumers | \`septum_symbol\`, \`action: "impact"\` | Separated \`call_sites\`, \`runtime_imports\`, \`type_only_imports\`, warnings and uncertainty |
|
|
23
|
+
| Supported route/handler/job/CLI/event | \`septum_slice\`, \`query\`, optional \`controller_file\`, \`max_depth\`, \`format\` | Catalog target (\`exact\` match for \`METHOD target\`), indented parent-attributed chain and diagnostics |
|
|
24
|
+
| Proposed imports | \`septum_boundary\`, \`scope: "file"\`, \`file_path\`, \`proposed_imports\` | Proposal decision and evaluated scope |
|
|
25
|
+
| Existing indexed or staged imports | \`septum_boundary\`, \`scope: "all" / "domain" / "staged"\` | Scoped violations, incomplete resolution and recovery hints |
|
|
15
26
|
|
|
16
|
-
|
|
27
|
+
## Context selection
|
|
17
28
|
|
|
18
|
-
|
|
19
|
-
|---|---|---|
|
|
20
|
-
| \`septum_domain\` | \`catalog\` inspects module architecture (supports \`detail_level: "compact"\`); \`register\` defines domain roots; \`topology\` logs infrastructure layers. | Domain registration mutates database state. Directory structures serve as modular hints. |
|
|
21
|
-
| \`septum_symbol\` | \`locate\`, \`inspect\`, \`impact\`, or \`hotspots\` across the project symbol table. | Backed by Tree-Sitter AST parsers. Impact analysis reports static inbound callers across the dependency graph. |
|
|
22
|
-
| \`septum_slice\` | Traces end-to-end execution paths from ingress handlers down through services and repositories; \`max_depth\` bounds call graph traversal. | Returns matched call graph chains; confidence metrics reflect static AST resolution depth. |
|
|
23
|
-
| \`septum_boundary\` | Validates proposed imports and detects \`circular_dependency\` cycles across scopes (\`file\`, \`staged\`, \`domain\`, \`all\`). | Evaluates allowed/forbidden dependency rules. Status \`approved\` confirms zero policy violations in the checked scope. |
|
|
24
|
-
| \`septum_feature\` | \`get\` retrieves active task context; \`lock\` registers task touchpoints; \`release\` clears locks. | Restricts edits to authorized module touchpoints during concurrent development sessions. |
|
|
29
|
+
Deep context supports indexed \`.ts\`, \`.tsx\`, \`.mts\` and \`.cts\` declarations. It follows bounded supported references up to \`max_depth\` import edges (default \`2\`, max \`4\`), ranks items hop-first (\`depth 0 → 1 → 2\`, direct calls and contracts ahead of transitive helpers), and can project public type contracts. It does not establish a complete business dependency closure.
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
Use \`budget_bytes\` and \`max_depth\` only for deep context. Do not combine them with \`include_source\`, \`source_start_line\` or \`source_line_limit\`. Those options select bounded source inspection when no explicit mode is supplied. \`inspect\` is an alias for \`context\`.
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
Source mode includes target source by default. Use \`include_source: false\` for signature/dependency details. When a source slice is truncated, follow \`next_start_line\`. One-hop delegation expansion (including same-file local helper delegation for polyglot files) is heuristic; inspect the selected dependency before treating it as a callee.
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
2. **Inspect Module Inventory:** Query the domain catalog to determine registered modules, AST index status, and file coverage metrics. If files are marked unsupported or skipped, note partial coverage.
|
|
32
|
-
3. **Differentiate Evidence from Assumptions:** Use concrete AST symbols, public exports, and declared configuration as evidence. Never guess interfaces or assume unverified dependencies.
|
|
33
|
-
4. **Identify Reusable Components:** Search existing services, models, and utility classes before introducing new declarations to adhere to the DRY principle.
|
|
34
|
-
5. **Analyze Refactoring Blast Radius:** Check inbound callers (\`septum_symbol impact\`) before modifying public method signatures or removing exported declarations.
|
|
35
|
-
6. **Validate Dependency Boundaries:** Run pre-commit checks (\`septum_boundary\`) to ensure proposed imports avoid circular dependencies and respect architectural layering.
|
|
35
|
+
For deep-context pages, pass the returned \`continuation\` with unchanged target, workspace, configuration, \`max_depth\` and budget. Restart retrieval on invalid/stale continuation. Capacity omissions are distinct from pagination.
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Workflow and evidence limits
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
1. Use map when the target domain or file is unknown. Full map detail expands navigation selection, not declaration detail.
|
|
40
|
+
2. Locate a declaration and resolve ambiguity through \`file_path\` or \`symbol_ref\`. Read freshness before using indexed coordinates.
|
|
41
|
+
3. Retrieve the relevant source/contracts. Inspect diagnostics and omissions, and read further source when needed.
|
|
42
|
+
4. Before a public-contract change, inspect impact and relevant consumers. \`inbound_callers_complete: false\` means the caller list is incomplete; risk is advisory.
|
|
43
|
+
5. Evaluate proposed imports against policy. Proposal approval does not certify existing imports or all possible cycles.
|
|
44
|
+
6. Check the relevant workspace/domain/staged scope and run application checks for behavior affected by the edit.
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
A slice's exact match applies to its catalog target. Imports do not prove calls; static relationships do not prove execution order or runtime dispatch. Validation/schema/entity nodes are context, not a required executed sequence.
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
Boundary \`approved\` describes the evaluated static scope. \`rejected\` reports known violations, including \`circular_dependency\`. \`unknown\` requires inspecting or recovering missing evidence. Resolve ambiguity by narrowing the request.
|
|
49
|
+
|
|
50
|
+
Language declaration support does not imply equivalent module resolution. Rust/Cargo, Ruby requires, Java source projects and C# namespaces have bounded resolver support; dynamic loaders, macros, conditional builds and missing binary metadata remain limited.
|
|
51
|
+
|
|
52
|
+
Set \`workspace_path\` when selecting among repositories. If the MCP tools are unavailable or insufficient, use direct source inspection and appropriate project verification.
|
|
53
|
+
|
|
54
|
+
## Resources & Prompts
|
|
55
|
+
|
|
56
|
+
- **MCP Resources (initial workspace):** \`septum://domains\`, \`septum://health\`, \`septum://boundaries\`, and \`septum://domain/{name}\` provide read-only JSON snapshots for the server's initial workspace; use the 4 MCP tools with \`workspace_path\` for multi-root queries.
|
|
57
|
+
- **MCP Prompts:** \`septum-pre-edit-check\` and \`septum-architecture-audit\` provide step-by-step verification playbooks.
|
|
58
|
+
|
|
59
|
+
Describe the operation and observed result. Do not promise token savings, response speed, memory savings, complete caller discovery or universal language/framework coverage.
|
|
51
60
|
`;
|
|
61
|
+
|
|
62
|
+
export const SEPTUM_MAP_SKILL_TEMPLATE = USE_SEPTUM_SKILL_TEMPLATE;
|