Define Aetheria world surface contract

This commit is contained in:
Meta Vens 2026-07-09 02:27:35 +01:00
commit be05146883
12 changed files with 255 additions and 1 deletions

View file

@ -45,6 +45,13 @@ try {
--expect-provider-surface aetheria:aetheria.daemon.editor `
--expect-provider-surface-kind aetheria:aetheria.daemon.game:interactive-world `
--expect-provider-surface-kind aetheria:aetheria.daemon.editor:interactive-world-editor `
--expect-provider-surface-field aetheria:aetheria.daemon.game:worldInteraction.projectionKind:provider-authored-world-surface `
--expect-provider-surface-field aetheria:aetheria.daemon.game:worldInteraction.commandBoundary:aetheria.daemon.commands `
--expect-provider-surface-field aetheria:aetheria.daemon.game:worldInteraction.receiptSchema:aetheria.eve_command_acceptance_status.v1 `
--expect-provider-surface-field aetheria:aetheria.daemon.game:worldInteraction.ownership:provider-owns-world-state-assets-command-acceptance-and-receipts `
--expect-provider-surface-field aetheria:aetheria.daemon.editor:worldInteraction.projectionKind:provider-authored-world-editor-surface `
--expect-provider-surface-field aetheria:aetheria.daemon.editor:worldInteraction.commandBoundary:aetheria.daemon.commands `
--expect-provider-surface-field aetheria:aetheria.daemon.editor:worldInteraction.receiptSchema:aetheria.eve_command_acceptance_status.v1 `
--expect-provider-command aetheria:aetheria.daemon.commands `
--expect-provider-receipt-state aetheria:accepted `
--expect-provider-receipt-state aetheria:reconciled `

View file

@ -54,6 +54,30 @@ if ($scenario.ownerRepo -ne $handoff.ownerRepo) {
throw "Aetheria scenario owner does not match handoff owner: $($scenario.ownerRepo)"
}
$worldSurfaces = @{}
foreach ($surface in @($advertisement.surfaces)) {
if ($surface.surfaceId -and $surface.worldInteraction) {
$worldSurfaces[$surface.surfaceId] = $surface
}
}
foreach ($requirement in @($scenario.requires.worldSurfaces)) {
if (-not $worldSurfaces.ContainsKey($requirement.surfaceId)) {
throw "Aetheria scenario requires world surface not advertised with worldInteraction: $($requirement.surfaceId)"
}
$advertisedSurface = $worldSurfaces[$requirement.surfaceId]
if ($advertisedSurface.surfaceKind -ne $requirement.surfaceKind) {
throw "Aetheria world surface kind mismatch for $($requirement.surfaceId): $($advertisedSurface.surfaceKind)"
}
foreach ($property in @("projectionKind", "commandBoundary", "receiptSchema")) {
if ($advertisedSurface.worldInteraction.$property -ne $requirement.$property) {
throw "Aetheria world surface $($requirement.surfaceId) $property mismatch: $($advertisedSurface.worldInteraction.$property)"
}
}
if (-not $advertisedSurface.worldInteraction.ownership) {
throw "Aetheria world surface $($requirement.surfaceId) missing ownership rule"
}
}
foreach ($fixtureId in @($handoff.fixtureIds)) {
if (-not (@($scenario.requires.fixtures) -contains $fixtureId)) {
throw "Aetheria provider handoff fixture is not required by scenario: $fixtureId"