@descryy/ir 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/LICENSE +21 -0
  2. package/dist/capabilities.d.ts +83 -0
  3. package/dist/capabilities.d.ts.map +1 -0
  4. package/dist/capabilities.js +91 -0
  5. package/dist/capabilities.js.map +1 -0
  6. package/dist/conformance/bind.d.ts +82 -0
  7. package/dist/conformance/bind.d.ts.map +1 -0
  8. package/dist/conformance/bind.js +157 -0
  9. package/dist/conformance/bind.js.map +1 -0
  10. package/dist/conformance/cli.d.ts +25 -0
  11. package/dist/conformance/cli.d.ts.map +1 -0
  12. package/dist/conformance/cli.js +137 -0
  13. package/dist/conformance/cli.js.map +1 -0
  14. package/dist/conformance/compare.d.ts +74 -0
  15. package/dist/conformance/compare.d.ts.map +1 -0
  16. package/dist/conformance/compare.js +140 -0
  17. package/dist/conformance/compare.js.map +1 -0
  18. package/dist/conformance/compose.d.ts +79 -0
  19. package/dist/conformance/compose.d.ts.map +1 -0
  20. package/dist/conformance/compose.js +167 -0
  21. package/dist/conformance/compose.js.map +1 -0
  22. package/dist/conformance/golden.d.ts +110 -0
  23. package/dist/conformance/golden.d.ts.map +1 -0
  24. package/dist/conformance/golden.js +252 -0
  25. package/dist/conformance/golden.js.map +1 -0
  26. package/dist/conformance/index.d.ts +26 -0
  27. package/dist/conformance/index.d.ts.map +1 -0
  28. package/dist/conformance/index.js +18 -0
  29. package/dist/conformance/index.js.map +1 -0
  30. package/dist/conformance/manifest-check.d.ts +78 -0
  31. package/dist/conformance/manifest-check.d.ts.map +1 -0
  32. package/dist/conformance/manifest-check.js +149 -0
  33. package/dist/conformance/manifest-check.js.map +1 -0
  34. package/dist/conformance/manifest.d.ts +83 -0
  35. package/dist/conformance/manifest.d.ts.map +1 -0
  36. package/dist/conformance/manifest.js +158 -0
  37. package/dist/conformance/manifest.js.map +1 -0
  38. package/dist/conformance/report.d.ts +14 -0
  39. package/dist/conformance/report.d.ts.map +1 -0
  40. package/dist/conformance/report.js +87 -0
  41. package/dist/conformance/report.js.map +1 -0
  42. package/dist/conformance/run.d.ts +172 -0
  43. package/dist/conformance/run.d.ts.map +1 -0
  44. package/dist/conformance/run.js +626 -0
  45. package/dist/conformance/run.js.map +1 -0
  46. package/dist/contracts.d.ts +198 -0
  47. package/dist/contracts.d.ts.map +1 -0
  48. package/dist/contracts.js +10 -0
  49. package/dist/contracts.js.map +1 -0
  50. package/dist/contradiction.d.ts +112 -0
  51. package/dist/contradiction.d.ts.map +1 -0
  52. package/dist/contradiction.js +97 -0
  53. package/dist/contradiction.js.map +1 -0
  54. package/dist/finding.d.ts +567 -0
  55. package/dist/finding.d.ts.map +1 -0
  56. package/dist/finding.js +491 -0
  57. package/dist/finding.js.map +1 -0
  58. package/dist/hypothesis.d.ts +130 -0
  59. package/dist/hypothesis.d.ts.map +1 -0
  60. package/dist/hypothesis.js +116 -0
  61. package/dist/hypothesis.js.map +1 -0
  62. package/dist/identity.d.ts +295 -0
  63. package/dist/identity.d.ts.map +1 -0
  64. package/dist/identity.js +404 -0
  65. package/dist/identity.js.map +1 -0
  66. package/dist/index.d.ts +34 -0
  67. package/dist/index.d.ts.map +1 -0
  68. package/dist/index.js +21 -0
  69. package/dist/index.js.map +1 -0
  70. package/dist/ir.d.ts +360 -0
  71. package/dist/ir.d.ts.map +1 -0
  72. package/dist/ir.js +76 -0
  73. package/dist/ir.js.map +1 -0
  74. package/dist/model-tables.d.ts +111 -0
  75. package/dist/model-tables.d.ts.map +1 -0
  76. package/dist/model-tables.js +103 -0
  77. package/dist/model-tables.js.map +1 -0
  78. package/dist/normalise.d.ts +114 -0
  79. package/dist/normalise.d.ts.map +1 -0
  80. package/dist/normalise.js +603 -0
  81. package/dist/normalise.js.map +1 -0
  82. package/dist/reliability.d.ts +89 -0
  83. package/dist/reliability.d.ts.map +1 -0
  84. package/dist/reliability.js +181 -0
  85. package/dist/reliability.js.map +1 -0
  86. package/dist/tool-surface.d.ts +131 -0
  87. package/dist/tool-surface.d.ts.map +1 -0
  88. package/dist/tool-surface.js +133 -0
  89. package/dist/tool-surface.js.map +1 -0
  90. package/dist/vocabulary.d.ts +73 -0
  91. package/dist/vocabulary.d.ts.map +1 -0
  92. package/dist/vocabulary.js +150 -0
  93. package/dist/vocabulary.js.map +1 -0
  94. package/package.json +27 -0
@@ -0,0 +1,626 @@
1
+ /**
2
+ * The conformance harness — the release gate for every adapter (§11A.10).
3
+ *
4
+ * Runs one `IRSource` over one corpus and reports, per golden pattern, whether
5
+ * the subgraph it produced is the shape the corpus says that pattern has.
6
+ *
7
+ * ## Five semantics this file settles
8
+ *
9
+ * 1. **Only the role-bound subgraph is compared.** Edges between nodes no role
10
+ * names are ignored — an adapter is allowed to know more than the corpus
11
+ * asks about. The one exception is a `forbiddenEdges` entry whose target is
12
+ * `ANY_TARGET`: that wildcard is precisely a licence to look outside the
13
+ * bound set, and the asymmetry *is* the precision rule. "Every expected thing
14
+ * is present" is checked inside the bound set; "this thing is present
15
+ * nowhere" cannot be.
16
+ *
17
+ * 2. **"Reported a resolution it did not reach" is an interpretation, not a
18
+ * second detector.** There is one check — a required edge is absent — and
19
+ * two ways to read it. The adapter said R3; at R3 this edge is mandatory; it
20
+ * is missing. Whether that is a recall gap or a dishonest claim is the same
21
+ * fact stated twice, so the harness detects it once and words it as both.
22
+ *
23
+ * 3. **`file` survives normalisation.** Pattern 01 asserts `sameFileAs`, which
24
+ * compares `node.file` between two nodes. A harness that normalised paths
25
+ * away for portability would delete the only field that assertion reads.
26
+ *
27
+ * 4. **Monotonicity is cross-run.** An edge present at R2 must still be present
28
+ * at R3; more resolution never removes knowledge. One run cannot see this, so
29
+ * it lives in `runConformanceSweep`.
30
+ *
31
+ * 5. **An unbound role is a loud failure, never a silent skip.** A corpus that
32
+ * quietly stops covering a pattern still reports green, and green is the
33
+ * thing everyone trusts. The exception is narrow and stated: a pattern that
34
+ * is skipped or not required at this resolution never asks for its roles, so
35
+ * it cannot fail to bind them.
36
+ *
37
+ * ## What this does not do
38
+ *
39
+ * It does not merge, store, or query. It reads one adapter's `IRBatch` through
40
+ * the Normaliser and compares. Cross-adapter facts — XL-1's single joined
41
+ * `API_ENDPOINT` — need two batches merged, which is the Graph Builder's job and
42
+ * is tested there.
43
+ */
44
+ import { normaliseBatch } from "../normalise.js";
45
+ import { bindRoles, samePath } from "./bind.js";
46
+ import { acceptedEdgeTypes, attrsSubset, mapFieldNames, UNMAPPED_ATTR_NODE_TYPES } from "./compare.js";
47
+ import { ANY_TARGET, patternRoles, } from "./golden.js";
48
+ import { checkManifest } from "./manifest-check.js";
49
+ const NO_COMMIT = "0".repeat(40);
50
+ /**
51
+ * Read `capabilities()` when the source has one.
52
+ *
53
+ * `IRSource` is the narrow contract — the git-history reader implements it and
54
+ * has no capability matrix. A duck-typed probe keeps the harness usable for
55
+ * every source while still consulting the matrix when there is one, which
56
+ * pattern 11 needs.
57
+ */
58
+ function capabilitiesOf(source) {
59
+ const candidate = source;
60
+ return typeof candidate.capabilities === "function" ? candidate.capabilities() : undefined;
61
+ }
62
+ /**
63
+ * Types this pattern needs the adapter to be able to produce at all.
64
+ *
65
+ * A pattern asserting a `MODEL` cannot be graded against an adapter that
66
+ * declares it cannot tell a persisted entity from any other named type. That is
67
+ * not a recall gap — the adapter never claimed the capability — and reporting it
68
+ * as a failure would push adapter authors to guess, which is the one thing
69
+ * §11B.1 forbids. `CapabilityMatrix` exists for exactly this: it is machine-read
70
+ * so the report can "name what was skipped rather than reporting a thin result
71
+ * as a clean one".
72
+ *
73
+ * The obvious objection is that an adapter could declare nothing and skip
74
+ * everything. It could — and the report would say so on every line, `passed`
75
+ * would count zero passes, and the four verdicts are never folded together. A
76
+ * declaration that broad is visible in a way a quiet failure is not.
77
+ */
78
+ function undeclaredTypes(ctx) {
79
+ const declaredNodes = ctx.declaredNodeTypes;
80
+ const declaredEdges = ctx.declaredEdgeTypes;
81
+ const nodes = declaredNodes === undefined
82
+ ? []
83
+ : [
84
+ ...new Set(ctx.pattern.nodes
85
+ .map((node) => ctx.manifest.roleTypeOverrides[node.role] ?? node.type)
86
+ .filter((type) => !declaredNodes.includes(type))),
87
+ ];
88
+ const edges = declaredEdges === undefined
89
+ ? []
90
+ : [
91
+ ...new Set(ctx.pattern.edges
92
+ .filter((edge) => acceptedEdgeTypes(edge.type, declaredEdges).length === 1)
93
+ .map((edge) => edge.type)
94
+ .filter((type) => !declaredEdges.includes(type))),
95
+ ];
96
+ return { nodes, edges };
97
+ }
98
+ function nodeLevel(pattern) {
99
+ return pattern.requiredAtResolution ?? 0;
100
+ }
101
+ function edgeLevel(pattern, declared) {
102
+ return declared ?? nodeLevel(pattern);
103
+ }
104
+ /** The lowest level at which this pattern asserts anything at all. */
105
+ function lowestRequired(pattern) {
106
+ let lowest = nodeLevel(pattern);
107
+ for (const edge of pattern.edges) {
108
+ const level = edgeLevel(pattern, edge.requiredAtResolution);
109
+ if (level < lowest)
110
+ lowest = level;
111
+ }
112
+ return lowest;
113
+ }
114
+ /**
115
+ * Expected attrs, with the manifest's field-name map applied.
116
+ *
117
+ * Skipped for database node types — see `UNMAPPED_ATTR_NODE_TYPES` and DEC-040.
118
+ */
119
+ function expectedAttrs(attrs, manifest, unmapped) {
120
+ return unmapped ? attrs : mapFieldNames(attrs, manifest.fieldNameMap);
121
+ }
122
+ function checkNodes(ctx, bound, deferred) {
123
+ const findings = [];
124
+ if (nodeLevel(ctx.pattern) > ctx.claimed) {
125
+ for (const expectation of ctx.pattern.nodes) {
126
+ deferred.push(`node "${expectation.role}" (required at R${nodeLevel(ctx.pattern)})`);
127
+ }
128
+ return findings;
129
+ }
130
+ for (const expectation of ctx.pattern.nodes) {
131
+ const node = bound.get(expectation.role);
132
+ if (node === undefined)
133
+ continue; // already reported as a binding failure
134
+ const expectedType = ctx.manifest.roleTypeOverrides[expectation.role] ?? expectation.type;
135
+ if (node.type !== expectedType) {
136
+ findings.push({
137
+ kind: "wrong-node-type",
138
+ pattern: ctx.id,
139
+ role: expectation.role,
140
+ detail: `expected ${expectedType}, got ${node.type}` +
141
+ (expectedType === expectation.type
142
+ ? ""
143
+ : ` (the corpus overrides the golden's ${expectation.type} for this role)`),
144
+ });
145
+ }
146
+ if (expectation.sameFileAs !== undefined) {
147
+ const other = bound.get(expectation.sameFileAs);
148
+ if (other !== undefined && !samePath(node.file, other.file)) {
149
+ findings.push({
150
+ kind: "wrong-file",
151
+ pattern: ctx.id,
152
+ role: expectation.role,
153
+ detail: `expected the same file as "${expectation.sameFileAs}" (${other.file ?? "null"}), ` +
154
+ `got ${node.file ?? "null"}. Containment lives in \`file\`, not in an edge — there ` +
155
+ `is no containment edge in the 14-type vocabulary.`,
156
+ });
157
+ }
158
+ }
159
+ if (expectation.attrs !== undefined) {
160
+ const unmapped = UNMAPPED_ATTR_NODE_TYPES.has(node.type);
161
+ const want = expectedAttrs(expectation.attrs, ctx.manifest, unmapped);
162
+ const mismatch = attrsSubset(node.attrs, want);
163
+ if (mismatch !== null) {
164
+ findings.push({
165
+ kind: "node-attr-mismatch",
166
+ pattern: ctx.id,
167
+ role: expectation.role,
168
+ detail: `${mismatch.path}: ${mismatch.detail}`,
169
+ });
170
+ }
171
+ }
172
+ }
173
+ return findings;
174
+ }
175
+ function checkEdges(ctx, bound, deferred) {
176
+ const findings = [];
177
+ const satisfied = [];
178
+ for (const expectation of ctx.pattern.edges) {
179
+ const required = edgeLevel(ctx.pattern, expectation.requiredAtResolution);
180
+ const from = bound.get(expectation.from);
181
+ const to = bound.get(expectation.to);
182
+ if (from === undefined || to === undefined)
183
+ continue;
184
+ const accepted = acceptedEdgeTypes(expectation.type, ctx.declaredEdgeTypes);
185
+ const actual = (ctx.edgesByFrom.get(from.id) ?? []).find((edge) => edge.to === to.id && accepted.includes(edge.type));
186
+ if (actual === undefined) {
187
+ // Below its required level, absence is correct degradation, not a gap.
188
+ if (required > ctx.claimed) {
189
+ deferred.push(`${expectation.type} "${expectation.from}"->"${expectation.to}" (required at R${required})`);
190
+ continue;
191
+ }
192
+ findings.push({
193
+ kind: "missing-edge",
194
+ pattern: ctx.id,
195
+ detail: `no ${accepted.join(" or ")} edge from "${expectation.from}" to "${expectation.to}", ` +
196
+ `required at R${required}.`,
197
+ interpretation: `The adapter's batch claims R${ctx.claimed}, and this edge is mandatory from R${required} ` +
198
+ `upward. Read as recall, it is a gap; read as provenance, it is a resolution level ` +
199
+ `reported but not reached. Same fact — the harness detects it once.`,
200
+ });
201
+ continue;
202
+ }
203
+ satisfied.push(`${expectation.from}->${expectation.to}:${expectation.type}`);
204
+ if (expectation.attrs !== undefined) {
205
+ const unmapped = UNMAPPED_ATTR_NODE_TYPES.has(from.type) || UNMAPPED_ATTR_NODE_TYPES.has(to.type);
206
+ const want = expectedAttrs(expectation.attrs, ctx.manifest, unmapped);
207
+ const mismatch = attrsSubset(actual.attrs ?? {}, want);
208
+ if (mismatch !== null) {
209
+ findings.push({
210
+ kind: "edge-attr-mismatch",
211
+ pattern: ctx.id,
212
+ detail: `${expectation.from}->${expectation.to}: ${mismatch.path}: ${mismatch.detail}`,
213
+ });
214
+ }
215
+ }
216
+ }
217
+ return { findings, satisfied };
218
+ }
219
+ /**
220
+ * The precision half: `forbiddenEdges` and `mustNotResolveTo`.
221
+ *
222
+ * Run whenever their roles bind, **regardless of the pattern's verdict**. A
223
+ * wrong edge is a false claim at every resolution level (`fixtures/README.md`),
224
+ * so neither a low resolution nor a missing framework extractor excuses it. The
225
+ * recall half is the opposite: excused below its required level, by design.
226
+ */
227
+ function checkPrecision(ctx, bound) {
228
+ const findings = [];
229
+ // A role that bound is a node that exists, and for these roles existing IS
230
+ // the violation. No edge is involved: the wrong thing an over-admitting route
231
+ // reader does is MINT A ROUTE, and until now the harness could forbid an edge
232
+ // to anywhere but could not forbid a node at all.
233
+ for (const entry of ctx.pattern.mustNotBind ?? []) {
234
+ const node = bound.get(entry.role);
235
+ if (node === undefined)
236
+ continue;
237
+ findings.push({
238
+ kind: "forbidden-node",
239
+ pattern: ctx.id,
240
+ role: entry.role,
241
+ detail: `emitted a ${node.type} node "${node.name}" (${node.file ?? "no file"}) for a construct ` +
242
+ `the corpus binds as an over-admission trap. ${entry.why}`,
243
+ interpretation: `This is the receiver check, stated as a gate. A route admitted because a member is ` +
244
+ `spelled like an HTTP verb is a false claim, and it is the highest-volume one measured ` +
245
+ `in this project: 1,150 on saleor, 241 on firefly-iii. Finding more here is the failure.`,
246
+ });
247
+ }
248
+ for (const forbidden of ctx.pattern.forbiddenEdges ?? []) {
249
+ const from = bound.get(forbidden.from);
250
+ if (from === undefined)
251
+ continue;
252
+ const candidates = (ctx.edgesByFrom.get(from.id) ?? []).filter((edge) => edge.type === forbidden.type);
253
+ if (forbidden.to === ANY_TARGET) {
254
+ // The wildcard looks outside the role-bound set on purpose: "this edge
255
+ // exists nowhere" is not a statement the bound subgraph can make.
256
+ for (const edge of candidates) {
257
+ findings.push({
258
+ kind: "forbidden-edge",
259
+ pattern: ctx.id,
260
+ role: forbidden.from,
261
+ detail: `emitted a ${edge.type} edge from "${forbidden.from}" to ${edge.to} at R${edge.resolution} ` +
262
+ `(confidence ${edge.confidence}). This pattern forbids that edge to any target.`,
263
+ interpretation: `A missing edge is a disclosed gap; a wrong edge is a false claim that corrupts every ` +
264
+ `layer above the graph. Finding more here is not better — it is the failure.`,
265
+ });
266
+ }
267
+ continue;
268
+ }
269
+ const target = bound.get(forbidden.to);
270
+ if (target === undefined)
271
+ continue;
272
+ for (const edge of candidates.filter((candidate) => candidate.to === target.id)) {
273
+ findings.push({
274
+ kind: "forbidden-edge",
275
+ pattern: ctx.id,
276
+ role: forbidden.from,
277
+ detail: `emitted a forbidden ${edge.type} edge from "${forbidden.from}" to "${forbidden.to}".`,
278
+ });
279
+ }
280
+ }
281
+ const mustNot = ctx.pattern.mustNotResolveTo;
282
+ if (mustNot !== undefined) {
283
+ const [fromRole = "", toRole = ""] = mustNot.edge.split("->");
284
+ const from = bound.get(fromRole);
285
+ const target = bound.get(mustNot.target);
286
+ const declaredType = ctx.pattern.edges.find((edge) => edge.from === fromRole && edge.to === toRole)?.type;
287
+ if (from !== undefined && target !== undefined && declaredType !== undefined) {
288
+ const accepted = acceptedEdgeTypes(declaredType, ctx.declaredEdgeTypes);
289
+ for (const edge of ctx.edgesByFrom.get(from.id) ?? []) {
290
+ if (edge.to !== target.id || !accepted.includes(edge.type))
291
+ continue;
292
+ findings.push({
293
+ kind: "wrong-target",
294
+ pattern: ctx.id,
295
+ role: fromRole,
296
+ detail: `the ${edge.type} edge from "${fromRole}" terminates at "${mustNot.target}". ${mustNot.why}`,
297
+ interpretation: "An edge present but pointing at the wrong target fails at any resolution level.",
298
+ });
299
+ }
300
+ }
301
+ }
302
+ return findings;
303
+ }
304
+ /** Roles a precision check needs bound, so they can be looked up even when the pattern is excused. */
305
+ function precisionRoles(pattern) {
306
+ const roles = new Set();
307
+ for (const forbidden of pattern.forbiddenEdges ?? []) {
308
+ roles.add(forbidden.from);
309
+ if (forbidden.to !== ANY_TARGET)
310
+ roles.add(forbidden.to);
311
+ }
312
+ if (pattern.mustNotResolveTo !== undefined) {
313
+ const [fromRole] = pattern.mustNotResolveTo.edge.split("->");
314
+ if (fromRole !== undefined)
315
+ roles.add(fromRole);
316
+ roles.add(pattern.mustNotResolveTo.target);
317
+ }
318
+ // An over-admission trap is checked even when the pattern is excused. An
319
+ // adapter that declares no route extractor and mints a route anyway is not
320
+ // excused by the declaration — it is contradicting it.
321
+ for (const entry of pattern.mustNotBind ?? [])
322
+ roles.add(entry.role);
323
+ return [...roles];
324
+ }
325
+ /**
326
+ * Does anything bound to this adapter supply what the pattern names?
327
+ *
328
+ * The harness compares two strings from one closed set and knows nothing about
329
+ * any framework — `"spring"` and `"rails"` stay inside the adapter, and only
330
+ * `"route-extractor"` crosses the boundary.
331
+ *
332
+ * `undefined` capabilities with extractors bound cannot reach here: that
333
+ * combination is an adapter failure recorded before grading. So the fallback is
334
+ * only ever taken by a source with nothing bound, where the answer is no.
335
+ */
336
+ function supplies(ctx, requirement) {
337
+ if (ctx.boundExtractors.length === 0)
338
+ return false;
339
+ return ctx.suppliedCapabilities?.includes(requirement) ?? false;
340
+ }
341
+ function runPattern(ctx) {
342
+ const { pattern, id } = ctx;
343
+ const missingCapability = pattern.requires !== undefined && !supplies(ctx, pattern.requires) ? pattern.requires : null;
344
+ const lowest = lowestRequired(pattern);
345
+ const cappedByCorpus = lowest > ctx.corpusCeiling;
346
+ const aboveClaimed = lowest > ctx.claimed;
347
+ const undeclared = undeclaredTypes(ctx);
348
+ // A negative nothing can violate is decorative. If the corpus binds none of
349
+ // the traps this pattern names, say so rather than reporting green — the
350
+ // measured cost of the alternative is three traps written into fixtures and
351
+ // asserted by nothing, which is what prompted this pattern.
352
+ const trapRoles = (pattern.mustNotBind ?? []).map((entry) => entry.role);
353
+ const corpusHasNoTrap = trapRoles.length > 0 && trapRoles.every((role) => ctx.manifest.roles[role] === undefined);
354
+ const excuse = missingCapability !== null
355
+ ? {
356
+ verdict: "skipped",
357
+ reason: `requires the "${missingCapability}" capability; nothing bound to this adapter supplies it` +
358
+ (ctx.boundExtractors.length === 0
359
+ ? `, and no framework extractor is bound at all`
360
+ : ` (bound: ${ctx.boundExtractors.join(", ")}, supplying ` +
361
+ `${(ctx.suppliedCapabilities ?? []).join(", ") || "nothing"})`) +
362
+ `. Routes, endpoint templates and ORM nullability are framework knowledge, not ` +
363
+ `language knowledge — a language adapter alone genuinely cannot produce them (§11A.8).`,
364
+ }
365
+ : corpusHasNoTrap
366
+ ? {
367
+ verdict: "skipped",
368
+ reason: `this corpus binds none of the over-admission traps this pattern names ` +
369
+ `(${trapRoles.join(", ")}), so there is nothing here it could catch. The adapter is ` +
370
+ `not at fault and is not credited either: a negative with no trap is decorative, and ` +
371
+ `reporting it as a pass is how three of them survived unasserted in this corpus.`,
372
+ }
373
+ : undeclared.nodes.length > 0 || undeclared.edges.length > 0
374
+ ? {
375
+ verdict: "skipped",
376
+ reason: `the adapter's capabilities() does not declare ` +
377
+ [...undeclared.nodes, ...undeclared.edges].map((type) => type).join(", ") +
378
+ `, which this pattern asserts. Declared incapacity is reported, never failed — the ` +
379
+ `alternative is an adapter that guesses to stay green (DEC-043).`,
380
+ }
381
+ : cappedByCorpus
382
+ ? {
383
+ verdict: "not-required",
384
+ reason: `asserts from R${lowest}, above the R${ctx.corpusCeiling} this corpus ` +
385
+ `declares reachable.`,
386
+ }
387
+ : aboveClaimed
388
+ ? {
389
+ verdict: "not-required",
390
+ reason: `asserts from R${lowest}; the adapter reached R${ctx.claimed}. Absence below a ` +
391
+ `required level is correct degradation.`,
392
+ }
393
+ : null;
394
+ // Precision checks are never excused. Bind only what they need, and stay
395
+ // silent when even that does not bind — at this point absence is legitimate.
396
+ if (excuse !== null) {
397
+ const roles = precisionRoles(pattern);
398
+ const bound = roles.length === 0 ? new Map() : bindRoles(ctx.nodes, ctx.manifest, roles).bound;
399
+ const violations = checkPrecision(ctx, bound);
400
+ if (violations.length > 0) {
401
+ return {
402
+ pattern: id,
403
+ verdict: "fail",
404
+ findings: violations,
405
+ deferred: [],
406
+ satisfied: { roles: [], edges: [] },
407
+ };
408
+ }
409
+ return {
410
+ pattern: id,
411
+ verdict: excuse.verdict,
412
+ reason: excuse.reason,
413
+ findings: [],
414
+ deferred: [],
415
+ satisfied: { roles: [], edges: [] },
416
+ };
417
+ }
418
+ // Precision roles ride along with the graded ones. `patternRoles` is the
419
+ // POSITIVE set — the roles that must bind, whose absence is a loud failure —
420
+ // and a must-not-bind role is neither: it is checked by binding it and
421
+ // treating success as the violation. Omitting it here made the negative fire
422
+ // only on patterns that were excused, which is every pattern except the ones
423
+ // it exists to police.
424
+ const roles = [...new Set([...patternRoles(pattern), ...precisionRoles(pattern)])];
425
+ // The golden already states each role's type; handing it to the binder lets a
426
+ // module and a symbol of one name be told apart without loosening anything.
427
+ const expectedTypes = new Map((pattern.nodes ?? []).map((n) => [n.role, n.type]));
428
+ const { bound, failures } = bindRoles(ctx.nodes, ctx.manifest, roles, expectedTypes);
429
+ const findings = failures
430
+ // A must-not-bind role failing to bind is the PASS condition, not a defect.
431
+ // It is the one role in the harness whose absence is the assertion, so the
432
+ // binder's "unbound is a loud failure" rule is inverted for it and only for
433
+ // it. An AMBIGUOUS trap role is still a violation and is caught by
434
+ // checkPrecision, which sees whichever node bound.
435
+ .filter((failure) => !trapRoles.includes(failure.role))
436
+ .map((failure) => ({
437
+ kind: failure.reason === "ambiguous" ? "role-ambiguous" : "role-unbound",
438
+ pattern: id,
439
+ role: failure.role,
440
+ detail: failure.detail,
441
+ }));
442
+ const deferred = [];
443
+ findings.push(...checkNodes(ctx, bound, deferred));
444
+ const edges = checkEdges(ctx, bound, deferred);
445
+ findings.push(...edges.findings);
446
+ findings.push(...checkPrecision(ctx, bound));
447
+ return {
448
+ pattern: id,
449
+ verdict: findings.length === 0 ? "pass" : "fail",
450
+ findings,
451
+ deferred,
452
+ satisfied: { roles: [...bound.keys()].sort(), edges: edges.satisfied.sort() },
453
+ };
454
+ }
455
+ // ---------------------------------------------------------------------------
456
+ /**
457
+ * Run one source over one corpus.
458
+ *
459
+ * The source's own `reachedResolution` is the level everything is judged
460
+ * against. That is not trust — it is the opposite: the adapter's claim is the
461
+ * standard it is then held to, which is what makes semantic 2 above possible.
462
+ *
463
+ * Lifecycle stays with the caller. `dispose()` is mandatory on a
464
+ * `LanguageAdapter` and a harness that called it would break any caller running
465
+ * a resolution sweep over one instance.
466
+ */
467
+ export async function runConformance(input) {
468
+ const { source, manifest, golden, root } = input;
469
+ const capabilities = capabilitiesOf(source);
470
+ const raw = await source.emit({
471
+ root: {
472
+ repo: input.repo ?? "conformance-corpus",
473
+ absolutePath: root,
474
+ commitSha: input.commitSha ?? NO_COMMIT,
475
+ },
476
+ prepareTimeoutMs: input.prepareTimeoutMs ?? 30_000,
477
+ signal: input.signal ?? new AbortController().signal,
478
+ });
479
+ // Everything an adapter emits reaches the graph through the Normaliser, so
480
+ // conformance runs against what would actually be stored — not against what
481
+ // the adapter hoped to store.
482
+ const { batch, rejections, clamps } = normaliseBatch(raw);
483
+ const counts = {
484
+ pass: 0,
485
+ fail: 0,
486
+ skipped: 0,
487
+ "not-required": 0,
488
+ };
489
+ if (batch === null) {
490
+ return {
491
+ adapter: source.id,
492
+ corpus: manifest.adapter,
493
+ claimedResolution: 0,
494
+ patterns: [],
495
+ rejections,
496
+ clamps,
497
+ manifest: { findings: [], adapterFailed: false, corpusThin: false, unpublishable: [] },
498
+ passed: false,
499
+ counts,
500
+ };
501
+ }
502
+ const edgesByFrom = new Map();
503
+ for (const edge of batch.edges) {
504
+ const list = edgesByFrom.get(edge.from);
505
+ if (list === undefined)
506
+ edgesByFrom.set(edge.from, [edge]);
507
+ else
508
+ list.push(edge);
509
+ }
510
+ const selected = input.patterns;
511
+ const manifestCheck = checkManifest(capabilities, batch);
512
+ /**
513
+ * Who is answering "what is bound, and what does it supply".
514
+ *
515
+ * The adapter's own `capabilities()` when it has one — it is the authority on
516
+ * what it can do, and an adapter that has since bound an extractor must be
517
+ * held to the patterns that unlocks rather than keep the corpus's older,
518
+ * easier expectation. The manifest answers only for a bare `IRSource`.
519
+ */
520
+ const declarer = capabilities ?? manifest;
521
+ const results = [];
522
+ for (const [id, pattern] of Object.entries(golden.patterns)) {
523
+ if (selected !== undefined && !selected.includes(id))
524
+ continue;
525
+ const result = runPattern({
526
+ id,
527
+ pattern,
528
+ manifest,
529
+ nodes: batch.nodes,
530
+ edgesByFrom,
531
+ claimed: batch.reachedResolution,
532
+ declaredEdgeTypes: capabilities?.edgeTypes,
533
+ declaredNodeTypes: capabilities?.nodeTypes,
534
+ // Both fields come from ONE declarer, never mixed. Taking the extractors
535
+ // from the adapter and the capabilities from the manifest would let a
536
+ // corpus vouch for an extractor the adapter never bound, which is the
537
+ // drift the two-field split exists to make impossible.
538
+ boundExtractors: declarer.frameworkExtractors,
539
+ suppliedCapabilities: declarer.frameworkCapabilities,
540
+ corpusCeiling: input.corpusResolutionCeiling ?? manifest.expectedMaxResolution,
541
+ });
542
+ results.push(result);
543
+ counts[result.verdict] += 1;
544
+ }
545
+ return {
546
+ adapter: source.id,
547
+ corpus: manifest.adapter,
548
+ claimedResolution: batch.reachedResolution,
549
+ patterns: results,
550
+ rejections,
551
+ clamps,
552
+ manifest: manifestCheck,
553
+ // A rejected item never reaches a graph, so an adapter that earns one has
554
+ // already failed — whatever the patterns say about what did get through.
555
+ //
556
+ // `manifest.adapterFailed` joins them: emitting a type it does not declare
557
+ // means the harness skipped gates this adapter would have run, so a clean
558
+ // pattern sheet was never evidence of anything. `corpusThin` deliberately
559
+ // does NOT appear here — that is the corpus's failure, not the adapter's.
560
+ passed: counts.fail === 0 && rejections.length === 0 && !manifestCheck.adapterFailed,
561
+ counts,
562
+ };
563
+ }
564
+ /**
565
+ * Run the corpus at every level the adapter claims, and check monotonicity.
566
+ *
567
+ * **More resolution never removes knowledge.** An edge found at R2 must still be
568
+ * there at R3, and a role that bound must still bind. The failure this catches
569
+ * is real and easy to ship: a resolver that only consults the type checker when
570
+ * types are available stops falling back to the name-based path, and quietly
571
+ * loses edges the weaker mode found. Only a sweep can see it — each individual
572
+ * run looks fine.
573
+ */
574
+ export async function runConformanceSweep(input) {
575
+ const levels = input.levels ??
576
+ [0, 1, 2, 3].filter((level) => level <= input.manifest.expectedMaxResolution);
577
+ const runs = [];
578
+ for (const level of levels) {
579
+ const source = await input.createSource(level);
580
+ runs.push({ level, result: await runConformance({ ...input, source }) });
581
+ }
582
+ const monotonicity = [];
583
+ for (let i = 1; i < runs.length; i += 1) {
584
+ const previous = runs[i - 1];
585
+ const current = runs[i];
586
+ if (current.result.claimedResolution < previous.result.claimedResolution) {
587
+ monotonicity.push({
588
+ kind: "monotonicity",
589
+ pattern: "(run)",
590
+ detail: `asked for R${current.level} the adapter claimed R${current.result.claimedResolution}, ` +
591
+ `below the R${previous.result.claimedResolution} it claimed at R${previous.level}.`,
592
+ });
593
+ }
594
+ const before = new Map(previous.result.patterns.map((p) => [p.pattern, p]));
595
+ for (const after of current.result.patterns) {
596
+ const earlier = before.get(after.pattern);
597
+ if (earlier === undefined)
598
+ continue;
599
+ for (const role of earlier.satisfied.roles) {
600
+ if (!after.satisfied.roles.includes(role)) {
601
+ monotonicity.push({
602
+ kind: "monotonicity",
603
+ pattern: after.pattern,
604
+ role,
605
+ detail: `bound at R${previous.level} but not at R${current.level}.`,
606
+ });
607
+ }
608
+ }
609
+ for (const edge of earlier.satisfied.edges) {
610
+ if (!after.satisfied.edges.includes(edge)) {
611
+ monotonicity.push({
612
+ kind: "monotonicity",
613
+ pattern: after.pattern,
614
+ detail: `${edge} was present at R${previous.level} and is absent at R${current.level}.`,
615
+ });
616
+ }
617
+ }
618
+ }
619
+ }
620
+ return {
621
+ runs,
622
+ monotonicity,
623
+ passed: monotonicity.length === 0 && runs.every((run) => run.result.passed),
624
+ };
625
+ }
626
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/conformance/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAKH,OAAO,EAAE,cAAc,EAA8B,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACvG,OAAO,EACL,UAAU,EACV,YAAY,GAGb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AA6GxE,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEjC;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,MAAgB;IACtC,MAAM,SAAS,GAAG,MAAkC,CAAC;IACrD,OAAO,OAAO,SAAS,CAAC,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,YAA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