Export provider plugin requirement coverage
This commit is contained in:
parent
8d4d1de876
commit
a4fdc2f6df
6 changed files with 162 additions and 0 deletions
|
|
@ -318,6 +318,11 @@ Recently cut:
|
|||
and Norn `describe`, `lower`, and `apply` operations as `contracted`, so plugin
|
||||
owners can consume the coverage ledger without walking Eve's nested plugin
|
||||
records.
|
||||
- Provider/plugin requirement coverage is now exported as root
|
||||
`providerPluginRequirementCoverage[]` records. The plugin-owner smoke asserts
|
||||
the Sai VN provider surface requirements for `sai.vn`, `norn.graph`, and
|
||||
`tex.math` as satisfied by their owning plugin repos, keeping provider
|
||||
requirements separate from runtime projection support.
|
||||
- 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
|
||||
|
|
|
|||
|
|
@ -151,6 +151,13 @@ 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 <pluginId:operation:status:ownerRepo>`
|
||||
without walking nested plugin records.
|
||||
Provider-advertised plugin requirements are indexed as root
|
||||
`providerPluginRequirementCoverage[]` records. These join provider id, surface
|
||||
id, plugin id, plugin owner, plugin status, required capabilities, and missing
|
||||
capabilities so provider and plugin owners can consume requirement coverage
|
||||
without reconstructing the provider/plugin join. Consumer smokes can assert
|
||||
them with
|
||||
`--expect-provider-plugin-requirement <providerId:surfaceId:pluginId:status:pluginOwnerRepo>`.
|
||||
|
||||
The runtime conformance pack is evidence-shaped, not fixture-shaped. Its
|
||||
`packs/runtime.json` document includes `runtimeTargets` so runtime repos can
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
"providers",
|
||||
"runtimes",
|
||||
"pluginAbiOperationCoverage",
|
||||
"providerPluginRequirementCoverage",
|
||||
"interactiveWorldSurfaces",
|
||||
"worldSurfaceLoweringCoverage",
|
||||
"splitTargetBlockers",
|
||||
|
|
@ -632,6 +633,67 @@
|
|||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"providerPluginRequirementCoverage": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"providerId",
|
||||
"providerOwnerRepo",
|
||||
"surfaceId",
|
||||
"pluginId",
|
||||
"pluginOwnerRepo",
|
||||
"pluginStatus",
|
||||
"versionRange",
|
||||
"status",
|
||||
"requiredCapabilities",
|
||||
"optionalCapabilities",
|
||||
"missingRequiredCapabilities"
|
||||
],
|
||||
"properties": {
|
||||
"providerId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"providerOwnerRepo": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"surfaceId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"pluginId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"pluginOwnerRepo": {
|
||||
"type": "string"
|
||||
},
|
||||
"pluginStatus": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"versionRange": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"requiredCapabilities": {
|
||||
"type": "array"
|
||||
},
|
||||
"optionalCapabilities": {
|
||||
"type": "array"
|
||||
},
|
||||
"missingRequiredCapabilities": {
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ node $consumerScript $consumerExport `
|
|||
--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-provider-plugin-requirement gamecult.home.vn:sai.visual_novel.surface:sai.vn:satisfied:Sai `
|
||||
--expect-plugin-operation norn.graph:describe `
|
||||
--expect-plugin-operation norn.graph:validate `
|
||||
--expect-plugin-operation norn.graph:project `
|
||||
|
|
@ -55,6 +56,8 @@ node $consumerScript $consumerExport `
|
|||
--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-provider-plugin-requirement gamecult.home.vn:sai.visual_novel.surface:norn.graph:satisfied:Norn `
|
||||
--expect-provider-plugin-requirement gamecult.home.vn:sai.visual_novel.surface:tex.math:satisfied:EvePlugins `
|
||||
--expect-plugin-capability sai.vn:vn.stage `
|
||||
--expect-plugin-capability sai.vn:story.choose `
|
||||
--expect-plugin-capability sai.vn:story.continue `
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ if (!exportDirectory) {
|
|||
" --expect-provider-surface-kind <providerId:surfaceId:surfaceKind>",
|
||||
" --expect-provider-surface-field <providerId:surfaceId:field.path:value>",
|
||||
" --expect-interactive-world-surface <providerId:surfaceId:targetId:ownerRepo>",
|
||||
" --expect-provider-plugin-requirement <providerId:surfaceId:pluginId:status:pluginOwnerRepo>",
|
||||
" --expect-provider-command <providerId:command>",
|
||||
" --expect-provider-receipt-state <providerId:state>",
|
||||
" --expect-provider-handoff <providerId>",
|
||||
|
|
@ -127,6 +128,7 @@ function validateIndex(index, directory, expectations, errors) {
|
|||
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 providerPluginRequirementCoverage = Array.isArray(index.providerPluginRequirementCoverage) ? index.providerPluginRequirementCoverage : [];
|
||||
const capabilityGaps = Array.isArray(index.capabilityGaps) ? index.capabilityGaps : [];
|
||||
const runtimePluginProjectionGaps = Array.isArray(index.runtimePluginProjectionGaps) ? index.runtimePluginProjectionGaps : [];
|
||||
const interactiveWorldSurfaces = Array.isArray(index.interactiveWorldSurfaces) ? index.interactiveWorldSurfaces : [];
|
||||
|
|
@ -137,6 +139,7 @@ function validateIndex(index, directory, expectations, errors) {
|
|||
validatePluginRecords(plugins, errors);
|
||||
validatePluginAbiOperationCoverage(index.pluginAbiOperationCoverage, errors);
|
||||
validateProviderRecords(providers, errors);
|
||||
validateProviderPluginRequirementCoverage(index.providerPluginRequirementCoverage, errors);
|
||||
validateRuntimeRecords(runtimes, errors);
|
||||
validateSplitTargetRecords(splitTargets, errors);
|
||||
validateInteractiveWorldSurfaces(index.interactiveWorldSurfaces, errors);
|
||||
|
|
@ -383,6 +386,22 @@ function validateIndex(index, directory, expectations, errors) {
|
|||
if (!surface[field]) errors.push(`interactiveWorldSurfaces:${expectation.providerId}:${expectation.surfaceId}:${field}:missing`);
|
||||
}
|
||||
}
|
||||
for (const expectation of expectations.providerPluginRequirements) {
|
||||
const requirement = providerPluginRequirementCoverage.find(candidate =>
|
||||
candidate.providerId === expectation.providerId &&
|
||||
candidate.surfaceId === expectation.surfaceId &&
|
||||
candidate.pluginId === expectation.pluginId);
|
||||
if (!requirement) {
|
||||
errors.push(`providerPluginRequirementCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.pluginId}:missing`);
|
||||
continue;
|
||||
}
|
||||
if (requirement.status !== expectation.status) {
|
||||
errors.push(`providerPluginRequirementCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.pluginId}:status:expected ${expectation.status} got ${requirement.status || ""}`);
|
||||
}
|
||||
if (requirement.pluginOwnerRepo !== expectation.pluginOwnerRepo) {
|
||||
errors.push(`providerPluginRequirementCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.pluginId}:pluginOwnerRepo:expected ${expectation.pluginOwnerRepo} got ${requirement.pluginOwnerRepo || ""}`);
|
||||
}
|
||||
}
|
||||
for (const expectation of expectations.providerCommands) {
|
||||
const provider = providers.find(candidate => candidate.providerId === expectation.providerId);
|
||||
if (!provider) {
|
||||
|
|
@ -770,6 +789,21 @@ function validateProviderRecords(providers, errors) {
|
|||
}
|
||||
}
|
||||
|
||||
function validateProviderPluginRequirementCoverage(records, errors) {
|
||||
if (!Array.isArray(records)) {
|
||||
errors.push("providerPluginRequirementCoverage:missing");
|
||||
return;
|
||||
}
|
||||
for (const [index, record] of records.entries()) {
|
||||
for (const field of ["providerId", "providerOwnerRepo", "surfaceId", "pluginId", "pluginStatus", "status"]) {
|
||||
if (!record?.[field]) errors.push(`providerPluginRequirementCoverage:${index}:${field}:missing`);
|
||||
}
|
||||
for (const field of ["requiredCapabilities", "optionalCapabilities", "missingRequiredCapabilities"]) {
|
||||
if (!Array.isArray(record?.[field])) errors.push(`providerPluginRequirementCoverage:${index}:${field}:expected array`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validateInteractiveWorldSurfaces(surfaces, errors) {
|
||||
if (!Array.isArray(surfaces)) {
|
||||
errors.push("interactiveWorldSurfaces:missing");
|
||||
|
|
@ -840,6 +874,7 @@ function parseArguments(args) {
|
|||
providerSurfaceKinds: [],
|
||||
providerSurfaceFields: [],
|
||||
interactiveWorldSurfaces: [],
|
||||
providerPluginRequirements: [],
|
||||
providerCommands: [],
|
||||
providerReceiptStates: [],
|
||||
providerHandoffs: [],
|
||||
|
|
@ -888,6 +923,7 @@ function parseArguments(args) {
|
|||
["--expect-provider-surface-kind", expectations.providerSurfaceKinds],
|
||||
["--expect-provider-surface-field", expectations.providerSurfaceFields],
|
||||
["--expect-interactive-world-surface", expectations.interactiveWorldSurfaces],
|
||||
["--expect-provider-plugin-requirement", expectations.providerPluginRequirements],
|
||||
["--expect-provider-command", expectations.providerCommands],
|
||||
["--expect-provider-receipt-state", expectations.providerReceiptStates],
|
||||
["--expect-provider-handoff", expectations.providerHandoffs],
|
||||
|
|
@ -957,6 +993,8 @@ function parseArguments(args) {
|
|||
target.push(parseProviderSurfaceFieldExpectation(value));
|
||||
} else if (option === "--expect-interactive-world-surface") {
|
||||
target.push(parseInteractiveWorldSurfaceExpectation(value));
|
||||
} else if (option === "--expect-provider-plugin-requirement") {
|
||||
target.push(parseProviderPluginRequirementExpectation(value));
|
||||
} else if (option === "--expect-provider-command") {
|
||||
target.push(parseProviderExpectation(value, "command"));
|
||||
} else if (option === "--expect-provider-receipt-state") {
|
||||
|
|
@ -1144,6 +1182,21 @@ function parseInteractiveWorldSurfaceExpectation(value) {
|
|||
};
|
||||
}
|
||||
|
||||
function parseProviderPluginRequirementExpectation(value) {
|
||||
const parts = value.split(":");
|
||||
if (parts.length !== 5 || parts.some(part => !part)) {
|
||||
console.error(`Expected provider plugin requirement in <providerId:surfaceId:pluginId:status:pluginOwnerRepo> form, got: ${value}`);
|
||||
process.exit(2);
|
||||
}
|
||||
return {
|
||||
providerId: parts[0],
|
||||
surfaceId: parts[1],
|
||||
pluginId: parts[2],
|
||||
status: parts[3],
|
||||
pluginOwnerRepo: parts[4],
|
||||
};
|
||||
}
|
||||
|
||||
function parseProviderExpectation(value, field) {
|
||||
const separator = value.indexOf(":");
|
||||
if (separator <= 0 || separator === value.length - 1) {
|
||||
|
|
|
|||
|
|
@ -1675,6 +1675,7 @@ function buildConformanceExport(report) {
|
|||
worldSurfaceLoweringGaps: collectWorldSurfaceLoweringGaps(report),
|
||||
splitTargetBlockers: collectSplitTargetBlockers(report),
|
||||
pluginAbiOperationCoverage: collectPluginAbiOperationCoverage(report),
|
||||
providerPluginRequirementCoverage: collectProviderPluginRequirementCoverage(report),
|
||||
capabilityGaps: collectCapabilityGaps(report),
|
||||
plugins: (report.plugins || []).map(plugin => ({
|
||||
pluginId: plugin.pluginId,
|
||||
|
|
@ -1980,6 +1981,37 @@ function collectPluginAbiOperationCoverage(report) {
|
|||
return coverage;
|
||||
}
|
||||
|
||||
function collectProviderPluginRequirementCoverage(report) {
|
||||
const pluginById = new Map((report.plugins || []).map(plugin => [plugin.pluginId, plugin]));
|
||||
const coverage = [];
|
||||
for (const provider of report.providers || []) {
|
||||
for (const requirement of provider.pluginRequirements || []) {
|
||||
const plugin = pluginById.get(requirement.pluginId);
|
||||
const pluginCapabilities = new Set(plugin?.capabilities || []);
|
||||
const missingRequiredCapabilities = (requirement.requiredCapabilities || [])
|
||||
.filter(capability => !pluginCapabilities.has(capability));
|
||||
coverage.push({
|
||||
providerId: provider.providerId,
|
||||
providerOwnerRepo: provider.ownerRepo || "",
|
||||
surfaceId: requirement.surfaceId || "",
|
||||
pluginId: requirement.pluginId || "",
|
||||
pluginOwnerRepo: plugin?.ownerRepo || "",
|
||||
pluginStatus: plugin?.status || "missing",
|
||||
versionRange: requirement.versionRange || "",
|
||||
status: !plugin
|
||||
? "missing-plugin"
|
||||
: missingRequiredCapabilities.length
|
||||
? "missing-capability"
|
||||
: "satisfied",
|
||||
requiredCapabilities: requirement.requiredCapabilities || [],
|
||||
optionalCapabilities: requirement.optionalCapabilities || [],
|
||||
missingRequiredCapabilities,
|
||||
});
|
||||
}
|
||||
}
|
||||
return coverage;
|
||||
}
|
||||
|
||||
function collectSplitTargetBlockers(report) {
|
||||
return (report.splitTargets || []).flatMap(target => target.blockerRecords || []);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue