@principal-ai/subsystems-core 0.51.4 → 0.51.6
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 +21 -6
- package/dist/audit/boundary.d.ts +104 -0
- package/dist/audit/boundary.d.ts.map +1 -0
- package/dist/audit/boundary.js +363 -0
- package/dist/audit/boundary.js.map +1 -0
- package/dist/audit/c4.d.ts +41 -0
- package/dist/audit/c4.d.ts.map +1 -0
- package/dist/audit/c4.js +41 -0
- package/dist/audit/c4.js.map +1 -0
- package/dist/audit/engine.d.ts +135 -0
- package/dist/audit/engine.d.ts.map +1 -0
- package/dist/audit/engine.js +828 -0
- package/dist/audit/engine.js.map +1 -0
- package/dist/audit/fixes.d.ts +80 -0
- package/dist/audit/fixes.d.ts.map +1 -0
- package/dist/audit/fixes.js +162 -0
- package/dist/audit/fixes.js.map +1 -0
- package/dist/audit/hash.d.ts +25 -0
- package/dist/audit/hash.d.ts.map +1 -0
- package/dist/audit/hash.js +53 -0
- package/dist/audit/hash.js.map +1 -0
- package/dist/audit/index.d.ts +11 -1
- package/dist/audit/index.d.ts.map +1 -1
- package/dist/audit/index.js +37 -3
- package/dist/audit/index.js.map +1 -1
- package/dist/audit/local-graphify.d.ts +75 -0
- package/dist/audit/local-graphify.d.ts.map +1 -0
- package/dist/audit/local-graphify.js +283 -0
- package/dist/audit/local-graphify.js.map +1 -0
- package/dist/audit/paths.d.ts +16 -0
- package/dist/audit/paths.d.ts.map +1 -0
- package/dist/audit/paths.js +31 -0
- package/dist/audit/paths.js.map +1 -0
- package/dist/audit/pure.d.ts +18 -0
- package/dist/audit/pure.d.ts.map +1 -0
- package/dist/audit/pure.js +50 -0
- package/dist/audit/pure.js.map +1 -0
- package/dist/audit/report-logic.d.ts +17 -0
- package/dist/audit/report-logic.d.ts.map +1 -0
- package/dist/audit/report-logic.js +206 -0
- package/dist/audit/report-logic.js.map +1 -0
- package/dist/audit/report.d.ts +136 -0
- package/dist/audit/report.d.ts.map +1 -0
- package/dist/audit/report.js +3 -0
- package/dist/audit/report.js.map +1 -0
- package/dist/audit/trail.d.ts +29 -0
- package/dist/audit/trail.d.ts.map +1 -0
- package/dist/audit/trail.js +59 -0
- package/dist/audit/trail.js.map +1 -0
- package/dist/audit/verification.d.ts +98 -0
- package/dist/audit/verification.d.ts.map +1 -0
- package/dist/audit/verification.js +11 -0
- package/dist/audit/verification.js.map +1 -0
- package/dist/audit/verify/component.d.ts +68 -0
- package/dist/audit/verify/component.d.ts.map +1 -0
- package/dist/audit/verify/component.js +500 -0
- package/dist/audit/verify/component.js.map +1 -0
- package/dist/audit/verify/declarations.d.ts +58 -0
- package/dist/audit/verify/declarations.d.ts.map +1 -0
- package/dist/audit/verify/declarations.js +227 -0
- package/dist/audit/verify/declarations.js.map +1 -0
- package/dist/audit/verify/grammar.d.ts +12 -0
- package/dist/audit/verify/grammar.d.ts.map +1 -0
- package/dist/audit/verify/grammar.js +57 -0
- package/dist/audit/verify/grammar.js.map +1 -0
- package/dist/audit/verify/index.d.ts +12 -0
- package/dist/audit/verify/index.d.ts.map +1 -0
- package/dist/audit/verify/index.js +31 -0
- package/dist/audit/verify/index.js.map +1 -0
- package/dist/audit/verify/parser.d.ts +19 -0
- package/dist/audit/verify/parser.d.ts.map +1 -0
- package/dist/audit/verify/parser.js +122 -0
- package/dist/audit/verify/parser.js.map +1 -0
- package/dist/audit/verify/span.d.ts +49 -0
- package/dist/audit/verify/span.d.ts.map +1 -0
- package/dist/audit/verify/span.js +377 -0
- package/dist/audit/verify/span.js.map +1 -0
- package/dist/graphify/anchor.d.ts +45 -0
- package/dist/graphify/anchor.d.ts.map +1 -0
- package/dist/graphify/anchor.js +179 -0
- package/dist/graphify/anchor.js.map +1 -0
- package/dist/graphify/consolidated.d.ts +259 -0
- package/dist/graphify/consolidated.d.ts.map +1 -0
- package/dist/graphify/consolidated.js +12 -0
- package/dist/graphify/consolidated.js.map +1 -0
- package/dist/graphify/construct.d.ts +41 -0
- package/dist/graphify/construct.d.ts.map +1 -0
- package/dist/graphify/construct.js +106 -0
- package/dist/graphify/construct.js.map +1 -0
- package/dist/graphify/ids.d.ts +19 -0
- package/dist/graphify/ids.d.ts.map +1 -0
- package/dist/graphify/ids.js +53 -0
- package/dist/graphify/ids.js.map +1 -0
- package/dist/graphify/index.d.ts +16 -0
- package/dist/graphify/index.d.ts.map +1 -0
- package/dist/graphify/index.js +32 -0
- package/dist/graphify/index.js.map +1 -0
- package/dist/graphify/resolve.d.ts +48 -0
- package/dist/graphify/resolve.d.ts.map +1 -0
- package/dist/graphify/resolve.js +89 -0
- package/dist/graphify/resolve.js.map +1 -0
- package/dist/graphify/signature.d.ts +87 -0
- package/dist/graphify/signature.d.ts.map +1 -0
- package/dist/graphify/signature.js +282 -0
- package/dist/graphify/signature.js.map +1 -0
- package/dist/graphify/types.d.ts +141 -0
- package/dist/graphify/types.d.ts.map +1 -0
- package/dist/graphify/types.js +9 -0
- package/dist/graphify/types.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +2 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +3 -1
- package/dist/node.js.map +1 -1
- package/dist/storage/topic-share.d.ts +57 -0
- package/dist/storage/topic-share.d.ts.map +1 -0
- package/dist/storage/topic-share.js +55 -0
- package/dist/storage/topic-share.js.map +1 -0
- package/package.json +16 -2
- package/src/audit/boundary.ts +447 -0
- package/src/audit/c4.ts +70 -0
- package/src/audit/engine.ts +1058 -0
- package/src/audit/fixes.ts +192 -0
- package/src/audit/hash.ts +58 -0
- package/src/audit/index.ts +33 -8
- package/src/audit/local-graphify.test.ts +163 -0
- package/src/audit/local-graphify.ts +354 -0
- package/src/audit/paths.ts +25 -0
- package/src/audit/pure.ts +91 -0
- package/src/audit/report-logic.test.ts +145 -0
- package/src/audit/report-logic.ts +245 -0
- package/src/audit/report.ts +203 -0
- package/src/audit/trail.ts +77 -0
- package/src/audit/verification.ts +104 -0
- package/src/audit/verify/component.ts +760 -0
- package/src/audit/verify/declarations.ts +284 -0
- package/src/audit/verify/grammar.ts +57 -0
- package/src/audit/verify/index.ts +41 -0
- package/src/audit/verify/parser.ts +124 -0
- package/src/audit/verify/span.ts +478 -0
- package/src/graphify/anchor.ts +206 -0
- package/src/graphify/consolidated.ts +298 -0
- package/src/graphify/construct.ts +153 -0
- package/src/graphify/ids.ts +48 -0
- package/src/graphify/index.ts +16 -0
- package/src/graphify/resolve.ts +115 -0
- package/src/graphify/signature.ts +354 -0
- package/src/graphify/types.ts +164 -0
- package/src/index.ts +5 -3
- package/src/node.ts +2 -0
- package/src/storage/topic-share.test.ts +71 -0
- package/src/storage/topic-share.ts +91 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.summarizeLanes = exports.summarizeVerification = exports.isVerifiedConstructCheck = exports.classifyAuditReport = exports.auditHasPartialGaps = exports.auditHasIssues = exports.auditIssueCount = exports.auditFixGroups = void 0;
|
|
4
|
+
function auditFixGroups(report) {
|
|
5
|
+
const byFix = new Map();
|
|
6
|
+
for (const finding of report.findings) {
|
|
7
|
+
if (!finding.fix)
|
|
8
|
+
continue;
|
|
9
|
+
byFix.set(finding.fix.id, (byFix.get(finding.fix.id) ?? 0) + 1);
|
|
10
|
+
}
|
|
11
|
+
return [...byFix.entries()].map(([fixId, count]) => ({
|
|
12
|
+
fixId: fixId,
|
|
13
|
+
count,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
exports.auditFixGroups = auditFixGroups;
|
|
17
|
+
function auditIssueCount(report) {
|
|
18
|
+
const fromFindings = report.findings.filter((finding) => finding.severity === 'error').length;
|
|
19
|
+
if (fromFindings > 0)
|
|
20
|
+
return fromFindings;
|
|
21
|
+
return report.checks.filter((check) => check.verdict === 'issue').length;
|
|
22
|
+
}
|
|
23
|
+
exports.auditIssueCount = auditIssueCount;
|
|
24
|
+
function auditHasIssues(report) {
|
|
25
|
+
if (report.needsUpdate)
|
|
26
|
+
return true;
|
|
27
|
+
if (report.checks.some((check) => check.verdict === 'issue'))
|
|
28
|
+
return true;
|
|
29
|
+
return report.findings.some((finding) => finding.severity === 'error');
|
|
30
|
+
}
|
|
31
|
+
exports.auditHasIssues = auditHasIssues;
|
|
32
|
+
/** Gaps that are not failures — some checks confirmed, some still need follow-up. */
|
|
33
|
+
function auditHasPartialGaps(report) {
|
|
34
|
+
if (report.findings.some((finding) => finding.severity === 'info'))
|
|
35
|
+
return true;
|
|
36
|
+
for (const check of report.checks) {
|
|
37
|
+
if (check.verdict === 'issue')
|
|
38
|
+
continue;
|
|
39
|
+
if (check.constructInferred === 'unknown' && check.constructMatch !== true)
|
|
40
|
+
return true;
|
|
41
|
+
if (check.signature === 'skipped')
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return report.boundaryChecks?.some((check) => check.verdict === 'gap') ?? false;
|
|
45
|
+
}
|
|
46
|
+
exports.auditHasPartialGaps = auditHasPartialGaps;
|
|
47
|
+
function classifyAuditReport(report) {
|
|
48
|
+
if (auditHasIssues(report))
|
|
49
|
+
return 'issues';
|
|
50
|
+
if (auditHasPartialGaps(report))
|
|
51
|
+
return 'partially_verified';
|
|
52
|
+
return 'fully_verified';
|
|
53
|
+
}
|
|
54
|
+
exports.classifyAuditReport = classifyAuditReport;
|
|
55
|
+
/** Fully verified construct claim: exact graph anchor, source, kind, signature, and span. */
|
|
56
|
+
function isVerifiedConstructCheck(check) {
|
|
57
|
+
return (check.verdict === 'ok' &&
|
|
58
|
+
check.graphify === 'confirmed' &&
|
|
59
|
+
check.fileExists === true &&
|
|
60
|
+
check.constructMatch === true &&
|
|
61
|
+
check.signature !== 'mismatch' &&
|
|
62
|
+
check.signature !== 'skipped' &&
|
|
63
|
+
check.declarationFreshness !== 'stale' &&
|
|
64
|
+
check.declarationFreshness !== 'missing');
|
|
65
|
+
}
|
|
66
|
+
exports.isVerifiedConstructCheck = isVerifiedConstructCheck;
|
|
67
|
+
function emptyTally() {
|
|
68
|
+
return { verified: 0, open: 0, blocked: 0, na: 0, blocking: 0 };
|
|
69
|
+
}
|
|
70
|
+
function finalizeLayer(tally) {
|
|
71
|
+
const adjudicable = tally.verified + tally.open;
|
|
72
|
+
const coverage = adjudicable > 0
|
|
73
|
+
? tally.verified / adjudicable
|
|
74
|
+
: tally.blocked > 0
|
|
75
|
+
? 0
|
|
76
|
+
: 1;
|
|
77
|
+
return {
|
|
78
|
+
verified: tally.verified,
|
|
79
|
+
open: tally.open,
|
|
80
|
+
blocked: tally.blocked,
|
|
81
|
+
na: tally.na,
|
|
82
|
+
coverage,
|
|
83
|
+
blocking: tally.blocking,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function mergeTallies(...tallies) {
|
|
87
|
+
const merged = emptyTally();
|
|
88
|
+
for (const tally of tallies) {
|
|
89
|
+
merged.verified += tally.verified;
|
|
90
|
+
merged.open += tally.open;
|
|
91
|
+
merged.blocked += tally.blocked;
|
|
92
|
+
merged.na += tally.na;
|
|
93
|
+
merged.blocking += tally.blocking;
|
|
94
|
+
}
|
|
95
|
+
return merged;
|
|
96
|
+
}
|
|
97
|
+
function classifyConstructCheck(check, tally) {
|
|
98
|
+
if (check.graphify === 'skipped') {
|
|
99
|
+
tally.na++;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (check.verdict === 'issue' || check.fileExists === false) {
|
|
103
|
+
tally.open++;
|
|
104
|
+
tally.blocking++;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (check.fileExists === null || check.graphify === 'unavailable') {
|
|
108
|
+
tally.blocked++;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (isVerifiedConstructCheck(check)) {
|
|
112
|
+
tally.verified++;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
tally.open++;
|
|
116
|
+
}
|
|
117
|
+
function classifyBoundaryCheck(check, tally) {
|
|
118
|
+
if (check.kind === 'skipped' || check.verdict === 'skipped') {
|
|
119
|
+
tally.na++;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (check.verdict === 'issue') {
|
|
123
|
+
tally.open++;
|
|
124
|
+
tally.blocking++;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (check.verdict === 'ok') {
|
|
128
|
+
tally.verified++;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
tally.open++;
|
|
132
|
+
}
|
|
133
|
+
/** Derive the claim-based verification ledger from an audit report. */
|
|
134
|
+
function summarizeVerification(report) {
|
|
135
|
+
const construct = emptyTally();
|
|
136
|
+
const boundary = emptyTally();
|
|
137
|
+
const topology = emptyTally();
|
|
138
|
+
for (const check of report.checks)
|
|
139
|
+
classifyConstructCheck(check, construct);
|
|
140
|
+
for (const check of report.boundaryChecks ?? [])
|
|
141
|
+
classifyBoundaryCheck(check, boundary);
|
|
142
|
+
const total = finalizeLayer(mergeTallies(construct, boundary, topology));
|
|
143
|
+
return {
|
|
144
|
+
...total,
|
|
145
|
+
byLayer: {
|
|
146
|
+
construct: finalizeLayer(construct),
|
|
147
|
+
boundary: finalizeLayer(boundary),
|
|
148
|
+
topology: finalizeLayer(topology),
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
exports.summarizeVerification = summarizeVerification;
|
|
153
|
+
function laneStatus(tally) {
|
|
154
|
+
if (tally.blocking > 0)
|
|
155
|
+
return 'issues';
|
|
156
|
+
if (tally.open > 0)
|
|
157
|
+
return 'partial';
|
|
158
|
+
if (tally.verified > 0)
|
|
159
|
+
return 'verified';
|
|
160
|
+
if (tally.blocked > 0)
|
|
161
|
+
return 'blocked';
|
|
162
|
+
return 'none';
|
|
163
|
+
}
|
|
164
|
+
/** Coarse verification status mapped onto the four model layers. */
|
|
165
|
+
function summarizeLanes(report, opts) {
|
|
166
|
+
const construct = emptyTally();
|
|
167
|
+
for (const check of report.checks)
|
|
168
|
+
classifyConstructCheck(check, construct);
|
|
169
|
+
const staticTopology = emptyTally();
|
|
170
|
+
const dynamicTopology = emptyTally();
|
|
171
|
+
for (const check of report.boundaryChecks ?? []) {
|
|
172
|
+
if (check.kind === 'module_file')
|
|
173
|
+
classifyBoundaryCheck(check, staticTopology);
|
|
174
|
+
if (check.kind === 'process_nest' ||
|
|
175
|
+
check.kind === 'process_claim' ||
|
|
176
|
+
check.kind === 'process_container') {
|
|
177
|
+
classifyBoundaryCheck(check, dynamicTopology);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const hasStepIssues = (report.summary.stepsStale ?? 0) > 0;
|
|
181
|
+
const hasUnconfirmedSteps = (report.summary.stepsUnconfirmed ?? 0) > 0;
|
|
182
|
+
const hasVerifiedSteps = (report.summary.stepsVerified ?? 0) > 0;
|
|
183
|
+
const hasAnyStepInfo = hasStepIssues || hasUnconfirmedSteps || hasVerifiedSteps;
|
|
184
|
+
const trail = !opts.hasTrails
|
|
185
|
+
? 'none'
|
|
186
|
+
: report.summary.trailFailures > 0 || hasStepIssues
|
|
187
|
+
? 'issues'
|
|
188
|
+
: hasUnconfirmedSteps
|
|
189
|
+
? 'partial'
|
|
190
|
+
: hasVerifiedSteps
|
|
191
|
+
? 'verified'
|
|
192
|
+
: hasAnyStepInfo
|
|
193
|
+
? 'partial'
|
|
194
|
+
: 'verified';
|
|
195
|
+
const constructStatus = report.summary.components > 0 && laneStatus(construct) === 'none'
|
|
196
|
+
? 'partial'
|
|
197
|
+
: laneStatus(construct);
|
|
198
|
+
return {
|
|
199
|
+
construct: constructStatus,
|
|
200
|
+
'static-topology': laneStatus(staticTopology),
|
|
201
|
+
'dynamic-topology': laneStatus(dynamicTopology),
|
|
202
|
+
trail,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
exports.summarizeLanes = summarizeLanes;
|
|
206
|
+
//# sourceMappingURL=report-logic.js.map
|
|
@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C,SAAS,CAAC,KAAK,MAAM;QAC/D,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAE3B,OAAO;QACL,SAAS,EAAE,eAAe;QAC1B,iBAAiB,EAAE,UAAU,CAAC,cAAc,CAAC;QAC7C,kBAAkB,EAAE,UAAU,CAAC,eAAe,CAAC;QAC/C,KAAK;KACN,CAAA;AACH,CAAC;AA/CD,wCA+CC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { SubsystemSourceSpan } from '../types/subsystem-model';
|
|
2
|
+
export type AuditSpanFreshness = 'full' | 'stale' | 'missing' | 'unanchored' | 'unchecked';
|
|
3
|
+
export type SubsystemModelAuditFindingKind = 'missing_file' | 'component_unconnected' | 'symbol_ambiguous' | 'symbol_unmatched' | 'trail' | 'construct_span_stale' | 'construct_span_unconfirmed' | 'construct_span_capturable' | 'construct_mismatch' | 'construct_unconfirmed' | 'store_type_undeclared' | 'store_type_stale' | 'signature_mismatch' | 'signature_unconfirmed' | 'step_span_unconfirmed' | 'step_span_stale' | 'step_site_outside_from' | 'step_site_unconfirmed' | 'step_site_mismatch' | 'step_site_stale' | 'step_target_mismatch' | 'step_target_stale' | 'repo_unresolved' | 'graphify_unavailable' | 'third_party_path' | 'boundary_module_file_mismatch' | 'boundary_process_nest_disagree' | 'boundary_process_missing' | 'boundary_process_unassigned' | 'boundary_process_proposed' | 'boundary_process_rejected' | 'boundary_process_unbacked';
|
|
4
|
+
export type SubsystemModelAuditSeverity = 'error' | 'info';
|
|
5
|
+
export type SubsystemModelAuditFix = {
|
|
6
|
+
id: 'adopt_graphify_signature';
|
|
7
|
+
label: string;
|
|
8
|
+
parameterTypes: string[];
|
|
9
|
+
returnTypes: string[];
|
|
10
|
+
} | {
|
|
11
|
+
id: 'adopt_graphify_file';
|
|
12
|
+
label: string;
|
|
13
|
+
file: string;
|
|
14
|
+
previousFile?: string;
|
|
15
|
+
} | {
|
|
16
|
+
id: 'adopt_graphify_declaration_ref';
|
|
17
|
+
label: string;
|
|
18
|
+
declarationSpan: SubsystemSourceSpan;
|
|
19
|
+
previousStartLine?: number;
|
|
20
|
+
} | {
|
|
21
|
+
id: 'adopt_tree_sitter_span';
|
|
22
|
+
label: string;
|
|
23
|
+
declarationSpan: SubsystemSourceSpan;
|
|
24
|
+
};
|
|
25
|
+
export interface SubsystemModelAuditFixGroup {
|
|
26
|
+
fixId: SubsystemModelAuditFix['id'];
|
|
27
|
+
count: number;
|
|
28
|
+
}
|
|
29
|
+
export interface SubsystemModelAuditFinding {
|
|
30
|
+
kind: SubsystemModelAuditFindingKind;
|
|
31
|
+
severity: SubsystemModelAuditSeverity;
|
|
32
|
+
componentAlias?: string;
|
|
33
|
+
componentName?: string;
|
|
34
|
+
moduleKey?: string;
|
|
35
|
+
processKey?: string;
|
|
36
|
+
purl?: string;
|
|
37
|
+
trailId?: string;
|
|
38
|
+
step?: number;
|
|
39
|
+
message: string;
|
|
40
|
+
fix?: SubsystemModelAuditFix;
|
|
41
|
+
}
|
|
42
|
+
export interface SubsystemModelAuditCheck {
|
|
43
|
+
componentAlias: string;
|
|
44
|
+
componentName?: string;
|
|
45
|
+
construct?: string;
|
|
46
|
+
symbol?: string;
|
|
47
|
+
file?: string;
|
|
48
|
+
fileExists: boolean | null;
|
|
49
|
+
symbolDeclared: boolean | null;
|
|
50
|
+
declarationFreshness?: AuditSpanFreshness | 'n/a';
|
|
51
|
+
constructMatch?: boolean | null;
|
|
52
|
+
constructClaimed?: string;
|
|
53
|
+
constructInferred?: string;
|
|
54
|
+
constructEvidence?: string[];
|
|
55
|
+
signature?: 'match' | 'mismatch' | 'skipped' | 'augmented' | 'n/a';
|
|
56
|
+
storeType?: 'declared' | 'undeclared' | 'stale' | 'n/a';
|
|
57
|
+
anchor?: 'exact' | 'file-only' | 'ambiguous' | 'missing' | 'n/a';
|
|
58
|
+
graphify: 'confirmed' | 'weak' | 'unavailable' | 'skipped';
|
|
59
|
+
verdict: 'ok' | 'issue' | 'skipped';
|
|
60
|
+
note?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SubsystemModelAuditBoundaryCheck {
|
|
63
|
+
componentAlias: string;
|
|
64
|
+
componentName?: string;
|
|
65
|
+
kind: 'module_file' | 'process_nest' | 'process_claim' | 'process_container' | 'skipped';
|
|
66
|
+
module?: string;
|
|
67
|
+
file?: string;
|
|
68
|
+
process?: string;
|
|
69
|
+
verdict: 'ok' | 'issue' | 'gap' | 'skipped';
|
|
70
|
+
note?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface SubsystemModelAuditReport {
|
|
73
|
+
graphId: string;
|
|
74
|
+
title: string;
|
|
75
|
+
checkedAt: string;
|
|
76
|
+
needsUpdate: boolean;
|
|
77
|
+
summary: {
|
|
78
|
+
components: number;
|
|
79
|
+
filesVerified: number;
|
|
80
|
+
symbolsVerified: number;
|
|
81
|
+
declarationsFresh: number;
|
|
82
|
+
constructsMatched: number;
|
|
83
|
+
signaturesMatched: number;
|
|
84
|
+
anchorsExact: number;
|
|
85
|
+
graphifyConfirmed: number;
|
|
86
|
+
externalsSkipped: number;
|
|
87
|
+
missingFiles: number;
|
|
88
|
+
missingSymbols: number;
|
|
89
|
+
trailFailures: number;
|
|
90
|
+
stepsUnconfirmed: number;
|
|
91
|
+
stepsStale: number;
|
|
92
|
+
stepsVerified: number;
|
|
93
|
+
staleDeclarations: number;
|
|
94
|
+
constructMismatches: number;
|
|
95
|
+
signatureMismatches: number;
|
|
96
|
+
weakAnchors: number;
|
|
97
|
+
unresolved: number;
|
|
98
|
+
ok: number;
|
|
99
|
+
modulesClaimed: number;
|
|
100
|
+
moduleFileOk: number;
|
|
101
|
+
moduleFileMismatch: number;
|
|
102
|
+
processNestsChecked: number;
|
|
103
|
+
processNestOk: number;
|
|
104
|
+
processNestDisagree: number;
|
|
105
|
+
processRequired: number;
|
|
106
|
+
processClaimed: number;
|
|
107
|
+
processMissing: number;
|
|
108
|
+
};
|
|
109
|
+
checks: SubsystemModelAuditCheck[];
|
|
110
|
+
boundaryChecks?: SubsystemModelAuditBoundaryCheck[];
|
|
111
|
+
findings: SubsystemModelAuditFinding[];
|
|
112
|
+
}
|
|
113
|
+
export type SubsystemVerificationLane = 'construct' | 'static-topology' | 'dynamic-topology' | 'trail';
|
|
114
|
+
export type VerificationLaneStatus = 'verified' | 'partial' | 'issues' | 'blocked' | 'none';
|
|
115
|
+
export interface SubsystemModelVerificationLayer {
|
|
116
|
+
verified: number;
|
|
117
|
+
open: number;
|
|
118
|
+
blocked: number;
|
|
119
|
+
na: number;
|
|
120
|
+
coverage: number;
|
|
121
|
+
blocking: number;
|
|
122
|
+
}
|
|
123
|
+
export interface SubsystemModelVerification {
|
|
124
|
+
verified: number;
|
|
125
|
+
open: number;
|
|
126
|
+
blocked: number;
|
|
127
|
+
na: number;
|
|
128
|
+
coverage: number;
|
|
129
|
+
blocking: number;
|
|
130
|
+
byLayer: {
|
|
131
|
+
construct: SubsystemModelVerificationLayer;
|
|
132
|
+
boundary: SubsystemModelVerificationLayer;
|
|
133
|
+
topology: SubsystemModelVerificationLayer;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/audit/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,OAAO,GACP,SAAS,GACT,YAAY,GACZ,WAAW,CAAA;AAEf,MAAM,MAAM,8BAA8B,GACtC,cAAc,GACd,uBAAuB,GACvB,kBAAkB,GAClB,kBAAkB,GAClB,OAAO,GACP,sBAAsB,GACtB,4BAA4B,GAC5B,2BAA2B,GAC3B,oBAAoB,GACpB,uBAAuB,GACvB,uBAAuB,GACvB,kBAAkB,GAClB,oBAAoB,GACpB,uBAAuB,GACvB,uBAAuB,GACv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AAM,CAAA;QAC3B,eAAe,EAAE,MAAM,CAAA;QACvB,cAAc,EAAE,MAAM,CAAA;QACtB,cAAc,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,MAAM,EAAE,wBAAwB,EAAE,CAAA;IAClC,cAAc,CAAC,EAAE,gCAAgC,EAAE,CAAA;IACnD,QAAQ,EAAE,0BAA0B,EAAE,CAAA;CACvC;AAED,MAAM,MAAM,yBAAyB,GACjC,WAAW,GACX,iBAAiB,GACjB,kBAAkB,GAClB,OAAO,CAAA;AAEX,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,SAAS,GACT,QAAQ,GACR,SAAS,GACT,MAAM,CAAA;AAEV,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE;QACP,SAAS,EAAE,+BAA+B,CAAA;QAC1C,QAAQ,EAAE,+BAA+B,CAAA;QACzC,QAAQ,EAAE,+BAA+B,CAAA;KAC1C,CAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/audit/report.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trail rules shared by the audit engine and the UI.
|
|
3
|
+
*/
|
|
4
|
+
import type { SubsystemComponent, SubsystemTrail, SubsystemTrailStep } from '../types/subsystem-model';
|
|
5
|
+
import type { SubsystemModelAuditFinding } from './report';
|
|
6
|
+
type StepSite = Pick<SubsystemTrailStep, 'mechanism' | 'file' | 'span' | 'site'>;
|
|
7
|
+
type FromComponent = Pick<SubsystemComponent, 'file' | 'declarationSpan'>;
|
|
8
|
+
/**
|
|
9
|
+
* True when a `calls` step's site is not housed by its `from` component.
|
|
10
|
+
*
|
|
11
|
+
* - Different file → outside (the component cannot contain the site).
|
|
12
|
+
* - Same file but the stored site span falls outside the component's
|
|
13
|
+
* declaration span → outside (a sibling construct, not a nested one).
|
|
14
|
+
* - Unknown component span / site span → not enough evidence to call it
|
|
15
|
+
* outside; stay permissive so missing spans stay a separate finding.
|
|
16
|
+
*
|
|
17
|
+
* Always false for non-`calls` mechanisms: `uses`, `feeds`, `writes`, … are
|
|
18
|
+
* allowed to point at evidence in another construct.
|
|
19
|
+
*/
|
|
20
|
+
export declare function callsSiteOutsideFrom(step: StepSite, from: FromComponent | undefined): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Components with no trail edges.
|
|
23
|
+
*
|
|
24
|
+
* A standalone node may be intentional, but is worth a second look in a
|
|
25
|
+
* subsystem graph whose purpose is to explain relationships.
|
|
26
|
+
*/
|
|
27
|
+
export declare function unconnectedComponentFindings(components: readonly SubsystemComponent[], trails: readonly SubsystemTrail[]): SubsystemModelAuditFinding[];
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=trail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trail.d.ts","sourceRoot":"","sources":["../../src/audit/trail.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE1D,KAAK,QAAQ,GAAG,IAAI,CAClB,kBAAkB,EAClB,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CACvC,CAAA;AACD,KAAK,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAA;AAEzE;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,aAAa,GAAG,SAAS,GAC9B,OAAO,CAgBT;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,SAAS,kBAAkB,EAAE,EACzC,MAAM,EAAE,SAAS,cAAc,EAAE,GAChC,0BAA0B,EAAE,CAiB9B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Trail rules shared by the audit engine and the UI.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.unconnectedComponentFindings = exports.callsSiteOutsideFrom = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* True when a `calls` step's site is not housed by its `from` component.
|
|
9
|
+
*
|
|
10
|
+
* - Different file → outside (the component cannot contain the site).
|
|
11
|
+
* - Same file but the stored site span falls outside the component's
|
|
12
|
+
* declaration span → outside (a sibling construct, not a nested one).
|
|
13
|
+
* - Unknown component span / site span → not enough evidence to call it
|
|
14
|
+
* outside; stay permissive so missing spans stay a separate finding.
|
|
15
|
+
*
|
|
16
|
+
* Always false for non-`calls` mechanisms: `uses`, `feeds`, `writes`, … are
|
|
17
|
+
* allowed to point at evidence in another construct.
|
|
18
|
+
*/
|
|
19
|
+
function callsSiteOutsideFrom(step, from) {
|
|
20
|
+
if (step.mechanism !== 'calls' || !from)
|
|
21
|
+
return false;
|
|
22
|
+
const fromFile = from.file?.trim();
|
|
23
|
+
if (fromFile && fromFile !== step.file)
|
|
24
|
+
return true;
|
|
25
|
+
const fromSpan = from.declarationSpan;
|
|
26
|
+
const siteSpan = step.site?.span ?? step.span;
|
|
27
|
+
if (fromSpan && siteSpan) {
|
|
28
|
+
return !(fromSpan.startLine <= siteSpan.startLine &&
|
|
29
|
+
siteSpan.endLine <= fromSpan.endLine);
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
exports.callsSiteOutsideFrom = callsSiteOutsideFrom;
|
|
34
|
+
/**
|
|
35
|
+
* Components with no trail edges.
|
|
36
|
+
*
|
|
37
|
+
* A standalone node may be intentional, but is worth a second look in a
|
|
38
|
+
* subsystem graph whose purpose is to explain relationships.
|
|
39
|
+
*/
|
|
40
|
+
function unconnectedComponentFindings(components, trails) {
|
|
41
|
+
const connected = new Set();
|
|
42
|
+
for (const trail of trails) {
|
|
43
|
+
for (const step of trail.steps ?? []) {
|
|
44
|
+
connected.add(step.from);
|
|
45
|
+
connected.add(step.to);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return components
|
|
49
|
+
.filter((component) => !connected.has(component.alias))
|
|
50
|
+
.map((component) => ({
|
|
51
|
+
kind: 'component_unconnected',
|
|
52
|
+
severity: 'info',
|
|
53
|
+
componentAlias: component.alias,
|
|
54
|
+
componentName: component.name,
|
|
55
|
+
message: `Component ${JSON.stringify(component.name)} has no trail edges. Add a trail if it participates in this subsystem, or remove it if it is out of scope.`,
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
exports.unconnectedComponentFindings = unconnectedComponentFindings;
|
|
59
|
+
//# sourceMappingURL=trail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trail.js","sourceRoot":"","sources":["../../src/audit/trail.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAeH;;;;;;;;;;;GAWG;AACH,SAAgB,oBAAoB,CAClC,IAAc,EACd,IAA+B;IAE/B,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IAErD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAA;IAClC,IAAI,QA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1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural shape of one component-verification result as the audit engine
|
|
3
|
+
* consumes it.
|
|
4
|
+
*
|
|
5
|
+
* The concrete verifier lives in the host (filesystem, Graphify, tree-sitter).
|
|
6
|
+
* The engine only reads these fields, so the host result is assignable without
|
|
7
|
+
* the engine depending on host code.
|
|
8
|
+
*/
|
|
9
|
+
import type { SubsystemSourceSpan } from '../types/subsystem-model';
|
|
10
|
+
import type { AuditSpanFreshness } from './report';
|
|
11
|
+
export interface AuditFileCheck {
|
|
12
|
+
exists: boolean;
|
|
13
|
+
symbolDeclared?: boolean | null;
|
|
14
|
+
repoRoot?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AuditFileSuggestion {
|
|
17
|
+
file: string;
|
|
18
|
+
nodeId?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface AuditAnchorCandidate {
|
|
22
|
+
nodeId: string;
|
|
23
|
+
label: string;
|
|
24
|
+
source_file?: string;
|
|
25
|
+
source_location?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AuditAnchorCheck {
|
|
28
|
+
resolution: 'exact' | 'file-only' | 'ambiguous' | 'missing';
|
|
29
|
+
nodeId?: string;
|
|
30
|
+
label?: string;
|
|
31
|
+
source_file?: string;
|
|
32
|
+
source_location?: string;
|
|
33
|
+
candidates?: AuditAnchorCandidate[];
|
|
34
|
+
}
|
|
35
|
+
export interface AuditConstructCheck {
|
|
36
|
+
claimed: string;
|
|
37
|
+
inferred: 'class' | 'function' | 'method' | 'type' | 'module' | 'unknown';
|
|
38
|
+
/** true = match, false = known mismatch, null = unconfirmed. */
|
|
39
|
+
match: boolean | null;
|
|
40
|
+
evidence?: string[];
|
|
41
|
+
/** Agent-confirmed construct that cleared a gap. */
|
|
42
|
+
augmented?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface AuditSignatureTypes {
|
|
45
|
+
parameterTypes: string[];
|
|
46
|
+
returnTypes: string[];
|
|
47
|
+
inlineParameters?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface AuditSignatureCheck {
|
|
50
|
+
match: boolean;
|
|
51
|
+
skipped: boolean;
|
|
52
|
+
reason?: string;
|
|
53
|
+
skipCode?: string;
|
|
54
|
+
claimed: AuditSignatureTypes;
|
|
55
|
+
inferred: AuditSignatureTypes;
|
|
56
|
+
/** Agent-extracted, human-confirmed signature. */
|
|
57
|
+
augmented?: {
|
|
58
|
+
parameters: Array<{
|
|
59
|
+
type: string;
|
|
60
|
+
optional?: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
returnType?: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface AuditDeclarationCheck {
|
|
66
|
+
freshness: AuditSpanFreshness;
|
|
67
|
+
span?: SubsystemSourceSpan;
|
|
68
|
+
liveContentHash?: string;
|
|
69
|
+
/** Content-preserving re-pin candidate. */
|
|
70
|
+
repin?: SubsystemSourceSpan;
|
|
71
|
+
derivation?: {
|
|
72
|
+
class: 'deterministic' | 'trivial' | 'ambiguous' | 'unknown' | 'skipped';
|
|
73
|
+
endLine?: number;
|
|
74
|
+
span?: SubsystemSourceSpan;
|
|
75
|
+
failedGates?: string[];
|
|
76
|
+
evidence?: string[];
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface AuditComponentVerification {
|
|
80
|
+
ok: boolean;
|
|
81
|
+
error?: string;
|
|
82
|
+
code?: string;
|
|
83
|
+
componentAlias?: string;
|
|
84
|
+
file?: AuditFileCheck;
|
|
85
|
+
fileSuggest?: AuditFileSuggestion;
|
|
86
|
+
fileCandidates?: AuditFileSuggestion[];
|
|
87
|
+
cache?: {
|
|
88
|
+
status: 'ready' | 'missing' | 'unavailable';
|
|
89
|
+
purl: string;
|
|
90
|
+
repoRoot?: string;
|
|
91
|
+
};
|
|
92
|
+
anchor?: AuditAnchorCheck;
|
|
93
|
+
construct?: AuditConstructCheck;
|
|
94
|
+
signature?: AuditSignatureCheck;
|
|
95
|
+
declaration?: AuditDeclarationCheck;
|
|
96
|
+
storeTypeUndeclared?: boolean;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/audit/verification.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAElD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAA;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAA;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;IACzE,gEAAgE;IAChE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AA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,WAAW,CAAC,EAAE,mBAAmB,CAAA;IACjC,cAAc,CAAC,EAAE,mBAAmB,EAAE,CAAA;IACtC,KAAK,CAAC,EAAE;QACN,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,aAAa,CAAA;QAC3C,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B,WAAW,CAAC,EAAE,qBAAqB,CAAA;IACnC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Structural shape of one component-verification result as the audit engine
|
|
4
|
+
* consumes it.
|
|
5
|
+
*
|
|
6
|
+
* The concrete verifier lives in the host (filesystem, Graphify, tree-sitter).
|
|
7
|
+
* The engine only reads these fields, so the host result is assignable without
|
|
8
|
+
* the engine depending on host code.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
//# sourceMappingURL=verification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification.js","sourceRoot":"","sources":["../../src/audit/verification.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic per-component verification shared by every audit host.
|
|
3
|
+
*
|
|
4
|
+
* Filesystem and tree-sitter access are local; the model store, Graphify
|
|
5
|
+
* transport, accepted augmentations, and span promotion are injected by the
|
|
6
|
+
* host. Studio and the CLI therefore run the same verification policy.
|
|
7
|
+
*/
|
|
8
|
+
import type { SubsystemComponent } from '../../types/subsystem-model';
|
|
9
|
+
import type { GraphifyAuditProvider } from '../graphify-provider';
|
|
10
|
+
import type { AuditComponentVerification } from '../verification';
|
|
11
|
+
import { type SpanTreeCache } from './span';
|
|
12
|
+
export interface VerifyComponentSpanClaim {
|
|
13
|
+
startLine: number;
|
|
14
|
+
endLine: number;
|
|
15
|
+
contentHash: string;
|
|
16
|
+
}
|
|
17
|
+
export interface VerifyComponentSignatureClaim {
|
|
18
|
+
parameters: Array<{
|
|
19
|
+
type: string;
|
|
20
|
+
optional?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
returnType?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface VerifyComponentAugmentation {
|
|
25
|
+
claims: {
|
|
26
|
+
span?: VerifyComponentSpanClaim;
|
|
27
|
+
construct?: string;
|
|
28
|
+
signature?: VerifyComponentSignatureClaim;
|
|
29
|
+
};
|
|
30
|
+
evidence?: string[];
|
|
31
|
+
}
|
|
32
|
+
/** Host-owned state the verifier reads or writes. */
|
|
33
|
+
export interface VerifyComponentDeps {
|
|
34
|
+
/** Load the stored model, or null when the id is unknown. */
|
|
35
|
+
loadModel(graphId: string): Promise<{
|
|
36
|
+
id: string;
|
|
37
|
+
components: SubsystemComponent[];
|
|
38
|
+
} | null>;
|
|
39
|
+
/** Persist promoted components (non-dry-run span promotion only). */
|
|
40
|
+
updateComponents?(graphId: string, components: SubsystemComponent[]): Promise<void>;
|
|
41
|
+
findAcceptedSpanAugmentation(input: {
|
|
42
|
+
purl: string;
|
|
43
|
+
file: string;
|
|
44
|
+
symbol: string;
|
|
45
|
+
}): Promise<VerifyComponentAugmentation | null>;
|
|
46
|
+
findAcceptedConstructAugmentation(input: {
|
|
47
|
+
purl: string;
|
|
48
|
+
file: string;
|
|
49
|
+
symbol: string;
|
|
50
|
+
}): Promise<VerifyComponentAugmentation | null>;
|
|
51
|
+
findAcceptedSignatureAugmentation(input: {
|
|
52
|
+
purl: string;
|
|
53
|
+
file: string;
|
|
54
|
+
symbol: string;
|
|
55
|
+
}): Promise<VerifyComponentAugmentation | null>;
|
|
56
|
+
}
|
|
57
|
+
export interface VerifyComponentOptions {
|
|
58
|
+
dryRun?: boolean;
|
|
59
|
+
graphifyProvider: GraphifyAuditProvider;
|
|
60
|
+
treeCache?: SpanTreeCache;
|
|
61
|
+
}
|
|
62
|
+
export declare function verifySubsystemComponent(graphId: string, componentAlias: string, opts: VerifyComponentOptions, deps: VerifyComponentDeps): Promise<AuditComponentVerification>;
|
|
63
|
+
/** Verdict category for a single component verification result. */
|
|
64
|
+
export declare function verifyVerdict(r: AuditComponentVerification): {
|
|
65
|
+
category: string;
|
|
66
|
+
detail?: string;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=component.d.ts.map
|