Export command boundary coverage

This commit is contained in:
Meta Vens 2026-07-09 03:13:08 +01:00
commit 79db997e28
6 changed files with 191 additions and 0 deletions

View file

@ -20,6 +20,7 @@ if (!exportDirectory) {
" --expect-capability-gap <substring>",
" --expect-runtime-plugin-gap <runtimeId:pluginId:ownerRepo>",
" --expect-world-lowering-coverage <providerId:surfaceId:targetId:status:ownerRepo:runtimeId>",
" --expect-command-boundary-coverage <providerId:surfaceId:targetId:status:ownerRepo:runtimeId>",
" --expect-world-lowering-gap <providerId:surfaceId:targetId:ownerRepo:runtimeId>",
" --expect-conformance-handoff",
" --expect-plugin-operation <pluginId:operation>",
@ -133,6 +134,7 @@ function validateIndex(index, directory, expectations, errors) {
const runtimePluginProjectionGaps = Array.isArray(index.runtimePluginProjectionGaps) ? index.runtimePluginProjectionGaps : [];
const interactiveWorldSurfaces = Array.isArray(index.interactiveWorldSurfaces) ? index.interactiveWorldSurfaces : [];
const worldSurfaceLoweringCoverage = Array.isArray(index.worldSurfaceLoweringCoverage) ? index.worldSurfaceLoweringCoverage : [];
const commandBoundaryCoverage = Array.isArray(index.commandBoundaryCoverage) ? index.commandBoundaryCoverage : [];
const splitTargetBlockers = Array.isArray(index.splitTargetBlockers) ? index.splitTargetBlockers : [];
const worldSurfaceLoweringGaps = Array.isArray(index.worldSurfaceLoweringGaps) ? index.worldSurfaceLoweringGaps : [];
@ -157,6 +159,7 @@ function validateIndex(index, directory, expectations, errors) {
validateRuntimePluginProjectionGaps(index.runtimePluginProjectionGaps, errors);
validateSplitTargetBlockers(index.splitTargetBlockers, errors);
validateWorldSurfaceLoweringCoverage(index.worldSurfaceLoweringCoverage, errors);
validateCommandBoundaryCoverage(index.commandBoundaryCoverage, errors);
validateWorldSurfaceLoweringGaps(index.worldSurfaceLoweringGaps, errors);
for (const expectedGap of expectations.capabilityGaps) {
if (!capabilityGaps.some(gap => capabilityGapText(gap).includes(expectedGap))) {
@ -197,6 +200,25 @@ function validateIndex(index, directory, expectations, errors) {
errors.push(`worldSurfaceLoweringCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.targetId}:runtimeId:expected ${expectation.runtimeId} got ${coverage.runtimeId || ""}`);
}
}
for (const expectation of expectations.commandBoundaryCoverage) {
const coverage = commandBoundaryCoverage.find(candidate =>
candidate.providerId === expectation.providerId &&
candidate.surfaceId === expectation.surfaceId &&
candidate.targetId === expectation.targetId);
if (!coverage) {
errors.push(`commandBoundaryCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.targetId}:missing`);
continue;
}
if (coverage.status !== expectation.status) {
errors.push(`commandBoundaryCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.targetId}:status:expected ${expectation.status} got ${coverage.status || ""}`);
}
if (coverage.runtimeOwnerRepo !== expectation.ownerRepo) {
errors.push(`commandBoundaryCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.targetId}:runtimeOwnerRepo:expected ${expectation.ownerRepo} got ${coverage.runtimeOwnerRepo || ""}`);
}
if (coverage.runtimeId !== expectation.runtimeId) {
errors.push(`commandBoundaryCoverage:${expectation.providerId}:${expectation.surfaceId}:${expectation.targetId}:runtimeId:expected ${expectation.runtimeId} got ${coverage.runtimeId || ""}`);
}
}
for (const expectation of expectations.worldLoweringGaps) {
const gap = worldSurfaceLoweringGaps.find(candidate =>
candidate.providerId === expectation.providerId &&
@ -726,6 +748,21 @@ function validateWorldSurfaceLoweringCoverage(records, errors) {
}
}
function validateCommandBoundaryCoverage(records, errors) {
if (!Array.isArray(records)) {
errors.push("commandBoundaryCoverage:missing");
return;
}
for (const [index, record] of records.entries()) {
for (const field of ["providerId", "providerOwnerRepo", "surfaceId", "targetId", "runtimeId", "runtimeOwnerRepo", "status", "severity", "commandBoundary", "receiptSchema"]) {
if (!record?.[field]) errors.push(`commandBoundaryCoverage:${index}:${field}:missing`);
}
if (record?.status === "covered" && record.runtimeCommandSchema !== "gamecult.eve.command.v1") {
errors.push(`commandBoundaryCoverage:${index}:runtimeCommandSchema:expected gamecult.eve.command.v1 got ${record.runtimeCommandSchema || ""}`);
}
}
}
function validateWorldSurfaceLoweringGaps(gaps, errors) {
if (!Array.isArray(gaps)) {
errors.push("worldSurfaceLoweringGaps:missing");
@ -899,6 +936,7 @@ function parseArguments(args) {
capabilityGaps: [],
runtimePluginGaps: [],
worldLoweringCoverage: [],
commandBoundaryCoverage: [],
worldLoweringGaps: [],
conformanceHandoff: false,
};
@ -944,6 +982,7 @@ function parseArguments(args) {
["--expect-capability-gap", expectations.capabilityGaps],
["--expect-runtime-plugin-gap", expectations.runtimePluginGaps],
["--expect-world-lowering-coverage", expectations.worldLoweringCoverage],
["--expect-command-boundary-coverage", expectations.commandBoundaryCoverage],
["--expect-world-lowering-gap", expectations.worldLoweringGaps],
]);
@ -1033,6 +1072,8 @@ function parseArguments(args) {
target.push(parseWorldLoweringGapExpectation(value));
} else if (option === "--expect-world-lowering-coverage") {
target.push(parseWorldLoweringCoverageExpectation(value));
} else if (option === "--expect-command-boundary-coverage") {
target.push(parseCommandBoundaryCoverageExpectation(value));
} else if (option === "--expect-runtime-plugin-gap") {
target.push(parseRuntimePluginGapExpectation(value));
} else {
@ -1075,6 +1116,22 @@ function parseWorldLoweringCoverageExpectation(value) {
};
}
function parseCommandBoundaryCoverageExpectation(value) {
const parts = value.split(":");
if (parts.length !== 6 || parts.some(part => !part)) {
console.error(`Expected command boundary coverage in <providerId:surfaceId:targetId:status:ownerRepo:runtimeId> form, got: ${value}`);
process.exit(2);
}
return {
providerId: parts[0],
surfaceId: parts[1],
targetId: parts[2],
status: parts[3],
ownerRepo: parts[4],
runtimeId: parts[5],
};
}
function parseRuntimePluginGapExpectation(value) {
const parts = value.split(":");
if (parts.length !== 3 || parts.some(part => !part)) {

View file

@ -1672,6 +1672,7 @@ function buildConformanceExport(report) {
runtimePluginProjectionGaps: collectRuntimePluginProjectionGaps(report),
interactiveWorldSurfaces: collectInteractiveWorldSurfaces(report),
worldSurfaceLoweringCoverage: collectWorldSurfaceLoweringCoverage(report),
commandBoundaryCoverage: collectCommandBoundaryCoverage(report),
worldSurfaceLoweringGaps: collectWorldSurfaceLoweringGaps(report),
splitTargetBlockers: collectSplitTargetBlockers(report),
pluginAbiOperationCoverage: collectPluginAbiOperationCoverage(report),
@ -2069,6 +2070,46 @@ function collectWorldSurfaceLoweringCoverage(report) {
return coverage;
}
function collectCommandBoundaryCoverage(report) {
const { claimByTarget, runtimeByTarget } = buildWorldSurfaceLoweringTargetIndex(report);
const coverage = [];
for (const surface of collectInteractiveWorldSurfaces(report)) {
for (const targetId of surface.loweringTargets || []) {
const claim = claimByTarget.get(targetId);
const runtime = runtimeByTarget.get(targetId);
const runtimeCommandSchema = runtime?.commandTransportSmoke?.schema || "";
const missingProviderBoundary = !surface.commandBoundary || !surface.receiptSchema;
let status = "covered";
if (!runtime) {
status = "missing-runtime";
} else if (!claim) {
status = "missing-runtime-claim";
} else if (missingProviderBoundary) {
status = "missing-provider-boundary";
} else if (runtimeCommandSchema !== "gamecult.eve.command.v1") {
status = "missing-command-transport";
}
coverage.push({
providerId: surface.providerId,
providerOwnerRepo: surface.ownerRepo || "",
surfaceId: surface.surfaceId,
surfaceKind: surface.surfaceKind || "",
targetId,
runtimeId: runtime?.id || "world-surface-lowering",
runtimeOwnerRepo: runtime ? resolveRuntimeProjectionOwnerRepo(runtime) : "Eve",
splitTarget: runtime?.splitTarget || "",
runtimeStatus: runtime?.status || "",
status,
severity: status === "covered" ? "ok" : "blocker",
commandBoundary: surface.commandBoundary || "",
receiptSchema: surface.receiptSchema || "",
runtimeCommandSchema,
});
}
}
return coverage;
}
function resolveRuntimeProjectionOwnerRepo(runtime) {
return runtime.lifecycle?.release?.ownerRepo
|| runtime.lifecycle?.test?.ownerRepo