septum 0.1.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/LICENSE +21 -0
- package/README.md +100 -0
- package/bin/septum.ts +4 -0
- package/package.json +62 -0
- package/src/cli/commands/check.ts +161 -0
- package/src/cli/commands/hook.ts +188 -0
- package/src/cli/commands/ingest.ts +29 -0
- package/src/cli/commands/init.ts +211 -0
- package/src/cli/commands/locate.ts +61 -0
- package/src/cli/commands/query.ts +64 -0
- package/src/cli/commands/serve.ts +5 -0
- package/src/cli/commands/slice.ts +90 -0
- package/src/cli/commands/sync.ts +31 -0
- package/src/cli/index.ts +178 -0
- package/src/cli/templates/hooks.ts +75 -0
- package/src/cli/templates/rules.ts +38 -0
- package/src/cli/templates/skill.ts +66 -0
- package/src/core/boundary/evaluator.ts +210 -0
- package/src/core/config/loader.ts +84 -0
- package/src/core/config/schema.ts +39 -0
- package/src/core/database/client.ts +132 -0
- package/src/core/database/repositories/dependency.repository.ts +279 -0
- package/src/core/database/repositories/domain.repository.ts +198 -0
- package/src/core/database/repositories/file.repository.ts +99 -0
- package/src/core/database/repositories/meta.repository.ts +33 -0
- package/src/core/database/repositories/symbol.repository.ts +424 -0
- package/src/core/database/repository.ts +242 -0
- package/src/core/database/schema.sql +92 -0
- package/src/core/discovery/topology-detector.ts +418 -0
- package/src/core/ingestion/hasher.ts +5 -0
- package/src/core/ingestion/pipeline.ts +438 -0
- package/src/core/parser/boundary-tracker.ts +128 -0
- package/src/core/parser/extractors/base.ts +60 -0
- package/src/core/parser/extractors/frontend.ts +194 -0
- package/src/core/parser/extractors/go.ts +176 -0
- package/src/core/parser/extractors/laravel-semantic.ts +426 -0
- package/src/core/parser/extractors/mcp-cli-semantic.ts +199 -0
- package/src/core/parser/extractors/nestjs-semantic.ts +119 -0
- package/src/core/parser/extractors/php.ts +149 -0
- package/src/core/parser/extractors/python.ts +226 -0
- package/src/core/parser/extractors/registry.ts +49 -0
- package/src/core/parser/extractors/semantic-extractor.interface.ts +21 -0
- package/src/core/parser/extractors/typescript.ts +177 -0
- package/src/core/parser/tree-sitter.ts +39 -0
- package/src/core/resolver/call-graph-tracer.ts +668 -0
- package/src/core/resolver/module-resolver.ts +323 -0
- package/src/core/resolver/symbol-locator.ts +405 -0
- package/src/core/resolver/vertical-slice-tracer.ts +236 -0
- package/src/core/session/session-manager.ts +56 -0
- package/src/core/telemetry/telemetry.ts +86 -0
- package/src/index.ts +18 -0
- package/src/mcp/schemas.ts +68 -0
- package/src/mcp/server.ts +602 -0
- package/src/mcp/tools/check-boundary.ts +102 -0
- package/src/mcp/tools/get-domain-catalog.ts +91 -0
- package/src/mcp/tools/get-feature-context.ts +116 -0
- package/src/mcp/tools/get-symbol-hotspots.ts +49 -0
- package/src/mcp/tools/get-symbol-impact.ts +26 -0
- package/src/mcp/tools/get-symbol.ts +63 -0
- package/src/mcp/tools/locate-symbol.ts +74 -0
- package/src/mcp/tools/register-domain.ts +64 -0
- package/src/mcp/tools/trace-vertical-slice.ts +102 -0
- package/src/types/index.ts +296 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
export type EnforcementMode = "strict" | "warn";
|
|
2
|
+
|
|
3
|
+
export type ArchetypeKind =
|
|
4
|
+
| "controller"
|
|
5
|
+
| "service"
|
|
6
|
+
| "model"
|
|
7
|
+
| "repository"
|
|
8
|
+
| "action"
|
|
9
|
+
| "job"
|
|
10
|
+
| "event"
|
|
11
|
+
| "listener"
|
|
12
|
+
| "middleware"
|
|
13
|
+
| "request"
|
|
14
|
+
| "resource"
|
|
15
|
+
| "util"
|
|
16
|
+
| "unknown";
|
|
17
|
+
|
|
18
|
+
export type SymbolKind =
|
|
19
|
+
| "class"
|
|
20
|
+
| "interface"
|
|
21
|
+
| "trait"
|
|
22
|
+
| "enum"
|
|
23
|
+
| "method"
|
|
24
|
+
| "function"
|
|
25
|
+
| "type"
|
|
26
|
+
| "property";
|
|
27
|
+
|
|
28
|
+
export type Visibility = "public" | "protected" | "private";
|
|
29
|
+
|
|
30
|
+
export interface SeptumConfig {
|
|
31
|
+
version: string;
|
|
32
|
+
settings: {
|
|
33
|
+
enforcement: EnforcementMode;
|
|
34
|
+
db_path?: string;
|
|
35
|
+
ignore_patterns?: string[];
|
|
36
|
+
};
|
|
37
|
+
domains: Record<string, DomainConfig>;
|
|
38
|
+
features?: Record<string, FeatureConfig>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface DomainConfig {
|
|
42
|
+
root: string;
|
|
43
|
+
allowed_dependencies?: string[];
|
|
44
|
+
forbidden_dependencies?: string[];
|
|
45
|
+
archetypes?: Record<string, string>;
|
|
46
|
+
description?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface FeatureConfig {
|
|
50
|
+
domain: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
allowed_touchpoints: string[];
|
|
53
|
+
reuse_symbols?: string[];
|
|
54
|
+
input_contract?: Record<string, unknown>;
|
|
55
|
+
output_contract?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface FeatureContextResponse {
|
|
59
|
+
feature: string;
|
|
60
|
+
domain: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
allowed_touchpoints: string[];
|
|
63
|
+
reuse_symbols: Array<{
|
|
64
|
+
name: string;
|
|
65
|
+
kind: string;
|
|
66
|
+
signature?: string;
|
|
67
|
+
methods?: string[];
|
|
68
|
+
properties?: string[];
|
|
69
|
+
file_path?: string;
|
|
70
|
+
domain?: string;
|
|
71
|
+
}>;
|
|
72
|
+
input_contract: Record<string, unknown>;
|
|
73
|
+
output_contract: Record<string, unknown>;
|
|
74
|
+
governance_directives?: string[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CheckBoundaryArgs {
|
|
78
|
+
file_path: string;
|
|
79
|
+
proposed_imports: string[];
|
|
80
|
+
feature_key?: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface DomainRecord {
|
|
84
|
+
id: number;
|
|
85
|
+
name: string;
|
|
86
|
+
root_path: string;
|
|
87
|
+
allowed_deps_json: string;
|
|
88
|
+
forbidden_deps_json: string;
|
|
89
|
+
archetypes_json: string;
|
|
90
|
+
created_at: string;
|
|
91
|
+
updated_at: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface FileRecord {
|
|
95
|
+
id: number;
|
|
96
|
+
domain_id: number;
|
|
97
|
+
path: string;
|
|
98
|
+
archetype: ArchetypeKind;
|
|
99
|
+
content_hash: string;
|
|
100
|
+
line_count: number;
|
|
101
|
+
mtime_ms: number;
|
|
102
|
+
size_bytes: number;
|
|
103
|
+
last_scanned_at: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface ActiveFeatureSession {
|
|
107
|
+
feature_key: string;
|
|
108
|
+
domain: string;
|
|
109
|
+
touchpoints: string[];
|
|
110
|
+
locked_at: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface SymbolRecord {
|
|
114
|
+
id: number;
|
|
115
|
+
file_id: number;
|
|
116
|
+
name: string;
|
|
117
|
+
kind: SymbolKind;
|
|
118
|
+
signature: string;
|
|
119
|
+
visibility: Visibility;
|
|
120
|
+
line_start: number;
|
|
121
|
+
line_end: number;
|
|
122
|
+
line_count: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface DependencyRecord {
|
|
126
|
+
id: number;
|
|
127
|
+
source_file_id: number;
|
|
128
|
+
target_symbol_or_path: string;
|
|
129
|
+
import_statement: string;
|
|
130
|
+
line_number: number;
|
|
131
|
+
is_external: boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface ExtractedSymbol {
|
|
135
|
+
name: string;
|
|
136
|
+
kind: SymbolKind;
|
|
137
|
+
signature: string;
|
|
138
|
+
visibility: Visibility;
|
|
139
|
+
line_start: number;
|
|
140
|
+
line_end: number;
|
|
141
|
+
line_count: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface ExtractedDependency {
|
|
145
|
+
target: string;
|
|
146
|
+
statement: string;
|
|
147
|
+
line_number: number;
|
|
148
|
+
is_external: boolean;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface ParsedFileAST {
|
|
152
|
+
symbols: ExtractedSymbol[];
|
|
153
|
+
dependencies: ExtractedDependency[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type BoundaryViolationRule =
|
|
157
|
+
| "forbidden_dependency"
|
|
158
|
+
| "disallowed_dependency"
|
|
159
|
+
| "touchpoint_violation"
|
|
160
|
+
| "unknown_feature";
|
|
161
|
+
|
|
162
|
+
export interface BoundaryViolation {
|
|
163
|
+
file: string;
|
|
164
|
+
line: number;
|
|
165
|
+
source_domain: string;
|
|
166
|
+
target_domain: string;
|
|
167
|
+
imported_target: string;
|
|
168
|
+
rule: BoundaryViolationRule;
|
|
169
|
+
message: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface DomainCatalogResponse {
|
|
173
|
+
domain: string;
|
|
174
|
+
root: string;
|
|
175
|
+
allowed_dependencies: string[];
|
|
176
|
+
forbidden_dependencies: string[];
|
|
177
|
+
files: Array<{
|
|
178
|
+
path: string;
|
|
179
|
+
archetype: ArchetypeKind;
|
|
180
|
+
symbols: Array<{
|
|
181
|
+
name: string;
|
|
182
|
+
kind: SymbolKind;
|
|
183
|
+
properties?: string[];
|
|
184
|
+
methods?: string[];
|
|
185
|
+
signatures?: string[];
|
|
186
|
+
}>;
|
|
187
|
+
}>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface ExecutionChainNode {
|
|
191
|
+
stage:
|
|
192
|
+
| "ingress"
|
|
193
|
+
| "validation"
|
|
194
|
+
| "controller"
|
|
195
|
+
| "orchestrator"
|
|
196
|
+
| "use_case"
|
|
197
|
+
| "domain"
|
|
198
|
+
| "entity"
|
|
199
|
+
| "egress"
|
|
200
|
+
| "repository"
|
|
201
|
+
| string;
|
|
202
|
+
symbol: string;
|
|
203
|
+
file?: string;
|
|
204
|
+
line?: number;
|
|
205
|
+
description?: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface VerticalSliceRecord {
|
|
209
|
+
id: number;
|
|
210
|
+
domain_id: number | null;
|
|
211
|
+
feature_key: string | null;
|
|
212
|
+
http_method: string;
|
|
213
|
+
route_uri: string;
|
|
214
|
+
route_name: string | null;
|
|
215
|
+
controller_class: string;
|
|
216
|
+
action_name: string;
|
|
217
|
+
controller_file: string | null;
|
|
218
|
+
controller_line: number;
|
|
219
|
+
architecture_style: string;
|
|
220
|
+
entry_kind: string;
|
|
221
|
+
execution_chain_json: string;
|
|
222
|
+
created_at: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface VerticalSliceTraceResponse {
|
|
226
|
+
query: string;
|
|
227
|
+
found: boolean;
|
|
228
|
+
confidence?: "exact" | "inferred";
|
|
229
|
+
is_exact_match?: boolean;
|
|
230
|
+
architecture_style?: string;
|
|
231
|
+
entrypoint?: {
|
|
232
|
+
method: string;
|
|
233
|
+
uri: string;
|
|
234
|
+
name?: string | null;
|
|
235
|
+
controller: string;
|
|
236
|
+
action: string;
|
|
237
|
+
file?: string | null;
|
|
238
|
+
line?: number;
|
|
239
|
+
};
|
|
240
|
+
chain?: ExecutionChainNode[];
|
|
241
|
+
alternatives?: Array<{
|
|
242
|
+
method: string;
|
|
243
|
+
uri: string;
|
|
244
|
+
controller: string;
|
|
245
|
+
action: string;
|
|
246
|
+
}>;
|
|
247
|
+
message: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface GetSymbolArgs {
|
|
251
|
+
symbol: string;
|
|
252
|
+
domain?: string;
|
|
253
|
+
include_dependencies?: boolean;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface SymbolExactRange {
|
|
257
|
+
start_line: number;
|
|
258
|
+
end_line: number;
|
|
259
|
+
total_lines: number;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface GetSymbolDetailsResponse {
|
|
263
|
+
symbol: string;
|
|
264
|
+
kind: SymbolKind | string;
|
|
265
|
+
file_path: string;
|
|
266
|
+
domain?: string;
|
|
267
|
+
exact_range: SymbolExactRange;
|
|
268
|
+
signature: string;
|
|
269
|
+
visibility?: Visibility | string;
|
|
270
|
+
dependencies_injected: string[];
|
|
271
|
+
outbound_calls: string[];
|
|
272
|
+
sibling_methods?: string[];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface GetSymbolImpactArgs {
|
|
276
|
+
symbol: string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface InboundCaller {
|
|
280
|
+
file: string;
|
|
281
|
+
caller: string;
|
|
282
|
+
line: number;
|
|
283
|
+
kind?: string;
|
|
284
|
+
domain?: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface GetSymbolImpactResponse {
|
|
288
|
+
target_symbol: string;
|
|
289
|
+
impact_summary: {
|
|
290
|
+
total_dependents: number;
|
|
291
|
+
risk_level: "low" | "medium" | "high";
|
|
292
|
+
affected_files_count: number;
|
|
293
|
+
};
|
|
294
|
+
inbound_callers: InboundCaller[];
|
|
295
|
+
}
|
|
296
|
+
|