@skillstech/thunderlang 0.1.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +375 -0
  2. package/LICENSE +21 -0
  3. package/README.md +165 -0
  4. package/dist/core.cjs +6768 -0
  5. package/dist/index.cjs +9308 -0
  6. package/intent-graph.schema.json +687 -0
  7. package/package.json +84 -0
  8. package/src/ai-core.mjs +67 -0
  9. package/src/ai-events.mjs +56 -0
  10. package/src/ai.mjs +324 -0
  11. package/src/arch.mjs +55 -0
  12. package/src/atlas.mjs +118 -0
  13. package/src/changes.mjs +74 -0
  14. package/src/classification.mjs +36 -0
  15. package/src/cli.mjs +1534 -0
  16. package/src/codegen.mjs +214 -0
  17. package/src/compile.mjs +142 -0
  18. package/src/comprehension.mjs +130 -0
  19. package/src/conflict.mjs +0 -0
  20. package/src/core.d.ts +99 -0
  21. package/src/core.mjs +92 -0
  22. package/src/data-schema.mjs +137 -0
  23. package/src/decision.mjs +38 -0
  24. package/src/distributed.mjs +48 -0
  25. package/src/draft.mjs +101 -0
  26. package/src/drift.mjs +177 -0
  27. package/src/emit.mjs +519 -0
  28. package/src/exporters.mjs +245 -0
  29. package/src/expr.mjs +245 -0
  30. package/src/fable.mjs +110 -0
  31. package/src/focus.mjs +151 -0
  32. package/src/format.mjs +55 -0
  33. package/src/governance.mjs +100 -0
  34. package/src/graph-source.mjs +292 -0
  35. package/src/guard.mjs +105 -0
  36. package/src/guardian.mjs +98 -0
  37. package/src/hash.mjs +89 -0
  38. package/src/importers.mjs +194 -0
  39. package/src/index.d.ts +725 -0
  40. package/src/index.mjs +185 -0
  41. package/src/intellisense.mjs +210 -0
  42. package/src/intent-atlas.mjs +77 -0
  43. package/src/intent-graph.mjs +346 -0
  44. package/src/intent-ir.mjs +144 -0
  45. package/src/intent-schema.mjs +215 -0
  46. package/src/ledger.mjs +109 -0
  47. package/src/lifecycle.mjs +56 -0
  48. package/src/lift.mjs +693 -0
  49. package/src/lsp.mjs +152 -0
  50. package/src/mcp.mjs +158 -0
  51. package/src/migrate.mjs +118 -0
  52. package/src/outcome.mjs +93 -0
  53. package/src/parse.mjs +733 -0
  54. package/src/patch.mjs +364 -0
  55. package/src/privacy.mjs +61 -0
  56. package/src/proof-schema.mjs +129 -0
  57. package/src/report.mjs +84 -0
  58. package/src/runtime.mjs +96 -0
  59. package/src/sarif.mjs +88 -0
  60. package/src/scan-queries.mjs +97 -0
  61. package/src/scan.mjs +87 -0
  62. package/src/security.mjs +73 -0
  63. package/src/select.mjs +80 -0
  64. package/src/semantic-diff.mjs +125 -0
  65. package/src/simulate.mjs +106 -0
  66. package/src/style.mjs +250 -0
  67. package/src/sync.mjs +103 -0
  68. package/src/testing.mjs +59 -0
  69. package/src/twelve-factor.mjs +173 -0
  70. package/src/verify-diff.mjs +105 -0
  71. package/src/xml.mjs +87 -0
  72. package/syntaxes/intent.tmLanguage.json +55 -0
package/src/index.d.ts ADDED
@@ -0,0 +1,725 @@
1
+ // Type declarations for @skillstech/thunderlang.
2
+ // Hand-written: the compiler core is ESM JavaScript. Shapes that are large or
3
+ // internal are typed loosely (Record/unknown); the primary entry points are typed.
4
+
5
+ /** A parsed .intent file. Loosely typed; fields are populated by parseIntent. */
6
+ export interface IntentAst {
7
+ mission: string | null;
8
+ goal: string;
9
+ why: string;
10
+ requires: string[];
11
+ inputs: Array<{ name: string; type: string; modifiers: string[]; notes: string[]; line: number }>;
12
+ outputs: Array<{ name: string; type: string; modifiers: string[]; notes: string[]; line: number }>;
13
+ guarantees: Array<{ id: string; statement: string; because: string | null; verify: string[]; notes: string[]; line: number }>;
14
+ neverRules: Array<{ id: string; statement: string; because: string | null; verify: string[]; notes: string[]; line: number }>;
15
+ constraints: string[];
16
+ targets: string[];
17
+ style: string[];
18
+ verify: string[];
19
+ errors: Array<{ name: string; line: number }>;
20
+ examples: Array<{ given: string; expect: string | null; line: number }>;
21
+ architecture: string[];
22
+ // Product / intent-graph profile (intent-graph-v1)
23
+ profiles: string[];
24
+ title: string | null;
25
+ actor: string | null;
26
+ problem: string;
27
+ persona: string | null;
28
+ customer: string | null;
29
+ evidence: Array<{ name: string; classification: string | null; confidence: string | null; source: string | null; line: number }>;
30
+ outcomes: Array<{ name: string; description: string | null; line: number }>;
31
+ metrics: Array<{ name: string; baseline: string | null; target: string | null; window: string | null; line: number }>;
32
+ scope: { include: string[]; exclude: string[] };
33
+ nonGoals: string[];
34
+ owner: string | null;
35
+ approvals: string[];
36
+ unknowns: Array<{ name: string; owner: string | null; resolveBefore: string | null; blocks: string | null; line: number }>;
37
+ questions: Array<{ name: string; askedOf: string | null; blocks: string | null; line: number }>;
38
+ assumptionDecls: Array<{ name: string; confidence: string | null; validateWith: string | null; line: number }>;
39
+ experiences: Array<{
40
+ name: string; actor: string | null; goal: string; enterWhen: string[];
41
+ journeys: Array<{ name: string | null; steps: string[] }>;
42
+ states: Array<{ name: string | null; directives: string[]; offers: string[]; preserves: boolean; hasRecovery: boolean; line: number }>;
43
+ responsive: string[]; accessible: { target: string | null; requirements: string[] };
44
+ follows: string[]; line: number;
45
+ }>;
46
+ patterns: Array<{ name: string; requires: string[]; accessible: string[]; line: number }>;
47
+ roleConstraints: Array<{ role: string; statement: string; line: number }>;
48
+ conflicts: Array<{ name: string; between: string[]; options: string[]; resolveBy: string[]; before: string | null; resolution: null | { chosen: string | null; by: string | null; at: string | null; decision: string | null }; line: number }>;
49
+ lifecycles: Array<{ name: string; states: string[]; transitions: Array<{ name: string | null; from: string | null; to: string | null; within: string | null }>; terminals: string[]; line: number }>;
50
+ always: string[];
51
+ eventually: Array<{ statement: string; within: string | null; line: number }>;
52
+ until: Array<{ condition: string; restrict: string | null; line: number }>;
53
+ commands: Array<{ name: string; idempotencyKey: string | null; timeout: string | null; retry: string | null; backoff: string | null; line: number }>;
54
+ handlers: Array<{ trigger: string; compensate: string[]; notify: string[]; preserve: string[]; actions: string[] }>;
55
+ decisions: Array<{ name: string; inputs: string[]; rules: Array<{ name: string | null; when: string | null; result: string | null; priority: string | null; line: number }>; default: string | null; explanationRequired: boolean; owner: string | null; line: number }>;
56
+ implementation: null | {
57
+ id?: string; scope?: string; strategy?: string; editing?: string;
58
+ risk?: string; approval?: string; pending: boolean;
59
+ mayModify?: string[]; mustNotModify?: string[]; line?: number;
60
+ };
61
+ services: unknown[];
62
+ apis: unknown[];
63
+ events: unknown[];
64
+ databases: unknown[];
65
+ // Skills the mission requires (normalized to the shared `skill:<slug>` id) + the understanding
66
+ // a human must demonstrate to own it (Ownership Graph seam).
67
+ skills: Array<{ name: string; id: string; line: number }>;
68
+ demonstrates: Array<{ statement: string; line: number }>;
69
+ notes: unknown[];
70
+ diagnostics: Diagnostic[];
71
+ approval?: { reviewed: boolean; [k: string]: unknown };
72
+ [k: string]: unknown;
73
+ }
74
+
75
+ export interface Diagnostic {
76
+ level: 'error' | 'warning' | 'info';
77
+ code: string;
78
+ message: string;
79
+ why?: string;
80
+ fix?: Array<{ label: string; insert?: string; block?: string }>;
81
+ [k: string]: unknown;
82
+ }
83
+
84
+ export interface MissionIndexEntry {
85
+ missionId: string | null;
86
+ mission: string | null;
87
+ intentProofHash: string;
88
+ file: string | null;
89
+ area: string | null;
90
+ risk: 'low' | 'medium' | 'high';
91
+ riskFactors: string[];
92
+ guarantees: number;
93
+ neverRules: number;
94
+ verifyTests: number;
95
+ verification: 'none' | 'declared-partial' | 'declared-full';
96
+ reviewed: boolean;
97
+ }
98
+
99
+ export interface MissionIndex {
100
+ schema: 'mission-index-v1';
101
+ generatedBy: string;
102
+ product: string | null;
103
+ note: string;
104
+ missions: MissionIndexEntry[];
105
+ summary: {
106
+ missions: number;
107
+ byArea: Record<string, number>;
108
+ declaredFull: number;
109
+ declaredPartial: number;
110
+ unverified: number;
111
+ highRisk: number;
112
+ };
113
+ }
114
+
115
+ // Parsing
116
+ export function parseIntent(source: string): IntentAst;
117
+ export function slug(text: string): string;
118
+ export const KNOWN_LENSES: string[];
119
+
120
+ // Semantic analysis, graphs, proof
121
+ export function semanticDiagnostics(ast: IntentAst): Diagnostic[];
122
+ export function buildContractGraph(ast: IntentAst, generatedAt?: string): Record<string, unknown>;
123
+ export function buildArchitectureGraph(ast: IntentAst, generatedAt?: string): Record<string, unknown>;
124
+ export function buildImplementationPlan(ast: IntentAst, generatedAt?: string): Record<string, unknown>;
125
+ export function buildProof(ast: IntentAst, opts: {
126
+ sourceFile: string; sourceHash: string; targetsRequested?: string[];
127
+ targetsGenerated?: string[]; diagnostics: Diagnostic[]; generatedAt?: string;
128
+ }): Record<string, unknown>;
129
+ export function sha256(input: string): string;
130
+ export const COMPILER_VERSION: string;
131
+ export const PROOF_SCHEMA_VERSION: string;
132
+ export const SOURCE_PRODUCT: string;
133
+
134
+ // Canonical proof envelope schema (intent-proof-v1)
135
+ export const PROOF_SCHEMA: string;
136
+ export const CLAIM_STATUSES: string[];
137
+ export const PROOF_STATUSES: string[];
138
+ export function intentProofJsonSchema(): Record<string, unknown>;
139
+ export function validateProof(proof: unknown): { valid: boolean; errors: Array<{ path: string; message: string }> };
140
+
141
+ // Compile + render
142
+ export function compileSource(source: string, opts?: { sourceFile?: string; generatedAt?: string; origin?: string }): Record<string, unknown>;
143
+ export function renderMarkdown(ast: IntentAst): string;
144
+ export function renderMermaid(ast: IntentAst): string;
145
+ export function renderTestplan(ast: IntentAst): string;
146
+
147
+ // IntelliSense
148
+ export function getCompletions(source: string, position: { line: number; column: number }): unknown;
149
+ export function getHover(source: string, position: { line: number; column: number }): unknown;
150
+ export const SEMANTIC_TYPES: string[];
151
+
152
+ // IntentLift
153
+ export interface IntentSeed {
154
+ nodeId: string;
155
+ nodeType?: string;
156
+ title?: string;
157
+ confidence?: string;
158
+ evidenceRef: {
159
+ signals: string[];
160
+ sourceLocations?: Array<{ file: string; line?: number }>;
161
+ ledgerRef?: { seq: number; hash: string };
162
+ };
163
+ }
164
+ export function liftSource(source: string, opts?: { language?: string; file?: string; seeds?: IntentSeed[] }): Record<string, unknown>;
165
+ export function liftRepo(files: Array<{ file: string; source: string }>, opts?: { language?: string }): Record<string, unknown>;
166
+ export function languageForFile(file: string): string;
167
+ export function inferIntent(facts: unknown, opts?: unknown): Record<string, unknown>;
168
+ export function renderLiftedIntent(lifted: unknown): string;
169
+ export const SUPPORTED_LANGUAGES: string[];
170
+ export const SEED_SCHEMA: Record<string, unknown>;
171
+ export function normalizeSeeds(seeds: unknown): IntentSeed[];
172
+
173
+ // Approve + drift
174
+ export function approveIntent(text: string, opts?: { approvedBy?: string; approvedAt?: string }): Record<string, unknown>;
175
+ export function checkDrift(intentText: string, codeText: string, opts?: { language?: string }): Record<string, unknown>;
176
+ export function buildDriftHandoff(text: string, opts?: { generatedAt?: string }): Record<string, unknown>;
177
+ export function intentHash(text: string): string;
178
+
179
+ // Mission Atlas
180
+ export function buildMissionIndex(
181
+ files: Array<{ path?: string; source: string }>,
182
+ opts?: { product?: string },
183
+ ): MissionIndex;
184
+
185
+ // Architecture rules
186
+ export interface ArchitectureRule { from: string; relation: 'must-not-depend-on' | 'must-depend-on' | 'may-depend-on' | 'may-implement'; to: string; raw: string; }
187
+ export function parseArchitectureRules(lines: string[]): { rules: ArchitectureRule[]; unparsed: string[] };
188
+ export function violatesArchitecture(rules: ArchitectureRule[], from: string, to: string): ArchitectureRule | null;
189
+
190
+ // Canonical Intent Graph (intent-graph-v1)
191
+ export const INTENT_GRAPH_SCHEMA: string;
192
+ export interface IntentGraphNode {
193
+ id: string; type: string; title: string | null; description: string | null;
194
+ status: string; owner: string | null; classification: string | null;
195
+ confidence: string | null; source: string | null; tags: string[];
196
+ createdTime: string | null; updatedTime: string | null;
197
+ }
198
+ export interface IntentGraph {
199
+ schema: string; missionId: string;
200
+ nodes: IntentGraphNode[];
201
+ relationships: Array<{ from: string; type: string; to: string }>;
202
+ summary: { nodes: number; relationships: number; byType: Record<string, number>; unresolved: number; approvalsRequired: number };
203
+ }
204
+ export function buildIntentGraph(ast: IntentAst): IntentGraph;
205
+
206
+ // Intent Atlas (whole-system navigable map over the graph)
207
+ export const ATLAS_SCHEMA: string;
208
+ export interface IntentAtlas {
209
+ schema: string; product: string | null;
210
+ overview: { missions: number; nodes: number; relationships: number; byType: Record<string, number> };
211
+ missions: Array<{ id: string; title: string }>;
212
+ nodes: IntentGraphNode[];
213
+ relationships: Array<{ from: string; type: string; to: string }>;
214
+ }
215
+ export function buildAtlas(graphs: IntentGraph[], opts?: { product?: string }): IntentAtlas;
216
+ export function atlasNode(atlas: IntentAtlas, id: string): IntentGraphNode | null;
217
+ export function expandNode(atlas: IntentAtlas, id: string): { node: IntentGraphNode; out: Array<{ rel: string; node: { id: string } }>; inbound: Array<{ rel: string; node: { id: string } }> } | null;
218
+ export function searchAtlas(atlas: IntentAtlas, query: string, opts?: { type?: string; limit?: number }): IntentGraphNode[];
219
+
220
+ // Semantic diff (by meaning; invalidated-approval detection)
221
+ export interface IntentDiff {
222
+ schema: string;
223
+ addedNodes: IntentGraphNode[]; removedNodes: IntentGraphNode[];
224
+ changedNodes: Array<{ id: string; type: string; before: IntentGraphNode; after: IntentGraphNode }>;
225
+ addedRelationships: Array<{ from: string; type: string; to: string }>;
226
+ removedRelationships: Array<{ from: string; type: string; to: string }>;
227
+ invalidatedApprovals: string[];
228
+ summary: { added: number; removed: number; changed: number; addedByType: Record<string, number>; removedByType: Record<string, number>; relationshipsAdded: number; relationshipsRemoved: number; approvalsInvalidated: number };
229
+ }
230
+ export function diffGraphs(before: { nodes: IntentGraphNode[]; relationships: Array<{ from: string; type: string; to: string }> }, after: { nodes: IntentGraphNode[]; relationships: Array<{ from: string; type: string; to: string }> }): IntentDiff;
231
+
232
+ // Three-way semantic merge
233
+ export interface IntentMerge {
234
+ schema: string;
235
+ merged: { nodes: IntentGraphNode[]; relationships: Array<{ from: string; type: string; to: string }> };
236
+ conflicts: Array<{ id: string; type: string; base: IntentGraphNode | null; ours: IntentGraphNode | null; theirs: IntentGraphNode | null }>;
237
+ clean: boolean;
238
+ summary: { nodes: number; relationships: number; conflicts: number };
239
+ }
240
+ export function mergeGraphs(base: { nodes: IntentGraphNode[]; relationships: unknown[] }, ours: { nodes: IntentGraphNode[]; relationships: unknown[] }, theirs: { nodes: IntentGraphNode[]; relationships: unknown[] }): IntentMerge;
241
+
242
+ // Classification model (intent-graph-v1 Section 5)
243
+ export const CLASSIFICATIONS: string[];
244
+ export const CONFIDENCE: string[];
245
+ export const UNSETTLED: Set<string>;
246
+ export const BLOCKABLE_PHASES: string[];
247
+ export function classify(word: string): string | null;
248
+ export function isFactual(classification: string): boolean;
249
+
250
+ // Constraint composition + conflict resolution (Gap 1)
251
+ export interface DetectedConflict { type: 'declared' | 'scope-contradiction' | 'redundant' | 'negation'; name: string; between: string[]; options?: string[]; resolveBy?: string[]; before?: string | null; status: string; }
252
+ export function composeConstraints(ast: IntentAst): { total: number; byRole: Record<string, string[]> };
253
+ export function detectConflicts(ast: IntentAst): DetectedConflict[];
254
+
255
+ // Temporal + lifecycle semantics (Gap 2)
256
+ export interface LifecycleIR { name: string; states: string[]; terminals: string[]; initial: string | null; transitions: Array<{ name: string | null; from: string | null; to: string | null; within: string | null }>; out: Record<string, string[]>; reachable: string[]; }
257
+ export function buildLifecycle(lc: IntentAst['lifecycles'][number]): LifecycleIR;
258
+ export function analyzeLifecycle(lc: IntentAst['lifecycles'][number]): { ir: LifecycleIR; findings: Array<{ code: string; message: string }> };
259
+
260
+ // Distributed + failure semantics (Gap 3)
261
+ export function analyzeDistributed(ast: IntentAst): Array<{ code: string; target: string; message: string }>;
262
+
263
+ // Decisions + rules (Gap 4)
264
+ export function analyzeDecision(dec: IntentAst['decisions'][number]): Array<{ code: string; message: string }>;
265
+
266
+ // Governance: waivers (Gap 5)
267
+ export interface Waiver {
268
+ id: string;
269
+ code: string | null;
270
+ reason: string | null;
271
+ approvedBy: string | null;
272
+ scope: string | null;
273
+ expires: string | null;
274
+ line?: number;
275
+ }
276
+ export interface GovernanceDiagnostic {
277
+ level: string;
278
+ code: string;
279
+ role: string;
280
+ message: string;
281
+ why: string;
282
+ waiver: string;
283
+ }
284
+ export interface WaiverApplication {
285
+ schema: string;
286
+ diagnostics: Array<Record<string, unknown>>;
287
+ waived: Array<Record<string, unknown>>;
288
+ blockingAfter: Array<Record<string, unknown>>;
289
+ report: { total: number; waived: number; blockingAfter: number; waivers: number; activeWaivers: number };
290
+ }
291
+ export const GOVERNANCE_SCHEMA: string;
292
+ export function governanceDiagnostics(waivers?: Waiver[], diagnostics?: Array<Record<string, unknown>>, opts?: { now?: string | null }): GovernanceDiagnostic[];
293
+ export function applyWaivers(diagnostics?: Array<Record<string, unknown>>, waivers?: Waiver[], opts?: { now?: string | null }): WaiverApplication;
294
+
295
+ // Data purpose + privacy (Gap 6)
296
+ export interface PrivacyFinding { code: string; path: string | null; message: string; severity: string; }
297
+ export const PRIVACY_SCHEMA: string;
298
+ export const DATA_CLASSIFICATIONS: string[];
299
+ export const LAWFUL_BASES: string[];
300
+ export function analyzePrivacy(ast: IntentAst): PrivacyFinding[];
301
+
302
+ // Export adapters (interop): decisions/lifecycles/temporal -> DMN / BPMN / NuSMV
303
+ export const EXPORT_FORMATS: string[];
304
+ export function toDMN(ast: IntentAst): string;
305
+ export function toBPMN(ast: IntentAst): string;
306
+ export function toSMV(ast: IntentAst): string;
307
+ export function toMermaid(ast: IntentAst): string;
308
+ export function toPlaywright(ast: IntentAst): string;
309
+ export function exportIntent(ast: IntentAst, format: string): { format: string; ext: string; content: string } | null;
310
+
311
+ // Data-shape export: typed fields -> JSON Schema / OpenAPI
312
+ export function typeToJsonSchema(type: string): Record<string, unknown>;
313
+ export function isRecognizedType(type: string): boolean;
314
+ export const SECURITY_SCHEMA: string;
315
+ export function securityDiagnostics(ast: IntentAst): Array<{ code: string; severity: string; message: string; where: string; line: number | null }>;
316
+ export const SARIF_SCHEMA: string;
317
+ export function sarifLevel(diag: { level?: string; severity?: string }): "error" | "warning" | "note";
318
+ export function toSarif(reports: Array<{ file: string; diagnostics: Array<Record<string, unknown>> }>, opts?: { version?: string; toolName?: string }): Record<string, unknown>;
319
+ export const SYNC_SCHEMA: string;
320
+ export function parseToStructured(source: string): { schema: string; mission: string | null; graph: Record<string, unknown>; fields: Record<string, unknown> };
321
+ export function proposeIntent(structured: unknown, opts?: { base?: string | Record<string, unknown> | null }): { schema: string; ok: boolean; source?: string; diff?: Record<string, unknown> | null; ambiguities?: unknown[]; lostNodes?: unknown[]; validation?: Record<string, unknown>; warnings?: string[]; applied?: boolean; error?: string };
322
+ export const PATCH_SCHEMA: string;
323
+ export type IntentEdit =
324
+ | { op: "setField"; field: "goal" | "why" | "problem"; value: string }
325
+ | { op: "addGuarantee"; statement: string; because?: string; verify?: string }
326
+ | { op: "removeGuarantee"; match: string }
327
+ | { op: "addNever"; statement: string }
328
+ | { op: "removeNever"; match: string }
329
+ | { op: "addField"; section: "input" | "output"; name: string; type: string }
330
+ | { op: "removeField"; section: "input" | "output"; name: string }
331
+ | { op: "setFieldType"; section: "input" | "output"; name: string; type: string }
332
+ | { op: "addMetric"; name: string; baseline?: string; target?: string; window?: string }
333
+ | { op: "removeMetric"; name: string }
334
+ | { op: "setMetricField"; name: string; field: "baseline" | "target" | "window"; value: string }
335
+ | { op: "addOutcome"; name: string; description?: string }
336
+ | { op: "removeOutcome"; name: string }
337
+ | { op: "addRule"; decision: string; name: string; when?: string; return?: string }
338
+ | { op: "removeRule"; decision: string; name: string }
339
+ | { op: "setRule"; decision: string; name: string; when?: string; return?: string }
340
+ | { op: "setDefault"; decision: string; return: string };
341
+ export function applyEdits(source: string, edits: IntentEdit[]): { schema: string; source: string; applied: IntentEdit[]; skipped: Array<{ edit: IntentEdit; reason: string }> };
342
+ export const VERIFY_DIFF_SCHEMA: string;
343
+ export function verifyDiff(intentText: string, change: { before?: string | null; after: string; language?: string }): {
344
+ schema: string; ok: boolean; verdict: "PASS" | "BLOCK";
345
+ findings: Array<{ level: string; code: string; message: string; line?: number; regression: boolean }>;
346
+ blocking: number; summary: { verdict: string; findings: number; blocking: number; regressions: number };
347
+ };
348
+ export const DRAFT_SCHEMA: string;
349
+ export function draftIntent(brief: Record<string, unknown>): {
350
+ schema: string; source: string;
351
+ review: Array<{ kind: string; message: string }>;
352
+ diagnostics: Array<Record<string, unknown>>;
353
+ };
354
+ export const GUARD_SCHEMA: string;
355
+ export interface IntentGuard {
356
+ schema: string;
357
+ secretFields: string[];
358
+ decisions: string[];
359
+ neverRules: string[];
360
+ redact<T>(value: T): T;
361
+ decide(name: string, inputs: Record<string, unknown>): { result: unknown; matched?: string; trace?: unknown[]; allowed: boolean };
362
+ assertAllowed(name: string, inputs: Record<string, unknown>): { result: unknown; allowed: boolean };
363
+ }
364
+ export function buildGuard(ast: IntentAst, opts?: { denyResults?: string[]; mask?: string }): IntentGuard;
365
+ export function compileGuard(intentText: string, opts?: { denyResults?: string[]; mask?: string }): IntentGuard;
366
+ export function guardSummary(ast: IntentAst): { schema: string; redactsFields: string[]; enforcesDecisions: string[]; neverRules: string[] };
367
+ export const REPORT_SCHEMA: string;
368
+ export function buildReport(files: Array<{ file: string; source: string }>): {
369
+ schema: string; ok: boolean;
370
+ totals: { files: number; missions: number; diagnostics: number };
371
+ bySeverity: Record<string, number>;
372
+ byArea: Record<string, number>;
373
+ topCodes: Array<{ code: string; count: number; area: string }>;
374
+ coverage: Record<string, number | null>;
375
+ files: Array<{ file: string; mission: string | null; blocker: number; error: number; warning: number; info: number; ok: boolean }>;
376
+ };
377
+ export function toJSONSchema(ast: IntentAst, opts?: { which?: "input" | "output" | "both" }): Record<string, unknown>;
378
+ export function toOpenAPI(ast: IntentAst): Record<string, unknown>;
379
+
380
+ // Import adapters (round-trip): external DMN / BPMN -> ThunderLang source
381
+ export const IMPORT_FORMATS: string[];
382
+ export const IMPORT_SCHEMA: string;
383
+ export function fromDMN(xml: string): string;
384
+ export function fromBPMN(xml: string): string;
385
+ export function importIntent(xml: string, format?: string): string | null;
386
+ export function detectFormat(xml: string): "dmn" | "bpmn" | null;
387
+ export interface ImportReport {
388
+ schema: string;
389
+ format: "dmn" | "bpmn";
390
+ source: string;
391
+ warnings: Array<{ code: string; message: string; subject?: string }>;
392
+ stats: Record<string, number>;
393
+ ok: boolean;
394
+ }
395
+ export function importReport(xml: string, format?: string): ImportReport | null;
396
+ export interface XmlNode { name: string; attrs: Record<string, string>; children: XmlNode[]; text: string; }
397
+ export function parseXml(input: string): XmlNode;
398
+ export function findAll(node: XmlNode, localName: string): XmlNode[];
399
+ export function find(node: XmlNode, localName: string): XmlNode | null;
400
+ export function localName(name: string): string;
401
+
402
+ // Graph -> source (native round-trip)
403
+ export const GRAPH_SOURCE_SCHEMA: string;
404
+ export function graphToSource(graph: { nodes: IntentGraphNode[]; relationships: Array<{ from: string; type: string; to: string; name?: string | null; within?: string | null }> }): string;
405
+
406
+ // Schema migrations
407
+ export const MIGRATION_SCHEMA: string;
408
+ export const SCHEMA_CHAIN: string[];
409
+ export interface GraphLike { schema?: string; nodes: IntentGraphNode[]; relationships: Array<Record<string, unknown>>; }
410
+ export interface MigrationResult { schema: string; from: string; to: string; migrated: boolean; applied: Array<{ from: string; to: string; description: string }>; graph: GraphLike; }
411
+ export interface GraphValidation { schema: string; version: string; valid: boolean; issues: Array<{ level: string; code: string; message: string; id?: string }>; }
412
+ export const MIGRATIONS: Array<{ from: string; to: string; description: string; migrate: (g: GraphLike) => GraphLike }>;
413
+ export function graphVersion(graph: GraphLike): string;
414
+ export function migrateGraph(graph: GraphLike, opts?: { to?: string }): MigrationResult;
415
+ export function validateGraph(graph: GraphLike): GraphValidation;
416
+ export function renameNodeType(fromType: string, toType: string): (g: GraphLike) => GraphLike;
417
+ export function renameRelationshipType(fromType: string, toType: string): (g: GraphLike) => GraphLike;
418
+ export function backfillNodeField(field: string, value: unknown): (g: GraphLike) => GraphLike;
419
+ export function dropNodeField(field: string): (g: GraphLike) => GraphLike;
420
+
421
+ // Intent Runtime: executable intent (no AI)
422
+ export const RUNTIME_SCHEMA: string;
423
+ export interface DecisionRun {
424
+ schema: string;
425
+ decision: string;
426
+ result: string | null;
427
+ matched: string | null;
428
+ undecided: boolean;
429
+ explanationRequired: boolean;
430
+ trace: Array<{ rule: string | null; when: string | null; matched: boolean; error?: string; note?: string }>;
431
+ ok: boolean;
432
+ }
433
+ export interface LifecycleSim {
434
+ schema: string;
435
+ lifecycle: string;
436
+ path: string[];
437
+ steps: Array<{ event: string; from: string; to: string; ok: boolean; reason?: string; transition?: string | null }>;
438
+ finalState: string | null;
439
+ valid: boolean;
440
+ endedTerminal: boolean;
441
+ }
442
+ export function evaluateDecision(dec: IntentAst['decisions'][number], inputs?: Record<string, unknown>): DecisionRun;
443
+ export function simulateLifecycle(lc: IntentAst['lifecycles'][number], events?: string[]): LifecycleSim;
444
+ export function checkDecisionCases(dec: IntentAst['decisions'][number], cases?: Array<{ name?: string; inputs?: Record<string, unknown>; expect?: unknown }>): { schema: string; decision: string; total: number; passed: number; results: Array<{ case: string; inputs: Record<string, unknown>; expected: unknown; actual: string | null; matched: string | null; pass: boolean }> };
445
+
446
+ // Safe deterministic expression evaluator (decision conditions)
447
+ export class ExprError extends Error {}
448
+ export function compileExpr(src: string): (inputs?: Record<string, unknown>) => unknown;
449
+ export function evalExpr(src: string, inputs?: Record<string, unknown>): unknown;
450
+ export function tokenize(src: string): Array<{ t: string; v: unknown }>;
451
+
452
+ // First-class tests (self-verifying .intent files)
453
+ export const TEST_SCHEMA: string;
454
+ export interface TestReport {
455
+ schema: string;
456
+ total: number;
457
+ passed: number;
458
+ failed: number;
459
+ ok: boolean;
460
+ results: Array<{ target: string | null; case: string; kind: string; expected?: unknown; actual?: unknown; valid?: boolean; expectValid?: boolean | null; pass: boolean; error?: string; note?: string }>;
461
+ }
462
+ export function runTests(ast: IntentAst): TestReport;
463
+
464
+ // Outcome contracts (executable commitments)
465
+ export const OUTCOME_SCHEMA: string;
466
+ export interface OutcomeEvaluation {
467
+ schema: string;
468
+ contract: string;
469
+ target: string | null;
470
+ actual: string | null;
471
+ baseline: string | null;
472
+ direction: "higher" | "lower";
473
+ met: boolean | null;
474
+ improvement: number | null;
475
+ comparable: boolean;
476
+ matchedResult?: string | null;
477
+ status?: "met" | "missed" | "pending";
478
+ }
479
+ export function parseValue(raw: unknown): { value: number | null; unit: string | null; raw: unknown };
480
+ export function evaluateOutcomeContract(contract: Record<string, unknown>, actual: unknown): OutcomeEvaluation;
481
+ export function evaluateOutcomes(ast: IntentAst): { schema: string; total: number; met: number; missed: number; pending: number; evaluations: OutcomeEvaluation[] };
482
+ export function outcomeDiagnostics(ast: IntentAst): Array<{ code: string; contract: string; severity: string; message: string }>;
483
+
484
+ // Style intent , brand/visual language as a governed Experience-profile extension
485
+ export const STYLE_SCHEMA: string;
486
+ export const TOKEN_PATHS: string[];
487
+ export const BRAND_PATHS: string[];
488
+ export const STYLE_ADDRESS_SPACE: string[];
489
+ export const ACCESSIBILITY_TARGETS: string[];
490
+ export const MODE_VALUES: string[];
491
+ export const ACCESSIBILITY_CLASSIFICATION: string;
492
+ export interface StyleToken { path: string; value: string | null; canonical: boolean }
493
+ export interface StyleIntentView {
494
+ id: string; name: string | null; appliesTo: string | null; purpose: string | null;
495
+ audience: string[]; surfaces: string[]; scope: string | null;
496
+ accessibility: { target: string; classification: string; verified: boolean } | null;
497
+ tokens: StyleToken[];
498
+ }
499
+ export function styleDiagnostics(ast: IntentAst): Array<{ ruleId: string; severity: string; blocks: string[]; message: string; styleIntent: string; line: number }>;
500
+ export function analyzeStyle(ast: IntentAst): { schema: string; styleIntents: StyleIntentView[]; diagnostics: ReturnType<typeof styleDiagnostics>; addressSpace: string[]; accessibilityTargets: string[] };
501
+ export const DESIGN_TOKENS_SCHEMA: string;
502
+ export function toDesignTokens(ast: IntentAst): Record<string, unknown>;
503
+ export function toCss(ast: IntentAst): string;
504
+
505
+ // Canonical schema (consumers generate bindings from this)
506
+ export const SCHEMA_VERSION: string;
507
+ export const NODE_TYPES: string[];
508
+ export const RELATIONSHIP_TYPES: string[];
509
+ export const NODE_STATUSES: string[];
510
+ export function intentGraphJsonSchema(): Record<string, unknown>;
511
+ export type RulePhase = 'author' | 'verify';
512
+ export type RuleOwner = 'IL' | 'OT';
513
+ export type DiagnosticRule = { ruleId: string; area: string; severity: string; blocks: string[]; summary: string; owner?: RuleOwner; phase?: RulePhase; reserved?: boolean };
514
+ export const DIAGNOSTIC_RULES: DiagnosticRule[];
515
+ export const CORE_DIAGNOSTICS: DiagnosticRule[];
516
+ export const VERIFICATION_RULES: DiagnosticRule[];
517
+ export const ALL_DIAGNOSTICS: DiagnosticRule[];
518
+ export const RULE_PHASES: RulePhase[];
519
+ export const RULE_OWNERS: RuleOwner[];
520
+ export const RULE_NAMESPACES: Array<{ prefix: string; owner: RuleOwner; phase: RulePhase; description: string }>;
521
+ export function ruleNamespace(ruleId: string): { owner: RuleOwner; phase: RulePhase } | null;
522
+
523
+ // Deterministic candidate selection
524
+ export interface SelectionPolicy { require: string[]; prefer: Array<{ metric: string; direction: 'min' | 'max' }>; requireAllChecks: boolean; }
525
+ export function parseSelection(lines: string[]): SelectionPolicy;
526
+ export function regionMetrics(code: string): { size: number; complexity: number; dependencies: number };
527
+ export function selectCandidate(
528
+ candidates: Array<{ id: string; metrics: Record<string, number>; checksPassed?: boolean }>,
529
+ policy?: { prefer?: Array<{ metric: string; direction: 'min' | 'max' }>; requireAllChecks?: boolean },
530
+ ): { winner: { id: string } | null; ranking: Array<{ id: string }>; eligibleCount: number; rejected: number; prefer: Array<{ metric: string; direction: string }> };
531
+
532
+ // Intent AI implementations (intent-ai-v1)
533
+ export type ImplementationState =
534
+ | 'PENDING' | 'GENERATED' | 'VERIFIED' | 'VERIFIED_AWAITING_APPROVAL'
535
+ | 'APPROVED' | 'MODIFIED' | 'INVALID' | 'REJECTED' | 'ADOPTED';
536
+ export const IMPLEMENTATION_STATES: ImplementationState[];
537
+ export const RISK_LEVELS: Array<'low' | 'medium' | 'high' | 'critical'>;
538
+ export const HIGH_RISK: Set<string>;
539
+ export const MANIFEST_SCHEMA_VERSION: string;
540
+ export const COMMENT_PREFIX: Record<string, string>;
541
+ export const PROOF_CHECK_KEYS: string[];
542
+ export function blocksProduction(status: ImplementationState, opts?: { approvalRequired?: boolean }): boolean;
543
+ export interface MarkerRegion { token: string; id: string | null; attrs: Record<string, string>; startLine: number; endLine?: number; code?: string; }
544
+ export interface MarkerFinding { code: string; line: number; message: string; }
545
+ export function parseMarkers(code: string): { regions: MarkerRegion[]; findings: MarkerFinding[] };
546
+ export function renderMarker(meta: Record<string, unknown>, language?: string, opts?: { token?: string }): { open: string; close: string };
547
+ export function contractHash(ast: IntentAst): string;
548
+ export function implementationHash(regionCode: string): string;
549
+ export function buildImplementationPrompt(ast: IntentAst, opts?: { language?: string }): string;
550
+ export function buildManifest(
551
+ files: Array<{ path?: string; source: string; ast: IntentAst }>,
552
+ opts?: { projectId?: string },
553
+ ): {
554
+ schemaVersion: string; projectId: string | null; generatedBy: string;
555
+ implementations: Array<Record<string, unknown>>;
556
+ summary: { total: number; byStatus: Record<string, number>; approvalRequired: number };
557
+ };
558
+ export interface ResolvedState { status: ImplementationState; approvalRequired: boolean; reasons: MarkerFinding[]; }
559
+ export function resolveState(ctx: {
560
+ ast: IntentAst; region?: MarkerRegion | null;
561
+ proof?: { status?: string; contractHash?: string; implementationHash?: string } | null;
562
+ approval?: { contractHash?: string; implementationHash?: string } | null;
563
+ }): ResolvedState;
564
+ export function productionGate(
565
+ resolved: Array<{ id?: string; status: ImplementationState; approvalRequired?: boolean }>,
566
+ opts?: { allowPending?: boolean },
567
+ ): { ok: boolean; blocking: Array<{ id?: string; status: ImplementationState }>; total: number };
568
+ export function adoptRegion(code: string, id: string, language?: string): { code: string; adopted: string } | null;
569
+ export const APPROVALS_SCHEMA_VERSION: string;
570
+ export interface ApprovalRecord { decision: 'approved' | 'rejected'; by: string | null; role: string | null; note: string | null; contractHash: string; implementationHash: string; at: string | null; }
571
+ export interface ApprovalsStore { schemaVersion: string; approvals: Record<string, ApprovalRecord>; }
572
+ export function emptyApprovals(): ApprovalsStore;
573
+ export function approvalFor(store: ApprovalsStore, id: string): ApprovalRecord | null;
574
+ export function recordDecision(store: ApprovalsStore, id: string, rec: {
575
+ decision: 'approved' | 'rejected'; by?: string; role?: string; note?: string;
576
+ contractHash?: string; implementationHash?: string; at?: string;
577
+ }): { store: ApprovalsStore; record: ApprovalRecord } | { error: string };
578
+ export const INTENT_AI_EVENTS: string[];
579
+ export function makeEvent(type: string, fields?: Record<string, unknown>): Record<string, unknown>;
580
+
581
+ // Language Server
582
+ export function startLspServer(opts?: { readable?: NodeJS.ReadableStream; writable?: NodeJS.WritableStream }): void;
583
+
584
+ // Formatter
585
+ export function formatSource(source: string): string;
586
+ export function isFormatted(source: string): boolean;
587
+
588
+ // The pure hash (byte-identical to node:crypto), the ecosystem join-key digest.
589
+ export function sha256hex(input: string): string;
590
+
591
+ // Intent IR (intent-ir-v1) , the shared semantic representation
592
+ export const IR_SCHEMA: string;
593
+ export const IR_EMBEDS: string;
594
+ export const IR_NODE_TYPES: string[];
595
+ export const IR_RELATIONSHIP_TYPES: string[];
596
+ export const PROVENANCE: string[];
597
+ export const FACTUAL_PROVENANCE: Set<string>;
598
+ export function isFactualProvenance(p: string): boolean;
599
+ export const IR_CONFIDENCE: string[];
600
+ export const IR_CONFIDENCE_MEANING: Record<string, string>;
601
+ export function confidenceFromClassification(classification: string): string;
602
+ export const SENSITIVITY: string[];
603
+ export const RETENTION: string[];
604
+ export const REVIEW_STATUS: string[];
605
+ export const APPROVAL_STATUS: string[];
606
+ export const NODE_FIELDS: string[];
607
+ export interface IntentIRNode extends IntentGraphNode { provenance: string; confidence?: string | null; evidence?: unknown[]; }
608
+ export interface IntentIR { schema: string; embeds: string; missionId: string | null; nodes: IntentIRNode[]; relationships: Array<{ from: string; type: string; to: string }>; }
609
+ export function validateIR(ir: unknown): { valid: boolean; errors: Array<{ path: string; message: string }> };
610
+ export function graphToIR(graph: IntentGraph, opts?: { provenance?: string }): IntentIR;
611
+
612
+ // Fable , explainable rule + finding model
613
+ export const FABLE_SCHEMA: string;
614
+ export const RISK_CATEGORIES: string[];
615
+ export interface Finding {
616
+ findingId: string; ruleId: string; ruleVersion: string; category: string;
617
+ detected: string; why: string; evidence: unknown[]; affectedNodes: string[];
618
+ severity: string; confidence: string; detectionType: string; potentialImpact: string;
619
+ remediation: string; suggestedVerification: string; humanReviewRequired: boolean;
620
+ suppressed: boolean; riskAccepted: boolean;
621
+ }
622
+ export function toFinding(diag: Diagnostic, opts?: { file?: string | null; index?: number; affectedNodes?: string[] }): Finding;
623
+ export function fableRuleFor(ruleId: string): Record<string, unknown> | null;
624
+ export function universalPack(): Record<string, unknown>;
625
+
626
+ // Intent Scanner (intent-scan-v1)
627
+ export const SCAN_SCHEMA: string;
628
+ export interface ScanResult {
629
+ schema: string;
630
+ totals?: { files: number; missions: number; findings: number };
631
+ bySeverity: Record<string, number>;
632
+ risks: Array<{ category: string; count: number; blocker: number; error: number; warning: number; info: number; findingIds: string[] }>;
633
+ remediationSequence?: Array<{ ruleId: string; category: string; severity: string; count: number; remediation: string }>;
634
+ ir: IntentIR;
635
+ findings: Finding[];
636
+ ok: boolean;
637
+ }
638
+ export function scanIntent(source: string, opts?: { file?: string | null }): ScanResult & { file: string | null; mission: string | null; summary: Record<string, unknown> };
639
+ export function scanProject(files: Array<{ file: string; source: string }>): ScanResult;
640
+
641
+ // Focused scanner query views (intent-scan-view-v1)
642
+ export const VIEW_SCHEMA: string;
643
+ export function risksView(scan: ScanResult): Record<string, unknown>;
644
+ export function gapsView(scan: ScanResult): { schema: string; view: string; count: number; gaps: Array<{ ruleId: string; severity: string; detected: string; why: string; remediation: string }> };
645
+ export function unverifiedView(scan: ScanResult): { schema: string; view: string; count: number; claims: Array<{ id: string; type: string; title: string }>; findings: Array<{ ruleId: string; detected: string }> };
646
+ export function coverageView(scan: ScanResult): { schema: string; view: string; total: number; verified: number; coverage: number; unverified: Array<{ id: string; type: string; title: string }> };
647
+ export function unknownsView(scan: ScanResult): { schema: string; view: string; count: number; unknowns: Array<{ id: string; type: string; title: string; confidence: string | null; provenance: string | null }> };
648
+ export function contradictionsView(scan: ScanResult): Record<string, unknown>;
649
+ export const VIEWS: Record<string, (scan: ScanResult) => Record<string, unknown>>;
650
+
651
+ // Intent Lens , Intent Scope + Focus Graph + Intent Brief (intent-focus-v1)
652
+ export const FOCUS_SCHEMA: string;
653
+ export const SCOPE_TYPES: string[];
654
+ export const FOCUS_REASONS: string[];
655
+ export interface IntentScope {
656
+ schema: string; scopeId: string; projectId: string | null; type: string; title: string;
657
+ selectedNodeIds: string[]; createdBy: string | null; createdAt: string | null; provenance: string;
658
+ [key: string]: unknown;
659
+ }
660
+ export function makeScope(opts?: { type?: string; title?: string | null; seeds?: string[]; projectId?: string | null; createdBy?: string | null; createdAt?: string | null; [key: string]: unknown }): IntentScope;
661
+ export interface FocusNode { id: string; type: string; title: string; focusReason: string; depth: number; confidence: string | null; provenance: string | null; }
662
+ export interface FocusGraph {
663
+ schema: string; scope: IntentScope; depth: number; freshness: string;
664
+ overview: { nodes: number; relationships: number; byReason: Record<string, number>; byType: Record<string, number> };
665
+ nodes: FocusNode[];
666
+ relationships: Array<{ from: string; type: string; to: string }>;
667
+ }
668
+ export function buildFocusGraph(atlas: { nodes: IntentGraphNode[]; relationships: Array<{ from: string; type: string; to: string }> }, opts?: { seeds?: string[]; depth?: number; scope?: IntentScope }): FocusGraph;
669
+ export interface IntentBrief {
670
+ schema: string; scopeId: string | null; what: string | null; who: string[];
671
+ involves: Record<string, number>; guarantees: string[]; prohibitions: string[];
672
+ risks: number; verification: number; unknowns: string[]; confidence: string | null; needsReview: boolean;
673
+ }
674
+ export function intentBrief(focus: FocusGraph): IntentBrief;
675
+
676
+ // Comprehension Contract , the C0..C7 understanding level (intent-comprehension-v1)
677
+ export const COMPREHENSION_SCHEMA: string;
678
+ export const COMPREHENSION_LEVELS: Array<{ level: string; name: string; means: string }>;
679
+ export interface ComprehensionSignal { met: boolean; evidence: string[]; owner: string }
680
+ export interface ComprehensionResult {
681
+ schema: string; mission: string | null; level: string; levelName: string; means: string;
682
+ signals: Record<string, ComprehensionSignal>;
683
+ missing: Array<{ level: string; name: string; need: string; owner: string }>;
684
+ contract: Record<string, boolean>;
685
+ }
686
+ export function comprehensionLevel(ast: IntentAst, opts?: { observed?: boolean; learningPath?: boolean; governed?: boolean }): ComprehensionResult;
687
+ export function comprehensionReport(asts: IntentAst[], opts?: { observed?: boolean; learningPath?: boolean; governed?: boolean }): { schema: string; count: number; byLevel: Record<string, number>; missions: ComprehensionResult[] };
688
+
689
+ // Code generation , deterministic scaffolds from intent (intent-codegen-v1)
690
+ export const CODEGEN_SCHEMA: string;
691
+ export function toTypeScript(ast: IntentAst): string;
692
+ export function toCSharp(ast: IntentAst): string;
693
+ export function toJava(ast: IntentAst): string;
694
+ export const GENERATORS: Record<string, (ast: IntentAst) => string>;
695
+ export function exprToJs(src: string, opts?: { inputs?: string[] }): string;
696
+ export function subjectName(ast: IntentAst): string | null;
697
+ export function intentRefId(astOrName: IntentAst | string, opts?: { sourceHash?: string }): string;
698
+
699
+ // 12-Factor Agents conformance lens (twelve-factor-v1)
700
+ export const TWELVE_FACTOR_SCHEMA: string;
701
+ export interface TwelveFactorResult {
702
+ schemaVersion: string;
703
+ subject: string | null;
704
+ score: number;
705
+ grade: 'strong' | 'partial' | 'weak';
706
+ counts: { satisfied: number; partial: number; absent: number };
707
+ factors: Array<{ id: string; factor: number; name: string; verdict: 'satisfied' | 'partial' | 'absent'; evidence: string; fix?: string }>;
708
+ diagnostics: Diagnostic[];
709
+ }
710
+ export function twelveFactorReport(ast: IntentAst): TwelveFactorResult;
711
+ export function twelveFactorSummary(ast: IntentAst): { schemaVersion: string; score: number; grade: string; counts: { satisfied: number; partial: number; absent: number } };
712
+ export function skillRefId(name: string): string;
713
+
714
+ // Change Lens , what a branch/PR changed by meaning (intent-changes-v1)
715
+ export const CHANGES_SCHEMA: string;
716
+ export interface ChangeReport {
717
+ schema: string;
718
+ totals: { files: number; added: number; removed: number; changed: number; invalidatedApprovals: number; touched: number };
719
+ verdict: "review" | "changed" | "no-semantic-change";
720
+ regressions: Array<{ kind: string; type: string; thing: string; title: string; path: string }>;
721
+ highlights: Array<{ kind: string; type: string; thing: string; title: string; path: string }>;
722
+ files: Array<{ path: string; status: string; added: number; removed: number; changed: number; invalidatedApprovals: number }>;
723
+ touchedNodeIds: string[];
724
+ }
725
+ export function changeReport(pairs: Array<{ path: string; before: IntentGraph | null; after: IntentGraph | null }>): ChangeReport;