From 8d4d1de8769327cf8b8b742b63179e16837e3047 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 9 Jul 2026 03:06:27 +0100 Subject: [PATCH] Export plugin ABI operation coverage --- docs/eve-migration-roadmap.md | 5 ++ docs/parity-testing-harness.md | 5 ++ ...cult.eve.conformance_export.v1.schema.json | 67 +++++++++++++++++++ ...lugin-owner-conformance-consumer-smoke.ps1 | 6 ++ tools/conformance/consume-export.mjs | 51 ++++++++++++++ tools/parity/run-parity.mjs | 31 +++++++++ 6 files changed, 165 insertions(+) diff --git a/docs/eve-migration-roadmap.md b/docs/eve-migration-roadmap.md index 2cb98b7..866cfbe 100644 --- a/docs/eve-migration-roadmap.md +++ b/docs/eve-migration-roadmap.md @@ -313,6 +313,11 @@ Recently cut: `plugins[].abiOperationContracts`. Sai and Norn can consume operation-level `input` and `expect` contracts for `describe`, `validate`, `project`, `lower`, `measure`, and `apply` without reading Eve-local fixture files. +- Plugin ABI operation coverage is now exported as root + `pluginAbiOperationCoverage[]` records. The plugin-owner smoke asserts Sai + and Norn `describe`, `lower`, and `apply` operations as `contracted`, so plugin + owners can consume the coverage ledger without walking Eve's nested plugin + records. - Runtime/plugin projection gaps are now exported as `runtimePluginProjectionGaps[]`. The runtime-owner smoke asserts Unity and Electron plugin gaps as typed records, so missing Sai, Norn, or TeX projection diff --git a/docs/parity-testing-harness.md b/docs/parity-testing-harness.md index 155bd81..4381edc 100644 --- a/docs/parity-testing-harness.md +++ b/docs/parity-testing-harness.md @@ -146,6 +146,11 @@ Plugin ABI fixture operations are exported as `plugins[].abiOperationContracts` with `operation`, `input`, and `expect` blocks. Plugin owners can consume the operation-level contract for `describe`, `validate`, `project`, `lower`, `measure`, and `apply` without opening Eve-local fixture files. +The same operation set is indexed as root `pluginAbiOperationCoverage[]` records +with plugin id, owner repo, operation, status, fixture path, input keys, and +expect keys. Plugin-owner smokes can assert contracted operations with +`--expect-plugin-abi-operation-coverage ` +without walking nested plugin records. The runtime conformance pack is evidence-shaped, not fixture-shaped. Its `packs/runtime.json` document includes `runtimeTargets` so runtime repos can diff --git a/schemas/gamecult.eve.conformance_export.v1.schema.json b/schemas/gamecult.eve.conformance_export.v1.schema.json index 538454f..51a463b 100644 --- a/schemas/gamecult.eve.conformance_export.v1.schema.json +++ b/schemas/gamecult.eve.conformance_export.v1.schema.json @@ -11,6 +11,7 @@ "plugins", "providers", "runtimes", + "pluginAbiOperationCoverage", "interactiveWorldSurfaces", "worldSurfaceLoweringCoverage", "splitTargetBlockers", @@ -501,6 +502,72 @@ "additionalProperties": true } }, + "pluginAbiOperationCoverage": { + "type": "array", + "items": { + "type": "object", + "required": [ + "pluginId", + "ownerRepo", + "splitTarget", + "status", + "operation", + "abiFixturePath", + "inputKeys", + "expectKeys" + ], + "properties": { + "pluginId": { + "type": "string", + "minLength": 1 + }, + "ownerRepo": { + "type": "string", + "minLength": 1 + }, + "splitTarget": { + "type": "string" + }, + "status": { + "type": "string", + "minLength": 1 + }, + "operation": { + "type": "string", + "minLength": 1 + }, + "abiFixturePath": { + "type": "string", + "minLength": 1 + }, + "inputKeys": { + "type": "array" + }, + "expectKeys": { + "type": "array" + }, + "projectionKind": { + "type": "string" + }, + "loweringKind": { + "type": "string" + }, + "measurementKind": { + "type": "string" + }, + "commandEnvelope": { + "type": "string" + }, + "receiptSchema": { + "type": "string" + }, + "preservesProviderAuthority": { + "type": "boolean" + } + }, + "additionalProperties": true + } + }, "providers": { "type": "array", "items": { diff --git a/scripts/run-plugin-owner-conformance-consumer-smoke.ps1 b/scripts/run-plugin-owner-conformance-consumer-smoke.ps1 index a66f1c8..c516f3d 100644 --- a/scripts/run-plugin-owner-conformance-consumer-smoke.ps1 +++ b/scripts/run-plugin-owner-conformance-consumer-smoke.ps1 @@ -43,12 +43,18 @@ node $consumerScript $consumerExport ` --expect-plugin-operation sai.vn:lower ` --expect-plugin-operation sai.vn:measure ` --expect-plugin-operation sai.vn:apply ` + --expect-plugin-abi-operation-coverage sai.vn:describe:contracted:Sai ` + --expect-plugin-abi-operation-coverage sai.vn:lower:contracted:Sai ` + --expect-plugin-abi-operation-coverage sai.vn:apply:contracted:Sai ` --expect-plugin-operation norn.graph:describe ` --expect-plugin-operation norn.graph:validate ` --expect-plugin-operation norn.graph:project ` --expect-plugin-operation norn.graph:lower ` --expect-plugin-operation norn.graph:measure ` --expect-plugin-operation norn.graph:apply ` + --expect-plugin-abi-operation-coverage norn.graph:describe:contracted:Norn ` + --expect-plugin-abi-operation-coverage norn.graph:lower:contracted:Norn ` + --expect-plugin-abi-operation-coverage norn.graph:apply:contracted:Norn ` --expect-plugin-capability sai.vn:vn.stage ` --expect-plugin-capability sai.vn:story.choose ` --expect-plugin-capability sai.vn:story.continue ` diff --git a/tools/conformance/consume-export.mjs b/tools/conformance/consume-export.mjs index 5faf6b7..c7746d1 100644 --- a/tools/conformance/consume-export.mjs +++ b/tools/conformance/consume-export.mjs @@ -29,6 +29,7 @@ if (!exportDirectory) { " --expect-plugin-runtime-authority ", " --expect-plugin-runtime-field ", " --expect-plugin-abi-field ", + " --expect-plugin-abi-operation-coverage ", " --expect-plugin-handoff ", " --expect-provider-surface ", " --expect-provider-surface-kind ", @@ -125,6 +126,7 @@ function validateIndex(index, directory, expectations, errors) { const providers = Array.isArray(index.providers) ? index.providers : []; const runtimes = mergeRuntimeRecords(Array.isArray(index.runtimes) ? index.runtimes : [], exportedRuntimeTargets); const splitTargets = Array.isArray(index.splitTargets) ? index.splitTargets : []; + const pluginAbiOperationCoverage = Array.isArray(index.pluginAbiOperationCoverage) ? index.pluginAbiOperationCoverage : []; const capabilityGaps = Array.isArray(index.capabilityGaps) ? index.capabilityGaps : []; const runtimePluginProjectionGaps = Array.isArray(index.runtimePluginProjectionGaps) ? index.runtimePluginProjectionGaps : []; const interactiveWorldSurfaces = Array.isArray(index.interactiveWorldSurfaces) ? index.interactiveWorldSurfaces : []; @@ -133,6 +135,7 @@ function validateIndex(index, directory, expectations, errors) { const worldSurfaceLoweringGaps = Array.isArray(index.worldSurfaceLoweringGaps) ? index.worldSurfaceLoweringGaps : []; validatePluginRecords(plugins, errors); + validatePluginAbiOperationCoverage(index.pluginAbiOperationCoverage, errors); validateProviderRecords(providers, errors); validateRuntimeRecords(runtimes, errors); validateSplitTargetRecords(splitTargets, errors); @@ -292,6 +295,21 @@ function validateIndex(index, directory, expectations, errors) { errors.push(`plugins:${expectation.pluginId}:abiOperation:${expectation.operation}.${expectation.fieldPath}:expected ${expectation.value} got ${actual || ""}`); } } + for (const expectation of expectations.pluginAbiOperationCoverage) { + const record = pluginAbiOperationCoverage.find(candidate => + candidate.pluginId === expectation.pluginId && + candidate.operation === expectation.operation); + if (!record) { + errors.push(`pluginAbiOperationCoverage:${expectation.pluginId}:${expectation.operation}:missing`); + continue; + } + if (record.status !== expectation.status) { + errors.push(`pluginAbiOperationCoverage:${expectation.pluginId}:${expectation.operation}:status:expected ${expectation.status} got ${record.status || ""}`); + } + if (record.ownerRepo !== expectation.ownerRepo) { + errors.push(`pluginAbiOperationCoverage:${expectation.pluginId}:${expectation.operation}:ownerRepo:expected ${expectation.ownerRepo} got ${record.ownerRepo || ""}`); + } + } for (const expectedPlugin of expectations.pluginHandoffs) { const plugin = plugins.find(candidate => candidate.pluginId === expectedPlugin); if (!plugin) { @@ -725,6 +743,21 @@ function validatePluginRecords(plugins, errors) { } } +function validatePluginAbiOperationCoverage(records, errors) { + if (!Array.isArray(records)) { + errors.push("pluginAbiOperationCoverage:missing"); + return; + } + for (const [index, record] of records.entries()) { + for (const field of ["pluginId", "ownerRepo", "status", "operation", "abiFixturePath"]) { + if (!record?.[field]) errors.push(`pluginAbiOperationCoverage:${index}:${field}:missing`); + } + for (const field of ["inputKeys", "expectKeys"]) { + if (!Array.isArray(record?.[field])) errors.push(`pluginAbiOperationCoverage:${index}:${field}:expected array`); + } + } +} + function validateProviderRecords(providers, errors) { for (const provider of providers) { const label = `providers:${provider.providerId || "unknown"}`; @@ -800,6 +833,7 @@ function parseArguments(args) { pluginRuntimeAuthorities: [], pluginRuntimeFields: [], pluginAbiFields: [], + pluginAbiOperationCoverage: [], pluginHandoffs: [], providers: [], providerSurfaces: [], @@ -848,6 +882,7 @@ function parseArguments(args) { ["--expect-plugin-runtime-authority", expectations.pluginRuntimeAuthorities], ["--expect-plugin-runtime-field", expectations.pluginRuntimeFields], ["--expect-plugin-abi-field", expectations.pluginAbiFields], + ["--expect-plugin-abi-operation-coverage", expectations.pluginAbiOperationCoverage], ["--expect-plugin-handoff", expectations.pluginHandoffs], ["--expect-provider-surface", expectations.providerSurfaces], ["--expect-provider-surface-kind", expectations.providerSurfaceKinds], @@ -910,6 +945,8 @@ function parseArguments(args) { target.push(parsePluginRuntimeFieldExpectation(value)); } else if (option === "--expect-plugin-abi-field") { target.push(parsePluginAbiFieldExpectation(value)); + } else if (option === "--expect-plugin-abi-operation-coverage") { + target.push(parsePluginAbiOperationCoverageExpectation(value)); } else if (option === "--expect-plugin-handoff") { target.push(value); } else if (option === "--expect-provider-surface") { @@ -1065,6 +1102,20 @@ function parsePluginAbiFieldExpectation(value) { }; } +function parsePluginAbiOperationCoverageExpectation(value) { + const parts = value.split(":"); + if (parts.length !== 4 || parts.some(part => !part)) { + console.error(`Expected plugin ABI operation coverage in form, got: ${value}`); + process.exit(2); + } + return { + pluginId: parts[0], + operation: parts[1], + status: parts[2], + ownerRepo: parts[3], + }; +} + function parseProviderSurfaceFieldExpectation(value) { const parts = value.split(":"); if (parts.length < 4 || !parts[0] || !parts[1] || !parts[2] || !parts.slice(3).join(":")) { diff --git a/tools/parity/run-parity.mjs b/tools/parity/run-parity.mjs index 4e47074..f6419f6 100644 --- a/tools/parity/run-parity.mjs +++ b/tools/parity/run-parity.mjs @@ -1674,6 +1674,7 @@ function buildConformanceExport(report) { worldSurfaceLoweringCoverage: collectWorldSurfaceLoweringCoverage(report), worldSurfaceLoweringGaps: collectWorldSurfaceLoweringGaps(report), splitTargetBlockers: collectSplitTargetBlockers(report), + pluginAbiOperationCoverage: collectPluginAbiOperationCoverage(report), capabilityGaps: collectCapabilityGaps(report), plugins: (report.plugins || []).map(plugin => ({ pluginId: plugin.pluginId, @@ -1949,6 +1950,36 @@ function collectRuntimePluginProjectionGaps(report) { return gaps; } +function collectPluginAbiOperationCoverage(report) { + const requiredOperations = ["describe", "validate", "project", "lower", "measure", "apply"]; + const coverage = []; + for (const plugin of report.plugins || []) { + const operations = new Map((plugin.abiOperationContracts || []).map(contract => [contract.operation, contract])); + for (const operation of requiredOperations) { + const contract = operations.get(operation); + const input = contract?.input || {}; + const expect = contract?.expect || {}; + coverage.push({ + pluginId: plugin.pluginId, + ownerRepo: plugin.ownerRepo || "", + splitTarget: plugin.splitTarget || "", + status: contract ? "contracted" : "missing-contract", + operation, + abiFixturePath: plugin.abiFixturePath || "", + inputKeys: Object.keys(input).sort(), + expectKeys: Object.keys(expect).sort(), + projectionKind: expect.projectionKind || "", + loweringKind: expect.loweringKind || "", + measurementKind: expect.measurementKind || "", + commandEnvelope: expect.commandEnvelope || "", + receiptSchema: expect.receiptSchema || "", + preservesProviderAuthority: expect.preservesProviderAuthority === true, + }); + } + } + return coverage; +} + function collectSplitTargetBlockers(report) { return (report.splitTargets || []).flatMap(target => target.blockerRecords || []); }