@fuaran-ui/conformance 0.2.0 → 0.4.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.
- package/corpus/lenient/lenient-daterange-bare-array.expected.json +1 -0
- package/corpus/lenient/lenient-daterange-bare-array.json +1 -0
- package/corpus/lenient/lenient-daterange-static-envelope.expected.json +1 -0
- package/corpus/lenient/lenient-daterange-static-envelope.json +1 -0
- package/corpus/lenient/lenient-filterable-static-dashboard-compact.expected.json +1 -0
- package/corpus/lenient/lenient-filterable-static-dashboard-compact.json +1 -0
- package/corpus/lenient/lenient-grid-field-named-compact.expected.json +1 -0
- package/corpus/lenient/lenient-grid-field-named-compact.json +1 -0
- package/corpus/lenient/lenient-grid-transform-param-compact.expected.json +1 -0
- package/corpus/lenient/lenient-grid-transform-param-compact.json +1 -0
- package/corpus/lenient/lenient-master-detail-preselected-compact.expected.json +1 -0
- package/corpus/lenient/lenient-master-detail-preselected-compact.json +1 -0
- package/corpus/lenient/lenient-scalar-transform-composition-compact.expected.json +1 -0
- package/corpus/lenient/lenient-scalar-transform-composition-compact.json +1 -0
- package/corpus/lenient/lenient-tonedpill-pill-tag.expected.json +1 -0
- package/corpus/lenient/lenient-tonedpill-pill-tag.json +1 -0
- package/corpus/lenient/lenient-tonedpill-tone-aliases.expected.json +1 -0
- package/corpus/lenient/lenient-tonedpill-tone-aliases.json +1 -0
- package/corpus/lenient/lenient-tonedpill-tonemap-alias.expected.json +1 -0
- package/corpus/lenient/lenient-tonedpill-tonemap-alias.json +1 -0
- package/corpus/manifest.json +143 -1
- package/corpus/nodes/filters-date-range.json +1 -0
- package/corpus/nodes/form-date-range.json +1 -0
- package/corpus/nodes/grid-toned-pill.json +1 -0
- package/corpus/nodes/master-detail-preselected-second-row.json +1 -0
- package/corpus/reject/reject-daterange-unordered.json +1 -0
- package/corpus/reject/reject-tonedpill-unknown-tone.json +1 -0
- package/corpus/schema.json +53 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/report.ts","../src/corpus.ts","../src/run.ts","../src/cli.ts"],"names":["report","adapter"],"mappings":";;;;;;;;AAsEO,IAAM,cAAA,GAAiB,CAAC,IAAA,KAAwC;AACrE,EAAA,IAAI,IAAA,CAAK,KAAK,CAAC,CAAA,KAAM,EAAE,MAAA,KAAW,MAAM,GAAG,OAAO,gBAAA;AAClD,EAAA,IAAI,IAAA,CAAK,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA,CAAE,MAAA,KAAW,SAAS,CAAA,EAAG,OAAO,sBAAA;AACpE,EAAA,OAAO,YAAA;AACT,CAAA;AAEA,IAAM,cAAyC,EAAE,IAAA,EAAM,UAAK,IAAA,EAAM,QAAA,EAAK,SAAS,QAAA,EAAI;AAG7E,IAAM,YAAA,GAAe,CAACA,OAAAA,KAAsC;AACjE,EAAA,MAAM,QAAkB,EAAC;AACzB,EAAA,MAAM,IAAA,GACJA,OAAAA,CAAO,cAAA,CAAe,OAAA,KAAY,SAC9BA,OAAAA,CAAO,cAAA,CAAe,IAAA,GACtB,CAAA,EAAGA,QAAO,cAAA,CAAe,IAAI,CAAA,CAAA,EAAIA,OAAAA,CAAO,eAAe,OAAO,CAAA,CAAA;AACpE,EAAA,KAAA,CAAM,KAAK,CAAA,qCAAA,CAAuC,CAAA;AAClD,EAAA,KAAA,CAAM,IAAA,CAAK,oBAAoBA,OAAAA,CAAO,GAAA,CAAI,IAAI,CAAA,CAAA,EAAIA,OAAAA,CAAO,GAAA,CAAI,OAAO,CAAA,CAAE,CAAA;AACtE,EAAA,KAAA,CAAM,IAAA,CAAK,CAAA,iBAAA,EAAoB,IAAI,CAAA,CAAE,CAAA;AACrC,EAAA,KAAA,CAAM,IAAA;AAAA,IACJ,CAAA,kBAAA,EAAqBA,OAAAA,CA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;AACA,IAAI,UAAA,KAAe,QAAW,KAAA,EAAM;AAEpC,IAAM,SAAU,MAAM,OAAO,cAAc,OAAA,CAAQ,UAAoB,CAAC,CAAA,CAAE,IAAA,CAAA;AAC1E,IAAM,OAAA,GAAU,MAAA,CAAO,OAAA,IAAW,MAAA,CAAO,OAAA,EAAS,OAAA;AAClD,IAAM,cAAA,GAAiB,MAAA,CAAO,cAAA,IAAkB,MAAA,CAAO,OAAA,EAAS,cAAA;AAChE,IAAI,OAAA,KAAY,MAAA,IAAa,cAAA,KAAmB,MAAA,EAAW;AACzD,EAAA,OAAA,CAAQ,KAAA;AAAA,IACN,+GAC+C,UAAU,CAAA;AAAA,GAC3D;AACA,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB;AAEA,IAAM,MAAA,GAAS,eAAe,OAAA,EAAS;AAAA,EACrC,cAAA;AAAA,EACA,GAAI,UAAA,KAAe,MAAA,GAAY,EAAC,GAAI,EAAE,UAAA;AACxC,CAAC,CAAA;AAED,OAAA,CAAQ,GAAA,CAAI,YAAA,CAAa,MAAM,CAAC,CAAA;AAChC,IAAI,YAAY,MAAA,EAAW;AACzB,EAAA,aAAA,CAAc,OAAA,EAAS,KAAK,SAAA,CAAU,MAAA,EAAQ,MAAM,CAAC,CAAA,GAAI,MAAM,MAAM,CAAA;AACrE,EAAA,OAAA,CAAQ,GAAA,CAAI;AAAA,6BAAA,EAAkC,OAAO,CAAA,CAAE,CAAA;AACzD;AAEA,OAAA,CAAQ,IAAA;AAAA,EACN,OAAO,OAAA,KAAY,YAAA,GAAe,IAAI,MAAA,CAAO,OAAA,KAAY,yBAAyB,CAAA,GAAI;AACxF,CAAA","file":"cli.js","sourcesContent":["// ============================================================================\n// @fuaran-ui/conformance — the certification report.\n//\n// One `LegResult` per conformance leg. A leg is `skipped` (never attempted)\n// when the adapter lacks the hooks it needs — that is a capability statement,\n// not a failure. The verdict distinguishes the three honest outcomes:\n//\n// conformant every mandatory leg attempted and passed\n// partially-conformant every attempted leg passed; ≥1 mandatory leg skipped\n// non-conformant ≥1 attempted leg failed\n//\n// so a partial host (decode-only, node-only, …) certifies the legs it\n// implements rather than receiving a blanket fail.\n// ============================================================================\n\nimport type { ImplementationInfo } from './adapter.js';\n\nexport type LegId =\n | 'node-decode'\n | 'node-byte-identity'\n | 'node-reject'\n | 'op-decode'\n | 'op-byte-identity'\n | 'op-reject'\n | 'lenient-accept'\n | 'envelope-round-trip'\n | 'envelope-reject'\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer'\n | 'schema-validation'\n | 'apply';\n\nexport type LegStatus = 'pass' | 'fail' | 'skipped';\n\nexport interface FixtureFailure {\n readonly fixtureId: string;\n readonly summary: string;\n readonly detail?: string;\n}\n\nexport interface LegResult {\n readonly leg: LegId;\n /** Mandatory legs must all pass for the `conformant` verdict. */\n readonly mandatory: boolean;\n readonly status: LegStatus;\n /** Why the leg was not attempted (only when `status === 'skipped'`). */\n readonly skipReason?: string;\n readonly fixturesTotal: number;\n readonly fixturesPassed: number;\n readonly failures: readonly FixtureFailure[];\n}\n\nexport type Verdict = 'conformant' | 'partially-conformant' | 'non-conformant';\n\nexport interface ConformanceReport {\n readonly kit: { readonly name: string; readonly version: string };\n readonly implementation: ImplementationInfo;\n readonly corpus: {\n readonly manifestVersion: number;\n readonly digest: string;\n readonly fixtureCount: number;\n readonly source: 'bundled' | 'external';\n };\n readonly legs: readonly LegResult[];\n readonly verdict: Verdict;\n /** ISO-8601 generation timestamp. */\n readonly generatedAt: string;\n}\n\nexport const computeVerdict = (legs: readonly LegResult[]): Verdict => {\n if (legs.some((l) => l.status === 'fail')) return 'non-conformant';\n if (legs.some((l) => l.mandatory && l.status === 'skipped')) return 'partially-conformant';\n return 'conformant';\n};\n\nconst statusGlyph: Record<LegStatus, string> = { pass: '✓', fail: '✗', skipped: '–' };\n\n/** Render a report as a human-readable text block (what the CLI prints). */\nexport const formatReport = (report: ConformanceReport): string => {\n const lines: string[] = [];\n const impl =\n report.implementation.version === undefined\n ? report.implementation.name\n : `${report.implementation.name} ${report.implementation.version}`;\n lines.push(`Fuaran wire-format conformance report`);\n lines.push(` kit ${report.kit.name}@${report.kit.version}`);\n lines.push(` implementation ${impl}`);\n lines.push(\n ` corpus v${report.corpus.manifestVersion} (${report.corpus.fixtureCount} fixtures, ${report.corpus.source})`,\n );\n lines.push(` corpus digest sha256:${report.corpus.digest}`);\n lines.push(` generated ${report.generatedAt}`);\n lines.push('');\n for (const leg of report.legs) {\n const tier = leg.mandatory ? 'mandatory' : 'optional ';\n const counts =\n leg.status === 'skipped'\n ? (leg.skipReason ?? 'skipped')\n : `${leg.fixturesPassed}/${leg.fixturesTotal}`;\n lines.push(` ${statusGlyph[leg.status]} ${leg.leg.padEnd(20)} ${tier} ${counts}`);\n for (const f of leg.failures) {\n lines.push(` ${f.fixtureId}: ${f.summary}`);\n if (f.detail !== undefined)\n for (const detailLine of f.detail.split('\\n')) lines.push(` ${detailLine}`);\n }\n }\n lines.push('');\n lines.push(` verdict: ${report.verdict.toUpperCase()}`);\n if (report.verdict === 'partially-conformant') {\n const skipped = report.legs\n .filter((l) => l.mandatory && l.status === 'skipped')\n .map((l) => l.leg);\n lines.push(` (mandatory legs not attempted: ${skipped.join(', ')})`);\n }\n lines.push(\n ` Certification is per corpus version — re-certify when the corpus advances (WIRE_FORMAT.md §11).`,\n );\n return lines.join('\\n');\n};\n","// ============================================================================\n// @fuaran-ui/conformance — corpus loading + versioning.\n//\n// The package bundles a snapshot of the canonical wire-format conformance\n// corpus (`corpus/` — manifest.json + schema.json + nodes/ + ops/ + reject/),\n// so a third party needs nothing beyond `npm install` to certify. The\n// snapshot is synced from the authoritative workspace `wire-format-fixtures/`\n// corpus by `scripts/sync-corpus.mjs` and guarded byte-for-byte by the\n// package's own test suite, so it cannot silently drift from the authority.\n//\n// Every report names the corpus it certified against: the manifest `version`\n// plus a SHA-256 digest over the manifest, the schema, and every fixture\n// payload in manifest order. Certification is per corpus version — content\n// advances with the spec (WIRE_FORMAT.md §11), and a report against an older\n// digest does not certify conformance with a newer one.\n// ============================================================================\n\nimport { createHash } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport type FixtureKind =\n | 'node-round-trip'\n | 'op-round-trip'\n | 'reject'\n | 'lenient-accept'\n // WIRE_FORMAT.md §15 wire-versioning envelope + tolerance.\n | 'envelope-round-trip'\n | 'envelope-reject'\n // WIRE_FORMAT.md §18 elicitation envelope + answer conformance.\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer-accept'\n | 'elicitation-answer-reject';\n\nexport interface CorpusFixture {\n readonly id: string;\n readonly kind: FixtureKind;\n readonly decoder: 'node' | 'op' | 'elicitation' | 'elicitation-outcome' | 'elicitation-answer';\n readonly inputFile: string;\n readonly expectedFile?: string;\n readonly expectedErrorCode?: string;\n readonly expectedPath?: string;\n readonly description: string;\n}\n\ninterface Manifest {\n readonly version: number;\n readonly schema: string;\n readonly description: string;\n readonly fixtures: readonly CorpusFixture[];\n}\n\nexport interface Corpus {\n /** Absolute directory the corpus was loaded from. */\n readonly root: string;\n /** `bundled` (the package snapshot) or `external` (a caller-supplied root). */\n readonly source: 'bundled' | 'external';\n /** The manifest `version` field — the corpus major version. */\n readonly manifestVersion: number;\n readonly fixtures: readonly CorpusFixture[];\n /** SHA-256 (hex) over manifest.json + schema.json + every fixture payload in manifest order. */\n readonly digest: string;\n /** The canonical Draft 2020-12 JSON Schema (wire-format-fixtures/schema.json). */\n readonly schema: object;\n /** Read a corpus-relative payload file as UTF-8 text. */\n readonly read: (relPath: string) => string;\n}\n\n/** The bundled snapshot directory, resolved relative to the built module. */\nconst bundledRoot = (): string =>\n // dist/index.js → ../corpus (tsup `shims: true` provides import.meta.url under CJS).\n fileURLToPath(new URL('../corpus/', import.meta.url));\n\n/**\n * Load the conformance corpus. With no options, loads the snapshot bundled in\n * this package; pass `corpusRoot` to certify against an external corpus\n * checkout (e.g. the workspace `wire-format-fixtures/` directory).\n */\nexport const loadCorpus = (options?: { readonly corpusRoot?: string }): Corpus => {\n const external = options?.corpusRoot;\n const root = external ?? bundledRoot();\n const read = (relPath: string): string => readFileSync(join(root, relPath), 'utf8');\n\n const manifestText = read('manifest.json');\n const manifest = JSON.parse(manifestText) as Manifest;\n\n const hash = createHash('sha256');\n hash.update(manifestText);\n hash.update(read(manifest.schema));\n for (const f of manifest.fixtures) {\n hash.update(read(f.inputFile));\n if (f.expectedFile !== undefined && f.expectedFile !== f.inputFile)\n hash.update(read(f.expectedFile));\n }\n\n return {\n root,\n source: external === undefined ? 'bundled' : 'external',\n manifestVersion: manifest.version,\n fixtures: manifest.fixtures,\n digest: hash.digest('hex'),\n schema: JSON.parse(read(manifest.schema)) as object,\n read,\n };\n};\n","// ============================================================================\n// @fuaran-ui/conformance — the runner.\n//\n// Drives a candidate implementation (the `ConformanceAdapter`) over the\n// canonical corpus and produces a per-leg `ConformanceReport`. The assertion\n// semantics are exactly those of the in-house cross-implementation gate\n// (wire-format-fixtures/conformance/cross-host-conformance.mjs + the F#\n// Fuaran.UI.JsonDecode.Tests suite), packaged behind the adapter seam:\n//\n// node-decode / op-decode decode(inputFile) succeeds on every accept\n// fixture (the host accepts everything the\n// contract admits).\n// node-byte-identity / encode(decode(inputFile)) is byte-identical\n// op-byte-identity to expectedFile — the committed corpus IS\n// the canonical form, so byte-equality with it\n// is byte-equality with every conformant host.\n// node-reject / op-reject decode(inputFile) fails with the manifest's\n// expectedErrorCode at a path starting with\n// expectedPath (WIRE_FORMAT.md §6).\n// lenient-accept decode(inputFile) — a §16 SHORTHAND form —\n// succeeds AND encode(decode(inputFile)) is\n// byte-identical to expectedFile (the verbose\n// canonical form). Mandatory: a host that\n// rejects the shorthand, or normalises it to\n// different bytes, silently strands AI authors\n// (WIRE_FORMAT.md §16 normative block).\n// schema-validation the host's re-encoded output validates\n// against the canonical Draft 2020-12 schema\n// (schema.json) — only outputs that already\n// passed byte-identity are validated.\n// apply reserved; corpus v1 ships no apply fixtures.\n//\n// Exceptions thrown by adapter hooks are recorded as fixture failures, never\n// propagated — a crashing codec is a non-conformance finding, not a runner\n// crash.\n// ============================================================================\n\n// The named class export is the one binding ajv's CJS dist exposes identically\n// under every loader (NodeNext ESM, CJS require, bundlers) — the default-import\n// interop differs per loader and is avoided deliberately.\nimport { Ajv2020 } from 'ajv/dist/2020.js';\n\nimport type { AdapterDecodeResult, ConformanceAdapter, ImplementationInfo } from './adapter.js';\nimport { loadCorpus, type Corpus, type CorpusFixture } from './corpus.js';\nimport {\n computeVerdict,\n type ConformanceReport,\n type FixtureFailure,\n type LegId,\n type LegResult,\n} from './report.js';\n\nexport const KIT_NAME = '@fuaran-ui/conformance';\nexport const KIT_VERSION = '0.1.0';\n\nexport interface RunOptions {\n /** Names the candidate implementation in the report. */\n readonly implementation: ImplementationInfo;\n /** Certify against an external corpus checkout instead of the bundled snapshot. */\n readonly corpusRoot?: string;\n}\n\n// Fixtures are single-line compact JSON without a trailing newline; strip at\n// most one defensively so an editor/git autocrlf touch on a corpus payload\n// can't masquerade as a host divergence (the in-house gate's convention).\nconst canon = (s: string): string => s.replace(/\\r?\\n$/, '');\n\n/** First byte offset at which two strings differ, with a context window. */\nconst firstDiff = (expected: string, actual: string): string => {\n const n = Math.min(expected.length, actual.length);\n let i = 0;\n while (i < n && expected[i] === actual[i]) i++;\n const from = Math.max(0, i - 30);\n const win = (s: string): string => JSON.stringify(s.slice(from, i + 30));\n return (\n `byte offset ${i} (length canonical=${expected.length}, host=${actual.length})\\n` +\n ` canonical …${win(expected)}…\\n` +\n ` host …${win(actual)}…`\n );\n};\n\nconst messageOf = (err: unknown): string => (err instanceof Error ? err.message : String(err));\n\ninterface LegAccumulator {\n total: number;\n passed: number;\n failures: FixtureFailure[];\n}\n\nconst newAcc = (): LegAccumulator => ({ total: 0, passed: 0, failures: [] });\n\nconst toLeg = (\n leg: LegId,\n mandatory: boolean,\n acc: LegAccumulator | undefined,\n skipReason?: string,\n): LegResult =>\n acc === undefined\n ? {\n leg,\n mandatory,\n status: 'skipped',\n ...(skipReason === undefined ? {} : { skipReason }),\n fixturesTotal: 0,\n fixturesPassed: 0,\n failures: [],\n }\n : {\n leg,\n mandatory,\n status: acc.failures.length === 0 ? 'pass' : 'fail',\n fixturesTotal: acc.total,\n fixturesPassed: acc.passed,\n failures: acc.failures,\n };\n\n/** Run the certification kit: corpus × adapter → report. */\nexport const runConformance = (\n adapter: ConformanceAdapter,\n options: RunOptions,\n): ConformanceReport => {\n const corpus: Corpus = loadCorpus(\n options.corpusRoot === undefined ? undefined : { corpusRoot: options.corpusRoot },\n );\n\n const ajv = new Ajv2020({ strict: false, allErrors: true });\n const schemaValid = ajv.compile(corpus.schema);\n\n const accepts = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter(\n (f) => f.decoder === decoder && (f.kind === 'node-round-trip' || f.kind === 'op-round-trip'),\n );\n const rejects = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'reject');\n const lenients = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'lenient-accept');\n\n // Per-leg accumulators — undefined means the adapter lacks the hooks for the leg.\n const accs = new Map<LegId, LegAccumulator>();\n const acc = (leg: LegId): LegAccumulator => {\n let a = accs.get(leg);\n if (a === undefined) {\n a = newAcc();\n accs.set(leg, a);\n }\n return a;\n };\n\n const runSide = (\n decoder: 'node' | 'op',\n decode: ((json: string) => AdapterDecodeResult) | undefined,\n encode: ((value: unknown) => string) | undefined,\n ): void => {\n const decodeLeg: LegId = decoder === 'node' ? 'node-decode' : 'op-decode';\n const byteLeg: LegId = decoder === 'node' ? 'node-byte-identity' : 'op-byte-identity';\n const rejectLeg: LegId = decoder === 'node' ? 'node-reject' : 'op-reject';\n\n if (decode === undefined) return;\n\n for (const f of accepts(decoder)) {\n const input = corpus.read(f.inputFile);\n const d = acc(decodeLeg);\n d.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on an accept fixture (a conformant decoder never throws)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected an accept fixture',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n d.passed++;\n\n if (encode === undefined) continue;\n const b = acc(byteLeg);\n b.total++;\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded accept fixture',\n detail: messageOf(err),\n });\n continue;\n }\n if (actual !== expected) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder output diverges from the canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n b.passed++;\n\n // Schema-validate the host's own (byte-identical) output — proves the\n // host emits schema-valid wire, not merely corpus-identical wire.\n const s = acc('schema-validation');\n s.total++;\n if (schemaValid(JSON.parse(actual))) {\n s.passed++;\n } else {\n s.failures.push({\n fixtureId: f.id,\n summary: 'encoder output fails the canonical JSON Schema (schema.json)',\n detail: (schemaValid.errors ?? [])\n .map((e) => `${e.instancePath === '' ? '$' : e.instancePath} ${e.message ?? ''}`)\n .join('\\n'),\n });\n }\n }\n\n // Lenient-accept (§16): the shorthand MUST decode, and MUST normalise to\n // the verbose canonical bytes. Needs both hooks — with decode only, the\n // leg stays unattempted (skipped), same capability semantics as\n // byte-identity.\n if (encode !== undefined) {\n for (const f of lenients(decoder)) {\n const input = corpus.read(f.inputFile);\n const l = acc('lenient-accept');\n l.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a §16 shorthand (a conformant decoder accepts it)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected a §16 shorthand (MUST accept — WIRE_FORMAT §16)',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded §16 shorthand',\n detail: messageOf(err),\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (actual !== expected) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'shorthand normalisation diverges from the verbose canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n l.passed++;\n }\n }\n\n for (const f of rejects(decoder)) {\n const input = corpus.read(f.inputFile);\n const r = acc(rejectLeg);\n r.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (decoded.ok) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (decoded.error.code !== f.expectedErrorCode) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${decoded.error.code} (path ${decoded.error.path})`,\n });\n continue;\n }\n if (!decoded.error.path.startsWith(f.expectedPath ?? '$')) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${decoded.error.path} (code ${decoded.error.code})`,\n });\n continue;\n }\n r.passed++;\n }\n };\n\n runSide('node', adapter.decodeNode, adapter.encodeNode);\n runSide('op', adapter.decodeOp, adapter.encodeOp);\n\n // Envelope / tolerance (WIRE_FORMAT.md §15). `negotiateEnvelope` reads the\n // envelope, negotiates against the host's own core@1.0, and either refuses a\n // Foreign profile or returns the whole envelope re-encoded (unknown kinds\n // preserved). A round-trip fixture asserts the re-encode is byte-identical to\n // expectedFile; a reject fixture asserts the FOREIGN_PROFILE refusal.\n const negotiateEnvelope = adapter.negotiateEnvelope;\n if (negotiateEnvelope !== undefined) {\n const byKind = (kind: 'envelope-round-trip' | 'envelope-reject'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.kind === kind);\n\n for (const f of byKind('envelope-round-trip')) {\n const a = acc('envelope-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope refused a round-trip fixture (Current/Behind must be tolerated)',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'envelope re-encode diverges from the canonical form (must-ignore-but-preserve)',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of byKind('envelope-reject')) {\n const a = acc('envelope-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope ACCEPTED a Foreign artifact (must hard-refuse)',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n // Elicitation envelope + answer conformance (WIRE_FORMAT.md §18).\n // `roundTripElicitation` decodes with the fixture's decoder-named entry\n // point and re-encodes; `validateAnswerDocument` runs the §18.4 answer-\n // conformance gate over a {answer, contract} document.\n const roundTripElicitation = adapter.roundTripElicitation;\n if (roundTripElicitation !== undefined) {\n const elDecoder = (f: CorpusFixture): 'elicitation' | 'elicitation-outcome' =>\n f.decoder === 'elicitation-outcome' ? 'elicitation-outcome' : 'elicitation';\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-round-trip')) {\n const a = acc('elicitation-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation refused a round-trip fixture',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'elicitation re-encode diverges from the canonical form',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-reject')) {\n const a = acc('elicitation-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const validateAnswerDocument = adapter.validateAnswerDocument;\n if (validateAnswerDocument !== undefined) {\n for (const f of corpus.fixtures.filter(\n (x) => x.kind === 'elicitation-answer-accept' || x.kind === 'elicitation-answer-reject',\n )) {\n const a = acc('elicitation-answer');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = validateAnswerDocument(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument THREW (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (f.kind === 'elicitation-answer-accept') {\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument refused a conforming answer',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument ACCEPTED a nonconforming answer',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const need = (hooks: readonly string[]): string =>\n `adapter does not provide ${hooks.join(' + ')}`;\n const hasSchemaInput = adapter.encodeNode !== undefined || adapter.encodeOp !== undefined;\n\n const legs: LegResult[] = [\n toLeg('node-decode', true, accs.get('node-decode'), need(['decodeNode'])),\n toLeg(\n 'node-byte-identity',\n true,\n accs.get('node-byte-identity'),\n need(['decodeNode', 'encodeNode']),\n ),\n toLeg('node-reject', true, accs.get('node-reject'), need(['decodeNode'])),\n toLeg('op-decode', true, accs.get('op-decode'), need(['decodeOp'])),\n toLeg('op-byte-identity', true, accs.get('op-byte-identity'), need(['decodeOp', 'encodeOp'])),\n toLeg('op-reject', true, accs.get('op-reject'), need(['decodeOp'])),\n toLeg(\n 'lenient-accept',\n true,\n accs.get('lenient-accept'),\n need(['a decode + encode hook pair (node and/or op)']),\n ),\n toLeg(\n 'envelope-round-trip',\n true,\n accs.get('envelope-round-trip'),\n need(['negotiateEnvelope']),\n ),\n toLeg('envelope-reject', true, accs.get('envelope-reject'), need(['negotiateEnvelope'])),\n toLeg(\n 'elicitation-round-trip',\n true,\n accs.get('elicitation-round-trip'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-reject',\n true,\n accs.get('elicitation-reject'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-answer',\n true,\n accs.get('elicitation-answer'),\n need(['validateAnswerDocument']),\n ),\n toLeg(\n 'schema-validation',\n true,\n accs.get('schema-validation'),\n hasSchemaInput\n ? need(['a decode hook for the encode hooks provided'])\n : need(['encodeNode and/or encodeOp']),\n ),\n toLeg('apply', false, undefined, 'corpus v1 ships no apply fixtures — leg reserved'),\n ];\n\n return {\n kit: { name: KIT_NAME, version: KIT_VERSION },\n implementation: options.implementation,\n corpus: {\n manifestVersion: corpus.manifestVersion,\n digest: corpus.digest,\n fixtureCount: corpus.fixtures.length,\n source: corpus.source,\n },\n legs,\n verdict: computeVerdict(legs),\n generatedAt: new Date().toISOString(),\n };\n};\n","#!/usr/bin/env node\n// ============================================================================\n// @fuaran-ui/conformance — CLI.\n//\n// fuaran-conformance <adapter-module> [--corpus <dir>] [--json <file>]\n//\n// <adapter-module> is a path to a JS/TS-compiled module that exports the\n// candidate implementation:\n//\n// export const adapter = { decodeNode, encodeNode, decodeOp, encodeOp };\n// export const implementation = { name: 'my-host', version: '1.2.3' };\n//\n// (or the same two fields on the default export). Prints the human-readable\n// report; `--json` additionally writes the structured report. Exit codes:\n// 0 = conformant, 2 = partially-conformant, 1 = non-conformant or usage error.\n// ============================================================================\n\nimport { writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport type { ConformanceAdapter, ImplementationInfo } from './adapter.js';\nimport { formatReport } from './report.js';\nimport { runConformance } from './run.js';\n\ninterface AdapterModule {\n readonly adapter?: ConformanceAdapter;\n readonly implementation?: ImplementationInfo;\n readonly default?: {\n readonly adapter?: ConformanceAdapter;\n readonly implementation?: ImplementationInfo;\n };\n}\n\nconst usage = (): never => {\n console.error(\n 'Usage: fuaran-conformance <adapter-module> [--corpus <dir>] [--json <file>]\\n\\n' +\n ' <adapter-module> module exporting `adapter` (decode/encode hooks) and\\n' +\n ' `implementation` ({ name, version? })\\n' +\n ' --corpus <dir> certify against an external corpus checkout instead of\\n' +\n ' the snapshot bundled with this package\\n' +\n ' --json <file> also write the structured report as JSON\\n',\n );\n process.exit(1);\n};\n\nconst args = process.argv.slice(2);\nlet modulePath: string | undefined;\nlet corpusRoot: string | undefined;\nlet jsonOut: string | undefined;\n\nfor (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === '--corpus') corpusRoot = args[++i] ?? usage();\n else if (arg === '--json') jsonOut = args[++i] ?? usage();\n else if (modulePath === undefined && arg !== undefined && !arg.startsWith('--')) {\n modulePath = arg;\n } else usage();\n}\nif (modulePath === undefined) usage();\n\nconst loaded = (await import(pathToFileURL(resolve(modulePath as string)).href)) as AdapterModule;\nconst adapter = loaded.adapter ?? loaded.default?.adapter;\nconst implementation = loaded.implementation ?? loaded.default?.implementation;\nif (adapter === undefined || implementation === undefined) {\n console.error(\n `The adapter module must export \\`adapter\\` and \\`implementation\\` ` +\n `(named or on the default export). Loaded: ${modulePath}`,\n );\n process.exit(1);\n}\n\nconst report = runConformance(adapter, {\n implementation,\n ...(corpusRoot === undefined ? {} : { corpusRoot }),\n});\n\nconsole.log(formatReport(report));\nif (jsonOut !== undefined) {\n writeFileSync(jsonOut, JSON.stringify(report, null, 2) + '\\n', 'utf8');\n console.log(`\\nStructured report written to ${jsonOut}`);\n}\n\nprocess.exit(\n report.verdict === 'conformant' ? 0 : report.verdict === 'partially-conformant' ? 2 : 1,\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/report.ts","../src/corpus.ts","../src/run.ts","../src/cli.ts"],"names":["report","adapter"],"mappings":";;;;;;;;AAsEO,IAAM,cAAA,GAAiB,CAAC,IAAA,KAAwC;AACrE,EAAA,IAAI,IAAA,CAAK,KAAK,CAAC,CAAA,KAAM,EAAE,MAAA,KAAW,MAAM,GAAG,OAAO,gBAAA;AAClD,EAAA,IAAI,IAAA,CAAK,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA,CAAE,MAAA,KAAW,SAAS,CAAA,EAAG,OAAO,sBAAA;AACpE,EAAA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IAAM,MAAA,GAAS,eAAe,OAAA,EAAS;AAAA,EACrC,cAAA;AAAA,EACA,GAAI,UAAA,KAAe,MAAA,GAAY,EAAC,GAAI,EAAE,UAAA;AACxC,CAAC,CAAA;AAED,OAAA,CAAQ,GAAA,CAAI,YAAA,CAAa,MAAM,CAAC,CAAA;AAChC,IAAI,YAAY,MAAA,EAAW;AACzB,EAAA,aAAA,CAAc,OAAA,EAAS,KAAK,SAAA,CAAU,MAAA,EAAQ,MAAM,CAAC,CAAA,GAAI,MAAM,MAAM,CAAA;AACrE,EAAA,OAAA,CAAQ,GAAA,CAAI;AAAA,6BAAA,EAAkC,OAAO,CAAA,CAAE,CAAA;AACzD;AAEA,OAAA,CAAQ,IAAA;AAAA,EACN,OAAO,OAAA,KAAY,YAAA,GAAe,IAAI,MAAA,CAAO,OAAA,KAAY,yBAAyB,CAAA,GAAI;AACxF,CAAA","file":"cli.js","sourcesContent":["// ============================================================================\n// @fuaran-ui/conformance — the certification report.\n//\n// One `LegResult` per conformance leg. A leg is `skipped` (never attempted)\n// when the adapter lacks the hooks it needs — that is a capability statement,\n// not a failure. The verdict distinguishes the three honest outcomes:\n//\n// conformant every mandatory leg attempted and passed\n// partially-conformant every attempted leg passed; ≥1 mandatory leg skipped\n// non-conformant ≥1 attempted leg failed\n//\n// so a partial host (decode-only, node-only, …) certifies the legs it\n// implements rather than receiving a blanket fail.\n// ============================================================================\n\nimport type { ImplementationInfo } from './adapter.js';\n\nexport type LegId =\n | 'node-decode'\n | 'node-byte-identity'\n | 'node-reject'\n | 'op-decode'\n | 'op-byte-identity'\n | 'op-reject'\n | 'lenient-accept'\n | 'envelope-round-trip'\n | 'envelope-reject'\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer'\n | 'schema-validation'\n | 'apply';\n\nexport type LegStatus = 'pass' | 'fail' | 'skipped';\n\nexport interface FixtureFailure {\n readonly fixtureId: string;\n readonly summary: string;\n readonly detail?: string;\n}\n\nexport interface LegResult {\n readonly leg: LegId;\n /** Mandatory legs must all pass for the `conformant` verdict. */\n readonly mandatory: boolean;\n readonly status: LegStatus;\n /** Why the leg was not attempted (only when `status === 'skipped'`). */\n readonly skipReason?: string;\n readonly fixturesTotal: number;\n readonly fixturesPassed: number;\n readonly failures: readonly FixtureFailure[];\n}\n\nexport type Verdict = 'conformant' | 'partially-conformant' | 'non-conformant';\n\nexport interface ConformanceReport {\n readonly kit: { readonly name: string; readonly version: string };\n readonly implementation: ImplementationInfo;\n readonly corpus: {\n readonly manifestVersion: number;\n readonly digest: string;\n readonly fixtureCount: number;\n readonly source: 'bundled' | 'external';\n };\n readonly legs: readonly LegResult[];\n readonly verdict: Verdict;\n /** ISO-8601 generation timestamp. */\n readonly generatedAt: string;\n}\n\nexport const computeVerdict = (legs: readonly LegResult[]): Verdict => {\n if (legs.some((l) => l.status === 'fail')) return 'non-conformant';\n if (legs.some((l) => l.mandatory && l.status === 'skipped')) return 'partially-conformant';\n return 'conformant';\n};\n\nconst statusGlyph: Record<LegStatus, string> = { pass: '✓', fail: '✗', skipped: '–' };\n\n/** Render a report as a human-readable text block (what the CLI prints). */\nexport const formatReport = (report: ConformanceReport): string => {\n const lines: string[] = [];\n const impl =\n report.implementation.version === undefined\n ? report.implementation.name\n : `${report.implementation.name} ${report.implementation.version}`;\n lines.push(`Fuaran wire-format conformance report`);\n lines.push(` kit ${report.kit.name}@${report.kit.version}`);\n lines.push(` implementation ${impl}`);\n lines.push(\n ` corpus v${report.corpus.manifestVersion} (${report.corpus.fixtureCount} fixtures, ${report.corpus.source})`,\n );\n lines.push(` corpus digest sha256:${report.corpus.digest}`);\n lines.push(` generated ${report.generatedAt}`);\n lines.push('');\n for (const leg of report.legs) {\n const tier = leg.mandatory ? 'mandatory' : 'optional ';\n const counts =\n leg.status === 'skipped'\n ? (leg.skipReason ?? 'skipped')\n : `${leg.fixturesPassed}/${leg.fixturesTotal}`;\n lines.push(` ${statusGlyph[leg.status]} ${leg.leg.padEnd(20)} ${tier} ${counts}`);\n for (const f of leg.failures) {\n lines.push(` ${f.fixtureId}: ${f.summary}`);\n if (f.detail !== undefined)\n for (const detailLine of f.detail.split('\\n')) lines.push(` ${detailLine}`);\n }\n }\n lines.push('');\n lines.push(` verdict: ${report.verdict.toUpperCase()}`);\n if (report.verdict === 'partially-conformant') {\n const skipped = report.legs\n .filter((l) => l.mandatory && l.status === 'skipped')\n .map((l) => l.leg);\n lines.push(` (mandatory legs not attempted: ${skipped.join(', ')})`);\n }\n lines.push(\n ` Certification is per corpus version — re-certify when the corpus advances (WIRE_FORMAT.md §11).`,\n );\n return lines.join('\\n');\n};\n","// ============================================================================\n// @fuaran-ui/conformance — corpus loading + versioning.\n//\n// The package bundles a snapshot of the canonical wire-format conformance\n// corpus under `corpus/` — manifest.json + schema.json + every fixture family\n// the manifest enumerates — so a third party needs nothing beyond\n// `npm install` to certify. The snapshot is synced from the authoritative\n// `wire-format-fixtures/` corpus by `scripts/sync-corpus.mjs`, and the same\n// script's `--check` mode guards it byte-for-byte from the package's own test\n// suite, so it cannot silently drift from the authority.\n//\n// Every report names the corpus it certified against: the manifest `version`\n// plus a SHA-256 digest over the manifest, the schema, and every fixture\n// payload in manifest order. Certification is per corpus version — content\n// advances with the spec (WIRE_FORMAT.md §11), and a report against an older\n// digest does not certify conformance with a newer one.\n// ============================================================================\n\nimport { createHash } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport type FixtureKind =\n | 'node-round-trip'\n | 'op-round-trip'\n | 'reject'\n | 'lenient-accept'\n // WIRE_FORMAT.md §15 wire-versioning envelope + tolerance.\n | 'envelope-round-trip'\n | 'envelope-reject'\n // WIRE_FORMAT.md §18 elicitation envelope + answer conformance.\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer-accept'\n | 'elicitation-answer-reject';\n\nexport interface CorpusFixture {\n readonly id: string;\n readonly kind: FixtureKind;\n readonly decoder: 'node' | 'op' | 'elicitation' | 'elicitation-outcome' | 'elicitation-answer';\n readonly inputFile: string;\n readonly expectedFile?: string;\n readonly expectedErrorCode?: string;\n readonly expectedPath?: string;\n readonly description: string;\n}\n\ninterface Manifest {\n readonly version: number;\n readonly schema: string;\n readonly description: string;\n readonly fixtures: readonly CorpusFixture[];\n}\n\nexport interface Corpus {\n /** Absolute directory the corpus was loaded from. */\n readonly root: string;\n /** `bundled` (the package snapshot) or `external` (a caller-supplied root). */\n readonly source: 'bundled' | 'external';\n /** The manifest `version` field — the corpus major version. */\n readonly manifestVersion: number;\n readonly fixtures: readonly CorpusFixture[];\n /** SHA-256 (hex) over manifest.json + schema.json + every fixture payload in manifest order. */\n readonly digest: string;\n /** The canonical Draft 2020-12 JSON Schema (wire-format-fixtures/schema.json). */\n readonly schema: object;\n /** Read a corpus-relative payload file as UTF-8 text. */\n readonly read: (relPath: string) => string;\n}\n\n/** The bundled snapshot directory, resolved relative to the built module. */\nconst bundledRoot = (): string =>\n // dist/index.js → ../corpus (tsup `shims: true` provides import.meta.url under CJS).\n fileURLToPath(new URL('../corpus/', import.meta.url));\n\n/**\n * Load the conformance corpus. With no options, loads the snapshot bundled in\n * this package; pass `corpusRoot` to certify against an external corpus\n * checkout (e.g. the workspace `wire-format-fixtures/` directory).\n */\nexport const loadCorpus = (options?: { readonly corpusRoot?: string }): Corpus => {\n const external = options?.corpusRoot;\n const root = external ?? bundledRoot();\n const read = (relPath: string): string => readFileSync(join(root, relPath), 'utf8');\n\n const manifestText = read('manifest.json');\n const manifest = JSON.parse(manifestText) as Manifest;\n\n const hash = createHash('sha256');\n hash.update(manifestText);\n hash.update(read(manifest.schema));\n for (const f of manifest.fixtures) {\n hash.update(read(f.inputFile));\n if (f.expectedFile !== undefined && f.expectedFile !== f.inputFile)\n hash.update(read(f.expectedFile));\n }\n\n return {\n root,\n source: external === undefined ? 'bundled' : 'external',\n manifestVersion: manifest.version,\n fixtures: manifest.fixtures,\n digest: hash.digest('hex'),\n schema: JSON.parse(read(manifest.schema)) as object,\n read,\n };\n};\n","// ============================================================================\n// @fuaran-ui/conformance — the runner.\n//\n// Drives a candidate implementation (the `ConformanceAdapter`) over the\n// canonical corpus and produces a per-leg `ConformanceReport`. The assertion\n// semantics are exactly those of the in-house cross-implementation gate\n// (wire-format-fixtures/conformance/cross-host-conformance.mjs + the F#\n// Fuaran.UI.JsonDecode.Tests suite), packaged behind the adapter seam:\n//\n// node-decode / op-decode decode(inputFile) succeeds on every accept\n// fixture (the host accepts everything the\n// contract admits).\n// node-byte-identity / encode(decode(inputFile)) is byte-identical\n// op-byte-identity to expectedFile — the committed corpus IS\n// the canonical form, so byte-equality with it\n// is byte-equality with every conformant host.\n// node-reject / op-reject decode(inputFile) fails with the manifest's\n// expectedErrorCode at a path starting with\n// expectedPath (WIRE_FORMAT.md §6).\n// lenient-accept decode(inputFile) — a §16 SHORTHAND form —\n// succeeds AND encode(decode(inputFile)) is\n// byte-identical to expectedFile (the verbose\n// canonical form). Mandatory: a host that\n// rejects the shorthand, or normalises it to\n// different bytes, silently strands AI authors\n// (WIRE_FORMAT.md §16 normative block).\n// schema-validation the host's re-encoded output validates\n// against the canonical Draft 2020-12 schema\n// (schema.json) — only outputs that already\n// passed byte-identity are validated.\n// apply reserved; corpus v1 ships no apply fixtures.\n//\n// Exceptions thrown by adapter hooks are recorded as fixture failures, never\n// propagated — a crashing codec is a non-conformance finding, not a runner\n// crash.\n// ============================================================================\n\n// The named class export is the one binding ajv's CJS dist exposes identically\n// under every loader (NodeNext ESM, CJS require, bundlers) — the default-import\n// interop differs per loader and is avoided deliberately.\nimport { Ajv2020 } from 'ajv/dist/2020.js';\n\nimport type { AdapterDecodeResult, ConformanceAdapter, ImplementationInfo } from './adapter.js';\nimport { loadCorpus, type Corpus, type CorpusFixture } from './corpus.js';\nimport {\n computeVerdict,\n type ConformanceReport,\n type FixtureFailure,\n type LegId,\n type LegResult,\n} from './report.js';\n\nexport const KIT_NAME = '@fuaran-ui/conformance';\nexport const KIT_VERSION = '0.1.0';\n\nexport interface RunOptions {\n /** Names the candidate implementation in the report. */\n readonly implementation: ImplementationInfo;\n /** Certify against an external corpus checkout instead of the bundled snapshot. */\n readonly corpusRoot?: string;\n}\n\n// Fixtures are single-line compact JSON without a trailing newline; strip at\n// most one defensively so an editor/git autocrlf touch on a corpus payload\n// can't masquerade as a host divergence (the in-house gate's convention).\nconst canon = (s: string): string => s.replace(/\\r?\\n$/, '');\n\n/** First byte offset at which two strings differ, with a context window. */\nconst firstDiff = (expected: string, actual: string): string => {\n const n = Math.min(expected.length, actual.length);\n let i = 0;\n while (i < n && expected[i] === actual[i]) i++;\n const from = Math.max(0, i - 30);\n const win = (s: string): string => JSON.stringify(s.slice(from, i + 30));\n return (\n `byte offset ${i} (length canonical=${expected.length}, host=${actual.length})\\n` +\n ` canonical …${win(expected)}…\\n` +\n ` host …${win(actual)}…`\n );\n};\n\nconst messageOf = (err: unknown): string => (err instanceof Error ? err.message : String(err));\n\ninterface LegAccumulator {\n total: number;\n passed: number;\n failures: FixtureFailure[];\n}\n\nconst newAcc = (): LegAccumulator => ({ total: 0, passed: 0, failures: [] });\n\nconst toLeg = (\n leg: LegId,\n mandatory: boolean,\n acc: LegAccumulator | undefined,\n skipReason?: string,\n): LegResult =>\n acc === undefined\n ? {\n leg,\n mandatory,\n status: 'skipped',\n ...(skipReason === undefined ? {} : { skipReason }),\n fixturesTotal: 0,\n fixturesPassed: 0,\n failures: [],\n }\n : {\n leg,\n mandatory,\n status: acc.failures.length === 0 ? 'pass' : 'fail',\n fixturesTotal: acc.total,\n fixturesPassed: acc.passed,\n failures: acc.failures,\n };\n\n/** Run the certification kit: corpus × adapter → report. */\nexport const runConformance = (\n adapter: ConformanceAdapter,\n options: RunOptions,\n): ConformanceReport => {\n const corpus: Corpus = loadCorpus(\n options.corpusRoot === undefined ? undefined : { corpusRoot: options.corpusRoot },\n );\n\n const ajv = new Ajv2020({ strict: false, allErrors: true });\n const schemaValid = ajv.compile(corpus.schema);\n\n const accepts = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter(\n (f) => f.decoder === decoder && (f.kind === 'node-round-trip' || f.kind === 'op-round-trip'),\n );\n const rejects = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'reject');\n const lenients = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'lenient-accept');\n\n // Per-leg accumulators — undefined means the adapter lacks the hooks for the leg.\n const accs = new Map<LegId, LegAccumulator>();\n const acc = (leg: LegId): LegAccumulator => {\n let a = accs.get(leg);\n if (a === undefined) {\n a = newAcc();\n accs.set(leg, a);\n }\n return a;\n };\n\n const runSide = (\n decoder: 'node' | 'op',\n decode: ((json: string) => AdapterDecodeResult) | undefined,\n encode: ((value: unknown) => string) | undefined,\n ): void => {\n const decodeLeg: LegId = decoder === 'node' ? 'node-decode' : 'op-decode';\n const byteLeg: LegId = decoder === 'node' ? 'node-byte-identity' : 'op-byte-identity';\n const rejectLeg: LegId = decoder === 'node' ? 'node-reject' : 'op-reject';\n\n if (decode === undefined) return;\n\n for (const f of accepts(decoder)) {\n const input = corpus.read(f.inputFile);\n const d = acc(decodeLeg);\n d.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on an accept fixture (a conformant decoder never throws)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected an accept fixture',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n d.passed++;\n\n if (encode === undefined) continue;\n const b = acc(byteLeg);\n b.total++;\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded accept fixture',\n detail: messageOf(err),\n });\n continue;\n }\n if (actual !== expected) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder output diverges from the canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n b.passed++;\n\n // Schema-validate the host's own (byte-identical) output — proves the\n // host emits schema-valid wire, not merely corpus-identical wire.\n const s = acc('schema-validation');\n s.total++;\n if (schemaValid(JSON.parse(actual))) {\n s.passed++;\n } else {\n s.failures.push({\n fixtureId: f.id,\n summary: 'encoder output fails the canonical JSON Schema (schema.json)',\n detail: (schemaValid.errors ?? [])\n .map((e) => `${e.instancePath === '' ? '$' : e.instancePath} ${e.message ?? ''}`)\n .join('\\n'),\n });\n }\n }\n\n // Lenient-accept (§16): the shorthand MUST decode, and MUST normalise to\n // the verbose canonical bytes. Needs both hooks — with decode only, the\n // leg stays unattempted (skipped), same capability semantics as\n // byte-identity.\n if (encode !== undefined) {\n for (const f of lenients(decoder)) {\n const input = corpus.read(f.inputFile);\n const l = acc('lenient-accept');\n l.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a §16 shorthand (a conformant decoder accepts it)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected a §16 shorthand (MUST accept — WIRE_FORMAT §16)',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded §16 shorthand',\n detail: messageOf(err),\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (actual !== expected) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'shorthand normalisation diverges from the verbose canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n l.passed++;\n }\n }\n\n for (const f of rejects(decoder)) {\n const input = corpus.read(f.inputFile);\n const r = acc(rejectLeg);\n r.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (decoded.ok) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (decoded.error.code !== f.expectedErrorCode) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${decoded.error.code} (path ${decoded.error.path})`,\n });\n continue;\n }\n if (!decoded.error.path.startsWith(f.expectedPath ?? '$')) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${decoded.error.path} (code ${decoded.error.code})`,\n });\n continue;\n }\n r.passed++;\n }\n };\n\n runSide('node', adapter.decodeNode, adapter.encodeNode);\n runSide('op', adapter.decodeOp, adapter.encodeOp);\n\n // Envelope / tolerance (WIRE_FORMAT.md §15). `negotiateEnvelope` reads the\n // envelope, negotiates against the host's own core@1.0, and either refuses a\n // Foreign profile or returns the whole envelope re-encoded (unknown kinds\n // preserved). A round-trip fixture asserts the re-encode is byte-identical to\n // expectedFile; a reject fixture asserts the FOREIGN_PROFILE refusal.\n const negotiateEnvelope = adapter.negotiateEnvelope;\n if (negotiateEnvelope !== undefined) {\n const byKind = (kind: 'envelope-round-trip' | 'envelope-reject'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.kind === kind);\n\n for (const f of byKind('envelope-round-trip')) {\n const a = acc('envelope-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope refused a round-trip fixture (Current/Behind must be tolerated)',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'envelope re-encode diverges from the canonical form (must-ignore-but-preserve)',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of byKind('envelope-reject')) {\n const a = acc('envelope-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope ACCEPTED a Foreign artifact (must hard-refuse)',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n // Elicitation envelope + answer conformance (WIRE_FORMAT.md §18).\n // `roundTripElicitation` decodes with the fixture's decoder-named entry\n // point and re-encodes; `validateAnswerDocument` runs the §18.4 answer-\n // conformance gate over a {answer, contract} document.\n const roundTripElicitation = adapter.roundTripElicitation;\n if (roundTripElicitation !== undefined) {\n const elDecoder = (f: CorpusFixture): 'elicitation' | 'elicitation-outcome' =>\n f.decoder === 'elicitation-outcome' ? 'elicitation-outcome' : 'elicitation';\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-round-trip')) {\n const a = acc('elicitation-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation refused a round-trip fixture',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'elicitation re-encode diverges from the canonical form',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-reject')) {\n const a = acc('elicitation-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const validateAnswerDocument = adapter.validateAnswerDocument;\n if (validateAnswerDocument !== undefined) {\n for (const f of corpus.fixtures.filter(\n (x) => x.kind === 'elicitation-answer-accept' || x.kind === 'elicitation-answer-reject',\n )) {\n const a = acc('elicitation-answer');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = validateAnswerDocument(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument THREW (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (f.kind === 'elicitation-answer-accept') {\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument refused a conforming answer',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument ACCEPTED a nonconforming answer',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const need = (hooks: readonly string[]): string =>\n `adapter does not provide ${hooks.join(' + ')}`;\n const hasSchemaInput = adapter.encodeNode !== undefined || adapter.encodeOp !== undefined;\n\n const legs: LegResult[] = [\n toLeg('node-decode', true, accs.get('node-decode'), need(['decodeNode'])),\n toLeg(\n 'node-byte-identity',\n true,\n accs.get('node-byte-identity'),\n need(['decodeNode', 'encodeNode']),\n ),\n toLeg('node-reject', true, accs.get('node-reject'), need(['decodeNode'])),\n toLeg('op-decode', true, accs.get('op-decode'), need(['decodeOp'])),\n toLeg('op-byte-identity', true, accs.get('op-byte-identity'), need(['decodeOp', 'encodeOp'])),\n toLeg('op-reject', true, accs.get('op-reject'), need(['decodeOp'])),\n toLeg(\n 'lenient-accept',\n true,\n accs.get('lenient-accept'),\n need(['a decode + encode hook pair (node and/or op)']),\n ),\n toLeg(\n 'envelope-round-trip',\n true,\n accs.get('envelope-round-trip'),\n need(['negotiateEnvelope']),\n ),\n toLeg('envelope-reject', true, accs.get('envelope-reject'), need(['negotiateEnvelope'])),\n toLeg(\n 'elicitation-round-trip',\n true,\n accs.get('elicitation-round-trip'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-reject',\n true,\n accs.get('elicitation-reject'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-answer',\n true,\n accs.get('elicitation-answer'),\n need(['validateAnswerDocument']),\n ),\n toLeg(\n 'schema-validation',\n true,\n accs.get('schema-validation'),\n hasSchemaInput\n ? need(['a decode hook for the encode hooks provided'])\n : need(['encodeNode and/or encodeOp']),\n ),\n toLeg('apply', false, undefined, 'corpus v1 ships no apply fixtures — leg reserved'),\n ];\n\n return {\n kit: { name: KIT_NAME, version: KIT_VERSION },\n implementation: options.implementation,\n corpus: {\n manifestVersion: corpus.manifestVersion,\n digest: corpus.digest,\n fixtureCount: corpus.fixtures.length,\n source: corpus.source,\n },\n legs,\n verdict: computeVerdict(legs),\n generatedAt: new Date().toISOString(),\n };\n};\n","#!/usr/bin/env node\n// ============================================================================\n// @fuaran-ui/conformance — CLI.\n//\n// fuaran-conformance <adapter-module> [--corpus <dir>] [--json <file>]\n//\n// <adapter-module> is a path to a JS/TS-compiled module that exports the\n// candidate implementation:\n//\n// export const adapter = { decodeNode, encodeNode, decodeOp, encodeOp };\n// export const implementation = { name: 'my-host', version: '1.2.3' };\n//\n// (or the same two fields on the default export). Prints the human-readable\n// report; `--json` additionally writes the structured report. Exit codes:\n// 0 = conformant, 2 = partially-conformant, 1 = non-conformant or usage error.\n// ============================================================================\n\nimport { writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport type { ConformanceAdapter, ImplementationInfo } from './adapter.js';\nimport { formatReport } from './report.js';\nimport { runConformance } from './run.js';\n\ninterface AdapterModule {\n readonly adapter?: ConformanceAdapter;\n readonly implementation?: ImplementationInfo;\n readonly default?: {\n readonly adapter?: ConformanceAdapter;\n readonly implementation?: ImplementationInfo;\n };\n}\n\nconst usage = (): never => {\n console.error(\n 'Usage: fuaran-conformance <adapter-module> [--corpus <dir>] [--json <file>]\\n\\n' +\n ' <adapter-module> module exporting `adapter` (decode/encode hooks) and\\n' +\n ' `implementation` ({ name, version? })\\n' +\n ' --corpus <dir> certify against an external corpus checkout instead of\\n' +\n ' the snapshot bundled with this package\\n' +\n ' --json <file> also write the structured report as JSON\\n',\n );\n process.exit(1);\n};\n\nconst args = process.argv.slice(2);\nlet modulePath: string | undefined;\nlet corpusRoot: string | undefined;\nlet jsonOut: string | undefined;\n\nfor (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === '--corpus') corpusRoot = args[++i] ?? usage();\n else if (arg === '--json') jsonOut = args[++i] ?? usage();\n else if (modulePath === undefined && arg !== undefined && !arg.startsWith('--')) {\n modulePath = arg;\n } else usage();\n}\nif (modulePath === undefined) usage();\n\nconst loaded = (await import(pathToFileURL(resolve(modulePath as string)).href)) as AdapterModule;\nconst adapter = loaded.adapter ?? loaded.default?.adapter;\nconst implementation = loaded.implementation ?? loaded.default?.implementation;\nif (adapter === undefined || implementation === undefined) {\n console.error(\n `The adapter module must export \\`adapter\\` and \\`implementation\\` ` +\n `(named or on the default export). Loaded: ${modulePath}`,\n );\n process.exit(1);\n}\n\nconst report = runConformance(adapter, {\n implementation,\n ...(corpusRoot === undefined ? {} : { corpusRoot }),\n});\n\nconsole.log(formatReport(report));\nif (jsonOut !== undefined) {\n writeFileSync(jsonOut, JSON.stringify(report, null, 2) + '\\n', 'utf8');\n console.log(`\\nStructured report written to ${jsonOut}`);\n}\n\nprocess.exit(\n report.verdict === 'conformant' ? 0 : report.verdict === 'partially-conformant' ? 2 : 1,\n);\n"]}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.15_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","../src/corpus.ts","../src/report.ts","../src/run.ts"],"names":["fileURLToPath","readFileSync","join","createHash","Ajv2020"],"mappings":";;;;;;;;;AAKA,IAAM,gBAAA,GAAmB,MACvB,OAAO,QAAA,KAAa,WAAA,GAChB,IAAI,GAAA,CAAI,CAAA,KAAA,EAAQ,UAAU,CAAA,CAAE,CAAA,CAAE,IAAA,GAC7B,QAAA,CAAS,aAAA,IAAiB,QAAA,CAAS,aAAA,CAAc,OAAA,CAAQ,WAAA,EAAY,KAAM,QAAA,GAC1E,QAAA,CAAS,aAAA,CAAc,GAAA,GACvB,IAAI,GAAA,CAAI,SAAA,EAAW,QAAA,CAAS,OAAO,CAAA,CAAE,IAAA;AAEtC,IAAM,gCAAgC,gBAAA,EAAiB;AC2D9D,IAAM,WAAA,GAAc;AAAA;AAAA,EAElBA,iBAAA,CAAc,IAAI,GAAA,CAAI,YAAA,EAAc,aAAe,CAAC;AAAA,CAAA;AAO/C,IAAM,UAAA,GAAa,CAAC,OAAA,KAAuD;AAChF,EAAA,MAAM,WAAW,OAAA,EAAS,UAAA;AAC1B,EAAA,MAAM,IAAA,GAAO,YAAY,WAAA,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ject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","// ============================================================================\n// @fuaran-ui/conformance — corpus loading + versioning.\n//\n// The package bundles a snapshot of the canonical wire-format conformance\n// corpus (`corpus/` — manifest.json + schema.json + nodes/ + ops/ + reject/),\n// so a third party needs nothing beyond `npm install` to certify. The\n// snapshot is synced from the authoritative workspace `wire-format-fixtures/`\n// corpus by `scripts/sync-corpus.mjs` and guarded byte-for-byte by the\n// package's own test suite, so it cannot silently drift from the authority.\n//\n// Every report names the corpus it certified against: the manifest `version`\n// plus a SHA-256 digest over the manifest, the schema, and every fixture\n// payload in manifest order. Certification is per corpus version — content\n// advances with the spec (WIRE_FORMAT.md §11), and a report against an older\n// digest does not certify conformance with a newer one.\n// ============================================================================\n\nimport { createHash } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport type FixtureKind =\n | 'node-round-trip'\n | 'op-round-trip'\n | 'reject'\n | 'lenient-accept'\n // WIRE_FORMAT.md §15 wire-versioning envelope + tolerance.\n | 'envelope-round-trip'\n | 'envelope-reject'\n // WIRE_FORMAT.md §18 elicitation envelope + answer conformance.\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer-accept'\n | 'elicitation-answer-reject';\n\nexport interface CorpusFixture {\n readonly id: string;\n readonly kind: FixtureKind;\n readonly decoder: 'node' | 'op' | 'elicitation' | 'elicitation-outcome' | 'elicitation-answer';\n readonly inputFile: string;\n readonly expectedFile?: string;\n readonly expectedErrorCode?: string;\n readonly expectedPath?: string;\n readonly description: string;\n}\n\ninterface Manifest {\n readonly version: number;\n readonly schema: string;\n readonly description: string;\n readonly fixtures: readonly CorpusFixture[];\n}\n\nexport interface Corpus {\n /** Absolute directory the corpus was loaded from. */\n readonly root: string;\n /** `bundled` (the package snapshot) or `external` (a caller-supplied root). */\n readonly source: 'bundled' | 'external';\n /** The manifest `version` field — the corpus major version. */\n readonly manifestVersion: number;\n readonly fixtures: readonly CorpusFixture[];\n /** SHA-256 (hex) over manifest.json + schema.json + every fixture payload in manifest order. */\n readonly digest: string;\n /** The canonical Draft 2020-12 JSON Schema (wire-format-fixtures/schema.json). */\n readonly schema: object;\n /** Read a corpus-relative payload file as UTF-8 text. */\n readonly read: (relPath: string) => string;\n}\n\n/** The bundled snapshot directory, resolved relative to the built module. */\nconst bundledRoot = (): string =>\n // dist/index.js → ../corpus (tsup `shims: true` provides import.meta.url under CJS).\n fileURLToPath(new URL('../corpus/', import.meta.url));\n\n/**\n * Load the conformance corpus. With no options, loads the snapshot bundled in\n * this package; pass `corpusRoot` to certify against an external corpus\n * checkout (e.g. the workspace `wire-format-fixtures/` directory).\n */\nexport const loadCorpus = (options?: { readonly corpusRoot?: string }): Corpus => {\n const external = options?.corpusRoot;\n const root = external ?? bundledRoot();\n const read = (relPath: string): string => readFileSync(join(root, relPath), 'utf8');\n\n const manifestText = read('manifest.json');\n const manifest = JSON.parse(manifestText) as Manifest;\n\n const hash = createHash('sha256');\n hash.update(manifestText);\n hash.update(read(manifest.schema));\n for (const f of manifest.fixtures) {\n hash.update(read(f.inputFile));\n if (f.expectedFile !== undefined && f.expectedFile !== f.inputFile)\n hash.update(read(f.expectedFile));\n }\n\n return {\n root,\n source: external === undefined ? 'bundled' : 'external',\n manifestVersion: manifest.version,\n fixtures: manifest.fixtures,\n digest: hash.digest('hex'),\n schema: JSON.parse(read(manifest.schema)) as object,\n read,\n };\n};\n","// ============================================================================\n// @fuaran-ui/conformance — the certification report.\n//\n// One `LegResult` per conformance leg. A leg is `skipped` (never attempted)\n// when the adapter lacks the hooks it needs — that is a capability statement,\n// not a failure. The verdict distinguishes the three honest outcomes:\n//\n// conformant every mandatory leg attempted and passed\n// partially-conformant every attempted leg passed; ≥1 mandatory leg skipped\n// non-conformant ≥1 attempted leg failed\n//\n// so a partial host (decode-only, node-only, …) certifies the legs it\n// implements rather than receiving a blanket fail.\n// ============================================================================\n\nimport type { ImplementationInfo } from './adapter.js';\n\nexport type LegId =\n | 'node-decode'\n | 'node-byte-identity'\n | 'node-reject'\n | 'op-decode'\n | 'op-byte-identity'\n | 'op-reject'\n | 'lenient-accept'\n | 'envelope-round-trip'\n | 'envelope-reject'\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer'\n | 'schema-validation'\n | 'apply';\n\nexport type LegStatus = 'pass' | 'fail' | 'skipped';\n\nexport interface FixtureFailure {\n readonly fixtureId: string;\n readonly summary: string;\n readonly detail?: string;\n}\n\nexport interface LegResult {\n readonly leg: LegId;\n /** Mandatory legs must all pass for the `conformant` verdict. */\n readonly mandatory: boolean;\n readonly status: LegStatus;\n /** Why the leg was not attempted (only when `status === 'skipped'`). */\n readonly skipReason?: string;\n readonly fixturesTotal: number;\n readonly fixturesPassed: number;\n readonly failures: readonly FixtureFailure[];\n}\n\nexport type Verdict = 'conformant' | 'partially-conformant' | 'non-conformant';\n\nexport interface ConformanceReport {\n readonly kit: { readonly name: string; readonly version: string };\n readonly implementation: ImplementationInfo;\n readonly corpus: {\n readonly manifestVersion: number;\n readonly digest: string;\n readonly fixtureCount: number;\n readonly source: 'bundled' | 'external';\n };\n readonly legs: readonly LegResult[];\n readonly verdict: Verdict;\n /** ISO-8601 generation timestamp. */\n readonly generatedAt: string;\n}\n\nexport const computeVerdict = (legs: readonly LegResult[]): Verdict => {\n if (legs.some((l) => l.status === 'fail')) return 'non-conformant';\n if (legs.some((l) => l.mandatory && l.status === 'skipped')) return 'partially-conformant';\n return 'conformant';\n};\n\nconst statusGlyph: Record<LegStatus, string> = { pass: '✓', fail: '✗', skipped: '–' };\n\n/** Render a report as a human-readable text block (what the CLI prints). */\nexport const formatReport = (report: ConformanceReport): string => {\n const lines: string[] = [];\n const impl =\n report.implementation.version === undefined\n ? report.implementation.name\n : `${report.implementation.name} ${report.implementation.version}`;\n lines.push(`Fuaran wire-format conformance report`);\n lines.push(` kit ${report.kit.name}@${report.kit.version}`);\n lines.push(` implementation ${impl}`);\n lines.push(\n ` corpus v${report.corpus.manifestVersion} (${report.corpus.fixtureCount} fixtures, ${report.corpus.source})`,\n );\n lines.push(` corpus digest sha256:${report.corpus.digest}`);\n lines.push(` generated ${report.generatedAt}`);\n lines.push('');\n for (const leg of report.legs) {\n const tier = leg.mandatory ? 'mandatory' : 'optional ';\n const counts =\n leg.status === 'skipped'\n ? (leg.skipReason ?? 'skipped')\n : `${leg.fixturesPassed}/${leg.fixturesTotal}`;\n lines.push(` ${statusGlyph[leg.status]} ${leg.leg.padEnd(20)} ${tier} ${counts}`);\n for (const f of leg.failures) {\n lines.push(` ${f.fixtureId}: ${f.summary}`);\n if (f.detail !== undefined)\n for (const detailLine of f.detail.split('\\n')) lines.push(` ${detailLine}`);\n }\n }\n lines.push('');\n lines.push(` verdict: ${report.verdict.toUpperCase()}`);\n if (report.verdict === 'partially-conformant') {\n const skipped = report.legs\n .filter((l) => l.mandatory && l.status === 'skipped')\n .map((l) => l.leg);\n lines.push(` (mandatory legs not attempted: ${skipped.join(', ')})`);\n }\n lines.push(\n ` Certification is per corpus version — re-certify when the corpus advances (WIRE_FORMAT.md §11).`,\n );\n return lines.join('\\n');\n};\n","// ============================================================================\n// @fuaran-ui/conformance — the runner.\n//\n// Drives a candidate implementation (the `ConformanceAdapter`) over the\n// canonical corpus and produces a per-leg `ConformanceReport`. The assertion\n// semantics are exactly those of the in-house cross-implementation gate\n// (wire-format-fixtures/conformance/cross-host-conformance.mjs + the F#\n// Fuaran.UI.JsonDecode.Tests suite), packaged behind the adapter seam:\n//\n// node-decode / op-decode decode(inputFile) succeeds on every accept\n// fixture (the host accepts everything the\n// contract admits).\n// node-byte-identity / encode(decode(inputFile)) is byte-identical\n// op-byte-identity to expectedFile — the committed corpus IS\n// the canonical form, so byte-equality with it\n// is byte-equality with every conformant host.\n// node-reject / op-reject decode(inputFile) fails with the manifest's\n// expectedErrorCode at a path starting with\n// expectedPath (WIRE_FORMAT.md §6).\n// lenient-accept decode(inputFile) — a §16 SHORTHAND form —\n// succeeds AND encode(decode(inputFile)) is\n// byte-identical to expectedFile (the verbose\n// canonical form). Mandatory: a host that\n// rejects the shorthand, or normalises it to\n// different bytes, silently strands AI authors\n// (WIRE_FORMAT.md §16 normative block).\n// schema-validation the host's re-encoded output validates\n// against the canonical Draft 2020-12 schema\n// (schema.json) — only outputs that already\n// passed byte-identity are validated.\n// apply reserved; corpus v1 ships no apply fixtures.\n//\n// Exceptions thrown by adapter hooks are recorded as fixture failures, never\n// propagated — a crashing codec is a non-conformance finding, not a runner\n// crash.\n// ============================================================================\n\n// The named class export is the one binding ajv's CJS dist exposes identically\n// under every loader (NodeNext ESM, CJS require, bundlers) — the default-import\n// interop differs per loader and is avoided deliberately.\nimport { Ajv2020 } from 'ajv/dist/2020.js';\n\nimport type { AdapterDecodeResult, ConformanceAdapter, ImplementationInfo } from './adapter.js';\nimport { loadCorpus, type Corpus, type CorpusFixture } from './corpus.js';\nimport {\n computeVerdict,\n type ConformanceReport,\n type FixtureFailure,\n type LegId,\n type LegResult,\n} from './report.js';\n\nexport const KIT_NAME = '@fuaran-ui/conformance';\nexport const KIT_VERSION = '0.1.0';\n\nexport interface RunOptions {\n /** Names the candidate implementation in the report. */\n readonly implementation: ImplementationInfo;\n /** Certify against an external corpus checkout instead of the bundled snapshot. */\n readonly corpusRoot?: string;\n}\n\n// Fixtures are single-line compact JSON without a trailing newline; strip at\n// most one defensively so an editor/git autocrlf touch on a corpus payload\n// can't masquerade as a host divergence (the in-house gate's convention).\nconst canon = (s: string): string => s.replace(/\\r?\\n$/, '');\n\n/** First byte offset at which two strings differ, with a context window. */\nconst firstDiff = (expected: string, actual: string): string => {\n const n = Math.min(expected.length, actual.length);\n let i = 0;\n while (i < n && expected[i] === actual[i]) i++;\n const from = Math.max(0, i - 30);\n const win = (s: string): string => JSON.stringify(s.slice(from, i + 30));\n return (\n `byte offset ${i} (length canonical=${expected.length}, host=${actual.length})\\n` +\n ` canonical …${win(expected)}…\\n` +\n ` host …${win(actual)}…`\n );\n};\n\nconst messageOf = (err: unknown): string => (err instanceof Error ? err.message : String(err));\n\ninterface LegAccumulator {\n total: number;\n passed: number;\n failures: FixtureFailure[];\n}\n\nconst newAcc = (): LegAccumulator => ({ total: 0, passed: 0, failures: [] });\n\nconst toLeg = (\n leg: LegId,\n mandatory: boolean,\n acc: LegAccumulator | undefined,\n skipReason?: string,\n): LegResult =>\n acc === undefined\n ? {\n leg,\n mandatory,\n status: 'skipped',\n ...(skipReason === undefined ? {} : { skipReason }),\n fixturesTotal: 0,\n fixturesPassed: 0,\n failures: [],\n }\n : {\n leg,\n mandatory,\n status: acc.failures.length === 0 ? 'pass' : 'fail',\n fixturesTotal: acc.total,\n fixturesPassed: acc.passed,\n failures: acc.failures,\n };\n\n/** Run the certification kit: corpus × adapter → report. */\nexport const runConformance = (\n adapter: ConformanceAdapter,\n options: RunOptions,\n): ConformanceReport => {\n const corpus: Corpus = loadCorpus(\n options.corpusRoot === undefined ? undefined : { corpusRoot: options.corpusRoot },\n );\n\n const ajv = new Ajv2020({ strict: false, allErrors: true });\n const schemaValid = ajv.compile(corpus.schema);\n\n const accepts = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter(\n (f) => f.decoder === decoder && (f.kind === 'node-round-trip' || f.kind === 'op-round-trip'),\n );\n const rejects = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'reject');\n const lenients = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'lenient-accept');\n\n // Per-leg accumulators — undefined means the adapter lacks the hooks for the leg.\n const accs = new Map<LegId, LegAccumulator>();\n const acc = (leg: LegId): LegAccumulator => {\n let a = accs.get(leg);\n if (a === undefined) {\n a = newAcc();\n accs.set(leg, a);\n }\n return a;\n };\n\n const runSide = (\n decoder: 'node' | 'op',\n decode: ((json: string) => AdapterDecodeResult) | undefined,\n encode: ((value: unknown) => string) | undefined,\n ): void => {\n const decodeLeg: LegId = decoder === 'node' ? 'node-decode' : 'op-decode';\n const byteLeg: LegId = decoder === 'node' ? 'node-byte-identity' : 'op-byte-identity';\n const rejectLeg: LegId = decoder === 'node' ? 'node-reject' : 'op-reject';\n\n if (decode === undefined) return;\n\n for (const f of accepts(decoder)) {\n const input = corpus.read(f.inputFile);\n const d = acc(decodeLeg);\n d.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on an accept fixture (a conformant decoder never throws)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected an accept fixture',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n d.passed++;\n\n if (encode === undefined) continue;\n const b = acc(byteLeg);\n b.total++;\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded accept fixture',\n detail: messageOf(err),\n });\n continue;\n }\n if (actual !== expected) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder output diverges from the canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n b.passed++;\n\n // Schema-validate the host's own (byte-identical) output — proves the\n // host emits schema-valid wire, not merely corpus-identical wire.\n const s = acc('schema-validation');\n s.total++;\n if (schemaValid(JSON.parse(actual))) {\n s.passed++;\n } else {\n s.failures.push({\n fixtureId: f.id,\n summary: 'encoder output fails the canonical JSON Schema (schema.json)',\n detail: (schemaValid.errors ?? [])\n .map((e) => `${e.instancePath === '' ? '$' : e.instancePath} ${e.message ?? ''}`)\n .join('\\n'),\n });\n }\n }\n\n // Lenient-accept (§16): the shorthand MUST decode, and MUST normalise to\n // the verbose canonical bytes. Needs both hooks — with decode only, the\n // leg stays unattempted (skipped), same capability semantics as\n // byte-identity.\n if (encode !== undefined) {\n for (const f of lenients(decoder)) {\n const input = corpus.read(f.inputFile);\n const l = acc('lenient-accept');\n l.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a §16 shorthand (a conformant decoder accepts it)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected a §16 shorthand (MUST accept — WIRE_FORMAT §16)',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded §16 shorthand',\n detail: messageOf(err),\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (actual !== expected) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'shorthand normalisation diverges from the verbose canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n l.passed++;\n }\n }\n\n for (const f of rejects(decoder)) {\n const input = corpus.read(f.inputFile);\n const r = acc(rejectLeg);\n r.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (decoded.ok) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (decoded.error.code !== f.expectedErrorCode) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${decoded.error.code} (path ${decoded.error.path})`,\n });\n continue;\n }\n if (!decoded.error.path.startsWith(f.expectedPath ?? '$')) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${decoded.error.path} (code ${decoded.error.code})`,\n });\n continue;\n }\n r.passed++;\n }\n };\n\n runSide('node', adapter.decodeNode, adapter.encodeNode);\n runSide('op', adapter.decodeOp, adapter.encodeOp);\n\n // Envelope / tolerance (WIRE_FORMAT.md §15). `negotiateEnvelope` reads the\n // envelope, negotiates against the host's own core@1.0, and either refuses a\n // Foreign profile or returns the whole envelope re-encoded (unknown kinds\n // preserved). A round-trip fixture asserts the re-encode is byte-identical to\n // expectedFile; a reject fixture asserts the FOREIGN_PROFILE refusal.\n const negotiateEnvelope = adapter.negotiateEnvelope;\n if (negotiateEnvelope !== undefined) {\n const byKind = (kind: 'envelope-round-trip' | 'envelope-reject'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.kind === kind);\n\n for (const f of byKind('envelope-round-trip')) {\n const a = acc('envelope-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope refused a round-trip fixture (Current/Behind must be tolerated)',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'envelope re-encode diverges from the canonical form (must-ignore-but-preserve)',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of byKind('envelope-reject')) {\n const a = acc('envelope-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope ACCEPTED a Foreign artifact (must hard-refuse)',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n // Elicitation envelope + answer conformance (WIRE_FORMAT.md §18).\n // `roundTripElicitation` decodes with the fixture's decoder-named entry\n // point and re-encodes; `validateAnswerDocument` runs the §18.4 answer-\n // conformance gate over a {answer, contract} document.\n const roundTripElicitation = adapter.roundTripElicitation;\n if (roundTripElicitation !== undefined) {\n const elDecoder = (f: CorpusFixture): 'elicitation' | 'elicitation-outcome' =>\n f.decoder === 'elicitation-outcome' ? 'elicitation-outcome' : 'elicitation';\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-round-trip')) {\n const a = acc('elicitation-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation refused a round-trip fixture',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'elicitation re-encode diverges from the canonical form',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-reject')) {\n const a = acc('elicitation-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const validateAnswerDocument = adapter.validateAnswerDocument;\n if (validateAnswerDocument !== undefined) {\n for (const f of corpus.fixtures.filter(\n (x) => x.kind === 'elicitation-answer-accept' || x.kind === 'elicitation-answer-reject',\n )) {\n const a = acc('elicitation-answer');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = validateAnswerDocument(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument THREW (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (f.kind === 'elicitation-answer-accept') {\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument refused a conforming answer',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument ACCEPTED a nonconforming answer',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const need = (hooks: readonly string[]): string =>\n `adapter does not provide ${hooks.join(' + ')}`;\n const hasSchemaInput = adapter.encodeNode !== undefined || adapter.encodeOp !== undefined;\n\n const legs: LegResult[] = [\n toLeg('node-decode', true, accs.get('node-decode'), need(['decodeNode'])),\n toLeg(\n 'node-byte-identity',\n true,\n accs.get('node-byte-identity'),\n need(['decodeNode', 'encodeNode']),\n ),\n toLeg('node-reject', true, accs.get('node-reject'), need(['decodeNode'])),\n toLeg('op-decode', true, accs.get('op-decode'), need(['decodeOp'])),\n toLeg('op-byte-identity', true, accs.get('op-byte-identity'), need(['decodeOp', 'encodeOp'])),\n toLeg('op-reject', true, accs.get('op-reject'), need(['decodeOp'])),\n toLeg(\n 'lenient-accept',\n true,\n accs.get('lenient-accept'),\n need(['a decode + encode hook pair (node and/or op)']),\n ),\n toLeg(\n 'envelope-round-trip',\n true,\n accs.get('envelope-round-trip'),\n need(['negotiateEnvelope']),\n ),\n toLeg('envelope-reject', true, accs.get('envelope-reject'), need(['negotiateEnvelope'])),\n toLeg(\n 'elicitation-round-trip',\n true,\n accs.get('elicitation-round-trip'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-reject',\n true,\n accs.get('elicitation-reject'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-answer',\n true,\n accs.get('elicitation-answer'),\n need(['validateAnswerDocument']),\n ),\n toLeg(\n 'schema-validation',\n true,\n accs.get('schema-validation'),\n hasSchemaInput\n ? need(['a decode hook for the encode hooks provided'])\n : need(['encodeNode and/or encodeOp']),\n ),\n toLeg('apply', false, undefined, 'corpus v1 ships no apply fixtures — leg reserved'),\n ];\n\n return {\n kit: { name: KIT_NAME, version: KIT_VERSION },\n implementation: options.implementation,\n corpus: {\n manifestVersion: corpus.manifestVersion,\n digest: corpus.digest,\n fixtureCount: corpus.fixtures.length,\n source: corpus.source,\n },\n legs,\n verdict: computeVerdict(legs),\n generatedAt: new Date().toISOString(),\n };\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.15_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","../src/corpus.ts","../src/report.ts","../src/run.ts"],"names":["fileURLToPath","readFileSync","join","createHash","Ajv2020"],"mappings":";;;;;;;;;AAKA,IAAM,gBAAA,GAAmB,MACvB,OAAO,QAAA,KAAa,WAAA,GAChB,IAAI,GAAA,CAAI,CAAA,KAAA,EAAQ,UAAU,CAAA,CAAE,CAAA,CAAE,IAAA,GAC7B,QAAA,CAAS,aAAA,IAAiB,QAAA,CAAS,aAAA,CAA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;AAAA,IAC5C,gBAAgB,OAAA,CAAQ,cAAA;AAAA,IACxB,MAAA,EAAQ;AAAA,MACN,iBAAiB,MAAA,CAAO,eAAA;AAAA,MACxB,QAAQ,MAAA,CAAO,MAAA;AAAA,MACf,YAAA,EAAc,OAAO,QAAA,CAAS,MAAA;AAAA,MAC9B,QAAQ,MAAA,CAAO;AAAA,KACjB;AAAA,IACA,IAAA;AAAA,IACA,OAAA,EAAS,eAAe,IAAI,CAAA;AAAA,IAC5B,WAAA,EAAA,iBAAa,IAAI,IAAA,EAAK,EAAE,WAAA;AAAY,GACtC;AACF","file":"index.cjs","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","// ============================================================================\n// @fuaran-ui/conformance — corpus loading + versioning.\n//\n// The package bundles a snapshot of the canonical wire-format conformance\n// corpus under `corpus/` — manifest.json + schema.json + every fixture family\n// the manifest enumerates — so a third party needs nothing beyond\n// `npm install` to certify. The snapshot is synced from the authoritative\n// `wire-format-fixtures/` corpus by `scripts/sync-corpus.mjs`, and the same\n// script's `--check` mode guards it byte-for-byte from the package's own test\n// suite, so it cannot silently drift from the authority.\n//\n// Every report names the corpus it certified against: the manifest `version`\n// plus a SHA-256 digest over the manifest, the schema, and every fixture\n// payload in manifest order. Certification is per corpus version — content\n// advances with the spec (WIRE_FORMAT.md §11), and a report against an older\n// digest does not certify conformance with a newer one.\n// ============================================================================\n\nimport { createHash } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport type FixtureKind =\n | 'node-round-trip'\n | 'op-round-trip'\n | 'reject'\n | 'lenient-accept'\n // WIRE_FORMAT.md §15 wire-versioning envelope + tolerance.\n | 'envelope-round-trip'\n | 'envelope-reject'\n // WIRE_FORMAT.md §18 elicitation envelope + answer conformance.\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer-accept'\n | 'elicitation-answer-reject';\n\nexport interface CorpusFixture {\n readonly id: string;\n readonly kind: FixtureKind;\n readonly decoder: 'node' | 'op' | 'elicitation' | 'elicitation-outcome' | 'elicitation-answer';\n readonly inputFile: string;\n readonly expectedFile?: string;\n readonly expectedErrorCode?: string;\n readonly expectedPath?: string;\n readonly description: string;\n}\n\ninterface Manifest {\n readonly version: number;\n readonly schema: string;\n readonly description: string;\n readonly fixtures: readonly CorpusFixture[];\n}\n\nexport interface Corpus {\n /** Absolute directory the corpus was loaded from. */\n readonly root: string;\n /** `bundled` (the package snapshot) or `external` (a caller-supplied root). */\n readonly source: 'bundled' | 'external';\n /** The manifest `version` field — the corpus major version. */\n readonly manifestVersion: number;\n readonly fixtures: readonly CorpusFixture[];\n /** SHA-256 (hex) over manifest.json + schema.json + every fixture payload in manifest order. */\n readonly digest: string;\n /** The canonical Draft 2020-12 JSON Schema (wire-format-fixtures/schema.json). */\n readonly schema: object;\n /** Read a corpus-relative payload file as UTF-8 text. */\n readonly read: (relPath: string) => string;\n}\n\n/** The bundled snapshot directory, resolved relative to the built module. */\nconst bundledRoot = (): string =>\n // dist/index.js → ../corpus (tsup `shims: true` provides import.meta.url under CJS).\n fileURLToPath(new URL('../corpus/', import.meta.url));\n\n/**\n * Load the conformance corpus. With no options, loads the snapshot bundled in\n * this package; pass `corpusRoot` to certify against an external corpus\n * checkout (e.g. the workspace `wire-format-fixtures/` directory).\n */\nexport const loadCorpus = (options?: { readonly corpusRoot?: string }): Corpus => {\n const external = options?.corpusRoot;\n const root = external ?? bundledRoot();\n const read = (relPath: string): string => readFileSync(join(root, relPath), 'utf8');\n\n const manifestText = read('manifest.json');\n const manifest = JSON.parse(manifestText) as Manifest;\n\n const hash = createHash('sha256');\n hash.update(manifestText);\n hash.update(read(manifest.schema));\n for (const f of manifest.fixtures) {\n hash.update(read(f.inputFile));\n if (f.expectedFile !== undefined && f.expectedFile !== f.inputFile)\n hash.update(read(f.expectedFile));\n }\n\n return {\n root,\n source: external === undefined ? 'bundled' : 'external',\n manifestVersion: manifest.version,\n fixtures: manifest.fixtures,\n digest: hash.digest('hex'),\n schema: JSON.parse(read(manifest.schema)) as object,\n read,\n };\n};\n","// ============================================================================\n// @fuaran-ui/conformance — the certification report.\n//\n// One `LegResult` per conformance leg. A leg is `skipped` (never attempted)\n// when the adapter lacks the hooks it needs — that is a capability statement,\n// not a failure. The verdict distinguishes the three honest outcomes:\n//\n// conformant every mandatory leg attempted and passed\n// partially-conformant every attempted leg passed; ≥1 mandatory leg skipped\n// non-conformant ≥1 attempted leg failed\n//\n// so a partial host (decode-only, node-only, …) certifies the legs it\n// implements rather than receiving a blanket fail.\n// ============================================================================\n\nimport type { ImplementationInfo } from './adapter.js';\n\nexport type LegId =\n | 'node-decode'\n | 'node-byte-identity'\n | 'node-reject'\n | 'op-decode'\n | 'op-byte-identity'\n | 'op-reject'\n | 'lenient-accept'\n | 'envelope-round-trip'\n | 'envelope-reject'\n | 'elicitation-round-trip'\n | 'elicitation-reject'\n | 'elicitation-answer'\n | 'schema-validation'\n | 'apply';\n\nexport type LegStatus = 'pass' | 'fail' | 'skipped';\n\nexport interface FixtureFailure {\n readonly fixtureId: string;\n readonly summary: string;\n readonly detail?: string;\n}\n\nexport interface LegResult {\n readonly leg: LegId;\n /** Mandatory legs must all pass for the `conformant` verdict. */\n readonly mandatory: boolean;\n readonly status: LegStatus;\n /** Why the leg was not attempted (only when `status === 'skipped'`). */\n readonly skipReason?: string;\n readonly fixturesTotal: number;\n readonly fixturesPassed: number;\n readonly failures: readonly FixtureFailure[];\n}\n\nexport type Verdict = 'conformant' | 'partially-conformant' | 'non-conformant';\n\nexport interface ConformanceReport {\n readonly kit: { readonly name: string; readonly version: string };\n readonly implementation: ImplementationInfo;\n readonly corpus: {\n readonly manifestVersion: number;\n readonly digest: string;\n readonly fixtureCount: number;\n readonly source: 'bundled' | 'external';\n };\n readonly legs: readonly LegResult[];\n readonly verdict: Verdict;\n /** ISO-8601 generation timestamp. */\n readonly generatedAt: string;\n}\n\nexport const computeVerdict = (legs: readonly LegResult[]): Verdict => {\n if (legs.some((l) => l.status === 'fail')) return 'non-conformant';\n if (legs.some((l) => l.mandatory && l.status === 'skipped')) return 'partially-conformant';\n return 'conformant';\n};\n\nconst statusGlyph: Record<LegStatus, string> = { pass: '✓', fail: '✗', skipped: '–' };\n\n/** Render a report as a human-readable text block (what the CLI prints). */\nexport const formatReport = (report: ConformanceReport): string => {\n const lines: string[] = [];\n const impl =\n report.implementation.version === undefined\n ? report.implementation.name\n : `${report.implementation.name} ${report.implementation.version}`;\n lines.push(`Fuaran wire-format conformance report`);\n lines.push(` kit ${report.kit.name}@${report.kit.version}`);\n lines.push(` implementation ${impl}`);\n lines.push(\n ` corpus v${report.corpus.manifestVersion} (${report.corpus.fixtureCount} fixtures, ${report.corpus.source})`,\n );\n lines.push(` corpus digest sha256:${report.corpus.digest}`);\n lines.push(` generated ${report.generatedAt}`);\n lines.push('');\n for (const leg of report.legs) {\n const tier = leg.mandatory ? 'mandatory' : 'optional ';\n const counts =\n leg.status === 'skipped'\n ? (leg.skipReason ?? 'skipped')\n : `${leg.fixturesPassed}/${leg.fixturesTotal}`;\n lines.push(` ${statusGlyph[leg.status]} ${leg.leg.padEnd(20)} ${tier} ${counts}`);\n for (const f of leg.failures) {\n lines.push(` ${f.fixtureId}: ${f.summary}`);\n if (f.detail !== undefined)\n for (const detailLine of f.detail.split('\\n')) lines.push(` ${detailLine}`);\n }\n }\n lines.push('');\n lines.push(` verdict: ${report.verdict.toUpperCase()}`);\n if (report.verdict === 'partially-conformant') {\n const skipped = report.legs\n .filter((l) => l.mandatory && l.status === 'skipped')\n .map((l) => l.leg);\n lines.push(` (mandatory legs not attempted: ${skipped.join(', ')})`);\n }\n lines.push(\n ` Certification is per corpus version — re-certify when the corpus advances (WIRE_FORMAT.md §11).`,\n );\n return lines.join('\\n');\n};\n","// ============================================================================\n// @fuaran-ui/conformance — the runner.\n//\n// Drives a candidate implementation (the `ConformanceAdapter`) over the\n// canonical corpus and produces a per-leg `ConformanceReport`. The assertion\n// semantics are exactly those of the in-house cross-implementation gate\n// (wire-format-fixtures/conformance/cross-host-conformance.mjs + the F#\n// Fuaran.UI.JsonDecode.Tests suite), packaged behind the adapter seam:\n//\n// node-decode / op-decode decode(inputFile) succeeds on every accept\n// fixture (the host accepts everything the\n// contract admits).\n// node-byte-identity / encode(decode(inputFile)) is byte-identical\n// op-byte-identity to expectedFile — the committed corpus IS\n// the canonical form, so byte-equality with it\n// is byte-equality with every conformant host.\n// node-reject / op-reject decode(inputFile) fails with the manifest's\n// expectedErrorCode at a path starting with\n// expectedPath (WIRE_FORMAT.md §6).\n// lenient-accept decode(inputFile) — a §16 SHORTHAND form —\n// succeeds AND encode(decode(inputFile)) is\n// byte-identical to expectedFile (the verbose\n// canonical form). Mandatory: a host that\n// rejects the shorthand, or normalises it to\n// different bytes, silently strands AI authors\n// (WIRE_FORMAT.md §16 normative block).\n// schema-validation the host's re-encoded output validates\n// against the canonical Draft 2020-12 schema\n// (schema.json) — only outputs that already\n// passed byte-identity are validated.\n// apply reserved; corpus v1 ships no apply fixtures.\n//\n// Exceptions thrown by adapter hooks are recorded as fixture failures, never\n// propagated — a crashing codec is a non-conformance finding, not a runner\n// crash.\n// ============================================================================\n\n// The named class export is the one binding ajv's CJS dist exposes identically\n// under every loader (NodeNext ESM, CJS require, bundlers) — the default-import\n// interop differs per loader and is avoided deliberately.\nimport { Ajv2020 } from 'ajv/dist/2020.js';\n\nimport type { AdapterDecodeResult, ConformanceAdapter, ImplementationInfo } from './adapter.js';\nimport { loadCorpus, type Corpus, type CorpusFixture } from './corpus.js';\nimport {\n computeVerdict,\n type ConformanceReport,\n type FixtureFailure,\n type LegId,\n type LegResult,\n} from './report.js';\n\nexport const KIT_NAME = '@fuaran-ui/conformance';\nexport const KIT_VERSION = '0.1.0';\n\nexport interface RunOptions {\n /** Names the candidate implementation in the report. */\n readonly implementation: ImplementationInfo;\n /** Certify against an external corpus checkout instead of the bundled snapshot. */\n readonly corpusRoot?: string;\n}\n\n// Fixtures are single-line compact JSON without a trailing newline; strip at\n// most one defensively so an editor/git autocrlf touch on a corpus payload\n// can't masquerade as a host divergence (the in-house gate's convention).\nconst canon = (s: string): string => s.replace(/\\r?\\n$/, '');\n\n/** First byte offset at which two strings differ, with a context window. */\nconst firstDiff = (expected: string, actual: string): string => {\n const n = Math.min(expected.length, actual.length);\n let i = 0;\n while (i < n && expected[i] === actual[i]) i++;\n const from = Math.max(0, i - 30);\n const win = (s: string): string => JSON.stringify(s.slice(from, i + 30));\n return (\n `byte offset ${i} (length canonical=${expected.length}, host=${actual.length})\\n` +\n ` canonical …${win(expected)}…\\n` +\n ` host …${win(actual)}…`\n );\n};\n\nconst messageOf = (err: unknown): string => (err instanceof Error ? err.message : String(err));\n\ninterface LegAccumulator {\n total: number;\n passed: number;\n failures: FixtureFailure[];\n}\n\nconst newAcc = (): LegAccumulator => ({ total: 0, passed: 0, failures: [] });\n\nconst toLeg = (\n leg: LegId,\n mandatory: boolean,\n acc: LegAccumulator | undefined,\n skipReason?: string,\n): LegResult =>\n acc === undefined\n ? {\n leg,\n mandatory,\n status: 'skipped',\n ...(skipReason === undefined ? {} : { skipReason }),\n fixturesTotal: 0,\n fixturesPassed: 0,\n failures: [],\n }\n : {\n leg,\n mandatory,\n status: acc.failures.length === 0 ? 'pass' : 'fail',\n fixturesTotal: acc.total,\n fixturesPassed: acc.passed,\n failures: acc.failures,\n };\n\n/** Run the certification kit: corpus × adapter → report. */\nexport const runConformance = (\n adapter: ConformanceAdapter,\n options: RunOptions,\n): ConformanceReport => {\n const corpus: Corpus = loadCorpus(\n options.corpusRoot === undefined ? undefined : { corpusRoot: options.corpusRoot },\n );\n\n const ajv = new Ajv2020({ strict: false, allErrors: true });\n const schemaValid = ajv.compile(corpus.schema);\n\n const accepts = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter(\n (f) => f.decoder === decoder && (f.kind === 'node-round-trip' || f.kind === 'op-round-trip'),\n );\n const rejects = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'reject');\n const lenients = (decoder: 'node' | 'op'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.decoder === decoder && f.kind === 'lenient-accept');\n\n // Per-leg accumulators — undefined means the adapter lacks the hooks for the leg.\n const accs = new Map<LegId, LegAccumulator>();\n const acc = (leg: LegId): LegAccumulator => {\n let a = accs.get(leg);\n if (a === undefined) {\n a = newAcc();\n accs.set(leg, a);\n }\n return a;\n };\n\n const runSide = (\n decoder: 'node' | 'op',\n decode: ((json: string) => AdapterDecodeResult) | undefined,\n encode: ((value: unknown) => string) | undefined,\n ): void => {\n const decodeLeg: LegId = decoder === 'node' ? 'node-decode' : 'op-decode';\n const byteLeg: LegId = decoder === 'node' ? 'node-byte-identity' : 'op-byte-identity';\n const rejectLeg: LegId = decoder === 'node' ? 'node-reject' : 'op-reject';\n\n if (decode === undefined) return;\n\n for (const f of accepts(decoder)) {\n const input = corpus.read(f.inputFile);\n const d = acc(decodeLeg);\n d.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on an accept fixture (a conformant decoder never throws)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n d.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected an accept fixture',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n d.passed++;\n\n if (encode === undefined) continue;\n const b = acc(byteLeg);\n b.total++;\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded accept fixture',\n detail: messageOf(err),\n });\n continue;\n }\n if (actual !== expected) {\n b.failures.push({\n fixtureId: f.id,\n summary: 'encoder output diverges from the canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n b.passed++;\n\n // Schema-validate the host's own (byte-identical) output — proves the\n // host emits schema-valid wire, not merely corpus-identical wire.\n const s = acc('schema-validation');\n s.total++;\n if (schemaValid(JSON.parse(actual))) {\n s.passed++;\n } else {\n s.failures.push({\n fixtureId: f.id,\n summary: 'encoder output fails the canonical JSON Schema (schema.json)',\n detail: (schemaValid.errors ?? [])\n .map((e) => `${e.instancePath === '' ? '$' : e.instancePath} ${e.message ?? ''}`)\n .join('\\n'),\n });\n }\n }\n\n // Lenient-accept (§16): the shorthand MUST decode, and MUST normalise to\n // the verbose canonical bytes. Needs both hooks — with decode only, the\n // leg stays unattempted (skipped), same capability semantics as\n // byte-identity.\n if (encode !== undefined) {\n for (const f of lenients(decoder)) {\n const input = corpus.read(f.inputFile);\n const l = acc('lenient-accept');\n l.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a §16 shorthand (a conformant decoder accepts it)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!decoded.ok) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'decoder rejected a §16 shorthand (MUST accept — WIRE_FORMAT §16)',\n detail: `${decoded.error.code} at ${decoded.error.path}${decoded.error.message === undefined ? '' : ` — ${decoded.error.message}`}`,\n });\n continue;\n }\n\n let actual: string;\n try {\n actual = encode(decoded.value);\n } catch (err) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'encoder THREW re-encoding a decoded §16 shorthand',\n detail: messageOf(err),\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (actual !== expected) {\n l.failures.push({\n fixtureId: f.id,\n summary: 'shorthand normalisation diverges from the verbose canonical form',\n detail: firstDiff(expected, actual),\n });\n continue;\n }\n l.passed++;\n }\n }\n\n for (const f of rejects(decoder)) {\n const input = corpus.read(f.inputFile);\n const r = acc(rejectLeg);\n r.total++;\n\n let decoded: AdapterDecodeResult;\n try {\n decoded = decode(input);\n } catch (err) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (decoded.ok) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decoder ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (decoded.error.code !== f.expectedErrorCode) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${decoded.error.code} (path ${decoded.error.path})`,\n });\n continue;\n }\n if (!decoded.error.path.startsWith(f.expectedPath ?? '$')) {\n r.failures.push({\n fixtureId: f.id,\n summary: 'decode-error PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${decoded.error.path} (code ${decoded.error.code})`,\n });\n continue;\n }\n r.passed++;\n }\n };\n\n runSide('node', adapter.decodeNode, adapter.encodeNode);\n runSide('op', adapter.decodeOp, adapter.encodeOp);\n\n // Envelope / tolerance (WIRE_FORMAT.md §15). `negotiateEnvelope` reads the\n // envelope, negotiates against the host's own core@1.0, and either refuses a\n // Foreign profile or returns the whole envelope re-encoded (unknown kinds\n // preserved). A round-trip fixture asserts the re-encode is byte-identical to\n // expectedFile; a reject fixture asserts the FOREIGN_PROFILE refusal.\n const negotiateEnvelope = adapter.negotiateEnvelope;\n if (negotiateEnvelope !== undefined) {\n const byKind = (kind: 'envelope-round-trip' | 'envelope-reject'): readonly CorpusFixture[] =>\n corpus.fixtures.filter((f) => f.kind === kind);\n\n for (const f of byKind('envelope-round-trip')) {\n const a = acc('envelope-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'negotiateEnvelope refused a round-trip fixture (Current/Behind must be tolerated)',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'envelope re-encode diverges from the canonical form (must-ignore-but-preserve)',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of byKind('envelope-reject')) {\n const a = acc('envelope-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = negotiateEnvelope(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'negotiateEnvelope ACCEPTED a Foreign artifact (must hard-refuse)',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n // Elicitation envelope + answer conformance (WIRE_FORMAT.md §18).\n // `roundTripElicitation` decodes with the fixture's decoder-named entry\n // point and re-encodes; `validateAnswerDocument` runs the §18.4 answer-\n // conformance gate over a {answer, contract} document.\n const roundTripElicitation = adapter.roundTripElicitation;\n if (roundTripElicitation !== undefined) {\n const elDecoder = (f: CorpusFixture): 'elicitation' | 'elicitation-outcome' =>\n f.decoder === 'elicitation-outcome' ? 'elicitation-outcome' : 'elicitation';\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-round-trip')) {\n const a = acc('elicitation-round-trip');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a round-trip fixture (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation refused a round-trip fixture',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n const expected = canon(corpus.read(f.expectedFile ?? f.inputFile));\n if (typeof r.value !== 'string' || r.value !== expected) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'elicitation re-encode diverges from the canonical form',\n detail:\n typeof r.value === 'string' ? firstDiff(expected, r.value) : 'value was not a string',\n });\n continue;\n }\n a.passed++;\n }\n\n for (const f of corpus.fixtures.filter((x) => x.kind === 'elicitation-reject')) {\n const a = acc('elicitation-reject');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = roundTripElicitation(elDecoder(f), input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary:\n 'roundTripElicitation THREW on a reject fixture (must return a structured error)',\n detail: messageOf(err),\n });\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'roundTripElicitation ACCEPTED a reject fixture',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const validateAnswerDocument = adapter.validateAnswerDocument;\n if (validateAnswerDocument !== undefined) {\n for (const f of corpus.fixtures.filter(\n (x) => x.kind === 'elicitation-answer-accept' || x.kind === 'elicitation-answer-reject',\n )) {\n const a = acc('elicitation-answer');\n a.total++;\n const input = corpus.read(f.inputFile);\n let r: AdapterDecodeResult;\n try {\n r = validateAnswerDocument(input);\n } catch (err) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument THREW (must return a structured result)',\n detail: messageOf(err),\n });\n continue;\n }\n if (f.kind === 'elicitation-answer-accept') {\n if (!r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument refused a conforming answer',\n detail: `${r.error.code} at ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n continue;\n }\n if (r.ok) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'validateAnswerDocument ACCEPTED a nonconforming answer',\n detail: `expected ${f.expectedErrorCode} at ${f.expectedPath}`,\n });\n continue;\n }\n if (r.error.code !== f.expectedErrorCode) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal CODE diverges from the canonical error',\n detail: `expected ${f.expectedErrorCode}, got ${r.error.code} (path ${r.error.path})`,\n });\n continue;\n }\n if (!r.error.path.startsWith(f.expectedPath ?? '$')) {\n a.failures.push({\n fixtureId: f.id,\n summary: 'refusal PATH diverges from the canonical error',\n detail: `expected prefix ${f.expectedPath}, got ${r.error.path}`,\n });\n continue;\n }\n a.passed++;\n }\n }\n\n const need = (hooks: readonly string[]): string =>\n `adapter does not provide ${hooks.join(' + ')}`;\n const hasSchemaInput = adapter.encodeNode !== undefined || adapter.encodeOp !== undefined;\n\n const legs: LegResult[] = [\n toLeg('node-decode', true, accs.get('node-decode'), need(['decodeNode'])),\n toLeg(\n 'node-byte-identity',\n true,\n accs.get('node-byte-identity'),\n need(['decodeNode', 'encodeNode']),\n ),\n toLeg('node-reject', true, accs.get('node-reject'), need(['decodeNode'])),\n toLeg('op-decode', true, accs.get('op-decode'), need(['decodeOp'])),\n toLeg('op-byte-identity', true, accs.get('op-byte-identity'), need(['decodeOp', 'encodeOp'])),\n toLeg('op-reject', true, accs.get('op-reject'), need(['decodeOp'])),\n toLeg(\n 'lenient-accept',\n true,\n accs.get('lenient-accept'),\n need(['a decode + encode hook pair (node and/or op)']),\n ),\n toLeg(\n 'envelope-round-trip',\n true,\n accs.get('envelope-round-trip'),\n need(['negotiateEnvelope']),\n ),\n toLeg('envelope-reject', true, accs.get('envelope-reject'), need(['negotiateEnvelope'])),\n toLeg(\n 'elicitation-round-trip',\n true,\n accs.get('elicitation-round-trip'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-reject',\n true,\n accs.get('elicitation-reject'),\n need(['roundTripElicitation']),\n ),\n toLeg(\n 'elicitation-answer',\n true,\n accs.get('elicitation-answer'),\n need(['validateAnswerDocument']),\n ),\n toLeg(\n 'schema-validation',\n true,\n accs.get('schema-validation'),\n hasSchemaInput\n ? need(['a decode hook for the encode hooks provided'])\n : need(['encodeNode and/or encodeOp']),\n ),\n toLeg('apply', false, undefined, 'corpus v1 ships no apply fixtures — leg reserved'),\n ];\n\n return {\n kit: { name: KIT_NAME, version: KIT_VERSION },\n implementation: options.implementation,\n corpus: {\n manifestVersion: corpus.manifestVersion,\n digest: corpus.digest,\n fixtureCount: corpus.fixtures.length,\n source: corpus.source,\n },\n legs,\n verdict: computeVerdict(legs),\n generatedAt: new Date().toISOString(),\n };\n};\n"]}
|