supercov 0.0.44 → 0.0.46

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 (45) hide show
  1. package/README.md +21 -12
  2. package/docs/agent-loop.md +17 -9
  3. package/docs/assertion-agent.md +146 -0
  4. package/docs/assertion-evidence.md +72 -663
  5. package/docs/assertion-maps.md +236 -0
  6. package/docs/assertions.md +132 -0
  7. package/docs/cli.md +40 -8
  8. package/docs/coverage-model.md +18 -0
  9. package/docs/evidence.md +28 -0
  10. package/docs/performance.md +16 -0
  11. package/docs/supported-suites.md +64 -147
  12. package/package.json +36 -35
  13. package/runtime/javascript/launchSupervisor.mjs +5 -0
  14. package/runtime/javascript/nodeTest.mjs +57 -41
  15. package/runtime/javascript/provenance.mjs +4 -1
  16. package/runtime/javascript/register.mjs +9 -5
  17. package/runtime/javascript/runnerEvidence.mjs +4 -1
  18. package/runtime/javascript/runtime.mjs +62 -36
  19. package/schemas/assertions.schema.json +276 -0
  20. package/analyzers/typescript/README.md +0 -59
  21. package/analyzers/typescript/bin/compiler-identity.mjs +0 -78
  22. package/analyzers/typescript/bin/identity.mjs +0 -71
  23. package/analyzers/typescript/bin/query.mjs +0 -29
  24. package/analyzers/typescript/dist/analyze.js +0 -5273
  25. package/analyzers/typescript/dist/archive.js +0 -337
  26. package/analyzers/typescript/dist/awaited-observations.js +0 -376
  27. package/analyzers/typescript/dist/build-identity.json +0 -1
  28. package/analyzers/typescript/dist/compiler.js +0 -32
  29. package/analyzers/typescript/dist/frontend.js +0 -75
  30. package/analyzers/typescript/dist/mock-counts.js +0 -2517
  31. package/analyzers/typescript/dist/native-frontend.js +0 -271
  32. package/analyzers/typescript/dist/pragmas.js +0 -186
  33. package/analyzers/typescript/dist/types.js +0 -1
  34. package/analyzers/typescript/package.json +0 -27
  35. package/analyzers/typescript/src/analyze.ts +0 -6180
  36. package/analyzers/typescript/src/archive.ts +0 -471
  37. package/analyzers/typescript/src/awaited-observations.ts +0 -561
  38. package/analyzers/typescript/src/compiler.ts +0 -49
  39. package/analyzers/typescript/src/frontend.ts +0 -136
  40. package/analyzers/typescript/src/mock-counts.ts +0 -3219
  41. package/analyzers/typescript/src/native-frontend.ts +0 -315
  42. package/analyzers/typescript/src/pragmas.ts +0 -284
  43. package/analyzers/typescript/src/types.ts +0 -45
  44. package/analyzers/typescript/tsconfig.json +0 -12
  45. package/docs/code-verification.md +0 -4
@@ -1,315 +0,0 @@
1
- /** Adapter for the exact TypeScript 7.0.2 API, not a legacy compiler fallback. */
2
- import type ts from "typescript";
3
- import { createRequire, isBuiltin } from "node:module";
4
- import { existsSync } from "node:fs";
5
- import { dirname, resolve } from "node:path";
6
- import { pathToFileURL } from "node:url";
7
- import { analysisPath } from "./compiler.js";
8
- import {
9
- selectedRootFiles,
10
- type CompilerFrontend,
11
- type SyntaxAPI,
12
- } from "./frontend.js";
13
-
14
- // The optional project dependency cannot be imported by the TS5 build. Native API
15
- // objects are confined to this adapter; its public surface is the shared frontend.
16
- type Native = any;
17
-
18
- export function nativeFrontend(
19
- entry: string,
20
- projectRoot: string,
21
- ): CompilerFrontend {
22
- const [major, minor] = process.versions.node.split(".").map(Number);
23
- if (major < 22 || (major === 22 && minor < 12))
24
- throw new Error(
25
- "The TypeScript 7 frontend requires Node 22.12 or newer (Node 24 is tested)",
26
- );
27
- const require = createRequire(pathToFileURL(entry));
28
- const ast: Native = require("typescript/unstable/ast");
29
- const native: Native = require("typescript/unstable/sync");
30
- const root = analysisPath(projectRoot);
31
- const key = (file: string) => analysisPath(file).replaceAll("\\", "/");
32
- const virtual = new Map<string, string>();
33
- let parseSerial = 0;
34
- const opened = new Set<string>();
35
- const limitations = new Set<string>();
36
- let api: Native;
37
- let snapshot: Native;
38
- let closed = false;
39
- function client() {
40
- if (closed) throw new Error("TypeScript 7 frontend is closed");
41
- return (api ??= new native.API({
42
- cwd: root,
43
- fs: {
44
- readFile: (file: string) => virtual.get(key(file)),
45
- fileExists: (file: string) =>
46
- virtual.has(key(file)) ? true : undefined,
47
- },
48
- }));
49
- }
50
- function update(config: string) {
51
- const previous = snapshot;
52
- snapshot = client().updateSnapshot({
53
- ...(!opened.has(config) ? { openProjects: [config] } : {}),
54
- fileChanges: { invalidateAll: true },
55
- });
56
- opened.add(config);
57
- previous?.dispose();
58
- const project = snapshot.getProject(config);
59
- if (!project)
60
- throw new Error(
61
- `TypeScript 7 did not open the analysis project: ${config}`,
62
- );
63
- return project;
64
- }
65
- function overlayConfig(path: string, config: unknown) {
66
- if (existsSync(path))
67
- throw new Error(`Reserved analysis config already exists: ${path}`);
68
- virtual.set(key(path), JSON.stringify(config));
69
- }
70
- const kinds = ast.SyntaxKind;
71
- const functionKinds = new Set(
72
- [
73
- "FunctionDeclaration",
74
- "MethodDeclaration",
75
- "Constructor",
76
- "GetAccessor",
77
- "SetAccessor",
78
- "FunctionExpression",
79
- "ArrowFunction",
80
- "MethodSignature",
81
- "CallSignature",
82
- "JSDocSignature",
83
- "ConstructSignature",
84
- "IndexSignature",
85
- "FunctionType",
86
- "JSDocFunctionType",
87
- "ConstructorType",
88
- ]
89
- .map((name) => kinds[name])
90
- .filter((value) => typeof value === "number"),
91
- );
92
- const loopKinds = new Set(
93
- [
94
- "ForStatement",
95
- "ForInStatement",
96
- "ForOfStatement",
97
- "WhileStatement",
98
- "DoStatement",
99
- ].map((name) => kinds[name]),
100
- );
101
- // These adapters preserve native nodes and native enum values. No TS5 predicate
102
- // may inspect a TS7 node: syntax-kind numeric values are different.
103
- const syntax = {
104
- ...ast,
105
- SymbolFlags: native.SymbolFlags,
106
- forEachChild: (node: Native, visit: Native, visitArray?: Native) =>
107
- node.forEachChild(visit, visitArray),
108
- isFunctionLike: (node: Native) => !!node && functionKinds.has(node.kind),
109
- isIterationStatement: (
110
- node: Native,
111
- lookInLabeledStatements: boolean,
112
- ): boolean =>
113
- !!node &&
114
- (loopKinds.has(node.kind) ||
115
- (lookInLabeledStatements &&
116
- node.kind === kinds.LabeledStatement &&
117
- syntax.isIterationStatement(node.statement, true))),
118
- isMethodSignature: ast.isMethodSignatureDeclaration,
119
- isParameter: ast.isParameterDeclaration,
120
- isTypeAssertionExpression: ast.isTypeAssertion,
121
- isStringLiteralLike: (node: Native) =>
122
- !!node &&
123
- (node.kind === kinds.StringLiteral ||
124
- node.kind === kinds.NoSubstitutionTemplateLiteral),
125
- canHaveModifiers: (node: Native) => !!node && "modifiers" in node,
126
- getModifiers: (node: Native) =>
127
- node.modifiers?.filter((m: Native) => m.kind !== kinds.Decorator),
128
- } as unknown as SyntaxAPI;
129
- for (const name of [
130
- "isMethodSignature",
131
- "isParameter",
132
- "isTypeAssertionExpression",
133
- "getLeadingCommentRanges",
134
- "getTrailingCommentRanges",
135
- ] as const)
136
- if (typeof syntax[name] !== "function")
137
- throw new Error(`Unsupported TypeScript 7 syntax API: ${name}`);
138
-
139
- const frontend: CompilerFrontend = {
140
- kind: "typescript-native-7",
141
- version: "7.0.2",
142
- syntax,
143
- limitations,
144
- close() {
145
- if (closed) return;
146
- closed = true;
147
- try {
148
- snapshot?.dispose();
149
- } finally {
150
- api?.close();
151
- }
152
- },
153
- parseSource(file, text) {
154
- const absolute = resolve(root, file);
155
- virtual.set(key(absolute), text);
156
- // Do not rely on 7.0.2 reloading an edited virtual config's root-file list.
157
- const parseConfig = resolve(
158
- root,
159
- `.supercov-asserted-parse-${++parseSerial}.tsconfig.json`,
160
- );
161
- overlayConfig(parseConfig, {
162
- files: [absolute],
163
- compilerOptions: {
164
- allowJs: true,
165
- checkJs: true,
166
- noResolve: true,
167
- noLib: true,
168
- noEmit: true,
169
- types: [],
170
- },
171
- });
172
- const project = update(parseConfig);
173
- const source = project.program.getSourceFile(absolute);
174
- if (!source || source.text !== text)
175
- throw new Error(`Native parser source mismatch: ${file}`);
176
- const errors = project.program.getSyntacticDiagnostics(absolute);
177
- if (errors.length)
178
- throw new Error(
179
- `Native parser rejected ${file}: ${JSON.stringify(errors)}`,
180
- );
181
- return source as ts.SourceFile;
182
- },
183
- openProgram(options) {
184
- const configPath = resolve(root, options.tsconfig ?? "tsconfig.json");
185
- const hasConfig = existsSync(configPath);
186
- if (!hasConfig && !options.sourceFiles)
187
- throw new Error(`Missing TypeScript config: ${configPath}`);
188
- const configured = hasConfig
189
- ? client().parseConfigFile(configPath).fileNames
190
- : [];
191
- const files = selectedRootFiles(options, configured);
192
- const overlay = resolve(
193
- dirname(configPath),
194
- ".supercov-asserted-query.tsconfig.json",
195
- );
196
- overlayConfig(overlay, {
197
- ...(hasConfig ? { extends: configPath } : {}),
198
- files,
199
- include: [],
200
- exclude: [],
201
- compilerOptions: {
202
- ...(options.sourceFiles ? { allowJs: true, checkJs: true } : {}),
203
- noEmit: true,
204
- },
205
- });
206
- const project = update(overlay);
207
- const program = project.program;
208
- const configErrors = program.getConfigFileParsingDiagnostics();
209
- if (configErrors.length)
210
- throw new Error(
211
- `TypeScript 7 configuration is invalid: ${JSON.stringify(configErrors)}`,
212
- );
213
- const checker = project.checker;
214
- const symbols = new WeakMap<object, ts.Symbol>();
215
- const nativeSymbols = new WeakMap<object, Native>();
216
- function wrapSymbol(symbol: Native): ts.Symbol | undefined {
217
- if (!symbol) return undefined;
218
- let wrapped = symbols.get(symbol);
219
- if (!wrapped) {
220
- wrapped = {
221
- flags: symbol.flags,
222
- name: symbol.name,
223
- escapedName: symbol.escapedName,
224
- get valueDeclaration() {
225
- return symbol.valueDeclaration?.resolve(project);
226
- },
227
- get declarations() {
228
- return symbol.declarations.map((handle: Native) => {
229
- const node = handle.resolve(project);
230
- if (!node)
231
- throw new Error(
232
- "TypeScript 7 declaration handle did not resolve",
233
- );
234
- return node;
235
- });
236
- },
237
- } as ts.Symbol;
238
- symbols.set(symbol, wrapped);
239
- nativeSymbols.set(wrapped, symbol);
240
- }
241
- return wrapped;
242
- }
243
- const allFiles: ts.SourceFile[] = program
244
- .getSourceFileNames()
245
- .map((file: string) => {
246
- const source = program.getSourceFile(file);
247
- if (!source) throw new Error(`Native source disappeared: ${file}`);
248
- return source;
249
- });
250
- const resolutionCache = new Map<string, string | undefined>();
251
- return {
252
- files: allFiles,
253
- checker: {
254
- getSymbolAtLocation: (node) =>
255
- wrapSymbol(checker.getSymbolAtLocation(node)),
256
- getShorthandAssignmentValueSymbol: (node) =>
257
- wrapSymbol(checker.getShorthandAssignmentValueSymbol(node)),
258
- getAliasedSymbol: (symbol) => {
259
- const original = nativeSymbols.get(symbol);
260
- if (!original)
261
- throw new Error("Symbol belongs to a different compiler session");
262
- return wrapSymbol(checker.getAliasedSymbol(original))!;
263
- },
264
- getResolvedSignature: (node) => {
265
- const signature = checker.getResolvedSignature(node);
266
- return signature
267
- ? ({
268
- getParameters: () =>
269
- signature.getParameters().map(wrapSymbol),
270
- } as ts.Signature)
271
- : undefined;
272
- },
273
- },
274
- resolveModule(specifier, from) {
275
- const cacheKey = `${key(from)}\0${specifier}`;
276
- if (resolutionCache.has(cacheKey))
277
- return resolutionCache.get(cacheKey);
278
- const source = program.getSourceFile(from);
279
- const paths = new Set<string>();
280
- const visit = (node: Native) => {
281
- if (syntax.isStringLiteralLike(node) && node.text === specifier) {
282
- // Ask the native checker about actual module-reference syntax. A
283
- // vi.mock string is not a TypeScript import and is not guessed.
284
- const p: Native = node.parent;
285
- if (
286
- p &&
287
- (ast.isImportDeclaration(p) ||
288
- ast.isExportDeclaration(p) ||
289
- (ast.isCallExpression(p) &&
290
- p.expression.kind === kinds.ImportKeyword))
291
- ) {
292
- const symbol = checker.getSymbolAtLocation(node);
293
- for (const handle of symbol?.declarations ?? []) {
294
- const declaration = handle.resolve(project);
295
- if (declaration && syntax.isSourceFile(declaration))
296
- paths.add(declaration.fileName);
297
- }
298
- }
299
- }
300
- node.forEachChild(visit);
301
- };
302
- if (source) visit(source);
303
- const result = paths.size === 1 ? [...paths][0] : undefined;
304
- if (!result && !isBuiltin(specifier))
305
- limitations.add(
306
- `native-module-resolution: ${key(from)} → ${specifier}`,
307
- );
308
- resolutionCache.set(cacheKey, result);
309
- return result;
310
- },
311
- };
312
- },
313
- };
314
- return frontend;
315
- }
@@ -1,284 +0,0 @@
1
- import type ts from "typescript";
2
- import type { Site } from "./types.js";
3
- import type { AwaitedObservationSource } from "./awaited-observations.js";
4
- import type {
5
- CallOmissionEvidence,
6
- CountSensitivityEvidence,
7
- PayloadSensitivityEvidence,
8
- DirectReturnSensitivityEvidence,
9
- CompletionSensitivityEvidence,
10
- } from "./mock-counts.js";
11
-
12
- export type AssertionPhase = { source?: string; op: string; status?: string };
13
- export function assertionWitnessIssue(
14
- phases: AssertionPhase[] | undefined,
15
- source?: string,
16
- method?: string,
17
- ) {
18
- const matches = (phases ?? []).filter(
19
- (p) => p.source === source && p.op.split(".").pop() === method,
20
- );
21
- if (source && matches.length && matches.every((p) => p.status === "passed"))
22
- return undefined;
23
- const statuses = new Set(matches.map((p) => p.status ?? "unknown"));
24
- return !phases
25
- ? ("capture-unavailable" as const)
26
- : !source
27
- ? ("uninstrumented-observation" as const)
28
- : !matches.length
29
- ? ("call-not-recorded" as const)
30
- : statuses.size > 1
31
- ? ("mixed-call-outcomes" as const)
32
- : statuses.has("failed")
33
- ? ("call-failed" as const)
34
- : ("call-incomplete" as const);
35
- }
36
-
37
- interface Attachment {
38
- testKey: string;
39
- source: string;
40
- method: string;
41
- inert: boolean;
42
- awaitedObservation?: AwaitedObservationSource;
43
- }
44
- interface Comment {
45
- id: string;
46
- where: string;
47
- raw: string;
48
- target?: { file: string; function: string; snippet?: string; via?: string };
49
- candidateSites: string[];
50
- issue?: string;
51
- attachments: Attachment[];
52
- check?: "missing-call" | "count" | "value" | "completion";
53
- }
54
- export interface PragmaHint {
55
- id: string;
56
- where: string;
57
- raw: string;
58
- target?: Comment["target"];
59
- candidateSites: string[];
60
- issue?: string;
61
- test?: string;
62
- assertionSource?: string;
63
- assertionMethod?: string;
64
- witness: "passed" | "unavailable";
65
- witnessIssue?: string;
66
- awaitedObservation?: AwaitedObservationSource;
67
- check?: "missing-call" | "count" | "value" | "completion";
68
- callOmission?: CallOmissionEvidence;
69
- countSensitivity?: CountSensitivityEvidence;
70
- payloadSensitivity?: PayloadSensitivityEvidence;
71
- directReturnSensitivity?: DirectReturnSensitivityEvidence;
72
- completionSensitivity?: CompletionSensitivityEvidence;
73
- }
74
-
75
- /** Source hints are kept OUT of observations. A comment never adds a boundary. */
76
- export function collectPragmas(
77
- compiler: import("./frontend.js").SyntaxAPI,
78
- files: ts.SourceFile[],
79
- relativeFile: (file: ts.SourceFile) => string,
80
- sites: Site[],
81
- ) {
82
- const comments = new Map<string, Comment>();
83
- const key = (sf: ts.SourceFile, pos: number) => `${relativeFile(sf)}:${pos}`;
84
- const location = (sf: ts.SourceFile, pos: number) => {
85
- const p = sf.getLineAndCharacterOfPosition(pos);
86
- return `${relativeFile(sf)}:${p.line + 1}:${p.character + 1}`;
87
- };
88
- for (const sf of files) {
89
- const collect = (ranges: ts.CommentRange[] | undefined) => {
90
- for (const range of ranges ?? []) {
91
- const raw = sf.text.slice(range.pos, range.end);
92
- if (!/^\/\/\s*observes:/.test(raw) || comments.has(key(sf, range.pos)))
93
- continue;
94
- const parts = raw.split(/;\s*check\s+/);
95
- const check =
96
- parts.length === 2 && parts[1].trim() === "missing call"
97
- ? ("missing-call" as const)
98
- : parts.length === 2 && parts[1].trim() === "count"
99
- ? ("count" as const)
100
- : parts.length === 2 && parts[1].trim() === "value"
101
- ? ("value" as const)
102
- : parts.length === 2 && parts[1].trim() === "completion"
103
- ? ("completion" as const)
104
- : undefined;
105
- const checkIssue =
106
- parts.length > 1 && !check ? "unsupported-check-recipe" : undefined;
107
- const parsed = /^\/\/\s*observes:\s*(\S+?)#(\S+)(?:\s+(.+?))?\s*$/.exec(
108
- parts[0],
109
- );
110
- const suffix = parsed?.[3]?.split(/(?:^|\s+)via\s+/);
111
- const target = parsed
112
- ? {
113
- file: parsed[1],
114
- function: parsed[2],
115
- snippet: suffix?.[0]?.trim() || undefined,
116
- via: suffix?.slice(1).join(" via ").trim() || undefined,
117
- }
118
- : undefined;
119
- const validPath =
120
- target &&
121
- !/[\\:]/.test(target.file) &&
122
- target.file
123
- .split("/")
124
- .every((part) => part && part !== "." && part !== "..");
125
- const matchingSites = validPath
126
- ? sites.filter(
127
- (s) =>
128
- s.file === target.file &&
129
- // The recipe selects the emission, not a containing callback-return site.
130
- (!check ||
131
- (check === "missing-call"
132
- ? s.category === "log"
133
- : check === "completion"
134
- ? s.category === "return" || s.category === "throw"
135
- : s.kind === "decision" || s.category === "return")) &&
136
- (s.owner === target.function || s.fn === target.function) &&
137
- (!target.snippet || s.text.includes(target.snippet)),
138
- )
139
- : [];
140
- // An exact whole-site selector is more specific than a containing return
141
- // whose display text happens to include that expression. Equal sibling
142
- // sites remain ambiguous. This only selects a node; it proves no behavior.
143
- const exact =
144
- check && target?.snippet
145
- ? matchingSites.filter(
146
- (s) => s.text.trim() === target.snippet!.trim(),
147
- )
148
- : [];
149
- const candidates = (exact.length ? exact : matchingSites).map(
150
- (s) => s.id,
151
- );
152
- comments.set(key(sf, range.pos), {
153
- id: location(sf, range.pos),
154
- where: location(sf, range.pos),
155
- raw,
156
- target,
157
- ...(check ? { check } : {}),
158
- candidateSites: candidates,
159
- issue:
160
- checkIssue ??
161
- (!target
162
- ? "invalid-syntax"
163
- : !validPath
164
- ? "invalid-target-path"
165
- : !candidates.length
166
- ? "target-not-in-inventory"
167
- : candidates.length > 1
168
- ? "ambiguous-target"
169
- : undefined),
170
- attachments: [],
171
- });
172
- }
173
- };
174
- const visit = (node: ts.Node) => {
175
- collect(compiler.getLeadingCommentRanges(sf.text, node.getFullStart()));
176
- collect(compiler.getTrailingCommentRanges(sf.text, node.getEnd()));
177
- compiler.forEachChild(node, visit);
178
- };
179
- visit(sf);
180
- }
181
- return {
182
- hasHint(node: ts.Node) {
183
- let statement = node;
184
- while (statement.parent && !compiler.isStatement(statement))
185
- statement = statement.parent;
186
- if (!compiler.isExpressionStatement(statement)) return false;
187
- const sf = node.getSourceFile();
188
- return (
189
- compiler.getLeadingCommentRanges(sf.text, statement.getFullStart()) ??
190
- []
191
- ).some((range) => comments.has(key(sf, range.pos)));
192
- },
193
- register(
194
- node: ts.CallExpression,
195
- method: string,
196
- testKey: string,
197
- inert: boolean,
198
- awaitedObservation?: AwaitedObservationSource,
199
- ) {
200
- let statement: ts.Node = node;
201
- while (statement.parent && !compiler.isStatement(statement))
202
- statement = statement.parent;
203
- // A comment on an if/block/declaration is not a claim about every assertion inside it.
204
- if (!compiler.isExpressionStatement(statement)) return;
205
- const sf = node.getSourceFile();
206
- for (const range of compiler.getLeadingCommentRanges(
207
- sf.text,
208
- statement.getFullStart(),
209
- ) ?? []) {
210
- const comment = comments.get(key(sf, range.pos));
211
- if (!comment) continue;
212
- const attachment = {
213
- testKey,
214
- source: location(sf, node.getStart(sf)),
215
- method,
216
- inert,
217
- ...(awaitedObservation ? { awaitedObservation } : {}),
218
- };
219
- if (
220
- !comment.attachments.some(
221
- (a) =>
222
- a.testKey === testKey &&
223
- a.source === attachment.source &&
224
- a.method === method,
225
- )
226
- )
227
- comment.attachments.push(attachment);
228
- }
229
- },
230
- finish(
231
- bindings: { testKey: string; id: string; phases?: AssertionPhase[] }[],
232
- ): PragmaHint[] {
233
- return [...comments.values()].flatMap<PragmaHint>(
234
- ({ attachments, ...comment }) => {
235
- const sources = new Set(
236
- attachments.map((a) => `${a.source}#${a.method}`),
237
- );
238
- const issue =
239
- comment.issue ??
240
- (sources.size > 1
241
- ? "ambiguous-assertion"
242
- : !sources.size
243
- ? "unattached-assertion"
244
- : undefined);
245
- const matched = bindings.flatMap((b) =>
246
- attachments
247
- .filter((a) => a.testKey === b.testKey && !a.inert)
248
- .map((a) => ({ a, b })),
249
- );
250
- if (sources.size !== 1 || !matched.length)
251
- return [
252
- {
253
- ...comment,
254
- issue: issue ?? "no-owning-passed-test",
255
- witness: "unavailable" as const,
256
- },
257
- ];
258
- return matched.map(({ a, b }) => {
259
- // A source-checked poll is not an explicit assertion phase. Neither
260
- // a matching phase name nor a passing test can supply its read receipt.
261
- const witnessIssue = a.awaitedObservation
262
- ? "observation-capture-unavailable"
263
- : assertionWitnessIssue(b.phases, a.source, a.method);
264
- return {
265
- ...comment,
266
- id: `${comment.id}@${b.id}`,
267
- issue,
268
- test: b.id,
269
- assertionSource: a.source,
270
- assertionMethod: a.method,
271
- ...(a.awaitedObservation
272
- ? { awaitedObservation: a.awaitedObservation }
273
- : {}),
274
- witness: witnessIssue
275
- ? ("unavailable" as const)
276
- : ("passed" as const),
277
- witnessIssue,
278
- };
279
- });
280
- },
281
- );
282
- },
283
- };
284
- }
@@ -1,45 +0,0 @@
1
- /** Source inventory supplied by the frontend. Positions are original-source UTF-16 offsets. */
2
- export interface Site {
3
- id: string;
4
- file: string;
5
- kind: "decision" | "effect";
6
- category: string;
7
- classification: "contractual" | "incidental" | "review";
8
- start: { line: number; column: number };
9
- end: { line: number; column: number };
10
- pos: number;
11
- endPos: number;
12
- text: string;
13
- fn: string;
14
- owner: string;
15
- exported: boolean;
16
- note?: string;
17
- chain?: string[];
18
- method?: string;
19
- arg0?: string;
20
- }
21
-
22
- export interface AnalyzeOptions {
23
- projectRoot: string;
24
- /** Query-local evidence supplied in memory by the archive adapter, using original-source positions. */
25
- evidenceFiles: Record<string, string>;
26
- /** Exact files selected by the archive integration, including JS and nonstandard test directories. */
27
- sourceFiles?: string[];
28
- testFiles?: string[];
29
- sourceDir?: string;
30
- testDir?: string;
31
- tsconfig?: string;
32
- /** Defaults to the compiler API installed in the project being analyzed. */
33
- typescript?: typeof import("typescript");
34
- }
35
-
36
- export interface AnalysisDiagnostics {
37
- runtimeTests: number;
38
- linkedTests: number;
39
- staticTests: number;
40
- linkedByAssertionLines: number;
41
- linkedByTitle: number;
42
- linkWarnings: string[];
43
- unrecognizedOperands: { shape: string; count: number }[];
44
- compilerVersion: string;
45
- }
@@ -1,12 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "strict": true,
7
- "skipLibCheck": true,
8
- "rootDir": "src",
9
- "outDir": "dist"
10
- },
11
- "include": ["src/**/*.ts"]
12
- }
@@ -1,4 +0,0 @@
1
- # Agent workflow
2
-
3
- The tutorial is now part of [Agent workflow](agent-loop.md), including the
4
- prompt, recorded checkout example, and guidance for longer runs.