diff --git a/docs/eve-migration-roadmap.md b/docs/eve-migration-roadmap.md index cb76fb7..9b47d98 100644 --- a/docs/eve-migration-roadmap.md +++ b/docs/eve-migration-roadmap.md @@ -274,13 +274,15 @@ Exit criteria: ## Active Work Queue -1. Add Aetheria scenario conformance replay that consumes provider - advertisements and reports command receipts without provider internals. -2. Add runtime command-transport smokes for Flutter and Unity so split targets +1. Add runtime command-transport smokes for Flutter and Unity so split targets can prove command emission through `gamecult.eve.command.v1`. Recently cut: +- Aetheria now has a provider scenario replay fixture advertised through its + provider advertisement. The parity harness validates advertised surfaces, + command boundary consumption, command intents, and provider-owned receipt + states without importing Aetheria internals into Eve. - Sai, Norn, and TeX now have plugin ABI fixtures for describe, validate, project, and apply behavior. The parity harness validates those fixtures against plugin manifests, so Eve proves the ABI shape without owning plugin diff --git a/schemas/gamecult.eve.provider_advertisement.v1.schema.json b/schemas/gamecult.eve.provider_advertisement.v1.schema.json index fc9ca94..b287811 100644 --- a/schemas/gamecult.eve.provider_advertisement.v1.schema.json +++ b/schemas/gamecult.eve.provider_advertisement.v1.schema.json @@ -160,6 +160,31 @@ }, "additionalProperties": true } + }, + "conformanceScenarios": { + "type": "array", + "items": { + "type": "object", + "required": ["scenarioId", "schema", "path"], + "properties": { + "scenarioId": { + "type": "string", + "minLength": 1 + }, + "schema": { + "type": "string", + "minLength": 1 + }, + "path": { + "type": "string", + "minLength": 1 + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": true + } } }, "additionalProperties": true diff --git a/schemas/gamecult.eve.provider_scenario.v1.schema.json b/schemas/gamecult.eve.provider_scenario.v1.schema.json new file mode 100644 index 0000000..c7828ca --- /dev/null +++ b/schemas/gamecult.eve.provider_scenario.v1.schema.json @@ -0,0 +1,132 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "gamecult.eve.provider_scenario.v1", + "title": "Eve Provider Scenario", + "type": "object", + "required": [ + "schema", + "scenarioId", + "providerId", + "ownerRepo", + "advertisementPath", + "requires", + "commandIntents", + "expectedReceipts" + ], + "properties": { + "schema": { + "const": "gamecult.eve.provider_scenario.v1" + }, + "scenarioId": { + "type": "string", + "minLength": 1 + }, + "providerId": { + "type": "string", + "minLength": 1 + }, + "ownerRepo": { + "type": "string", + "minLength": 1 + }, + "advertisementPath": { + "type": "string", + "minLength": 1 + }, + "requires": { + "type": "object", + "required": ["fixtures", "surfaces", "commands"], + "properties": { + "fixtures": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "surfaces": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "commands": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "schemas": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + } + }, + "additionalProperties": true + }, + "commandIntents": { + "type": "array", + "items": { + "type": "object", + "required": ["command", "commandId", "operation"], + "properties": { + "command": { + "type": "string", + "minLength": 1 + }, + "commandId": { + "type": "string", + "minLength": 1 + }, + "operation": { + "type": "string", + "minLength": 1 + }, + "payload": { + "type": "object" + } + }, + "additionalProperties": true + } + }, + "expectedReceipts": { + "type": "array", + "items": { + "type": "object", + "required": ["receiptId", "command", "commandId", "state", "authority", "ownerRepo"], + "properties": { + "receiptId": { + "type": "string", + "minLength": 1 + }, + "command": { + "type": "string", + "minLength": 1 + }, + "commandId": { + "type": "string", + "minLength": 1 + }, + "state": { + "type": "string", + "minLength": 1 + }, + "authority": { + "type": "string", + "minLength": 1 + }, + "ownerRepo": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": true + } + } + }, + "additionalProperties": true +} diff --git a/tools/parity/parity-manifest.json b/tools/parity/parity-manifest.json index 608c8a5..550debc 100644 --- a/tools/parity/parity-manifest.json +++ b/tools/parity/parity-manifest.json @@ -11,6 +11,7 @@ "gamecult.eve.plugin.v1": "schemas/gamecult.eve.plugin.v1.schema.json", "gamecult.eve.plugin_abi_fixture.v1": "schemas/gamecult.eve.plugin_abi_fixture.v1.schema.json", "gamecult.eve.plugin_advertisement.v1": "schemas/gamecult.eve.plugin_advertisement.v1.schema.json", + "gamecult.eve.provider_scenario.v1": "schemas/gamecult.eve.provider_scenario.v1.schema.json", "gamecult.eve.provider_advertisement.v1": "schemas/gamecult.eve.provider_advertisement.v1.schema.json" }, "conformancePacks": [ @@ -302,10 +303,12 @@ "graduationTrigger": "Aetheria owns RTS/ARPG world surfaces, generated level state, assets, command receipts, and scenario conformance; Eve keeps contract fixtures only.", "schemaPath": "schemas/gamecult.eve.provider_advertisement.v1.schema.json", "advertisementPath": "web/fixtures/aetheria.provider-advertisement.json", + "scenarioPath": "web/fixtures/aetheria-world-scenario.json", "requiredFixtures": ["aetheria-world"], "expectedSchemas": ["gamecult.eve.surface.v1", "gamecult.eve.command.v1", "aetheria.runtime.daemon.frame.v1"], "expectedSurfaces": ["aetheria.daemon.game", "aetheria.daemon.editor"], - "expectedCommands": ["aetheria.daemon.commands"] + "expectedCommands": ["aetheria.daemon.commands"], + "expectedPaths": ["web/fixtures/aetheria-world-scenario.json"] } ], "pluginManifests": [ diff --git a/tools/parity/run-parity.mjs b/tools/parity/run-parity.mjs index 4e3ac95..2e7d9a3 100644 --- a/tools/parity/run-parity.mjs +++ b/tools/parity/run-parity.mjs @@ -443,6 +443,8 @@ async function evaluateProvider(provider, fixtureResults) { const missingSchemas = (provider.expectedSchemas || []).filter(schema => !advertisedSchemaIds.includes(schema)); const missingSurfaces = (provider.expectedSurfaces || []).filter(surface => !surfaceIds.includes(surface)); const missingCommands = (provider.expectedCommands || []).filter(command => !commandIds.includes(command)); + const scenarioErrors = await validateProviderScenario(provider, advertisement, fixtureResults, advertisedSchemaIds, surfaceIds, commandIds); + const scenario = scenarioErrors.length || !provider.scenarioPath ? null : await readJsonDocument(provider.scenarioPath); const status = missingPaths.length ? "missing-body" : missingRequiredFixtures.length @@ -453,7 +455,9 @@ async function evaluateProvider(provider, fixtureResults) { ? "invalid-provider-advertisement" : missingSchemas.length || missingSurfaces.length || missingCommands.length ? "capability-gap" - : "advertised"; + : scenarioErrors.length + ? "invalid-provider-scenario" + : "advertised"; return { providerId: provider.providerId, @@ -466,7 +470,9 @@ async function evaluateProvider(provider, fixtureResults) { missingRequiredFixtures, schemaPath: provider.schemaPath || "", advertisementPath: provider.advertisementPath || "", + scenarioPath: provider.scenarioPath || "", advertisementErrors, + scenarioErrors, expectedPaths, missingPaths, missingIncubationFields, @@ -481,6 +487,8 @@ async function evaluateProvider(provider, fixtureResults) { missingSchemas, missingSurfaces, missingCommands, + scenarioId: scenario?.scenarioId || "", + scenarioReceiptStates: scenario ? [...new Set((scenario.expectedReceipts || []).map(receipt => receipt.state).filter(Boolean))].sort() : [], status, }; } @@ -489,6 +497,75 @@ async function readJsonDocument(documentPath) { return JSON.parse(await readFile(path.join(repoRoot, documentPath), "utf8")); } +async function validateProviderScenario(provider, advertisement, fixtureResults, advertisedSchemaIds, surfaceIds, commandIds) { + if (!provider.scenarioPath) return []; + + const errors = await validateJsonDocument( + manifest.schemas?.["gamecult.eve.provider_scenario.v1"], + provider.scenarioPath, + { + schema: "gamecult.eve.provider_scenario.v1", + providerId: provider.providerId, + }, + ); + if (errors.length) return errors; + + try { + const scenario = await readJsonDocument(provider.scenarioPath); + if (scenario.ownerRepo !== provider.ownerRepo) { + errors.push(`${provider.scenarioPath}:ownerRepo:expected ${provider.ownerRepo} got ${scenario.ownerRepo}`); + } + if (scenario.advertisementPath !== provider.advertisementPath) { + errors.push(`${provider.scenarioPath}:advertisementPath:expected ${provider.advertisementPath} got ${scenario.advertisementPath}`); + } + + const advertisedScenario = (advertisement?.conformanceScenarios || []).find(candidate => + candidate.scenarioId === scenario.scenarioId && candidate.path === provider.scenarioPath); + if (!advertisedScenario) { + errors.push(`${provider.advertisementPath}:conformanceScenarios:${scenario.scenarioId}:missing`); + } + + for (const fixtureId of scenario.requires?.fixtures || []) { + if (!fixtureResults.some(fixture => fixture.id === fixtureId && fixture.status === "pass")) { + errors.push(`${provider.scenarioPath}:requires.fixtures:${fixtureId}:missing`); + } + } + errors.push(...missingMembers(scenario.requires?.surfaces || [], surfaceIds, `${provider.scenarioPath}:requires.surfaces`)); + errors.push(...missingMembers(scenario.requires?.commands || [], commandIds, `${provider.scenarioPath}:requires.commands`)); + errors.push(...missingMembers(scenario.requires?.schemas || [], advertisedSchemaIds, `${provider.scenarioPath}:requires.schemas`)); + + const receipts = scenario.expectedReceipts || []; + const receiptKeys = new Set(receipts.map(receipt => `${receipt.command}:${receipt.commandId}`)); + for (const intent of scenario.commandIntents || []) { + if (!commandIds.includes(intent.command)) { + errors.push(`${provider.scenarioPath}:commandIntents:${intent.command}:unadvertised`); + } + if (!receiptKeys.has(`${intent.command}:${intent.commandId}`)) { + errors.push(`${provider.scenarioPath}:expectedReceipts:${intent.command}:${intent.commandId}:missing`); + } + } + + for (const receipt of receipts) { + if (!commandIds.includes(receipt.command)) { + errors.push(`${provider.scenarioPath}:expectedReceipts:${receipt.command}:unadvertised`); + } + if (receipt.ownerRepo !== provider.ownerRepo) { + errors.push(`${provider.scenarioPath}:expectedReceipts:${receipt.receiptId}:ownerRepo:expected ${provider.ownerRepo} got ${receipt.ownerRepo}`); + } + if (!["accepted", "denied", "pending", "reconciled"].includes(receipt.state)) { + errors.push(`${provider.scenarioPath}:expectedReceipts:${receipt.receiptId}:state:${receipt.state}:unknown`); + } + if (receipt.schema && !advertisedSchemaIds.includes(receipt.schema)) { + errors.push(`${provider.scenarioPath}:expectedReceipts:${receipt.receiptId}:schema:${receipt.schema}:unadvertised`); + } + } + } catch (error) { + errors.push(`${provider.scenarioPath}:invalid-json:${error instanceof Error ? error.message : String(error)}`); + } + + return errors; +} + async function validatePluginAbiFixture(plugin) { const errors = await validateJsonDocument( manifest.schemas?.["gamecult.eve.plugin_abi_fixture.v1"], @@ -951,18 +1028,19 @@ function renderMarkdown(report) { lines.push(`| ${plugin.title || plugin.pluginId} | ${plugin.status} | ${plugin.ownerRepo} | ${plugin.abiFixturePath || ""} | ${plugin.capabilities.join(", ")} | ${missing} |`); } - lines.push("", "## Providers", "", "| Provider | Status | Owner | Surfaces | Commands | Witnesses | Missing |", "| --- | --- | --- | --- | --- | --- | --- |"); + lines.push("", "## Providers", "", "| Provider | Status | Owner | Scenario | Receipt States | Surfaces | Commands | Witnesses | Missing |", "| --- | --- | --- | --- | --- | --- | --- | --- | --- |"); for (const provider of report.providers || []) { const missing = [ ...provider.missingPaths, ...provider.missingRequiredFixtures.map(id => `fixture:${id}`), ...provider.missingIncubationFields.map(id => `metadata:${id}`), ...provider.advertisementErrors.map(id => `advertisement:${id}`), + ...provider.scenarioErrors.map(id => `scenario:${id}`), ...provider.missingSchemas.map(id => `schema:${id}`), ...provider.missingSurfaces.map(id => `surface:${id}`), ...provider.missingCommands.map(id => `command:${id}`), ].join(", "); - lines.push(`| ${provider.title || provider.providerId} | ${provider.status} | ${provider.ownerRepo} | ${provider.surfaceIds.join(", ")} | ${provider.commandIds.join(", ")} | ${provider.witnessKinds.join(", ")} | ${missing} |`); + lines.push(`| ${provider.title || provider.providerId} | ${provider.status} | ${provider.ownerRepo} | ${provider.scenarioId || ""} | ${provider.scenarioReceiptStates.join(", ")} | ${provider.surfaceIds.join(", ")} | ${provider.commandIds.join(", ")} | ${provider.witnessKinds.join(", ")} | ${missing} |`); } lines.push("", "## Runtimes", "", "| Runtime | Status | Owner | Capture | Required Fixtures | Plugin Fixtures | Features | Plugin Gaps | Missing |", "| --- | --- | --- | --- | --- | --- | --- | --- | --- |"); diff --git a/web/fixtures/aetheria-world-scenario.json b/web/fixtures/aetheria-world-scenario.json new file mode 100644 index 0000000..cc92b93 --- /dev/null +++ b/web/fixtures/aetheria-world-scenario.json @@ -0,0 +1,53 @@ +{ + "schema": "gamecult.eve.provider_scenario.v1", + "scenarioId": "aetheria-world-command-replay", + "providerId": "aetheria", + "ownerRepo": "Aetheria", + "advertisementPath": "web/fixtures/aetheria.provider-advertisement.json", + "surfaceFixture": "aetheria-world", + "purpose": "Proves Aetheria interactive world clients consume provider advertisements, lower provider-owned game surfaces, issue command intents through the daemon boundary, and receive provider-owned receipts.", + "requires": { + "fixtures": ["aetheria-world"], + "surfaces": ["aetheria.daemon.game"], + "commands": ["aetheria.daemon.commands"], + "schemas": ["gamecult.eve.surface.v1", "gamecult.eve.command.v1", "aetheria.eve_command_acceptance_status.v1"] + }, + "commandIntents": [ + { + "command": "aetheria.daemon.commands", + "commandId": "aetheria.daemon.focus", + "operation": "focus_entity", + "payload": { + "entityId": "GateRelay" + } + }, + { + "command": "aetheria.daemon.commands", + "commandId": "aetheria.daemon.move_intent", + "operation": "set_move_vector", + "payload": { + "vector": [0.28, 0.0, 0.64] + } + } + ], + "expectedReceipts": [ + { + "receiptId": "aetheria.daemon.focus.accepted", + "command": "aetheria.daemon.commands", + "commandId": "aetheria.daemon.focus", + "state": "accepted", + "authority": "AetheriaRuntimeDaemonCommandBoundaryDocument", + "ownerRepo": "Aetheria", + "schema": "aetheria.eve_command_acceptance_status.v1" + }, + { + "receiptId": "aetheria.daemon.move_intent.reconciled", + "command": "aetheria.daemon.commands", + "commandId": "aetheria.daemon.move_intent", + "state": "reconciled", + "authority": "AetheriaRuntimeDaemonCommandBoundaryDocument", + "ownerRepo": "Aetheria", + "schema": "aetheria.eve_command_acceptance_status.v1" + } + ] +} diff --git a/web/fixtures/aetheria.provider-advertisement.json b/web/fixtures/aetheria.provider-advertisement.json index f993070..f72e32f 100644 --- a/web/fixtures/aetheria.provider-advertisement.json +++ b/web/fixtures/aetheria.provider-advertisement.json @@ -137,6 +137,14 @@ "summary": "Refresh player settings state." } ], + "conformanceScenarios": [ + { + "scenarioId": "aetheria-world-command-replay", + "schema": "gamecult.eve.provider_scenario.v1", + "path": "web/fixtures/aetheria-world-scenario.json", + "summary": "Interactive world replay through provider advertisement, daemon game surface, and provider-owned command receipts." + } + ], "styleCapabilities": [ { "styleProfile": "aetheria.daemon.world",