Declare runtime world surface lowering targets

This commit is contained in:
Meta Vens 2026-07-09 02:32:23 +01:00
commit c232f1453e
12 changed files with 262 additions and 3 deletions

View file

@ -34,6 +34,8 @@ if (!exportDirectory) {
" --expect-provider-handoff <providerId>",
" --expect-runtime-status <runtimeId:status>",
" --expect-runtime-feature <runtimeId:feature>",
" --expect-runtime-world-target <runtimeId:targetId>",
" --expect-runtime-world-field <runtimeId:targetId:field.path:value>",
" --expect-runtime-handoff <runtimeId>",
" --expect-runtime-command-schema <runtimeId:schema>",
" --expect-runtime-capture-status <runtimeId:status>",
@ -311,6 +313,34 @@ function validateIndex(index, directory, expectations, errors) {
errors.push(`runtimes:${expectation.runtimeId}:feature:${expectation.feature}:missing`);
}
}
for (const expectation of expectations.runtimeWorldTargets) {
const runtime = runtimes.find(candidate => candidate.runtimeId === expectation.runtimeId);
if (!runtime) {
errors.push(`runtimes:${expectation.runtimeId}:missing`);
continue;
}
const worldTargets = Array.isArray(runtime.worldSurfaceLowering) ? runtime.worldSurfaceLowering : [];
if (!worldTargets.some(candidate => candidate.targetId === expectation.targetId)) {
errors.push(`runtimes:${expectation.runtimeId}:worldSurfaceLowering:${expectation.targetId}:missing`);
}
}
for (const expectation of expectations.runtimeWorldFields) {
const runtime = runtimes.find(candidate => candidate.runtimeId === expectation.runtimeId);
if (!runtime) {
errors.push(`runtimes:${expectation.runtimeId}:missing`);
continue;
}
const worldTargets = Array.isArray(runtime.worldSurfaceLowering) ? runtime.worldSurfaceLowering : [];
const target = worldTargets.find(candidate => candidate.targetId === expectation.targetId);
if (!target) {
errors.push(`runtimes:${expectation.runtimeId}:worldSurfaceLowering:${expectation.targetId}:missing`);
continue;
}
const actual = readNestedField(target, expectation.fieldPath);
if (actual !== expectation.value) {
errors.push(`runtimes:${expectation.runtimeId}:worldSurfaceLowering:${expectation.targetId}.${expectation.fieldPath}:expected ${expectation.value} got ${actual || ""}`);
}
}
for (const expectation of expectations.runtimeCommandSchemas) {
const runtime = runtimes.find(candidate => candidate.runtimeId === expectation.runtimeId);
if (!runtime) {
@ -539,6 +569,8 @@ function parseArguments(args) {
runtimes: [],
runtimeStatuses: [],
runtimeFeatures: [],
runtimeWorldTargets: [],
runtimeWorldFields: [],
runtimeHandoffs: [],
runtimeCommandSchemas: [],
runtimeCaptureStatuses: [],
@ -577,6 +609,8 @@ function parseArguments(args) {
["--expect-provider-handoff", expectations.providerHandoffs],
["--expect-runtime-status", expectations.runtimeStatuses],
["--expect-runtime-feature", expectations.runtimeFeatures],
["--expect-runtime-world-target", expectations.runtimeWorldTargets],
["--expect-runtime-world-field", expectations.runtimeWorldFields],
["--expect-runtime-handoff", expectations.runtimeHandoffs],
["--expect-runtime-command-schema", expectations.runtimeCommandSchemas],
["--expect-runtime-capture-status", expectations.runtimeCaptureStatuses],
@ -639,6 +673,10 @@ function parseArguments(args) {
target.push(parseRuntimeExpectation(value, "status"));
} else if (option === "--expect-runtime-feature") {
target.push(parseRuntimeExpectation(value, "feature"));
} else if (option === "--expect-runtime-world-target") {
target.push(parseRuntimeWorldTargetExpectation(value));
} else if (option === "--expect-runtime-world-field") {
target.push(parseRuntimeWorldFieldExpectation(value));
} else if (option === "--expect-runtime-handoff") {
target.push(value);
} else if (option === "--expect-runtime-command-schema") {
@ -742,6 +780,32 @@ function parseRuntimeExpectation(value, field) {
};
}
function parseRuntimeWorldTargetExpectation(value) {
const separator = value.indexOf(":");
if (separator <= 0 || separator === value.length - 1) {
console.error(`Expected runtime world target in <runtimeId:targetId> form, got: ${value}`);
process.exit(2);
}
return {
runtimeId: value.slice(0, separator),
targetId: value.slice(separator + 1),
};
}
function parseRuntimeWorldFieldExpectation(value) {
const parts = value.split(":");
if (parts.length < 4 || !parts[0] || !parts[1] || !parts[2] || !parts.slice(3).join(":")) {
console.error(`Expected runtime world field in <runtimeId:targetId:field.path:value> form, got: ${value}`);
process.exit(2);
}
return {
runtimeId: parts[0],
targetId: parts[1],
fieldPath: parts[2],
value: parts.slice(3).join(":"),
};
}
function parseRuntimeLifecycleFieldExpectation(value) {
const parts = value.split(":");
if (parts.length < 4 || !parts[0] || !parts[1] || !parts[2] || !parts.slice(3).join(":")) {

View file

@ -622,6 +622,20 @@
"capabilities": ["embed.tex"]
}
],
"worldSurfaceLowering": [
{
"targetId": "web-reference",
"surfaceKinds": ["interactive-world", "interactive-world-editor"],
"projectionKinds": ["provider-authored-world-surface", "provider-authored-world-editor-surface"],
"supportLevel": "reference-dom-canvas-command-boundary",
"ownership": "runtime-lowers-provider-world-surface-without-owning-world-state",
"evidencePaths": [
"web/surface.js",
"packages/eve-browser-lowering/src/index.ts",
"web/fixtures/aetheria.provider-advertisement.json"
]
}
],
"expectedSourceSymbols": [
{
"path": "web/surface.js",
@ -947,6 +961,20 @@
"reason": "Unity UI Toolkit currently preserves embed.tex as generic Eve structure; no TeX projection adapter exists in this runtime."
}
],
"worldSurfaceLowering": [
{
"targetId": "unity-uitoolkit",
"surfaceKinds": ["interactive-world", "interactive-world-editor"],
"projectionKinds": ["provider-authored-world-surface", "provider-authored-world-editor-surface"],
"supportLevel": "ui-toolkit-semantic-command-surface",
"ownership": "runtime-lowers-provider-world-surface-without-owning-world-state",
"evidencePaths": [
"packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs",
"packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs",
"web/fixtures/aetheria.provider-advertisement.json"
]
}
],
"expectedPaths": [
"packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs",
"packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs",

View file

@ -345,6 +345,7 @@ async function evaluateRuntime(runtime, fixtureResults) {
supportedPlugins,
unsupportedPlugins: runtime.unsupportedPlugins || [],
unsupportedPluginNotes,
worldSurfaceLowering: runtime.worldSurfaceLowering || [],
missingRequiredFeatures,
commandTransportSmoke: runtime.commandTransportSmoke || null,
commandTransportSmokeErrors,
@ -1134,6 +1135,7 @@ async function validateRuntimeCapabilityManifest(runtime) {
const supportedFeatures = document.supportedFeatures || [];
const supportedPlugins = document.supportedPlugins || [];
const unsupportedPlugins = document.unsupportedPlugins || [];
const worldSurfaceLowering = document.worldSurfaceLowering || [];
const commandTransport = document.commandTransport || {};
const lifecycle = document.lifecycle || {};
@ -1148,6 +1150,11 @@ async function validateRuntimeCapabilityManifest(runtime) {
unsupportedPlugins,
`${capabilityManifest.manifestPath}:unsupportedPlugins`,
));
errors.push(...compareWorldSurfaceLoweringClaims(
runtime.worldSurfaceLowering || [],
worldSurfaceLowering,
`${capabilityManifest.manifestPath}:worldSurfaceLowering`,
));
const expectedCommandSchema = runtime.commandTransportSmoke?.schema || "";
if (expectedCommandSchema && commandTransport.schema !== expectedCommandSchema) {
@ -1175,6 +1182,32 @@ async function validateRuntimeCapabilityManifest(runtime) {
return errors;
}
function compareWorldSurfaceLoweringClaims(expectedClaims, actualClaims, label) {
const errors = [];
const actualByTarget = new Map((actualClaims || []).map(claim => [claim.targetId, claim]));
for (const expected of expectedClaims || []) {
const actual = actualByTarget.get(expected.targetId);
if (!actual) {
errors.push(`${label}:${expected.targetId}:missing`);
continue;
}
for (const key of ["supportLevel", "ownership"]) {
if ((expected[key] || "") !== (actual[key] || "")) {
errors.push(`${label}:${expected.targetId}.${key}:expected ${expected[key] || ""} got ${actual[key] || ""}`);
}
}
errors.push(...missingMembers(expected.surfaceKinds || [], actual.surfaceKinds || [], `${label}:${expected.targetId}.surfaceKinds`));
errors.push(...missingMembers(expected.projectionKinds || [], actual.projectionKinds || [], `${label}:${expected.targetId}.projectionKinds`));
errors.push(...missingMembers(expected.evidencePaths || [], actual.evidencePaths || [], `${label}:${expected.targetId}.evidencePaths`));
for (const evidencePath of actual.evidencePaths || []) {
if (!existsSync(path.join(repoRoot, evidencePath))) {
errors.push(`${label}:${expected.targetId}.evidencePath:${evidencePath}:missing`);
}
}
}
return errors;
}
function compareRuntimeLifecycleClaims(expectedLifecycle, actualLifecycle, manifestPath) {
const errors = [];
for (const stage of ["release", "test", "capture"]) {
@ -1516,6 +1549,7 @@ function buildConformanceExport(report) {
supportedFeatures: runtime.supportedFeatures,
supportedPlugins: runtime.supportedPlugins,
unsupportedPlugins: runtime.unsupportedPlugins,
worldSurfaceLowering: runtime.worldSurfaceLowering,
requiredFixtures: runtime.requiredFixtures,
pluginFixtures: runtime.pluginFixtures,
capabilityManifestPath: runtime.capabilityManifest?.manifestPath || "",
@ -1600,6 +1634,7 @@ function buildConformanceExport(report) {
commandTransportSchema: runtime.commandTransportSmoke?.schema || "",
captureStatus: runtime.capture?.status || "",
lifecycle: runtime.lifecycle,
worldSurfaceLowering: runtime.worldSurfaceLowering || [],
})),
splitTargets: report.splitTargets || [],
};
@ -1647,6 +1682,7 @@ function buildCapabilityMatrix(report) {
supportedFeatures: runtime.supportedFeatures || [],
supportedPlugins: runtime.supportedPlugins || [],
unsupportedPlugins: runtime.unsupportedPlugins || [],
worldSurfaceLowering: runtime.worldSurfaceLowering || [],
commandTransportSchema: runtime.commandTransportSmoke?.schema || "",
captureStatus: runtime.capture?.status || "",
splitHandoffExportPath: makeHandoffExportPath("runtime", runtime.id, runtime.splitHandoffPath || ""),
@ -1777,6 +1813,28 @@ function collectCapabilityGaps(report) {
}
}
const worldLoweringTargets = new Set();
for (const runtime of report.runtimes || []) {
for (const claim of runtime.worldSurfaceLowering || []) {
if (claim.targetId) worldLoweringTargets.add(claim.targetId);
}
}
for (const provider of report.providers || []) {
for (const surface of provider.surfaceContracts || []) {
for (const targetId of surface.worldInteraction?.loweringTargets || []) {
if (!worldLoweringTargets.has(targetId)) {
addGap({
kind: "runtime",
ownerRepo: "Eve",
subjectId: "world-surface-lowering",
gap: `provider:${provider.providerId}:surface:${surface.surfaceId}:world-lowering-target:${targetId}:missing-runtime`,
severity: "blocker",
});
}
}
}
}
for (const target of report.splitTargets || []) {
for (const blocker of target.blockers || []) {
addGap({