@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 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/conformance/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;CAC5F;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,EAAE,eAAe,CAAC;IAChD,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAChE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACtD,yFAAyF;IACzF,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/D,6FAA6F;IAC7F,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACzD;AAED,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAkB,IAAI,mBAAmB;CAC1C;AAqDD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAkG1D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAEzD"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * A corpus binding manifest — `fixtures/languages/<name>/manifest.json`.
3
+ *
4
+ * The golden says *what shape* a pattern has; a manifest says *which symbols in
5
+ * this corpus play those parts*. That split is what lets one golden gate many
6
+ * adapters, and it is why the manifest is data a human wrote rather than
7
+ * something an adapter supplies: an adapter that told the harness which of its
8
+ * own nodes to compare would be grading its own paper.
9
+ *
10
+ * Parsed as strictly as the golden, with one deliberate exception — any key
11
+ * ending in `Note` is documentation and is ignored. The corpus uses those to
12
+ * record *why* an override exists, which `fixtures/README.md` step 4 requires,
13
+ * and losing them to a strict parser would push the reasoning out of the file
14
+ * that needs it.
15
+ */
16
+ import { readFileSync } from "node:fs";
17
+ import { capabilityList as capabilityNames, isFrameworkCapability, } from "../capabilities.js";
18
+ import { isNodeType } from "../vocabulary.js";
19
+ export class ManifestError extends Error {
20
+ name = "ManifestError";
21
+ }
22
+ function fail(where, detail) {
23
+ throw new ManifestError(`${where}: ${detail}`);
24
+ }
25
+ function object(value, where) {
26
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
27
+ fail(where, "expected an object");
28
+ }
29
+ return value;
30
+ }
31
+ function stringList(value, where) {
32
+ if (!Array.isArray(value))
33
+ fail(where, "expected an array of strings");
34
+ for (const item of value) {
35
+ if (typeof item !== "string")
36
+ fail(where, "expected an array of strings");
37
+ }
38
+ return value;
39
+ }
40
+ function requiredString(value, key, where) {
41
+ const raw = value[key];
42
+ if (typeof raw !== "string" || raw === "")
43
+ fail(where, `"${key}" must be a non-empty string`);
44
+ return raw;
45
+ }
46
+ /**
47
+ * A capability list, closed against `capabilities.ts`.
48
+ *
49
+ * Rejected loudly for the same reason the golden rejects an unrecognised
50
+ * `requires`: a capability nothing recognises supplies nothing, so a typo here
51
+ * would skip every pattern needing it and the suite would go green having
52
+ * stopped checking. The two ends of the match are validated against one set.
53
+ */
54
+ function capabilityList_(value, where) {
55
+ const list = stringList(value, where);
56
+ for (const item of list) {
57
+ if (!isFrameworkCapability(item)) {
58
+ fail(where, `unrecognised capability "${item}". The recognised set is ${capabilityNames()}.`);
59
+ }
60
+ }
61
+ return list;
62
+ }
63
+ function stringMap(value, where) {
64
+ const map = object(value, where);
65
+ for (const [key, entry] of Object.entries(map)) {
66
+ if (typeof entry !== "string")
67
+ fail(`${where}.${key}`, "expected a string");
68
+ }
69
+ return map;
70
+ }
71
+ export function parseManifest(raw) {
72
+ const value = object(raw, "manifest");
73
+ const known = [
74
+ "adapter",
75
+ "language",
76
+ "root",
77
+ "parseGlobs",
78
+ "sqlGlobs",
79
+ "contractGlobs",
80
+ "expectedMaxResolution",
81
+ "frameworkExtractors",
82
+ "frameworkCapabilities",
83
+ "roles",
84
+ "roleTypeOverrides",
85
+ "fieldNameMap",
86
+ ];
87
+ const unknown = Object.keys(value).filter((k) => !known.includes(k) && k !== "note" && !k.endsWith("Note"));
88
+ if (unknown.length > 0) {
89
+ fail("manifest", `unknown key(s) ${unknown.map((k) => `"${k}"`).join(", ")}`);
90
+ }
91
+ const maxResolution = value["expectedMaxResolution"];
92
+ if (maxResolution !== 0 && maxResolution !== 1 && maxResolution !== 2 && maxResolution !== 3) {
93
+ fail("manifest.expectedMaxResolution", `must be 0-3, got ${JSON.stringify(maxResolution)}. R4 is observed at runtime and cannot ` +
94
+ `be reached by static analysis of a fixture, so no corpus may claim it.`);
95
+ }
96
+ const roles = {};
97
+ for (const [role, binding] of Object.entries(object(value["roles"], "manifest.roles"))) {
98
+ const where = `manifest.roles.${role}`;
99
+ const entry = object(binding, where);
100
+ const file = entry["file"];
101
+ if (file !== null && (typeof file !== "string" || file === "")) {
102
+ fail(where, `"file" must be a repo-relative path or null (DEC-014)`);
103
+ }
104
+ const rawAlternates = entry["alternates"];
105
+ if (rawAlternates !== undefined && !Array.isArray(rawAlternates)) {
106
+ fail(`${where}.alternates`, "must be an array of { symbol, file } pairs");
107
+ }
108
+ const alternates = (Array.isArray(rawAlternates) ? rawAlternates : []).map((item, index) => {
109
+ const at = `${where}.alternates[${index}]`;
110
+ const alternate = object(item, at);
111
+ const alternateFile = alternate["file"];
112
+ if (alternateFile !== null && (typeof alternateFile !== "string" || alternateFile === "")) {
113
+ fail(at, `"file" must be a repo-relative path or null (DEC-014)`);
114
+ }
115
+ return { symbol: requiredString(alternate, "symbol", at), file: alternateFile };
116
+ });
117
+ roles[role] = {
118
+ symbol: requiredString(entry, "symbol", where),
119
+ file,
120
+ ...(alternates.length === 0 ? {} : { alternates }),
121
+ };
122
+ }
123
+ const overrides = {};
124
+ const rawOverrides = value["roleTypeOverrides"];
125
+ if (rawOverrides !== undefined) {
126
+ for (const [role, type] of Object.entries(object(rawOverrides, "manifest.roleTypeOverrides"))) {
127
+ if (typeof type !== "string" || !isNodeType(type)) {
128
+ fail(`manifest.roleTypeOverrides.${role}`, `"${String(type)}" is not one of the 15 node types`);
129
+ }
130
+ if (roles[role] === undefined) {
131
+ fail(`manifest.roleTypeOverrides.${role}`, "overrides a role the manifest does not bind");
132
+ }
133
+ overrides[role] = type;
134
+ }
135
+ }
136
+ return {
137
+ adapter: requiredString(value, "adapter", "manifest"),
138
+ language: requiredString(value, "language", "manifest"),
139
+ root: requiredString(value, "root", "manifest"),
140
+ parseGlobs: stringList(value["parseGlobs"], "manifest.parseGlobs"),
141
+ sqlGlobs: stringList(value["sqlGlobs"] ?? [], "manifest.sqlGlobs"),
142
+ contractGlobs: stringList(value["contractGlobs"] ?? [], "manifest.contractGlobs"),
143
+ expectedMaxResolution: maxResolution,
144
+ frameworkExtractors: stringList(value["frameworkExtractors"] ?? [], "manifest.frameworkExtractors"),
145
+ ...(value["frameworkCapabilities"] === undefined
146
+ ? {}
147
+ : {
148
+ frameworkCapabilities: capabilityList_(value["frameworkCapabilities"], "manifest.frameworkCapabilities"),
149
+ }),
150
+ roles,
151
+ roleTypeOverrides: overrides,
152
+ fieldNameMap: stringMap(value["fieldNameMap"] ?? {}, "manifest.fieldNameMap"),
153
+ };
154
+ }
155
+ export function loadManifest(path) {
156
+ return parseManifest(JSON.parse(readFileSync(path, "utf8")));
157
+ }
158
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/conformance/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,cAAc,IAAI,eAAe,EACjC,qBAAqB,GAEtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AA4D7D,MAAM,OAAO,aAAc,SAAQ,KAAK;IACpB,IAAI,GAAG,eAAe,CAAC;CAC1C;AAED,SAAS,IAAI,CAAC,KAAa,EAAE,MAAc;IACzC,MAAM,IAAI,aAAa,CAAC,GAAG,KAAK,KAAK,MAAM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verdicts, printed as four verdicts. `skipped` and `not-required` are not
5
+ * folded into `pass` anywhere, and the totals line names all four — an adapter
6
+ * that satisfies three patterns and skips nine has not passed conformance in any
7
+ * sense a reader would recognise, and a report that says "12/12 OK" is how that
8
+ * gets shipped. Same rule as §20.2's four report categories: "we found nothing"
9
+ * and "we could not look" are different statements.
10
+ */
11
+ import type { ConformanceResult, SweepResult } from "./run.ts";
12
+ export declare function formatReport(result: ConformanceResult): string;
13
+ export declare function formatSweepReport(sweep: SweepResult): string;
14
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/conformance/report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAiC,WAAW,EAAE,MAAM,UAAU,CAAC;AA2B9F,wBAAgB,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA8C9D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAe5D"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * The reporter.
3
+ *
4
+ * Four verdicts, printed as four verdicts. `skipped` and `not-required` are not
5
+ * folded into `pass` anywhere, and the totals line names all four — an adapter
6
+ * that satisfies three patterns and skips nine has not passed conformance in any
7
+ * sense a reader would recognise, and a report that says "12/12 OK" is how that
8
+ * gets shipped. Same rule as §20.2's four report categories: "we found nothing"
9
+ * and "we could not look" are different statements.
10
+ */
11
+ const MARK = {
12
+ pass: "PASS",
13
+ fail: "FAIL",
14
+ skipped: "SKIP",
15
+ "not-required": "N/R ",
16
+ };
17
+ function formatPattern(pattern) {
18
+ const lines = [` ${MARK[pattern.verdict]} ${pattern.pattern}`];
19
+ if (pattern.reason !== undefined)
20
+ lines.push(` ${pattern.reason}`);
21
+ // A pass with deferred assertions is still a pass — but naming them is the
22
+ // difference between "we checked and it is fine" and "we did not check".
23
+ for (const assertion of pattern.deferred) {
24
+ lines.push(` not required at this resolution: ${assertion}`);
25
+ }
26
+ for (const finding of pattern.findings) {
27
+ const role = finding.role === undefined ? "" : ` [${finding.role}]`;
28
+ lines.push(` - ${finding.kind}${role}: ${finding.detail}`);
29
+ if (finding.interpretation !== undefined) {
30
+ lines.push(` ${finding.interpretation}`);
31
+ }
32
+ }
33
+ return lines;
34
+ }
35
+ export function formatReport(result) {
36
+ const lines = [
37
+ `conformance: ${result.adapter} against the "${result.corpus}" corpus, ` +
38
+ `claiming R${result.claimedResolution}`,
39
+ ];
40
+ for (const pattern of result.patterns)
41
+ lines.push(...formatPattern(pattern));
42
+ if (result.rejections.length > 0) {
43
+ lines.push(` FAIL the boundary rejected ${result.rejections.length} item(s); they would never reach ` +
44
+ `a graph, so the adapter has already failed:`);
45
+ for (const rejection of result.rejections) {
46
+ lines.push(` - ${rejection.code} (${rejection.scope} ${rejection.subject})`);
47
+ }
48
+ }
49
+ if (result.clamps.length > 0) {
50
+ lines.push(` note ${result.clamps.length} confidence value(s) were clamped down to their resolution ` +
51
+ `ceiling. Not a failure, but the adapter is claiming more certainty than its level allows.`);
52
+ }
53
+ // DEC-070. Printed above the verdict rather than appended after it, because
54
+ // an undeclared capability means the pattern sheet above was decided by a
55
+ // manifest that was wrong — the reader needs that before the tally, not after.
56
+ for (const finding of result.manifest.findings) {
57
+ const label = finding.kind === "undeclared" ? "FAIL " : "thin ";
58
+ lines.push(` ${label} manifest: ${finding.what} ${finding.type} — ${finding.detail}`);
59
+ }
60
+ if (result.manifest.unpublishable.length > 0) {
61
+ lines.push(` note ${result.manifest.unpublishable.length} declared capability/ies were never ` +
62
+ `exercised by this corpus and may not be published as a tier claim: ` +
63
+ `${result.manifest.unpublishable.join(", ")}.`);
64
+ }
65
+ const { counts } = result;
66
+ lines.push(` ${result.passed ? "CONFORMANT" : "NOT CONFORMANT"} — ${counts.pass} passed, ` +
67
+ `${counts.fail} failed, ${counts.skipped} skipped, ${counts["not-required"]} not required ` +
68
+ `at this resolution.`);
69
+ return lines.join("\n");
70
+ }
71
+ export function formatSweepReport(sweep) {
72
+ const lines = [];
73
+ for (const run of sweep.runs) {
74
+ lines.push(`--- asked for R${run.level} ---`);
75
+ lines.push(formatReport(run.result));
76
+ }
77
+ if (sweep.monotonicity.length > 0) {
78
+ lines.push("monotonicity violations — more resolution removed knowledge:");
79
+ for (const finding of sweep.monotonicity) {
80
+ const role = finding.role === undefined ? "" : ` [${finding.role}]`;
81
+ lines.push(` - ${finding.pattern}${role}: ${finding.detail}`);
82
+ }
83
+ }
84
+ lines.push(sweep.passed ? "sweep: CONFORMANT" : "sweep: NOT CONFORMANT");
85
+ return lines.join("\n");
86
+ }
87
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/conformance/report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,IAAI,GAA6C;IACrD,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,cAAc,EAAE,MAAM;CACvB,CAAC;AAEF,SAAS,aAAa,CAAC,OAAsB;IAC3C,MAAM,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,aAAa,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,2EAA2E;IAC3E,yEAAyE;IACzE,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,8CAA8C,SAAS,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAA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,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAC3E,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,GAAG,CAAC;YACpE,KAAK,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,OAAO,GAAG,IAAI,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC;IACzE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,172 @@
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 type { ResolutionLevel } from "../ir.ts";
45
+ import type { IRSource } from "../contracts.ts";
46
+ import { type Clamp, type Rejection } from "../normalise.ts";
47
+ import { type Golden } from "./golden.ts";
48
+ import type { CorpusManifest } from "./manifest.ts";
49
+ import { type ManifestCheck } from "./manifest-check.ts";
50
+ export type PatternVerdict = "pass" | "fail" | "skipped" | "not-required";
51
+ export type FindingKind = "role-unbound" | "role-ambiguous" | "wrong-node-type" | "wrong-file" | "node-attr-mismatch" | "missing-edge" | "edge-attr-mismatch" | "forbidden-edge" | "wrong-target" | "batch-rejected" | "forbidden-node" | "monotonicity";
52
+ export interface ConformanceFinding {
53
+ readonly kind: FindingKind;
54
+ readonly pattern: string;
55
+ readonly role?: string;
56
+ readonly detail: string;
57
+ /** How this reads in a report, when the plain fact understates it. */
58
+ readonly interpretation?: string;
59
+ }
60
+ export interface PatternResult {
61
+ readonly pattern: string;
62
+ readonly verdict: PatternVerdict;
63
+ /** Why, for `skipped` and `not-required`. */
64
+ readonly reason?: string;
65
+ readonly findings: readonly ConformanceFinding[];
66
+ /**
67
+ * Assertions that did not apply at this level, inside a pattern that was
68
+ * otherwise graded.
69
+ *
70
+ * `fixtures/README.md` is explicit that an edge absent below its
71
+ * `requiredAtResolution` is a **pass** — correct degradation, not a gap. But a
72
+ * pattern reported as a flat pass when the edge it exists for was never
73
+ * checked is "green means covered", which is the failure mode this whole
74
+ * project argues against. So the verdict follows the corpus and the deferred
75
+ * assertions are named alongside it.
76
+ */
77
+ readonly deferred: readonly string[];
78
+ /** What this run actually demonstrated. Feeds the monotonicity check. */
79
+ readonly satisfied: {
80
+ readonly roles: readonly string[];
81
+ /** `from->to:TYPE`, using golden role names. */
82
+ readonly edges: readonly string[];
83
+ };
84
+ }
85
+ export interface ConformanceResult {
86
+ readonly adapter: string;
87
+ readonly corpus: string;
88
+ /**
89
+ * Does the adapter do what it declares? DEC-070.
90
+ *
91
+ * Separate from `patterns` on purpose: a pattern verdict is about a golden,
92
+ * and this is about the manifest the harness *consults* to decide which
93
+ * patterns to run. Folding it into the pattern list would make the thing that
94
+ * chooses the gates just another gate.
95
+ */
96
+ readonly manifest: ManifestCheck;
97
+ /** The level the adapter's own batch claims it reached. The authority here. */
98
+ readonly claimedResolution: ResolutionLevel;
99
+ readonly patterns: readonly PatternResult[];
100
+ readonly rejections: readonly Rejection[];
101
+ readonly clamps: readonly Clamp[];
102
+ readonly passed: boolean;
103
+ readonly counts: Readonly<Record<PatternVerdict, number>>;
104
+ }
105
+ export interface ConformanceInput {
106
+ readonly source: IRSource;
107
+ readonly manifest: CorpusManifest;
108
+ readonly golden: Golden;
109
+ /** Absolute path to the corpus on disk. Never stored in the graph. */
110
+ readonly root: string;
111
+ /** Node identity includes it (DEC-011), but binding does not — see `bind.ts`. */
112
+ readonly repo?: string;
113
+ readonly commitSha?: string;
114
+ /** Run a subset. Omitted means the whole corpus. */
115
+ readonly patterns?: readonly string[];
116
+ /**
117
+ * Raise the corpus cap for a producer that is not bound by it.
118
+ *
119
+ * `manifest.expectedMaxResolution` is the corpus telling the *language*
120
+ * adapter how far this fixture can honestly be pushed — Go stops at R2 here
121
+ * because the fixture has no type information beyond names. A **format**
122
+ * adapter is not reading the same evidence: `adapter-openapi` reads a
123
+ * published contract and `adapter-sql` reads a migration, and both of those
124
+ * artefacts state their own shapes, so R3 is what the corpus actually offers
125
+ * them (§11B.4).
126
+ *
127
+ * Left unset the manifest wins, which keeps the default honest. It must be
128
+ * passed explicitly at the call site so that raising a cap is visible in the
129
+ * runner rather than buried in an adapter default.
130
+ */
131
+ readonly corpusResolutionCeiling?: ResolutionLevel;
132
+ readonly prepareTimeoutMs?: number;
133
+ readonly signal?: AbortSignal;
134
+ }
135
+ /**
136
+ * Run one source over one corpus.
137
+ *
138
+ * The source's own `reachedResolution` is the level everything is judged
139
+ * against. That is not trust — it is the opposite: the adapter's claim is the
140
+ * standard it is then held to, which is what makes semantic 2 above possible.
141
+ *
142
+ * Lifecycle stays with the caller. `dispose()` is mandatory on a
143
+ * `LanguageAdapter` and a harness that called it would break any caller running
144
+ * a resolution sweep over one instance.
145
+ */
146
+ export declare function runConformance(input: ConformanceInput): Promise<ConformanceResult>;
147
+ export interface SweepInput extends Omit<ConformanceInput, "source"> {
148
+ /** One source per level. A sweep needs an adapter configured to cap where it is asked to. */
149
+ readonly createSource: (atResolution: ResolutionLevel) => IRSource | Promise<IRSource>;
150
+ /** Defaults to R0 through the corpus's `expectedMaxResolution`. */
151
+ readonly levels?: readonly ResolutionLevel[];
152
+ }
153
+ export interface SweepResult {
154
+ readonly runs: readonly {
155
+ readonly level: ResolutionLevel;
156
+ readonly result: ConformanceResult;
157
+ }[];
158
+ readonly monotonicity: readonly ConformanceFinding[];
159
+ readonly passed: boolean;
160
+ }
161
+ /**
162
+ * Run the corpus at every level the adapter claims, and check monotonicity.
163
+ *
164
+ * **More resolution never removes knowledge.** An edge found at R2 must still be
165
+ * there at R3, and a role that bound must still bind. The failure this catches
166
+ * is real and easy to ship: a resolver that only consults the type checker when
167
+ * types are available stops falling back to the name-based path, and quietly
168
+ * loses edges the weaker mode found. Only a sweep can see it — each individual
169
+ * run looks fine.
170
+ */
171
+ export declare function runConformanceSweep(input: SweepInput): Promise<SweepResult>;
172
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/conformance/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,KAAK,EAA2B,eAAe,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,KAAK,EAAoB,QAAQ,EAAmB,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAkB,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI7E,OAAO,EAGL,KAAK,MAAM,EAEZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMxE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,CAAC;AAE1E,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,GACZ,oBAAoB,GACpB,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,CAAC;AAEnB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,cAAc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