Graduate Electron runtime to EveElectron

This commit is contained in:
Meta Vens 2026-07-10 07:48:35 +01:00
commit 3baf125b38
26 changed files with 141 additions and 2218 deletions

View file

@ -285,11 +285,23 @@ Exit criteria:
## Active Work Queue
1. Graduate the generic Electron host/preload contract into EveElectron so
Aetheria retains only daemon lifecycle and provider transport configuration.
1. Produce owner-repo Electron window captures for the generic world fixture
and Aetheria, then attach them to conformance from EveElectron.
Recently cut:
- `GameCult/EveElectron` now owns the generic Electron runtime package. Its
shell lowers provider-advertised surfaces and command intents; its window
host owns secure `BrowserWindow` construction and controls; its preload
helper exposes the narrow `window.eveProvider` transport. Aetheria consumes
those package APIs while retaining daemon launch, CultMesh decoding, asset
protocol, authored renderer assets, and product smoke assertions. The live
Stage 7C Electron daemon witness passes through that path. Eve parity reads
the owner capability manifest directly, and the incubating runtime body,
split handoff, release tools, capture tools, and duplicate lifecycle smokes
have been deleted from Eve. Owner-produced PNG attachment is the remaining
Electron deliverable.
- Sai now owns a live runtime-independent Ink playback sidecar. One retained
`stdio-ndjson` process opens a compiled story, applies a branch choice,
projects the resulting `gamecult.eve.surface.v1`, and jumps to another knot.

View file

@ -474,12 +474,11 @@ it without depending on Eve's source layout. The remaining blocker is
owner-repo production of the same capture path, not absence of a cell-grid
artifact.
Electron semantic capture evidence follows the same evidence rule without
pretending it is a packaged window PNG. `tools/eveelectron/eveelectron-capture-artifact.mjs`
lowers the Aetheria world surface through `EveElectronShell` into
`gamecult.eve.electron_shell_projection.v1` and writes
`artifacts/eveelectron-capture/latest/electron-shell-projection.json`. The
remaining blocker is packaged Electron window capture.
Electron runtime evidence is consumed from the `EveElectron` owner repo.
Eve core no longer manufactures a JSON shell projection and presents it as
runtime capture evidence. Until EveElectron attaches real window PNGs for a
generic provider and Aetheria, the capture contract reports
`contract-artifact-missing` and remains visibly pending.
Unity scene runtime evidence is now consumed from the `EveUnity` owner repo
through the parity runtime's `sourceRoot`. Eve does not generate a substitute

View file

@ -1,191 +0,0 @@
{
"schema": "gamecult.eve.runtime_capability.v1",
"runtimeId": "electron-shell",
"title": "Electron shell",
"owner": "EveElectron",
"incubation": {
"ownerRepo": "EveElectron",
"currentHostRepo": "Eve",
"splitTarget": "EveElectron",
"graduationTrigger": "Split when Electron has a provider-agnostic shell body, provider advertisement consumption, command transport, packaged app lifecycle, and capture evidence independent of Aetheria product code.",
"splitHandoff": {
"manifestPath": "runtimes/incubating/eve-electron/eveelectron-split-handoff.json",
"smokeCommand": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-eveelectron-split-handoff-smoke.ps1"
}
},
"supportedFeatures": [
"providerAdvertisements",
"commandTransport",
"surfaceTreeProjection",
"embeddedDocuments",
"pluginProjection"
],
"supportedPlugins": [
{
"pluginId": "sai.vn",
"capabilities": [
"vn.stage",
"story.choose",
"story.continue",
"story.jump"
],
"projectionAdapter": "EveElectronShell.buildPluginProjection"
},
{
"pluginId": "norn.graph",
"capabilities": [
"embed.norn"
],
"projectionAdapter": "EveElectronShell.buildPluginProjection"
},
{
"pluginId": "tex.math",
"capabilities": [
"embed.tex",
"tex.inline",
"tex.block"
],
"projectionAdapter": "EveElectronShell.buildPluginProjection"
}
],
"unsupportedPlugins": [],
"worldSurfaceLowering": [
{
"targetId": "electron-shell",
"surfaceKinds": ["interactive-world", "interactive-world-editor"],
"projectionKinds": ["provider-authored-world-surface", "provider-authored-world-editor-surface"],
"supportLevel": "electron-shell-surface-tree-command-surface",
"ownership": "runtime-lowers-provider-world-surface-without-owning-world-state",
"evidencePaths": [
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"web/fixtures/sai-vn-surface.json",
"web/fixtures/aetheria.provider-advertisement.json",
"web/fixtures/eve-world-smoke.provider-advertisement.json"
]
}
],
"commandTransport": {
"schema": "gamecult.eve.command_invocation.v1",
"status": "provider-shell-contract-skeleton",
"emitter": "EveElectronShell.createCommandIntent",
"clientId": "electron-shell",
"authority": "Electron emits command intents through provider-advertised command boundaries; providers accept, deny, and publish receipts."
},
"lifecycle": {
"release": {
"ownerRepo": "EveElectron",
"status": "pending-electron-package",
"releaseContract": {
"ownerRepo": "EveElectron",
"packageName": "eve-electron",
"packageRoot": "runtimes/incubating/eve-electron",
"versionSource": "runtimes/incubating/eve-electron/package.json",
"tagPattern": "eveelectron-v{version}",
"artifactKind": "electron-app",
"requestSchema": "gamecult.eve.runtime_release_request.v1",
"requestBuilder": "tools/eveelectron/eveelectron-release-contract.mjs",
"artifactPattern": "artifacts/eveelectron-release/{version}/eve-electron-{version}.zip",
"publishProof": "Packaged Electron release is created from the EveElectron repo and references the provider-agnostic shell package root."
},
"evidencePaths": [
"runtimes/incubating/eve-electron/package.json",
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/eveelectron-split-handoff.json",
"scripts/run-eveelectron-split-handoff-smoke.ps1",
"scripts/run-eveelectron-release-contract-smoke.ps1",
"tools/eveelectron/eveelectron-release-contract.mjs",
"tools/eveelectron/eveelectron-release-contract.test.mjs"
],
"pendingProofs": [
"Electron packaged app release is cut from EveElectron rather than Eve incubation."
]
},
"test": {
"ownerRepo": "EveElectron",
"status": "provider-shell-contract-skeleton",
"testContract": {
"ownerRepo": "EveElectron",
"runnerKind": "electron-provider-shell-smoke",
"runnerScript": "scripts/run-eveelectron-provider-shell-smoke.ps1",
"consumerProject": "E:\\Projects\\Aetheria",
"packageName": "eve-electron",
"testAssembly": "eve-electron-shell.test.mjs",
"testPlatform": "Node contract skeleton",
"resultsArtifact": "artifacts/eveelectron-provider-shell/{stamp}/provider-shell-results.json",
"logArtifact": "artifacts/eveelectron-provider-shell/{stamp}/provider-shell.log",
"manifestMutation": "None; the shell consumes provider advertisements and must not mutate provider product manifests."
},
"evidencePaths": [
"runtimes/incubating/eve-electron/package.json",
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"runtimes/incubating/eve-electron/eveelectron-split-handoff.json",
"scripts/run-eveelectron-split-handoff-smoke.ps1",
"scripts/run-eveelectron-provider-shell-smoke.ps1"
],
"pendingProofs": [
"Electron provider-advertisement smoke runs from EveElectron in a packaged Electron window without importing Aetheria source layout."
]
},
"capture": {
"ownerRepo": "EveElectron",
"status": "pending-electron-window-capture",
"captureContract": {
"ownerRepo": "EveElectron",
"runtimeId": "electron-shell",
"targetId": "electron-shell",
"requestSchema": "gamecult.eve.runtime_capture_request.v1",
"requestBuilder": "tools/eveelectron/eveelectron-capture-contract.mjs",
"advertisementPath": "web/fixtures/aetheria.provider-advertisement.json",
"captureKind": "electron-window-png",
"artifactKind": "png",
"artifactPattern": "artifacts/eveelectron-capture/{stamp}/electron-shell.png",
"conformanceAttachment": "runtime.captureArtifacts[]",
"requiredProvider": "aetheria",
"requiredSurface": "aetheria.daemon.game",
"additionalProviderSurfaces": [
{
"providerId": "eve.world-smoke",
"surfaceId": "eve.world-smoke.surface",
"purpose": "Generic non-product interactive-world capture control."
},
{
"providerId": "aetheria",
"surfaceId": "aetheria.daemon.editor",
"purpose": "Aetheria interactive-world-editor capture control."
}
],
"authority": "Capture observes Electron projection only; provider state, command acceptance, and receipts stay provider-owned.",
"publishProof": "Electron window capture artifact is attached to the runtime conformance report from EveElectron."
},
"evidencePaths": [
"tools/eveelectron/eveelectron-capture-contract.mjs",
"tools/eveelectron/eveelectron-capture-contract.test.mjs",
"tools/eveelectron/eveelectron-capture-artifact.mjs",
"tools/eveelectron/eveelectron-capture-artifact.test.mjs",
"scripts/run-eveelectron-capture-contract-smoke.ps1",
"scripts/run-eveelectron-capture-smoke.ps1"
],
"pendingProofs": [
"Electron window capture artifact is attached to the runtime conformance report."
]
}
},
"capture": {
"status": "json-projection",
"note": "Electron attaches a provider-advertisement-backed gamecult.eve.electron_shell_projection.v1 JSON projection artifact; packaged window PNG capture remains an EveElectron split blocker.",
"artifacts": [
{
"kind": "json-projection",
"schema": "gamecult.eve.electron_shell_projection.v1",
"path": "artifacts/eveelectron-capture/latest/electron-shell-projection.json",
"runtimeId": "electron-shell",
"providerId": "aetheria",
"surfaceId": "aetheria.daemon.game",
"sourceSurfacePath": "web/fixtures/aetheria-world-surface.json",
"requestPath": "artifacts/eveelectron-capture/latest/capture-request.json"
}
]
}
}

View file

@ -1,111 +0,0 @@
{
"schema": "gamecult.eve.runtime_split_handoff.v1",
"splitTarget": "EveElectron",
"ownerRepo": "EveElectron",
"currentHostRepo": "Eve",
"runtimeId": "electron-shell",
"packageName": "eve-electron",
"sourcePackageRoot": "runtimes/incubating/eve-electron",
"destinationPackageRoot": "packages/eve-electron",
"authorityBoundary": "EveElectron owns generic Electron shell projection, window lifecycle, packaged app build glue, provider advertisement consumption, command transport, capture, and shell-level plugin projection adapters. Aetheria owns Starbridge state, product-specific RTS flows, assets, command authorization, receipts, and authored provider surfaces. Eve keeps the surface, command, provider advertisement, plugin advertisement, and conformance contracts.",
"moveSets": [
{
"id": "electron-shell-runtime",
"stage": "runtime-body",
"currentPaths": [
"runtimes/incubating/eve-electron/package.json",
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"web/fixtures/sai-vn-surface.json"
],
"observedProviderPaths": [
"E:\\Projects\\Aetheria\\Aetheria.Rts.Web\\Electron",
"E:\\Projects\\Aetheria\\Aetheria.Rts.Web\\Client",
"E:\\Projects\\Aetheria\\Aetheria.Rts.Web\\tsconfig.electron.json"
],
"destinationOwner": "EveElectron",
"replacementProof": "EveElectron hosts a provider-agnostic Electron shell that loads provider advertisements and lowers Eve surfaces without importing Aetheria client modules."
},
{
"id": "electron-command-transport",
"stage": "command",
"currentPaths": [
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs"
],
"observedProviderPaths": [
"E:\\Projects\\Aetheria\\Aetheria.Rts.Web\\Client\\app.ts",
"E:\\Projects\\Aetheria\\Aetheria.Rts.Web\\Electron\\preload.cjs",
"E:\\Projects\\Aetheria\\Aetheria.Rts.Web\\Electron\\aetheria-cultmesh.ts"
],
"destinationOwner": "EveElectron",
"replacementProof": "Electron emits gamecult.eve.command.v1 intents through the provider-advertised command boundary and receives provider receipts instead of mutating local product state."
},
{
"id": "electron-world-surface-lowering",
"stage": "world-surface-lowering",
"currentPaths": [
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"runtimes/incubating/eve-electron/eve-runtime-capability.json"
],
"observedProviderPaths": [
"E:\\Projects\\Aetheria\\Aetheria.Rts.Web\\Client"
],
"destinationOwner": "EveElectron",
"replacementProof": "Electron claims provider-advertised world/editor surface targets with provider-agnostic surface-tree projection and command boundary evidence; packaged rendering and capture remain separate lifecycle proofs."
},
{
"id": "electron-plugin-projection",
"stage": "plugin-projection",
"currentPaths": [
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"runtimes/incubating/eve-electron/eve-runtime-capability.json",
"web/fixtures/sai-vn-surface.json"
],
"destinationOwner": "EveElectron",
"replacementProof": "EveElectron owns shell projection metadata for Sai, Norn, and TeX sidecar-advertised components; Sai keeps story state, Norn keeps graph layout/state, and EvePlugins keeps TeX rendering semantics."
},
{
"id": "electron-capture-lifecycle",
"stage": "capture",
"currentPaths": [
"tools/eveelectron/eveelectron-capture-contract.mjs",
"tools/eveelectron/eveelectron-capture-contract.test.mjs",
"tools/eveelectron/eveelectron-capture-artifact.mjs",
"tools/eveelectron/eveelectron-capture-artifact.test.mjs",
"scripts/run-eveelectron-capture-contract-smoke.ps1",
"scripts/run-eveelectron-capture-smoke.ps1"
],
"destinationOwner": "EveElectron",
"replacementProof": "EveElectron builds a provider-advertisement-backed capture request and deterministic gamecult.eve.electron_shell_projection.v1 JSON projection artifact now; the split is not complete until the EveElectron repo attaches desktop-window capture artifacts to conformance output for at least one non-Aetheria provider and one Aetheria scenario."
}
],
"contractInputs": [
"gamecult.eve.surface.v1",
"gamecult.eve.command.v1",
"gamecult.eve.provider_advertisement.v1",
"gamecult.eve.plugin_advertisement.v1",
"gamecult.eve.plugin.v1",
"gamecult.eve.conformance_export.v1"
],
"forbiddenImports": [
"Aetheria RTS client modules as EveElectron runtime authority",
"Aetheria Starbridge state as Electron shell truth",
"provider-specific IPC contracts that bypass gamecult.eve.command.v1",
"Sai story state, VN/Ink semantics, or story command interpretation as Electron shell authority",
"Norn graph layout, graph state, or command semantics as Electron shell authority",
"TeX parsing, typesetting, baseline metrics, or render-cache semantics as Electron shell authority",
"renderer-local product state as daemon truth"
],
"requiredExternalProofs": [
"EveElectron publishes a runtime capability manifest with provider advertisement consumption and command transport.",
"EveElectron owns a provider-shell contract skeleton that selects advertised provider surfaces, projects Eve surface trees, and emits gamecult.eve.command.v1 intents.",
"EveElectron projects Sai, Norn, and TeX sidecar plugin shells without importing plugin semantic internals.",
"EveElectron lowers at least one generic Eve provider surface that is not Aetheria.",
"EveElectron lowers Aetheria world/editor surfaces through provider advertisements without importing Aetheria internals.",
"Aetheria keeps Starbridge-specific UI, assets, authored flows, and receipts in the Aetheria repo.",
"EveElectron attaches packaged Electron window PNG capture artifacts to conformance output."
]
}

View file

@ -1,17 +0,0 @@
{
"name": "eve-electron",
"version": "0.1.0",
"type": "module",
"description": "Provider-agnostic Electron shell skeleton for Eve surfaces.",
"main": "src/eve-electron-shell.mjs",
"scripts": {
"test": "C:\\Progra~1\\nodejs\\node.exe --test test/*.test.mjs"
},
"keywords": [
"Eve",
"Electron",
"CultUI",
"provider-advertisement"
],
"license": "MPL-2.0"
}

View file

@ -1,233 +0,0 @@
export class EveElectronShell {
constructor({ clientId = "electron-shell" } = {}) {
this.clientId = clientId;
}
selectSurface(providerAdvertisement, requestedSurfaceId = "") {
const provider = normalizeProviderAdvertisement(providerAdvertisement);
const surfaces = provider.surfaces;
const surface = requestedSurfaceId
? surfaces.find(candidate => candidate.surfaceId === requestedSurfaceId)
: surfaces[0];
if (!surface) {
throw new Error(`Provider ${provider.providerId} does not advertise surface ${requestedSurfaceId || "(first)"}`);
}
return {
providerId: provider.providerId,
surfaceId: surface.surfaceId,
transport: surface.transport || "",
url: surface.url || surface.key || "",
worldInteraction: normalizeWorldInteraction(surface.worldInteraction),
};
}
lowerSurface(surfaceDocument, providerAdvertisement, requestedSurfaceId = "") {
const selected = this.selectSurface(providerAdvertisement, requestedSurfaceId);
const document = normalizeSurfaceDocument(surfaceDocument);
if (document.surfaceId !== selected.surfaceId) {
throw new Error(`Surface document ${document.surfaceId} does not match advertised Electron surface ${selected.surfaceId}.`);
}
return {
type: "electron-shell-projection",
schema: "gamecult.eve.electron_shell_projection.v1",
providerId: selected.providerId,
surfaceId: selected.surfaceId,
projectionKind: selected.worldInteraction.projectionKind,
commandBoundary: selected.worldInteraction.commandBoundary,
receiptSchema: selected.worldInteraction.receiptSchema,
ownership: selected.worldInteraction.ownership,
root: buildShellNode(document.root),
};
}
createCommandIntent(providerAdvertisement, requestedSurfaceId, command, payload = {}) {
if (!command) throw new Error("Command is required.");
const selected = this.selectSurface(providerAdvertisement, requestedSurfaceId);
const action = objectValue(payload.action);
const commandBoundary = firstString(
selected.worldInteraction.commandBoundary,
payload.commandBoundary,
action.commandBoundary,
action.target,
);
const receiptSchema = firstString(
selected.worldInteraction.receiptSchema,
payload.receiptSchema,
action.receiptSchema,
);
const intent = {
type: "surface-command",
schema: "gamecult.eve.command_invocation.v1",
providerId: selected.providerId,
surfaceId: selected.surfaceId,
command,
payload: {
...payload,
transport: payload.transport ?? null,
},
issuedAt: new Date().toISOString(),
clientId: this.clientId,
};
if (commandBoundary) intent.commandBoundary = commandBoundary;
if (receiptSchema) intent.receiptSchema = receiptSchema;
return intent;
}
}
export function normalizeProviderAdvertisement(providerAdvertisement) {
if (!providerAdvertisement || typeof providerAdvertisement !== "object") {
throw new Error("Provider advertisement is required.");
}
const providerId = String(providerAdvertisement.providerId || "");
if (!providerId) throw new Error("Provider advertisement missing providerId.");
const surfaces = Array.isArray(providerAdvertisement.surfaces)
? providerAdvertisement.surfaces
.filter(surface => surface && typeof surface === "object" && surface.surfaceId)
.map(surface => ({
...surface,
surfaceId: String(surface.surfaceId),
}))
: [];
if (!surfaces.length) throw new Error(`Provider ${providerId} advertises no surfaces.`);
return { ...providerAdvertisement, providerId, surfaces };
}
export function normalizeSurfaceDocument(surfaceDocument) {
if (!surfaceDocument || typeof surfaceDocument !== "object") {
throw new Error("Surface document is required.");
}
if (surfaceDocument.schema !== "gamecult.eve.surface.v1") {
throw new Error(`Unexpected surface schema: ${surfaceDocument.schema || ""}`);
}
const surface = objectValue(surfaceDocument.surface);
const surfaceId = firstString(surface.id);
if (!surfaceId) throw new Error("Surface document missing surface.id.");
const root = objectValue(surface.root);
if (!root.id) throw new Error(`Surface document ${surfaceId} missing surface.root.`);
return { ...surfaceDocument, surfaceId, root };
}
function buildShellNode(component) {
const source = objectValue(component);
const children = Array.isArray(source.children) ? source.children.map(buildShellNode) : [];
const embeddedDocuments = normalizeEmbeddedDocuments(source.embeddedDocuments);
const componentKind = firstString(source.kind);
const pluginProjection = buildPluginProjection(componentKind, source);
return {
id: firstString(source.id),
componentKind,
shellElementKind: shellElementKind(componentKind),
props: objectValue(source.props),
layout: objectValue(source.layout),
style: objectValue(source.style),
stateBindingCount: Array.isArray(source.stateBindings) ? source.stateBindings.length : 0,
embeddedDocumentCount: embeddedDocuments.length,
embeddedDocuments,
...(pluginProjection ? { pluginProjection } : {}),
children,
};
}
function normalizeEmbeddedDocuments(value) {
return Array.isArray(value)
? value
.filter(document => document && typeof document === "object")
.map(document => ({
slotId: firstString(document.slotId, document.id),
documentId: firstString(document.documentId, document.href, document.url),
schemaId: firstString(document.schemaId, document.schema),
presentationKind: firstString(document.presentationKind, document.kind),
}))
.filter(document => document.slotId || document.documentId)
: [];
}
function shellElementKind(componentKind) {
if (!componentKind) return "empty";
if (componentKind === "vn.stage") return "sai-vn-stage-shell";
if (componentKind === "embed.norn") return "norn-graph-shell";
if (componentKind === "embed.tex") return "tex-math-shell";
if (componentKind.startsWith("control.")) return "command-control";
if (componentKind.startsWith("embed.")) return "plugin-placeholder";
if (componentKind === "surface.slot") return "embedded-surface-slot";
if (componentKind.startsWith("field.") || componentKind.startsWith("world.")) return "world-projection-node";
if (componentKind.startsWith("text.") || componentKind === "text" || componentKind === "label") return "text";
return "shell-node";
}
function buildPluginProjection(componentKind, component) {
if (componentKind === "vn.stage") {
return {
pluginId: "sai.vn",
projectionKind: "sai-vn-electron-stage-shell",
abiSchema: "gamecult.eve.plugin_abi.v1",
commandBoundary: "sidecar-advertised-plugin-abi",
capabilities: ["vn.stage", "story.choose", "story.continue", "story.jump"],
documentId: firstString(component.props?.storyId, component.id),
semanticOwner: "Sai",
availability: "required",
};
}
if (componentKind === "embed.norn") {
return {
pluginId: "norn.graph",
projectionKind: "norn-graph-electron-overlay-shell",
abiSchema: "gamecult.eve.plugin_abi.v1",
commandBoundary: "sidecar-advertised-plugin-abi",
capabilities: ["embed.norn"],
documentId: firstString(component.props?.sourceUri, component.props?.documentId, component.id),
semanticOwner: "Norn",
availability: "optional-nested",
};
}
if (componentKind === "embed.tex") {
return {
pluginId: "tex.math",
projectionKind: texProjectionKind(component),
abiSchema: "gamecult.eve.plugin_abi.v1",
commandBoundary: "sidecar-advertised-plugin-abi",
capabilities: ["embed.tex", "tex.inline", "tex.block"],
documentId: firstString(component.props?.sourceUri, component.props?.source, component.id),
semanticOwner: "EvePlugins",
availability: "optional-nested",
};
}
return null;
}
function texProjectionKind(component) {
const display = firstString(component.props?.display, "inline");
if (display === "block") return "tex-math-electron-block-source-shell";
if (display === "page") return "tex-math-electron-page-source-shell";
return "tex-math-electron-inline-source-shell";
}
function normalizeWorldInteraction(value) {
const source = objectValue(value);
return {
projectionKind: firstString(source.projectionKind),
commandBoundary: firstString(source.commandBoundary),
receiptSchema: firstString(source.receiptSchema),
ownership: firstString(source.ownership),
};
}
function objectValue(value) {
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
}
function firstString(...values) {
for (const value of values) {
if (typeof value === "string" && value.trim()) return value;
if (typeof value === "number" && Number.isFinite(value)) return String(value);
}
return "";
}

View file

@ -1,246 +0,0 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import path from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
import { validateSchemaSubset } from "../../test-support/schema-subset.mjs";
import { EveElectronShell } from "../src/eve-electron-shell.mjs";
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../../..");
const electronProjectionSchema = JSON.parse(readFileSync(
path.join(repoRoot, "schemas/gamecult.eve.electron_shell_projection.v1.schema.json"),
"utf8",
));
test("selects the active advertised provider surface", () => {
const shell = new EveElectronShell();
const selected = shell.selectSurface(advertisement(), "aetheria.daemon.editor");
assert.equal(selected.providerId, "aetheria");
assert.equal(selected.surfaceId, "aetheria.daemon.editor");
assert.equal(selected.worldInteraction.commandBoundary, "aetheria.daemon.commands");
assert.equal(selected.worldInteraction.receiptSchema, "aetheria.eve_command_acceptance_status.v1");
});
test("command intents carry provider-advertised boundaries over component fallback", () => {
const shell = new EveElectronShell();
const intent = shell.createCommandIntent(
advertisement(),
"aetheria.daemon.game",
"aetheria.daemon.commands",
{
action: {
commandBoundary: "component.fallback.boundary",
receiptSchema: "component.fallback.receipt.v1",
target: "component.fallback.target",
},
commandId: "aetheria.daemon.focus",
},
);
assert.equal(intent.schema, "gamecult.eve.command_invocation.v1");
assert.equal(intent.providerId, "aetheria");
assert.equal(intent.surfaceId, "aetheria.daemon.game");
assert.equal(intent.commandBoundary, "aetheria.daemon.commands");
assert.equal(intent.receiptSchema, "aetheria.eve_command_acceptance_status.v1");
assert.equal(intent.clientId, "electron-shell");
});
test("lowers provider surface trees into an Electron shell projection", () => {
const shell = new EveElectronShell();
const projection = shell.lowerSurface(surfaceDocument(), advertisement(), "aetheria.daemon.game");
assert.deepEqual(validateSchemaSubset(electronProjectionSchema, projection), []);
assert.equal(projection.schema, "gamecult.eve.electron_shell_projection.v1");
assert.equal(projection.providerId, "aetheria");
assert.equal(projection.surfaceId, "aetheria.daemon.game");
assert.equal(projection.projectionKind, "provider-authored-world-surface");
assert.equal(projection.commandBoundary, "aetheria.daemon.commands");
assert.equal(projection.receiptSchema, "aetheria.eve_command_acceptance_status.v1");
assert.equal(projection.root.id, "aetheria.daemon.game.root");
assert.equal(projection.root.children.length, 3);
assert.equal(projection.root.children[0].shellElementKind, "world-projection-node");
assert.equal(projection.root.children[0].props.binding, "cultmesh://aetheria/world/entities");
assert.equal(projection.root.children[0].stateBindingCount, 1);
assert.equal(projection.root.children[1].shellElementKind, "command-control");
assert.equal(projection.root.children[1].props.command, "aetheria.daemon.commands");
assert.equal(projection.root.children[2].shellElementKind, "norn-graph-shell");
assert.equal(projection.root.children[2].pluginProjection.pluginId, "norn.graph");
assert.equal(projection.root.children[2].pluginProjection.semanticOwner, "Norn");
assert.equal(projection.root.children[2].embeddedDocumentCount, 1);
assert.deepEqual(projection.root.children[2].embeddedDocuments, [
{
slotId: "norn.map",
documentId: "cultmesh://aetheria/norn/map",
schemaId: "gamecult.eve.surface.v1",
presentationKind: "electron-overlay",
},
]);
});
test("lowers Sai, Norn, and TeX sidecar plugin shells without owning semantics", () => {
const shell = new EveElectronShell();
const saiSurface = JSON.parse(readFileSync(path.join(repoRoot, "web/fixtures/sai-vn-surface.json"), "utf8"));
const projection = shell.lowerSurface(saiSurface, saiAdvertisement(), "sai.visual_novel.surface");
assert.deepEqual(validateSchemaSubset(electronProjectionSchema, projection), []);
assert.equal(projection.providerId, "gamecult.home.vn");
assert.equal(projection.surfaceId, "sai.visual_novel.surface");
assert.equal(projection.root.shellElementKind, "sai-vn-stage-shell");
assert.equal(projection.root.pluginProjection.pluginId, "sai.vn");
assert.equal(projection.root.pluginProjection.semanticOwner, "Sai");
assert.equal(projection.root.pluginProjection.availability, "required");
assert.equal(projection.root.pluginProjection.commandBoundary, "sidecar-advertised-plugin-abi");
assert.deepEqual(projection.root.pluginProjection.capabilities, [
"vn.stage",
"story.choose",
"story.continue",
"story.jump",
]);
const norn = findNode(projection.root, "sai.graph");
assert.equal(norn.shellElementKind, "norn-graph-shell");
assert.equal(norn.pluginProjection.pluginId, "norn.graph");
assert.equal(norn.pluginProjection.projectionKind, "norn-graph-electron-overlay-shell");
assert.equal(norn.pluginProjection.semanticOwner, "Norn");
assert.equal(norn.pluginProjection.availability, "optional-nested");
assert.deepEqual(norn.pluginProjection.capabilities, ["embed.norn"]);
const tex = findNode(projection.root, "sai.tex.log-power");
assert.equal(tex.shellElementKind, "tex-math-shell");
assert.equal(tex.pluginProjection.pluginId, "tex.math");
assert.equal(tex.pluginProjection.projectionKind, "tex-math-electron-block-source-shell");
assert.equal(tex.pluginProjection.semanticOwner, "EvePlugins");
assert.equal(tex.pluginProjection.availability, "optional-nested");
assert.equal(tex.pluginProjection.documentId, "\\\\mathrm{votes}(p)=1+\\\\lfloor\\\\log_b(1+p)\\\\rfloor");
assert.deepEqual(tex.pluginProjection.capabilities, ["embed.tex", "tex.inline", "tex.block"]);
});
test("rejects surface documents that do not match the advertised target", () => {
const shell = new EveElectronShell();
assert.throws(
() => shell.lowerSurface(surfaceDocument("aetheria.daemon.game"), advertisement(), "aetheria.daemon.editor"),
/does not match advertised Electron surface/,
);
});
function advertisement() {
return {
schema: "gamecult.eve.provider_advertisement.v1",
providerId: "aetheria",
surfaces: [
{
surfaceId: "aetheria.daemon.game",
transport: "local-json",
url: "web/fixtures/aetheria-world-surface.json",
worldInteraction: {
projectionKind: "provider-authored-world-surface",
commandBoundary: "aetheria.daemon.commands",
receiptSchema: "aetheria.eve_command_acceptance_status.v1",
ownership: "provider-owns-world-state-assets-command-acceptance-and-receipts",
},
},
{
surfaceId: "aetheria.daemon.editor",
transport: "local-json",
url: "web/fixtures/aetheria-world-surface.json",
worldInteraction: {
projectionKind: "provider-authored-world-editor-surface",
commandBoundary: "aetheria.daemon.commands",
receiptSchema: "aetheria.eve_command_acceptance_status.v1",
ownership: "provider-owns-editor-state-assets-command-acceptance-and-receipts",
},
},
],
};
}
function saiAdvertisement() {
return {
schema: "gamecult.eve.provider_advertisement.v1",
providerId: "gamecult.home.vn",
surfaces: [
{
surfaceId: "sai.visual_novel.surface",
transport: "local-json",
url: "web/fixtures/sai-vn-surface.json",
worldInteraction: {
projectionKind: "provider-authored-world-surface",
commandBoundary: "sai.vn.plugin.commands",
receiptSchema: "gamecult.eve.command_receipt.v1",
ownership: "provider-owns-story-state-plugin-sidecars-own-nested-semantics",
},
},
],
};
}
function surfaceDocument(surfaceId = "aetheria.daemon.game") {
return {
type: "surface-state",
schema: "gamecult.eve.surface.v1",
providerId: "aetheria",
providerKind: "game.runtime",
title: "Aetheria world",
version: 1,
updatedAtUtc: "2026-07-09T00:00:00Z",
surface: {
id: surfaceId,
root: {
id: `${surfaceId}.root`,
kind: "surface",
props: {},
children: [
{
id: `${surfaceId}.entities`,
kind: "field.surface2d",
props: {
binding: "cultmesh://aetheria/world/entities",
},
stateBindings: [
{
target: "entities",
pointerId: "cultmesh://aetheria/world/entities",
},
],
children: [],
},
{
id: `${surfaceId}.focus`,
kind: "control.button",
props: {
command: "aetheria.daemon.commands",
commandId: "aetheria.daemon.focus",
},
children: [],
},
{
id: `${surfaceId}.norn`,
kind: "embed.norn",
props: {},
embeddedDocuments: [
{
slotId: "norn.map",
documentId: "cultmesh://aetheria/norn/map",
schemaId: "gamecult.eve.surface.v1",
presentationKind: "electron-overlay",
},
],
children: [],
},
],
},
styles: [],
},
commands: [],
};
}
function findNode(root, id) {
if (root.id === id) return root;
for (const child of root.children || []) {
const found = findNode(child, id);
if (found) return found;
}
return null;
}

View file

@ -82,23 +82,18 @@ try {
--expect-command-boundary-coverage aetheria:aetheria.daemon.editor:tui:covered:EveTui:tui `
--expect-split-target-proof "EveUnity:Aetheria daemon 3D ARPG world lowers through a generic EveUnity playable-world client" `
--expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:aetheria:aetheria.daemon.game `
--expect-runtime-capture-artifact electron-shell:json-projection:gamecult.eve.electron_shell_projection.v1:aetheria:aetheria.daemon.game `
--expect-runtime-capture-probe electron-shell:contract-artifact-missing:png:EveElectron `
--expect-runtime-capture-artifact tui:json-grid:gamecult.eve.tui_grid.v1:aetheria:aetheria.daemon.game `
--expect-split-handoff-move EveTui:tui:tui-runtime-body:current:exists:eve-tui-shell.mjs `
--expect-split-handoff-move EveTui:tui:tui-world-surface-lowering:current:exists:eve-tui-shell.mjs `
--expect-split-handoff-move EveTui:tui:tui-command-transport:current:exists:eve-tui-shell.mjs `
--expect-split-target-blocker "EveElectron:Electron shell runtime body graduates to EveElectron outside Aetheria product code" `
--expect-split-target-proof "EveElectron:Aetheria consumes EveElectron for generic window and preload authority" `
--expect-split-target-blocker "EveElectron:Electron packaged window PNG capture artifacts are attached to conformance output" `
--expect-split-target-blocker "EveTui:TUI package release is cut from EveTui rather than Eve incubation" `
--expect-split-target-blocker "EveTui:TUI capture path is owned by EveTui rather than Eve incubation" `
--expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:Packages/manifest.json `
--expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:GameCult.Eve.UnityUIToolkit.csproj `
--expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:Aetheria.State.Unity/AetheriaRuntimeCatalogClient.cs `
--expect-split-handoff-move EveElectron:electron-shell:electron-shell-runtime:current:exists:eve-electron-shell.mjs `
--expect-split-handoff-move EveElectron:electron-shell:electron-command-transport:current:exists:eve-electron-shell.mjs `
--expect-split-handoff-move EveElectron:electron-shell:electron-world-surface-lowering:current:exists:eve-electron-shell.mjs `
--expect-split-handoff-move EveElectron:electron-shell:electron-shell-runtime:observed-provider:exists:Aetheria.Rts.Web/Electron `
--expect-split-handoff-move EveElectron:electron-shell:electron-command-transport:observed-provider:exists:Aetheria.Rts.Web/Client/app.ts `
--expect-split-handoff-move EveElectron:electron-shell:electron-world-surface-lowering:observed-provider:exists:Aetheria.Rts.Web/Client `
--expect-provider-command aetheria:aetheria.daemon.commands `
--expect-provider-receipt-state aetheria:accepted `
--expect-provider-receipt-state aetheria:pending `

View file

@ -102,7 +102,7 @@ try {
--expect-screenshot-metric electron-shell:aetheria-world:bounding-boxes:pending-capture `
--expect-runtime-capture-probe unity-uitoolkit:semantic-artifact-present-capture-pending:png:EveUnity `
--expect-runtime-capture-probe unity-scene:control-artifact-present-product-capture-pending:png:EveUnity `
--expect-runtime-capture-probe electron-shell:semantic-artifact-present-capture-pending:png:EveElectron `
--expect-runtime-capture-probe electron-shell:contract-artifact-missing:png:EveElectron `
--expect-runtime-capture-probe tui:contract-artifact-present:json-grid:EveTui `
--expect-capability-gap "split-target:EveUnity:EveUnity:proof:Tagged UPM release" `
--expect-conformance-handoff

View file

@ -1,99 +0,0 @@
param(
[string] $CapabilityManifestPath = "runtimes\incubating\eve-electron\eve-runtime-capability.json",
[string] $AdvertisementPath = "web\fixtures\aetheria.provider-advertisement.json",
[string] $OutputPath = "artifacts\eveelectron-capture-contract\latest\capture-request.json",
[string] $Stamp = "smoke"
)
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$absoluteCapabilityPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) {
$CapabilityManifestPath
} else {
Join-Path $projectRoot $CapabilityManifestPath
}
$absoluteAdvertisementPath = if ([System.IO.Path]::IsPathRooted($AdvertisementPath)) {
$AdvertisementPath
} else {
Join-Path $projectRoot $AdvertisementPath
}
$absoluteOutputPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) {
$OutputPath
} else {
Join-Path $projectRoot $OutputPath
}
foreach ($path in @($absoluteCapabilityPath, $absoluteAdvertisementPath)) {
if (-not (Test-Path -LiteralPath $path)) {
throw "EveElectron capture contract input not found: $path"
}
}
$manifest = Get-Content -LiteralPath $absoluteCapabilityPath -Raw | ConvertFrom-Json
$captureContract = $manifest.lifecycle.capture.captureContract
if ($null -eq $captureContract) {
throw "EveElectron capture contract missing lifecycle.capture.captureContract"
}
foreach ($field in @("ownerRepo", "runtimeId", "targetId", "requestSchema", "requestBuilder", "advertisementPath", "captureKind", "artifactKind", "artifactPattern", "conformanceAttachment", "requiredProvider", "requiredSurface", "authority", "publishProof")) {
if (-not $captureContract.$field) {
throw "EveElectron capture contract missing $field"
}
}
if ($captureContract.ownerRepo -ne "EveElectron") {
throw "Unexpected EveElectron capture owner: $($captureContract.ownerRepo)"
}
if ($captureContract.runtimeId -ne "electron-shell") {
throw "Unexpected EveElectron capture runtime: $($captureContract.runtimeId)"
}
if ($captureContract.targetId -ne "electron-shell") {
throw "Unexpected EveElectron capture target: $($captureContract.targetId)"
}
if ($captureContract.requestSchema -ne "gamecult.eve.runtime_capture_request.v1") {
throw "Unexpected EveElectron capture request schema: $($captureContract.requestSchema)"
}
$builderPath = Join-Path $projectRoot $captureContract.requestBuilder
if (-not (Test-Path -LiteralPath $builderPath)) {
throw "EveElectron capture request builder not found: $($captureContract.requestBuilder)"
}
if ((Join-Path $projectRoot $captureContract.advertisementPath) -ne $absoluteAdvertisementPath) {
throw "EveElectron capture advertisement path mismatch: $($captureContract.advertisementPath) vs $AdvertisementPath"
}
node --test (Join-Path $projectRoot "tools\eveelectron\eveelectron-capture-contract.test.mjs")
if ($LASTEXITCODE -ne 0) {
throw "EveElectron capture contract tests failed with exit code $LASTEXITCODE"
}
node $builderPath --capability $absoluteCapabilityPath --advertisement $absoluteAdvertisementPath --output $absoluteOutputPath --stamp $Stamp
if ($LASTEXITCODE -ne 0) {
throw "EveElectron capture request builder failed with exit code $LASTEXITCODE"
}
if (-not (Test-Path -LiteralPath $absoluteOutputPath)) {
throw "EveElectron capture request was not written: $absoluteOutputPath"
}
$request = Get-Content -LiteralPath $absoluteOutputPath -Raw | ConvertFrom-Json
foreach ($expectation in @(
@{ field = "schema"; value = "gamecult.eve.runtime_capture_request.v1" },
@{ field = "runtimeId"; value = "electron-shell" },
@{ field = "ownerRepo"; value = "EveElectron" },
@{ field = "providerId"; value = "aetheria" },
@{ field = "surfaceId"; value = "aetheria.daemon.game" },
@{ field = "targetId"; value = "electron-shell" },
@{ field = "commandBoundary"; value = "aetheria.daemon.commands" },
@{ field = "receiptSchema"; value = "aetheria.eve_command_acceptance_status.v1" },
@{ field = "captureKind"; value = "electron-window-png" },
@{ field = "artifactKind"; value = "png" },
@{ field = "conformanceAttachment"; value = "runtime.captureArtifacts[]" }
)) {
if ($request.($expectation.field) -ne $expectation.value) {
throw "EveElectron capture request $($expectation.field) expected $($expectation.value) got $($request.($expectation.field))"
}
}
if ($request.artifactPath -ne "artifacts/eveelectron-capture/$Stamp/electron-shell.png") {
throw "Unexpected EveElectron capture artifact path: $($request.artifactPath)"
}
Write-Host "EveElectron capture contract smoke passed: $absoluteOutputPath"

View file

@ -1,77 +0,0 @@
param(
[string] $CapabilityManifestPath = "runtimes\incubating\eve-electron\eve-runtime-capability.json",
[string] $AdvertisementPath = "web\fixtures\aetheria.provider-advertisement.json",
[string] $SurfacePath = "web\fixtures\aetheria-world-surface.json",
[string] $OutputPath = "artifacts\eveelectron-capture\latest\electron-shell-projection.json",
[string] $RequestOutputPath = "artifacts\eveelectron-capture\latest\capture-request.json",
[string] $Stamp = "latest",
[string] $ExpectedProviderId = "aetheria",
[string] $ExpectedSurfaceId = "aetheria.daemon.game",
[string] $ExpectedCommandBoundary = "aetheria.daemon.commands",
[string] $ExpectedReceiptSchema = "aetheria.eve_command_acceptance_status.v1"
)
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
function Resolve-RepoPath([string] $candidate) {
if ([System.IO.Path]::IsPathRooted($candidate)) {
return $candidate
}
return Join-Path $projectRoot $candidate
}
$absoluteCapabilityPath = Resolve-RepoPath $CapabilityManifestPath
$absoluteAdvertisementPath = Resolve-RepoPath $AdvertisementPath
$absoluteSurfacePath = Resolve-RepoPath $SurfacePath
$absoluteOutputPath = Resolve-RepoPath $OutputPath
$absoluteRequestOutputPath = Resolve-RepoPath $RequestOutputPath
foreach ($path in @($absoluteCapabilityPath, $absoluteAdvertisementPath, $absoluteSurfacePath)) {
if (-not (Test-Path -LiteralPath $path)) {
throw "EveElectron capture input not found: $path"
}
}
node --test (Join-Path $projectRoot "tools\eveelectron\eveelectron-capture-artifact.test.mjs")
if ($LASTEXITCODE -ne 0) {
throw "EveElectron capture artifact tests failed with exit code $LASTEXITCODE"
}
node (Join-Path $projectRoot "tools\eveelectron\eveelectron-capture-artifact.mjs") `
--capability $absoluteCapabilityPath `
--advertisement $absoluteAdvertisementPath `
--surface $absoluteSurfacePath `
--output $absoluteOutputPath `
--request-output $absoluteRequestOutputPath `
--stamp $Stamp
if ($LASTEXITCODE -ne 0) {
throw "EveElectron capture artifact builder failed with exit code $LASTEXITCODE"
}
foreach ($path in @($absoluteOutputPath, $absoluteRequestOutputPath)) {
if (-not (Test-Path -LiteralPath $path)) {
throw "EveElectron capture artifact output missing: $path"
}
}
$projection = Get-Content -LiteralPath $absoluteOutputPath -Raw | ConvertFrom-Json
foreach ($expectation in @(
@{ field = "schema"; value = "gamecult.eve.electron_shell_projection.v1" },
@{ field = "runtimeId"; value = "electron-shell" },
@{ field = "providerId"; value = $ExpectedProviderId },
@{ field = "surfaceId"; value = $ExpectedSurfaceId },
@{ field = "commandBoundary"; value = $ExpectedCommandBoundary },
@{ field = "receiptSchema"; value = $ExpectedReceiptSchema },
@{ field = "artifactKind"; value = "json-projection" },
@{ field = "captureKind"; value = "electron-shell-projection-json" }
)) {
if ($projection.($expectation.field) -ne $expectation.value) {
throw "EveElectron projection $($expectation.field) expected $($expectation.value) got $($projection.($expectation.field))"
}
}
if (-not $projection.root.id) {
throw "EveElectron projection capture must contain a root shell node"
}
Write-Host "EveElectron capture smoke passed: $absoluteOutputPath"

View file

@ -1,199 +0,0 @@
param(
[string] $CapabilityManifestPath = "runtimes\incubating\eve-electron\eve-runtime-capability.json"
)
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$absoluteManifestPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) {
$CapabilityManifestPath
} else {
Join-Path $projectRoot $CapabilityManifestPath
}
if (-not (Test-Path -LiteralPath $absoluteManifestPath)) {
throw "EveElectron runtime capability manifest not found: $absoluteManifestPath"
}
$manifest = Get-Content -LiteralPath $absoluteManifestPath -Raw | ConvertFrom-Json
if ($manifest.schema -ne "gamecult.eve.runtime_capability.v1") {
throw "Unexpected EveElectron manifest schema: $($manifest.schema)"
}
if ($manifest.runtimeId -ne "electron-shell") {
throw "Unexpected EveElectron runtime id: $($manifest.runtimeId)"
}
if ($manifest.owner -ne "EveElectron") {
throw "Unexpected EveElectron owner: $($manifest.owner)"
}
if ($manifest.incubation.ownerRepo -ne "EveElectron") {
throw "Unexpected EveElectron incubation owner: $($manifest.incubation.ownerRepo)"
}
if ($manifest.incubation.currentHostRepo -ne "Eve") {
throw "Unexpected EveElectron current host repo: $($manifest.incubation.currentHostRepo)"
}
if ($manifest.incubation.splitTarget -ne "EveElectron") {
throw "Unexpected EveElectron split target: $($manifest.incubation.splitTarget)"
}
if (-not $manifest.incubation.splitHandoff.manifestPath) {
throw "EveElectron manifest missing split handoff path"
}
foreach ($feature in @("providerAdvertisements", "commandTransport", "surfaceTreeProjection", "embeddedDocuments", "pluginProjection")) {
if (-not (@($manifest.supportedFeatures) -contains $feature)) {
throw "EveElectron manifest missing provider-shell feature: $feature"
}
}
$expectedPlugins = @{
"sai.vn" = @("vn.stage", "story.choose", "story.continue", "story.jump")
"norn.graph" = @("embed.norn")
"tex.math" = @("embed.tex", "tex.inline", "tex.block")
}
foreach ($pluginId in $expectedPlugins.Keys) {
$supported = @($manifest.supportedPlugins) | Where-Object { $_.pluginId -eq $pluginId } | Select-Object -First 1
if (-not $supported) {
throw "EveElectron manifest missing supported plugin declaration: $pluginId"
}
foreach ($capability in $expectedPlugins[$pluginId]) {
if (-not (@($supported.capabilities) -contains $capability)) {
throw "EveElectron supported plugin $pluginId missing capability: $capability"
}
}
if ($supported.projectionAdapter -ne "EveElectronShell.buildPluginProjection") {
throw "EveElectron supported plugin $pluginId has unexpected projection adapter: $($supported.projectionAdapter)"
}
}
$worldSurfaceLoweringClaims = @()
if ($null -ne $manifest.worldSurfaceLowering) {
$worldSurfaceLoweringClaims = @($manifest.worldSurfaceLowering)
}
if ($worldSurfaceLoweringClaims.Count -ne 1) {
throw "EveElectron must claim exactly one world-surface lowering target"
}
$worldSurfaceLoweringClaim = $worldSurfaceLoweringClaims | Where-Object { $_.targetId -eq "electron-shell" } | Select-Object -First 1
if (-not $worldSurfaceLoweringClaim) {
throw "EveElectron manifest missing electron-shell world-surface lowering claim"
}
if ($worldSurfaceLoweringClaim.supportLevel -ne "electron-shell-surface-tree-command-surface") {
throw "Unexpected EveElectron world-surface support level: $($worldSurfaceLoweringClaim.supportLevel)"
}
if ($worldSurfaceLoweringClaim.ownership -ne "runtime-lowers-provider-world-surface-without-owning-world-state") {
throw "Unexpected EveElectron world-surface ownership: $($worldSurfaceLoweringClaim.ownership)"
}
foreach ($evidencePath in @($worldSurfaceLoweringClaim.evidencePaths)) {
$absoluteEvidencePath = Join-Path $projectRoot $evidencePath
if (-not (Test-Path -LiteralPath $absoluteEvidencePath)) {
throw "EveElectron world-surface claim missing evidence path: $evidencePath"
}
}
foreach ($pluginId in $expectedPlugins.Keys) {
$unsupported = @($manifest.unsupportedPlugins) | Where-Object { $_.pluginId -eq $pluginId } | Select-Object -First 1
if ($unsupported) {
throw "EveElectron manifest must not report $pluginId unsupported while the shell projection is declared"
}
}
if ($manifest.commandTransport.schema -ne "gamecult.eve.command_invocation.v1") {
throw "Unexpected EveElectron command schema: $($manifest.commandTransport.schema)"
}
if ($manifest.commandTransport.status -ne "provider-shell-contract-skeleton") {
throw "Unexpected EveElectron command transport status: $($manifest.commandTransport.status)"
}
foreach ($stage in @("release", "test", "capture")) {
$stageDocument = $manifest.lifecycle.$stage
if ($null -eq $stageDocument) {
throw "EveElectron lifecycle missing stage: $stage"
}
if ($stageDocument.ownerRepo -ne "EveElectron") {
throw "EveElectron lifecycle stage $stage has unexpected owner: $($stageDocument.ownerRepo)"
}
if (-not $stageDocument.status) {
throw "EveElectron lifecycle stage $stage missing status"
}
foreach ($evidencePath in @($stageDocument.evidencePaths)) {
$absoluteEvidencePath = Join-Path $projectRoot $evidencePath
if (-not (Test-Path -LiteralPath $absoluteEvidencePath)) {
throw "EveElectron lifecycle stage $stage missing evidence path: $evidencePath"
}
}
}
$releaseContract = $manifest.lifecycle.release.releaseContract
foreach ($field in @("ownerRepo", "packageName", "packageRoot", "versionSource", "tagPattern", "artifactKind", "requestSchema", "requestBuilder", "artifactPattern", "publishProof")) {
if (-not $releaseContract.$field) {
throw "EveElectron release contract missing $field"
}
}
if ($releaseContract.requestSchema -ne "gamecult.eve.runtime_release_request.v1") {
throw "EveElectron release contract has unexpected request schema: $($releaseContract.requestSchema)"
}
foreach ($pathProperty in @("packageRoot", "versionSource")) {
$relativePath = $releaseContract.$pathProperty
$absolutePath = Join-Path $projectRoot $relativePath
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "EveElectron release contract $pathProperty does not exist: $relativePath"
}
}
foreach ($pathProperty in @("requestBuilder")) {
$relativePath = $releaseContract.$pathProperty
$absolutePath = Join-Path $projectRoot $relativePath
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "EveElectron release contract $pathProperty does not exist: $relativePath"
}
}
$testContract = $manifest.lifecycle.test.testContract
foreach ($field in @("ownerRepo", "runnerKind", "runnerScript", "consumerProject", "packageName", "testAssembly", "testPlatform", "resultsArtifact", "logArtifact", "manifestMutation")) {
if (-not $testContract.$field) {
throw "EveElectron test contract missing $field"
}
}
foreach ($pathProperty in @("runnerScript", "consumerProject")) {
$candidate = $testContract.$pathProperty
$absolutePath = if ([System.IO.Path]::IsPathRooted($candidate)) {
$candidate
} else {
Join-Path $projectRoot $candidate
}
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "EveElectron test contract $pathProperty does not exist: $candidate"
}
}
$captureContract = $manifest.lifecycle.capture.captureContract
foreach ($field in @("ownerRepo", "runtimeId", "targetId", "requestSchema", "requestBuilder", "advertisementPath", "captureKind", "artifactKind", "artifactPattern", "conformanceAttachment", "requiredProvider", "requiredSurface", "authority", "publishProof")) {
if (-not $captureContract.$field) {
throw "EveElectron capture contract missing $field"
}
}
if ($captureContract.runtimeId -ne "electron-shell") {
throw "EveElectron capture contract has unexpected runtime: $($captureContract.runtimeId)"
}
if ($captureContract.targetId -ne "electron-shell") {
throw "EveElectron capture contract has unexpected target: $($captureContract.targetId)"
}
if ($captureContract.requestSchema -ne "gamecult.eve.runtime_capture_request.v1") {
throw "EveElectron capture contract has unexpected request schema: $($captureContract.requestSchema)"
}
if ($captureContract.captureKind -ne "electron-window-png") {
throw "EveElectron capture contract has unexpected capture kind: $($captureContract.captureKind)"
}
foreach ($pathProperty in @("requestBuilder", "advertisementPath")) {
$relativePath = $captureContract.$pathProperty
$absolutePath = Join-Path $projectRoot $relativePath
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "EveElectron capture contract $pathProperty does not exist: $relativePath"
}
}
& (Join-Path $projectRoot "scripts\run-eveelectron-split-handoff-smoke.ps1")
& (Join-Path $projectRoot "scripts\run-eveelectron-release-contract-smoke.ps1")
& (Join-Path $projectRoot "scripts\run-eveelectron-provider-shell-smoke.ps1")
& (Join-Path $projectRoot "scripts\run-eveelectron-capture-contract-smoke.ps1")
& (Join-Path $projectRoot "scripts\run-eveelectron-capture-smoke.ps1")
Write-Host "EveElectron lifecycle smoke passed: $absoluteManifestPath"

View file

@ -0,0 +1,50 @@
param(
[string] $EveElectronRoot = "E:\Projects\EveElectron",
[string] $AetheriaRoot = "E:\Projects\Aetheria"
)
$ErrorActionPreference = "Stop"
$manifestPath = Join-Path $EveElectronRoot "eve-runtime-capability.json"
$packagePath = Join-Path $EveElectronRoot "package.json"
$shellPath = Join-Path $EveElectronRoot "src\eve-electron-shell.mjs"
$windowPath = Join-Path $EveElectronRoot "src\window-host.mjs"
$preloadPath = Join-Path $EveElectronRoot "src\eve-provider-preload.cjs"
foreach ($path in @($manifestPath, $packagePath, $shellPath, $windowPath, $preloadPath)) {
if (-not (Test-Path -LiteralPath $path)) { throw "EveElectron owner path missing: $path" }
}
$manifest = Get-Content -LiteralPath $manifestPath -Raw | ConvertFrom-Json
if ($manifest.schema -ne "gamecult.eve.runtime_capability.v1" -or $manifest.runtimeId -ne "electron-shell" -or $manifest.owner -ne "EveElectron") {
throw "EveElectron owner manifest identity is invalid."
}
foreach ($feature in @("providerAdvertisements", "commandTransport", "surfaceTreeProjection", "securePreloadBridge", "windowLifecycle")) {
if (-not (@($manifest.supportedFeatures) -contains $feature)) { throw "EveElectron owner manifest missing feature: $feature" }
}
$main = Get-Content -LiteralPath (Join-Path $AetheriaRoot "Aetheria.Rts.Web\Electron\main.ts") -Raw
$preload = Get-Content -LiteralPath (Join-Path $AetheriaRoot "Aetheria.Rts.Web\Electron\preload.cjs") -Raw
$renderer = Get-Content -LiteralPath (Join-Path $AetheriaRoot "Aetheria.Rts.Web\Client\app.ts") -Raw
foreach ($symbol in @("createEveElectronWindow", "registerEveWindowControls", "@gamecult/eve-electron")) {
if (-not $main.Contains($symbol)) { throw "Aetheria Electron host does not consume owner symbol: $symbol" }
}
if (-not $preload.Contains("installEveProviderBridge") -or -not $preload.Contains("@gamecult/eve-electron/preload")) {
throw "Aetheria preload does not consume EveElectron's generic provider bridge."
}
if ($preload.Contains('eveSurface: request =>') -or $preload.Contains('submitEveCommand: request =>')) {
throw "Aetheria product namespace still publishes duplicate generic Eve methods."
}
if (-not $renderer.Contains("window.eveProvider.providerAdvertisement") -or $renderer.Contains("window.aetheriaRts.eveProviderAdvertisement")) {
throw "Aetheria renderer has not transferred generic provider authority to window.eveProvider."
}
Push-Location $EveElectronRoot
try {
node --test test/*.test.mjs test/*.test.cjs
if ($LASTEXITCODE -ne 0) { throw "EveElectron owner tests failed with exit code $LASTEXITCODE" }
npm pack --dry-run | Out-Null
if ($LASTEXITCODE -ne 0) { throw "EveElectron owner package smoke failed with exit code $LASTEXITCODE" }
} finally {
Pop-Location
}
Write-Host "EveElectron owner smoke passed: $EveElectronRoot"

View file

@ -1,113 +0,0 @@
param(
[string] $CapabilityManifestPath = "runtimes\incubating\eve-electron\eve-runtime-capability.json"
)
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$absoluteManifestPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) {
$CapabilityManifestPath
} else {
Join-Path $projectRoot $CapabilityManifestPath
}
if (-not (Test-Path -LiteralPath $absoluteManifestPath)) {
throw "EveElectron runtime capability manifest not found: $absoluteManifestPath"
}
$manifest = Get-Content -LiteralPath $absoluteManifestPath -Raw | ConvertFrom-Json
if ($manifest.runtimeId -ne "electron-shell") {
throw "Unexpected EveElectron runtime id: $($manifest.runtimeId)"
}
if ($manifest.lifecycle.test.status -ne "provider-shell-contract-skeleton") {
throw "Unexpected EveElectron provider shell status: $($manifest.lifecycle.test.status)"
}
foreach ($feature in @("providerAdvertisements", "commandTransport", "surfaceTreeProjection", "pluginProjection")) {
if (-not (@($manifest.supportedFeatures) -contains $feature)) {
throw "EveElectron provider shell missing supported feature: $feature"
}
}
foreach ($pluginId in @("sai.vn", "norn.graph", "tex.math")) {
$supported = @($manifest.supportedPlugins) | Where-Object { $_.pluginId -eq $pluginId } | Select-Object -First 1
if (-not $supported) {
throw "EveElectron provider shell missing supported plugin projection: $pluginId"
}
}
$worldSurfaceLoweringClaims = @()
if ($null -ne $manifest.worldSurfaceLowering) {
$worldSurfaceLoweringClaims = @($manifest.worldSurfaceLowering)
}
if ($worldSurfaceLoweringClaims.Count -ne 1) {
throw "EveElectron must claim exactly one provider world-surface lowering target"
}
$worldSurfaceLoweringClaim = $worldSurfaceLoweringClaims | Where-Object { $_.targetId -eq "electron-shell" } | Select-Object -First 1
if (-not $worldSurfaceLoweringClaim) {
throw "EveElectron missing electron-shell world-surface lowering claim"
}
foreach ($surfaceKind in @("interactive-world", "interactive-world-editor")) {
if (-not (@($worldSurfaceLoweringClaim.surfaceKinds) -contains $surfaceKind)) {
throw "EveElectron world-surface claim missing surface kind: $surfaceKind"
}
}
foreach ($projectionKind in @("provider-authored-world-surface", "provider-authored-world-editor-surface")) {
if (-not (@($worldSurfaceLoweringClaim.projectionKinds) -contains $projectionKind)) {
throw "EveElectron world-surface claim missing projection kind: $projectionKind"
}
}
if ($worldSurfaceLoweringClaim.supportLevel -ne "electron-shell-surface-tree-command-surface") {
throw "Unexpected EveElectron support level: $($worldSurfaceLoweringClaim.supportLevel)"
}
if ($worldSurfaceLoweringClaim.ownership -ne "runtime-lowers-provider-world-surface-without-owning-world-state") {
throw "Unexpected EveElectron ownership: $($worldSurfaceLoweringClaim.ownership)"
}
foreach ($evidencePath in @($worldSurfaceLoweringClaim.evidencePaths)) {
$absoluteEvidencePath = Join-Path $projectRoot $evidencePath
if (-not (Test-Path -LiteralPath $absoluteEvidencePath)) {
throw "EveElectron world-surface claim missing evidence path: $evidencePath"
}
}
$expectedFiles = @(
"runtimes\incubating\eve-electron\package.json",
"runtimes\incubating\eve-electron\src\eve-electron-shell.mjs",
"runtimes\incubating\eve-electron\test\eve-electron-shell.test.mjs",
"scripts\run-eveelectron-capture-contract-smoke.ps1",
"tools\eveelectron\eveelectron-capture-contract.mjs"
)
foreach ($relativePath in $expectedFiles) {
$absolutePath = Join-Path $projectRoot $relativePath
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "EveElectron provider shell missing file: $relativePath"
}
}
$shellSource = Get-Content -LiteralPath (Join-Path $projectRoot "runtimes\incubating\eve-electron\src\eve-electron-shell.mjs") -Raw
foreach ($symbol in @("EveElectronShell", "selectSurface", "lowerSurface", "createCommandIntent", "normalizeSurfaceDocument", "buildShellNode", "buildPluginProjection", "shellElementKind", "sai.vn", "norn.graph", "tex.math", "sidecar-advertised-plugin-abi", "worldInteraction", "commandBoundary", "receiptSchema", "electron-shell")) {
if (-not $shellSource.Contains($symbol)) {
throw "EveElectron provider shell source missing symbol: $symbol"
}
}
$testSource = Get-Content -LiteralPath (Join-Path $projectRoot "runtimes\incubating\eve-electron\test\eve-electron-shell.test.mjs") -Raw
foreach ($symbol in @("selects the active advertised provider surface", "lowers provider surface trees into an Electron shell projection", "lowers Sai, Norn, and TeX sidecar plugin shells without owning semantics", "sai-vn-stage-shell", "norn-graph-shell", "tex-math-shell", "rejects surface documents that do not match the advertised target", "command intents carry provider-advertised boundaries", "aetheria.daemon.commands", "aetheria.eve_command_acceptance_status.v1")) {
if (-not $testSource.Contains($symbol)) {
throw "EveElectron provider shell test missing symbol: $symbol"
}
}
Push-Location (Join-Path $projectRoot "runtimes\incubating\eve-electron")
try {
npm test
if ($LASTEXITCODE -ne 0) {
throw "EveElectron provider shell tests failed with exit code $LASTEXITCODE"
}
} finally {
Pop-Location
}
Write-Host "EveElectron provider shell smoke passed: $absoluteManifestPath"

View file

@ -1,98 +0,0 @@
param(
[string] $CapabilityManifestPath = "runtimes\incubating\eve-electron\eve-runtime-capability.json",
[string] $OutputPath = "artifacts\eveelectron-release-contract\latest\release-request.json"
)
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$absoluteCapabilityPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) {
$CapabilityManifestPath
} else {
Join-Path $projectRoot $CapabilityManifestPath
}
$absoluteOutputPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) {
$OutputPath
} else {
Join-Path $projectRoot $OutputPath
}
if (-not (Test-Path -LiteralPath $absoluteCapabilityPath)) {
throw "EveElectron release contract input not found: $absoluteCapabilityPath"
}
$manifest = Get-Content -LiteralPath $absoluteCapabilityPath -Raw | ConvertFrom-Json
$releaseContract = $manifest.lifecycle.release.releaseContract
if ($null -eq $releaseContract) {
throw "EveElectron release contract missing lifecycle.release.releaseContract"
}
foreach ($field in @("ownerRepo", "packageName", "packageRoot", "versionSource", "tagPattern", "artifactKind", "requestSchema", "requestBuilder", "artifactPattern", "publishProof")) {
if (-not $releaseContract.$field) {
throw "EveElectron release contract missing $field"
}
}
if ($releaseContract.ownerRepo -ne "EveElectron") {
throw "Unexpected EveElectron release owner: $($releaseContract.ownerRepo)"
}
if ($releaseContract.packageName -ne "eve-electron") {
throw "Unexpected EveElectron package name: $($releaseContract.packageName)"
}
if ($releaseContract.requestSchema -ne "gamecult.eve.runtime_release_request.v1") {
throw "Unexpected EveElectron release request schema: $($releaseContract.requestSchema)"
}
if ($releaseContract.artifactKind -ne "electron-app") {
throw "Unexpected EveElectron release artifact kind: $($releaseContract.artifactKind)"
}
$builderPath = Join-Path $projectRoot $releaseContract.requestBuilder
$packagePath = Join-Path $projectRoot $releaseContract.versionSource
$packageRoot = Join-Path $projectRoot $releaseContract.packageRoot
foreach ($path in @($builderPath, $packagePath, $packageRoot)) {
if (-not (Test-Path -LiteralPath $path)) {
throw "EveElectron release contract path not found: $path"
}
}
node --test (Join-Path $projectRoot "tools\eveelectron\eveelectron-release-contract.test.mjs")
if ($LASTEXITCODE -ne 0) {
throw "EveElectron release contract tests failed with exit code $LASTEXITCODE"
}
node $builderPath --capability $absoluteCapabilityPath --package $packagePath --output $absoluteOutputPath
if ($LASTEXITCODE -ne 0) {
throw "EveElectron release request builder failed with exit code $LASTEXITCODE"
}
if (-not (Test-Path -LiteralPath $absoluteOutputPath)) {
throw "EveElectron release request was not written: $absoluteOutputPath"
}
$request = Get-Content -LiteralPath $absoluteOutputPath -Raw | ConvertFrom-Json
$packageManifest = Get-Content -LiteralPath $packagePath -Raw | ConvertFrom-Json
foreach ($expectation in @(
@{ field = "schema"; value = "gamecult.eve.runtime_release_request.v1" },
@{ field = "ownerRepo"; value = "EveElectron" },
@{ field = "repository"; value = "GameCult/EveElectron" },
@{ field = "packageName"; value = "eve-electron" },
@{ field = "version"; value = $packageManifest.version },
@{ field = "packageRoot"; value = "runtimes/incubating/eve-electron" },
@{ field = "versionSource"; value = "runtimes/incubating/eve-electron/package.json" },
@{ field = "artifactKind"; value = "electron-app" }
)) {
if ($request.($expectation.field) -ne $expectation.value) {
throw "EveElectron release request $($expectation.field) expected $($expectation.value) got $($request.($expectation.field))"
}
}
$expectedTagName = $releaseContract.tagPattern.Replace("{version}", $packageManifest.version)
if ($request.tagName -ne $expectedTagName) {
throw "Unexpected EveElectron release tag: $($request.tagName)"
}
$expectedArtifactPath = $releaseContract.artifactPattern.Replace("{version}", $packageManifest.version)
if ($request.artifactPath -ne $expectedArtifactPath) {
throw "Unexpected EveElectron release artifact path: $($request.artifactPath)"
}
if ($request.main -ne $packageManifest.main) {
throw "EveElectron release request lost package main entry"
}
Write-Host "EveElectron release contract smoke passed: $absoluteOutputPath"

View file

@ -1,123 +0,0 @@
param(
[string] $HandoffPath = "runtimes\incubating\eve-electron\eveelectron-split-handoff.json"
)
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$absoluteHandoffPath = if ([System.IO.Path]::IsPathRooted($HandoffPath)) {
$HandoffPath
} else {
Join-Path $projectRoot $HandoffPath
}
if (-not (Test-Path -LiteralPath $absoluteHandoffPath)) {
throw "EveElectron split handoff manifest not found: $absoluteHandoffPath"
}
$handoff = Get-Content -LiteralPath $absoluteHandoffPath -Raw | ConvertFrom-Json
if ($handoff.schema -ne "gamecult.eve.runtime_split_handoff.v1") {
throw "Unexpected EveElectron split handoff schema: $($handoff.schema)"
}
if ($handoff.splitTarget -ne "EveElectron") {
throw "Unexpected EveElectron split handoff target: $($handoff.splitTarget)"
}
if ($handoff.ownerRepo -ne "EveElectron") {
throw "Unexpected EveElectron split handoff owner: $($handoff.ownerRepo)"
}
if ($handoff.currentHostRepo -ne "Eve") {
throw "Unexpected EveElectron split handoff host: $($handoff.currentHostRepo)"
}
if ($handoff.runtimeId -ne "electron-shell") {
throw "Unexpected EveElectron split handoff runtime: $($handoff.runtimeId)"
}
$moveSets = @($handoff.moveSets)
foreach ($stage in @("runtime-body", "command", "world-surface-lowering", "plugin-projection", "capture")) {
$moveSet = $moveSets | Where-Object { $_.stage -eq $stage } | Select-Object -First 1
if (-not $moveSet) {
throw "EveElectron split handoff missing move set for stage: $stage"
}
if ($moveSet.destinationOwner -ne "EveElectron") {
throw "EveElectron split handoff stage $stage has unexpected destination owner: $($moveSet.destinationOwner)"
}
if (-not $moveSet.replacementProof) {
throw "EveElectron split handoff stage $stage missing replacement proof"
}
foreach ($relativePath in @($moveSet.currentPaths)) {
$absolutePath = Join-Path $projectRoot $relativePath
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "EveElectron split handoff stage $stage references missing current path: $relativePath"
}
}
}
foreach ($id in @("electron-shell-runtime", "electron-command-transport", "electron-world-surface-lowering")) {
$moveSet = $moveSets | Where-Object { $_.id -eq $id } | Select-Object -First 1
if (-not $moveSet) {
throw "EveElectron split handoff missing move set: $id"
}
$observedPaths = @($moveSet.observedProviderPaths)
if ($observedPaths.Count -eq 0) {
throw "EveElectron split handoff move set $id must name observed Aetheria paths to replace"
}
foreach ($path in $observedPaths) {
if (-not (Test-Path -LiteralPath $path)) {
throw "EveElectron split handoff observed provider path missing: $path"
}
}
}
$captureMoveSet = $moveSets | Where-Object { $_.id -eq "electron-capture-lifecycle" } | Select-Object -First 1
if (-not $captureMoveSet) {
throw "EveElectron split handoff missing move set: electron-capture-lifecycle"
}
if (@($captureMoveSet.currentPaths).Count -eq 0) {
throw "EveElectron capture lifecycle move set must declare currentPaths"
}
$pluginMoveSet = $moveSets | Where-Object { $_.id -eq "electron-plugin-projection" } | Select-Object -First 1
if (-not $pluginMoveSet) {
throw "EveElectron split handoff missing move set: electron-plugin-projection"
}
foreach ($relativePath in @(
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"web/fixtures/sai-vn-surface.json"
)) {
if (-not (@($pluginMoveSet.currentPaths) -contains $relativePath)) {
throw "EveElectron plugin projection move set missing current path: $relativePath"
}
}
foreach ($contract in @(
"gamecult.eve.surface.v1",
"gamecult.eve.command.v1",
"gamecult.eve.provider_advertisement.v1",
"gamecult.eve.plugin_advertisement.v1",
"gamecult.eve.plugin.v1",
"gamecult.eve.conformance_export.v1"
)) {
if (-not (@($handoff.contractInputs) -contains $contract)) {
throw "EveElectron split handoff missing contract input: $contract"
}
}
foreach ($proof in @($handoff.requiredExternalProofs)) {
if (-not $proof) {
throw "EveElectron split handoff contains an empty required external proof"
}
}
foreach ($forbiddenImport in @(
"Sai story state, VN/Ink semantics, or story command interpretation as Electron shell authority",
"Norn graph layout, graph state, or command semantics as Electron shell authority",
"TeX parsing, typesetting, baseline metrics, or render-cache semantics as Electron shell authority"
)) {
if (-not (@($handoff.forbiddenImports) -contains $forbiddenImport)) {
throw "EveElectron split handoff missing forbidden import: $forbiddenImport"
}
}
Write-Host "EveElectron split handoff smoke passed: $absoluteHandoffPath"

View file

@ -36,15 +36,6 @@ try {
-ExpectedSurfaceId "eve.world-smoke.surface" `
-ExpectedCommandBoundary "eve.world-smoke.commands" `
-ExpectedReceiptSchema "eve.world_smoke.command_receipt.v1"
& (Join-Path $PSScriptRoot "run-eveelectron-capture-smoke.ps1") `
-AdvertisementPath "web\fixtures\eve-world-smoke.provider-advertisement.json" `
-SurfacePath "web\fixtures\eve-world-smoke-surface.json" `
-OutputPath "artifacts\eveelectron-capture\latest\eve-world-smoke-electron-shell-projection.json" `
-RequestOutputPath "artifacts\eveelectron-capture\latest\eve-world-smoke-capture-request.json" `
-ExpectedProviderId "eve.world-smoke" `
-ExpectedSurfaceId "eve.world-smoke.surface" `
-ExpectedCommandBoundary "eve.world-smoke.commands" `
-ExpectedReceiptSchema "eve.world_smoke.command_receipt.v1"
& (Join-Path $PSScriptRoot "run-evetui-capture-smoke.ps1")
& (Join-Path $PSScriptRoot "run-evetui-capture-smoke.ps1") `
-AdvertisementPath "web\fixtures\eve-world-smoke.provider-advertisement.json" `
@ -61,8 +52,7 @@ try {
& (Join-Path $PSScriptRoot "run-aetheria-provider-handoff-smoke.ps1")
& (Join-Path $PSScriptRoot "run-eveunity-split-handoff-smoke.ps1")
& (Join-Path $PSScriptRoot "run-eveunity-release-artifact-smoke.ps1")
& (Join-Path $PSScriptRoot "run-eveelectron-split-handoff-smoke.ps1")
& (Join-Path $PSScriptRoot "run-eveelectron-lifecycle-smoke.ps1")
& (Join-Path $PSScriptRoot "run-eveelectron-owner-smoke.ps1")
& (Join-Path $PSScriptRoot "run-evetui-split-handoff-smoke.ps1")
& (Join-Path $PSScriptRoot "run-evetui-lifecycle-smoke.ps1")
& (Join-Path $PSScriptRoot "run-conformance-consumer-smoke.ps1")

View file

@ -57,7 +57,7 @@ node $consumerScript $consumerExport `
--expect-runtime-status android-flutter:active `
--expect-runtime-status unity-uitoolkit:active `
--expect-runtime-status unity-scene:active `
--expect-runtime-status electron-shell:pending `
--expect-runtime-status electron-shell:active `
--expect-runtime-status tui:active `
--expect-runtime-status direct2d:external-adapter-spike `
--expect-runtime-feature web:providerAdvertisements `
@ -106,7 +106,7 @@ node $consumerScript $consumerExport `
--expect-runtime-world-field unity-scene:unity-scene:supportLevel:unity-playable-world-scene-command-surface `
--expect-runtime-world-field unity-scene:unity-scene:ownership:runtime-lowers-provider-world-surface-without-owning-world-state `
--expect-runtime-world-target electron-shell:electron-shell `
--expect-runtime-world-field electron-shell:electron-shell:supportLevel:electron-shell-surface-tree-command-surface `
--expect-runtime-world-field electron-shell:electron-shell:supportLevel:provider-shell-surface-tree-command-surface `
--expect-runtime-world-field electron-shell:electron-shell:ownership:runtime-lowers-provider-world-surface-without-owning-world-state `
--expect-runtime-world-target tui:tui `
--expect-runtime-world-field tui:tui:supportLevel:terminal-grid-command-surface `
@ -165,16 +165,14 @@ node $consumerScript $consumerExport `
--expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:aetheria:aetheria.daemon.game `
--expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:eve.world-smoke:eve.world-smoke.surface `
--expect-runtime-capture-status unity-scene:partial-world-smoke-playmode-capture `
--expect-runtime-capture-status electron-shell:json-projection `
--expect-runtime-capture-artifact electron-shell:json-projection:gamecult.eve.electron_shell_projection.v1:aetheria:aetheria.daemon.game `
--expect-runtime-capture-artifact electron-shell:json-projection:gamecult.eve.electron_shell_projection.v1:eve.world-smoke:eve.world-smoke.surface `
--expect-runtime-capture-status electron-shell:pending-owner-window-capture `
--expect-runtime-capture-status tui:json-grid `
--expect-runtime-capture-artifact tui:json-grid:gamecult.eve.tui_grid.v1:aetheria:aetheria.daemon.game `
--expect-runtime-capture-artifact tui:json-grid:gamecult.eve.tui_grid.v1:eve.world-smoke:eve.world-smoke.surface `
--expect-runtime-capture-status direct2d:missing `
--expect-runtime-capture-probe unity-uitoolkit:semantic-artifact-present-capture-pending:png:EveUnity `
--expect-runtime-capture-probe unity-scene:control-artifact-present-product-capture-pending:png:EveUnity `
--expect-runtime-capture-probe electron-shell:semantic-artifact-present-capture-pending:png:EveElectron `
--expect-runtime-capture-probe electron-shell:contract-artifact-missing:png:EveElectron `
--expect-runtime-capture-probe tui:contract-artifact-present:json-grid:EveTui `
--expect-screenshot-metric web:embedded-surface:structure:pass `
--expect-screenshot-metric web:embedded-surface:color-tokens:pass `
@ -263,29 +261,25 @@ node $consumerScript $consumerExport `
--expect-runtime-lifecycle-field "unity-scene:capture:captureContract.requiredSurface:aetheria.daemon.game" `
--expect-runtime-lifecycle-field "unity-scene:capture:captureContract.additionalProviderSurfaces.0.providerId:eve.world-smoke" `
--expect-runtime-lifecycle-field "unity-scene:capture:captureContract.additionalProviderSurfaces.0.surfaceId:eve.world-smoke.surface" `
--expect-runtime-lifecycle-status electron-shell:release:pending-electron-package `
--expect-runtime-lifecycle-status electron-shell:test:provider-shell-contract-skeleton `
--expect-runtime-lifecycle-status electron-shell:capture:pending-electron-window-capture `
--expect-runtime-lifecycle-pending "electron-shell:release:Electron packaged app release" `
--expect-runtime-lifecycle-pending "electron-shell:test:Electron provider-advertisement smoke runs from EveElectron in a packaged Electron window" `
--expect-runtime-lifecycle-pending "electron-shell:capture:Electron window capture artifact" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.artifactKind:electron-app" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.versionSource:runtimes/incubating/eve-electron/package.json" `
--expect-runtime-lifecycle-status electron-shell:release:owner-npm-package `
--expect-runtime-lifecycle-status electron-shell:test:owner-package-tests-and-aetheria-live-smoke `
--expect-runtime-lifecycle-status electron-shell:capture:pending-owner-window-capture `
--expect-runtime-lifecycle-pending "electron-shell:capture:Capture one non-product and one Aetheria window" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.artifactKind:npm-package" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.versionSource:package.json" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.requestSchema:gamecult.eve.runtime_release_request.v1" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.requestBuilder:tools/eveelectron/eveelectron-release-contract.mjs" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.artifactPattern:artifacts/eveelectron-release/{version}/eve-electron-{version}.zip" `
--expect-runtime-lifecycle-field "electron-shell:test:testContract.runnerKind:electron-provider-shell-smoke" `
--expect-runtime-lifecycle-field "electron-shell:test:testContract.runnerScript:scripts/run-eveelectron-provider-shell-smoke.ps1" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.requestBuilder:npm pack" `
--expect-runtime-lifecycle-field "electron-shell:release:releaseContract.artifactPattern:gamecult-eve-electron-{version}.tgz" `
--expect-runtime-lifecycle-field "electron-shell:test:testContract.runnerKind:node-and-provider-live-smoke" `
--expect-runtime-lifecycle-field "electron-shell:test:testContract.runnerScript:npm test" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.captureKind:electron-window-png" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.targetId:electron-shell" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.requestSchema:gamecult.eve.runtime_capture_request.v1" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.requestBuilder:tools/eveelectron/eveelectron-capture-contract.mjs" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.advertisementPath:web/fixtures/aetheria.provider-advertisement.json" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.requiredSurface:aetheria.daemon.game" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.requestBuilder:pending" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.advertisementPath:provider-supplied" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.requiredSurface:aetheria.game" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.additionalProviderSurfaces.0.providerId:eve.world-smoke" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.additionalProviderSurfaces.0.surfaceId:eve.world-smoke.surface" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.additionalProviderSurfaces.1.providerId:aetheria" `
--expect-runtime-lifecycle-field "electron-shell:capture:captureContract.additionalProviderSurfaces.1.surfaceId:aetheria.daemon.editor" `
--expect-runtime-lifecycle-status tui:release:pending-tui-package `
--expect-runtime-lifecycle-status tui:test:provider-shell-contract-skeleton `
--expect-runtime-lifecycle-status tui:capture:cell-grid-json-capture `

View file

@ -52,21 +52,9 @@ try {
--expect-split-target-blocker "EveUnity:Tagged UPM release" `
--expect-split-target EveElectron `
--expect-split-target-status EveElectron:incubating `
--expect-split-target-proof "EveElectron:EveElectron split handoff is machine-readable" `
--expect-split-target-proof "EveElectron:EveElectron lifecycle contract is machine-readable" `
--expect-runtime-capture-artifact electron-shell:json-projection:gamecult.eve.electron_shell_projection.v1:aetheria:aetheria.daemon.game `
--expect-runtime-capture-artifact electron-shell:json-projection:gamecult.eve.electron_shell_projection.v1:eve.world-smoke:eve.world-smoke.surface `
--expect-split-target-blocker "EveElectron:runtime:electron-shell:status:pending" `
--expect-split-target-blocker-record EveElectron:runtime-status:electron-shell `
--expect-split-handoff-move EveElectron:electron-shell:electron-shell-runtime:current:exists:eve-electron-shell.mjs `
--expect-split-handoff-move EveElectron:electron-shell:electron-command-transport:current:exists:eve-electron-shell.mjs `
--expect-split-handoff-move EveElectron:electron-shell:electron-world-surface-lowering:current:exists:eve-electron-shell.mjs `
--expect-split-handoff-move EveElectron:electron-shell:electron-plugin-projection:current:exists:sai-vn-surface.json `
--expect-split-handoff-move EveElectron:electron-shell:electron-capture-lifecycle:current:exists:eveelectron-capture-contract.mjs `
--expect-split-handoff-move EveElectron:electron-shell:electron-shell-runtime:observed-provider:exists:Aetheria.Rts.Web/Electron `
--expect-split-handoff-move EveElectron:electron-shell:electron-command-transport:observed-provider:exists:Aetheria.Rts.Web/Client/app.ts `
--expect-split-handoff-move EveElectron:electron-shell:electron-world-surface-lowering:observed-provider:exists:Aetheria.Rts.Web/Client `
--expect-split-target-blocker "EveElectron:Electron shell runtime body graduates to EveElectron outside Aetheria product code" `
--expect-split-target-proof "EveElectron:EveElectron owner repository publishes the generic runtime package" `
--expect-split-target-proof "EveElectron:EveElectron owns secure window and preload lifecycle" `
--expect-split-target-blocker "EveElectron:Electron packaged window PNG capture artifacts are attached to conformance output" `
--expect-split-target EveTui `
--expect-split-target-status EveTui:incubating `
--expect-split-target-proof "EveTui:EveTui split handoff is machine-readable" `

View file

@ -1,116 +0,0 @@
import { mkdirSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { EveElectronShell } from "../../runtimes/incubating/eve-electron/src/eve-electron-shell.mjs";
import { buildElectronCaptureRequest, loadJsonFile, writeCaptureRequest } from "./eveelectron-capture-contract.mjs";
export function buildElectronCaptureArtifact({
advertisement,
capabilityManifest,
surfaceDocument,
advertisementPath = "",
capabilityManifestPath = "",
captureSurfaceId = "",
stamp = "latest",
} = {}) {
const request = buildElectronCaptureRequest({
advertisement,
capabilityManifest,
advertisementPath,
capabilityManifestPath,
captureSurfaceId,
stamp,
});
const shell = new EveElectronShell();
const projection = shell.lowerSurface(surfaceDocument, advertisement, request.surfaceId);
validateProjectionArtifact(projection, request);
return {
request,
projection: {
...projection,
runtimeId: request.runtimeId,
artifactKind: "json-projection",
captureKind: "electron-shell-projection-json",
sourceAdvertisementPath: request.sourceAdvertisementPath,
sourceCapabilityManifestPath: request.sourceCapabilityManifestPath,
issuedAtUtc: request.issuedAtUtc,
},
};
}
export function writeElectronCaptureArtifact({ request, projection }, { outputPath, requestOutputPath = "" } = {}) {
if (!outputPath) throw new Error("outputPath is required");
mkdirSync(path.dirname(outputPath), { recursive: true });
writeFileSync(outputPath, `${JSON.stringify(projection, null, 2)}\n`, "utf8");
if (requestOutputPath) {
writeCaptureRequest(request, requestOutputPath);
}
}
function validateProjectionArtifact(projection, request) {
if (projection.schema !== "gamecult.eve.electron_shell_projection.v1") {
throw new Error(`Unexpected Electron projection schema: ${projection.schema || ""}`);
}
for (const [field, expected] of [
["providerId", request.providerId],
["surfaceId", request.surfaceId],
["projectionKind", request.projectionKind],
["commandBoundary", request.commandBoundary],
["receiptSchema", request.receiptSchema],
]) {
if ((projection[field] || "") !== (expected || "")) {
throw new Error(`Electron projection ${field} expected ${expected || ""} got ${projection[field] || ""}`);
}
}
if (!projection.root || !projection.root.id) {
throw new Error("Electron projection artifact must contain a root shell node");
}
}
function parseArgs(argv) {
const args = {};
for (let index = 0; index < argv.length; index += 1) {
const value = argv[index];
if (!value.startsWith("--")) continue;
const key = value.slice(2);
const next = argv[index + 1];
if (!next || next.startsWith("--")) {
args[key] = true;
} else {
args[key] = next;
index += 1;
}
}
return args;
}
function runCli() {
const args = parseArgs(process.argv.slice(2));
for (const required of ["advertisement", "capability", "surface", "output"]) {
if (!args[required]) {
throw new Error(`missing required --${required}`);
}
}
const stamp = args.stamp || "latest";
const artifact = buildElectronCaptureArtifact({
advertisement: loadJsonFile(args.advertisement),
capabilityManifest: loadJsonFile(args.capability),
surfaceDocument: loadJsonFile(args.surface),
advertisementPath: args.advertisement,
capabilityManifestPath: args.capability,
captureSurfaceId: args["surface-id"] || "",
stamp,
});
writeElectronCaptureArtifact(artifact, {
outputPath: args.output,
requestOutputPath: args["request-output"] || "",
});
process.stdout.write(`${args.output}\n`);
}
const invokedPath = process.argv[1] ? path.resolve(process.argv[1]) : "";
const modulePath = fileURLToPath(import.meta.url);
if (invokedPath === modulePath) {
runCli();
}

View file

@ -1,51 +0,0 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { buildElectronCaptureArtifact } from "./eveelectron-capture-artifact.mjs";
const advertisement = JSON.parse(readFileSync(new URL("../../web/fixtures/aetheria.provider-advertisement.json", import.meta.url), "utf8"));
const capabilityManifest = JSON.parse(readFileSync(new URL("../../runtimes/incubating/eve-electron/eve-runtime-capability.json", import.meta.url), "utf8"));
const surfaceDocument = JSON.parse(readFileSync(new URL("../../web/fixtures/aetheria-world-surface.json", import.meta.url), "utf8"));
const worldSmokeAdvertisement = JSON.parse(readFileSync(new URL("../../web/fixtures/eve-world-smoke.provider-advertisement.json", import.meta.url), "utf8"));
const worldSmokeSurfaceDocument = JSON.parse(readFileSync(new URL("../../web/fixtures/eve-world-smoke-surface.json", import.meta.url), "utf8"));
test("builds Electron shell projection capture artifact from provider advertisement and surface", () => {
const { request, projection } = buildElectronCaptureArtifact({
advertisement,
capabilityManifest,
surfaceDocument,
advertisementPath: "web/fixtures/aetheria.provider-advertisement.json",
capabilityManifestPath: "runtimes/incubating/eve-electron/eve-runtime-capability.json",
stamp: "smoke",
});
assert.equal(request.artifactPath, "artifacts/eveelectron-capture/smoke/electron-shell.png");
assert.equal(projection.schema, "gamecult.eve.electron_shell_projection.v1");
assert.equal(projection.runtimeId, "electron-shell");
assert.equal(projection.providerId, "aetheria");
assert.equal(projection.surfaceId, "aetheria.daemon.game");
assert.equal(projection.commandBoundary, "aetheria.daemon.commands");
assert.equal(projection.receiptSchema, "aetheria.eve_command_acceptance_status.v1");
assert.equal(projection.artifactKind, "json-projection");
assert.equal(projection.captureKind, "electron-shell-projection-json");
assert.equal(projection.root.id, "aetheria.daemon.game.root");
});
test("builds Electron shell projection capture artifact from a generic world provider", () => {
const { projection } = buildElectronCaptureArtifact({
advertisement: worldSmokeAdvertisement,
capabilityManifest,
surfaceDocument: worldSmokeSurfaceDocument,
advertisementPath: "web/fixtures/eve-world-smoke.provider-advertisement.json",
capabilityManifestPath: "runtimes/incubating/eve-electron/eve-runtime-capability.json",
stamp: "smoke",
});
assert.equal(projection.schema, "gamecult.eve.electron_shell_projection.v1");
assert.equal(projection.runtimeId, "electron-shell");
assert.equal(projection.providerId, "eve.world-smoke");
assert.equal(projection.surfaceId, "eve.world-smoke.surface");
assert.equal(projection.commandBoundary, "eve.world-smoke.commands");
assert.equal(projection.receiptSchema, "eve.world_smoke.command_receipt.v1");
assert.equal(projection.root.id, "eve.world-smoke.root");
});

View file

@ -1,160 +0,0 @@
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
export function buildElectronCaptureRequest({
advertisement,
capabilityManifest,
advertisementPath = "",
capabilityManifestPath = "",
captureSurfaceId = "",
stamp = new Date().toISOString().replace(/[:.]/g, "-"),
} = {}) {
if (!advertisement || typeof advertisement !== "object") {
throw new Error("advertisement is required");
}
if (!capabilityManifest || typeof capabilityManifest !== "object") {
throw new Error("capabilityManifest is required");
}
const captureContract = capabilityManifest.lifecycle?.capture?.captureContract;
if (!captureContract) {
throw new Error("capability manifest is missing lifecycle.capture.captureContract");
}
const captureSurface = selectCaptureSurface(captureContract, advertisement.providerId, captureSurfaceId);
if (!captureSurface) {
if (captureSurfaceId) {
throw new Error(
`capture surface mismatch: expected ${captureSurfaceList(captureContract)} got ${advertisement.providerId || "missing"}:${captureSurfaceId}`,
);
}
throw new Error(
`capture provider mismatch: expected ${captureProviderList(captureContract)} got ${advertisement.providerId || "missing"}`,
);
}
const targetId = captureContract.targetId || captureContract.runtimeId;
const surface = (advertisement.surfaces || []).find(candidate => candidate.surfaceId === captureSurface.surfaceId);
if (!surface) {
throw new Error(`capture surface not advertised: ${captureSurface.surfaceId}`);
}
const loweringTargets = surface.worldInteraction?.loweringTargets || [];
if (!loweringTargets.includes(targetId)) {
throw new Error(`surface ${surface.surfaceId} does not advertise lowering target ${targetId}`);
}
const artifactPath = replaceStamp(captureContract.artifactPattern, stamp);
return {
schema: captureContract.requestSchema || "gamecult.eve.runtime_capture_request.v1",
runtimeId: capabilityManifest.runtimeId,
ownerRepo: captureContract.ownerRepo,
providerId: advertisement.providerId,
surfaceId: surface.surfaceId,
surfaceKind: surface.surfaceKind || "",
targetId,
projectionKind: surface.worldInteraction?.projectionKind || "",
commandBoundary: surface.worldInteraction?.commandBoundary || "",
receiptSchema: surface.worldInteraction?.receiptSchema || "",
captureKind: captureContract.captureKind,
artifactKind: captureContract.artifactKind,
artifactPath,
conformanceAttachment: captureContract.conformanceAttachment,
authority: captureContract.authority,
sourceAdvertisementPath: advertisementPath,
sourceCapabilityManifestPath: capabilityManifestPath,
issuedAtUtc: stamp,
};
}
export function loadJsonFile(filePath) {
return JSON.parse(readFileSync(filePath, "utf8"));
}
export function writeCaptureRequest(request, outputPath) {
mkdirSync(path.dirname(outputPath), { recursive: true });
writeFileSync(outputPath, `${JSON.stringify(request, null, 2)}\n`, "utf8");
}
function replaceStamp(pattern, stamp) {
if (!pattern || !pattern.includes("{stamp}")) {
throw new Error(`capture artifact pattern must include {stamp}: ${pattern || "missing"}`);
}
return pattern.replace("{stamp}", stamp);
}
function selectCaptureSurface(captureContract, providerId, surfaceId = "") {
const claims = captureSurfaceClaims(captureContract).filter(claim => claim.providerId === providerId);
if (surfaceId) return claims.find(claim => claim.surfaceId === surfaceId) || null;
return claims[0] || null;
}
function captureProviderList(captureContract) {
return captureSurfaceClaims(captureContract).map(claim => claim.providerId).filter(Boolean).join(", ") || "missing";
}
function captureSurfaceList(captureContract) {
return captureSurfaceClaims(captureContract).map(claim => `${claim.providerId}:${claim.surfaceId}`).join(", ") || "missing";
}
function captureSurfaceClaims(captureContract) {
return [
{
providerId: captureContract.requiredProvider || "",
surfaceId: captureContract.requiredSurface || "",
},
...(Array.isArray(captureContract.additionalProviderSurfaces) ? captureContract.additionalProviderSurfaces : []),
]
.filter(claim => claim && typeof claim === "object")
.map(claim => ({
providerId: String(claim.providerId || ""),
surfaceId: String(claim.surfaceId || ""),
}))
.filter(claim => claim.providerId && claim.surfaceId);
}
function parseArgs(argv) {
const args = {};
for (let index = 0; index < argv.length; index += 1) {
const value = argv[index];
if (!value.startsWith("--")) continue;
const key = value.slice(2);
const next = argv[index + 1];
if (!next || next.startsWith("--")) {
args[key] = true;
} else {
args[key] = next;
index += 1;
}
}
return args;
}
function runCli() {
const args = parseArgs(process.argv.slice(2));
for (const required of ["advertisement", "capability", "output"]) {
if (!args[required]) {
throw new Error(`missing required --${required}`);
}
}
const stamp = args.stamp || new Date().toISOString().replace(/[:.]/g, "-");
const request = buildElectronCaptureRequest({
advertisement: loadJsonFile(args.advertisement),
capabilityManifest: loadJsonFile(args.capability),
advertisementPath: args.advertisement,
capabilityManifestPath: args.capability,
captureSurfaceId: args["surface-id"] || "",
stamp,
});
writeCaptureRequest(request, args.output);
process.stdout.write(`${args.output}\n`);
}
const invokedPath = process.argv[1] ? path.resolve(process.argv[1]) : "";
const modulePath = fileURLToPath(import.meta.url);
if (invokedPath === modulePath) {
runCli();
}

View file

@ -1,76 +0,0 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { buildElectronCaptureRequest } from "./eveelectron-capture-contract.mjs";
const advertisement = JSON.parse(readFileSync(new URL("../../web/fixtures/aetheria.provider-advertisement.json", import.meta.url), "utf8"));
const worldSmokeAdvertisement = JSON.parse(readFileSync(new URL("../../web/fixtures/eve-world-smoke.provider-advertisement.json", import.meta.url), "utf8"));
const capabilityManifest = JSON.parse(readFileSync(new URL("../../runtimes/incubating/eve-electron/eve-runtime-capability.json", import.meta.url), "utf8"));
test("builds Electron shell capture request from provider advertisement", () => {
const request = buildElectronCaptureRequest({
advertisement,
capabilityManifest,
advertisementPath: "web/fixtures/aetheria.provider-advertisement.json",
capabilityManifestPath: "runtimes/incubating/eve-electron/eve-runtime-capability.json",
stamp: "smoke",
});
assert.equal(request.schema, "gamecult.eve.runtime_capture_request.v1");
assert.equal(request.runtimeId, "electron-shell");
assert.equal(request.ownerRepo, "EveElectron");
assert.equal(request.providerId, "aetheria");
assert.equal(request.surfaceId, "aetheria.daemon.game");
assert.equal(request.targetId, "electron-shell");
assert.equal(request.projectionKind, "provider-authored-world-surface");
assert.equal(request.commandBoundary, "aetheria.daemon.commands");
assert.equal(request.receiptSchema, "aetheria.eve_command_acceptance_status.v1");
assert.equal(request.artifactPath, "artifacts/eveelectron-capture/smoke/electron-shell.png");
assert.match(request.authority, /provider state/);
});
test("builds Electron shell capture request for Aetheria editor surface", () => {
const request = buildElectronCaptureRequest({
advertisement,
capabilityManifest,
captureSurfaceId: "aetheria.daemon.editor",
advertisementPath: "web/fixtures/aetheria.provider-advertisement.json",
capabilityManifestPath: "runtimes/incubating/eve-electron/eve-runtime-capability.json",
stamp: "smoke",
});
assert.equal(request.runtimeId, "electron-shell");
assert.equal(request.providerId, "aetheria");
assert.equal(request.surfaceId, "aetheria.daemon.editor");
assert.equal(request.surfaceKind, "interactive-world-editor");
assert.equal(request.projectionKind, "provider-authored-world-editor-surface");
assert.equal(request.commandBoundary, "aetheria.daemon.commands");
assert.equal(request.receiptSchema, "aetheria.eve_command_acceptance_status.v1");
});
test("builds Electron shell capture request from a declared generic world provider", () => {
const request = buildElectronCaptureRequest({
advertisement: worldSmokeAdvertisement,
capabilityManifest,
advertisementPath: "web/fixtures/eve-world-smoke.provider-advertisement.json",
capabilityManifestPath: "runtimes/incubating/eve-electron/eve-runtime-capability.json",
stamp: "smoke",
});
assert.equal(request.runtimeId, "electron-shell");
assert.equal(request.providerId, "eve.world-smoke");
assert.equal(request.surfaceId, "eve.world-smoke.surface");
assert.equal(request.commandBoundary, "eve.world-smoke.commands");
assert.equal(request.receiptSchema, "eve.world_smoke.command_receipt.v1");
});
test("rejects capture request when the surface does not advertise Electron shell", () => {
const withoutTarget = structuredClone(advertisement);
const surface = withoutTarget.surfaces.find(candidate => candidate.surfaceId === "aetheria.daemon.game");
surface.worldInteraction.loweringTargets = surface.worldInteraction.loweringTargets.filter(target => target !== "electron-shell");
assert.throws(
() => buildElectronCaptureRequest({ advertisement: withoutTarget, capabilityManifest, stamp: "smoke" }),
/does not advertise lowering target electron-shell/,
);
});

View file

@ -1,114 +0,0 @@
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
export function buildElectronReleaseRequest({
capabilityManifest,
packageManifest,
capabilityManifestPath = "",
packageManifestPath = "",
repository = "GameCult/EveElectron",
} = {}) {
if (!capabilityManifest || typeof capabilityManifest !== "object") {
throw new Error("capabilityManifest is required");
}
if (!packageManifest || typeof packageManifest !== "object") {
throw new Error("packageManifest is required");
}
const releaseContract = capabilityManifest.lifecycle?.release?.releaseContract;
if (!releaseContract) {
throw new Error("capability manifest is missing lifecycle.release.releaseContract");
}
if (packageManifest.name !== releaseContract.packageName) {
throw new Error(`package name mismatch: expected ${releaseContract.packageName} got ${packageManifest.name || "missing"}`);
}
if (!packageManifest.version || !/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(packageManifest.version)) {
throw new Error(`package version is not a SemVer-compatible release version: ${packageManifest.version || "missing"}`);
}
const tagName = replaceVersion(releaseContract.tagPattern, packageManifest.version);
const artifactPath = replaceVersion(
releaseContract.artifactPattern || `artifacts/eveelectron-release/{version}/${releaseContract.packageName}-{version}.zip`,
packageManifest.version,
);
return {
schema: releaseContract.requestSchema || "gamecult.eve.runtime_release_request.v1",
ownerRepo: releaseContract.ownerRepo,
repository,
packageName: releaseContract.packageName,
version: packageManifest.version,
packageRoot: releaseContract.packageRoot,
versionSource: releaseContract.versionSource,
tagName,
artifactKind: releaseContract.artifactKind,
artifactPath,
publishProof: releaseContract.publishProof,
sourceCapabilityManifestPath: capabilityManifestPath,
sourcePackageManifestPath: packageManifestPath,
main: packageManifest.main || "",
scripts: packageManifest.scripts || {},
dependencies: packageManifest.dependencies || {},
devDependencies: packageManifest.devDependencies || {},
};
}
export function loadJsonFile(filePath) {
return JSON.parse(readFileSync(filePath, "utf8"));
}
export function writeReleaseRequest(request, outputPath) {
mkdirSync(path.dirname(outputPath), { recursive: true });
writeFileSync(outputPath, `${JSON.stringify(request, null, 2)}\n`, "utf8");
}
function replaceVersion(pattern, version) {
if (!pattern || !pattern.includes("{version}")) {
throw new Error(`release pattern must include {version}: ${pattern || "missing"}`);
}
return pattern.replaceAll("{version}", version);
}
function parseArgs(argv) {
const args = {};
for (let index = 0; index < argv.length; index += 1) {
const value = argv[index];
if (!value.startsWith("--")) continue;
const key = value.slice(2);
const next = argv[index + 1];
if (!next || next.startsWith("--")) {
args[key] = true;
} else {
args[key] = next;
index += 1;
}
}
return args;
}
function runCli() {
const args = parseArgs(process.argv.slice(2));
for (const required of ["capability", "package", "output"]) {
if (!args[required]) {
throw new Error(`missing required --${required}`);
}
}
const request = buildElectronReleaseRequest({
capabilityManifest: loadJsonFile(args.capability),
packageManifest: loadJsonFile(args.package),
capabilityManifestPath: args.capability,
packageManifestPath: args.package,
repository: args.repository || "GameCult/EveElectron",
});
writeReleaseRequest(request, args.output);
process.stdout.write(`${args.output}\n`);
}
const invokedPath = process.argv[1] ? path.resolve(process.argv[1]) : "";
const modulePath = fileURLToPath(import.meta.url);
if (invokedPath === modulePath) {
runCli();
}

View file

@ -1,37 +0,0 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { buildElectronReleaseRequest } from "./eveelectron-release-contract.mjs";
const capabilityManifest = JSON.parse(readFileSync(new URL("../../runtimes/incubating/eve-electron/eve-runtime-capability.json", import.meta.url), "utf8"));
const packageManifest = JSON.parse(readFileSync(new URL("../../runtimes/incubating/eve-electron/package.json", import.meta.url), "utf8"));
test("builds EveElectron release request from package manifest", () => {
const request = buildElectronReleaseRequest({
capabilityManifest,
packageManifest,
capabilityManifestPath: "runtimes/incubating/eve-electron/eve-runtime-capability.json",
packageManifestPath: "runtimes/incubating/eve-electron/package.json",
});
assert.equal(request.schema, "gamecult.eve.runtime_release_request.v1");
assert.equal(request.ownerRepo, "EveElectron");
assert.equal(request.repository, "GameCult/EveElectron");
assert.equal(request.packageName, "eve-electron");
assert.equal(request.version, "0.1.0");
assert.equal(request.packageRoot, "runtimes/incubating/eve-electron");
assert.equal(request.versionSource, "runtimes/incubating/eve-electron/package.json");
assert.equal(request.tagName, "eveelectron-v0.1.0");
assert.equal(request.artifactKind, "electron-app");
assert.equal(request.artifactPath, "artifacts/eveelectron-release/0.1.0/eve-electron-0.1.0.zip");
assert.equal(request.main, "src/eve-electron-shell.mjs");
});
test("rejects package manifests that do not match the Electron release contract", () => {
const wrongPackage = { ...packageManifest, name: "eve-wrong" };
assert.throws(
() => buildElectronReleaseRequest({ capabilityManifest, packageManifest: wrongPackage }),
/package name mismatch/,
);
});

View file

@ -658,45 +658,43 @@
"id": "EveElectron",
"ownerRepo": "EveElectron",
"repoRole": "runtime-target",
"status": "pending",
"status": "graduated-runtime-capture-pending",
"runtimes": ["electron-shell"],
"requiredRuntimeStatuses": ["active"],
"requiredFeatures": ["providerAdvertisements", "surfaceTreeProjection", "embeddedDocuments"],
"requiredPlugins": [],
"proofs": [
{
"description": "EveElectron split handoff is machine-readable.",
"description": "EveElectron owner repository publishes the generic runtime package.",
"status": "passed",
"evidencePaths": [
"runtimes/incubating/eve-electron/eveelectron-split-handoff.json",
"scripts/run-eveelectron-split-handoff-smoke.ps1",
"docs/eve-migration-roadmap.md",
"docs/parity-testing-harness.md"
"../EveElectron/package.json",
"../EveElectron/eve-runtime-capability.json",
"../EveElectron/src/index.mjs"
]
},
{
"description": "EveElectron lifecycle contract is machine-readable and smoke-checked.",
"description": "EveElectron owns secure window and preload lifecycle.",
"status": "passed",
"evidencePaths": [
"runtimes/incubating/eve-electron/eve-runtime-capability.json",
"scripts/run-eveelectron-lifecycle-smoke.ps1",
"scripts/run-eveelectron-provider-shell-smoke.ps1"
"../EveElectron/src/window-host.mjs",
"../EveElectron/src/eve-provider-preload.cjs",
"../EveElectron/test/window-host.test.mjs",
"../EveElectron/test/preload.test.cjs"
]
},
{
"description": "EveElectron provider-shell skeleton selects advertised surfaces, projects Eve surface trees, and emits Eve command intents.",
"description": "Aetheria consumes EveElectron for generic window and preload authority while retaining provider transport and daemon lifecycle.",
"status": "passed",
"evidencePaths": [
"runtimes/incubating/eve-electron/package.json",
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"scripts/run-eveelectron-provider-shell-smoke.ps1"
"../Aetheria/Aetheria.Rts.Web/package.json",
"../Aetheria/Aetheria.Rts.Web/Electron/main.ts",
"../Aetheria/Aetheria.Rts.Web/Electron/preload.cjs",
"../Aetheria/Aetheria.Rts.Web/Client/app.ts"
]
}
],
"pendingProofs": [
"Electron shell runtime body graduates to EveElectron outside Aetheria product code.",
"Electron renders embedded Eve documents in a packaged Electron window.",
"Electron packaged window PNG capture artifacts are attached to conformance output."
]
},
@ -750,19 +748,20 @@
{
"id": "electron-shell",
"title": "Electron shell",
"kind": "pending",
"kind": "active",
"ownerRepo": "EveElectron",
"repoRole": "runtime-target",
"splitTarget": "EveElectron",
"graduationTrigger": "Split when Electron has a provider-agnostic shell body, provider advertisement consumption, command transport, packaged app lifecycle, and capture evidence independent of Aetheria product code.",
"currentHostRepo": "EveElectron",
"sourceRoot": "../EveElectron",
"graduationTrigger": "Graduated: the runtime body and package are owned here.",
"capabilityManifest": {
"schemaPath": "schemas/gamecult.eve.runtime_capability.v1.schema.json",
"manifestPath": "runtimes/incubating/eve-electron/eve-runtime-capability.json"
"manifestPath": "eve-runtime-capability.json"
},
"splitHandoffPath": "runtimes/incubating/eve-electron/eveelectron-split-handoff.json",
"requiredFixtures": ["embedded-surface", "aetheria-world", "eve-world-smoke"],
"pluginFixtures": ["sai-vn"],
"supportedFeatures": ["providerAdvertisements", "commandTransport", "surfaceTreeProjection", "embeddedDocuments", "pluginProjection"],
"supportedFeatures": ["providerAdvertisements", "commandTransport", "surfaceTreeProjection", "embeddedDocuments", "pluginProjection", "securePreloadBridge", "windowLifecycle"],
"supportedPlugins": [
{
"pluginId": "sai.vn",
@ -783,94 +782,51 @@
"targetId": "electron-shell",
"surfaceKinds": ["interactive-world", "interactive-world-editor"],
"projectionKinds": ["provider-authored-world-surface", "provider-authored-world-editor-surface"],
"supportLevel": "electron-shell-surface-tree-command-surface",
"supportLevel": "provider-shell-surface-tree-command-surface",
"ownership": "runtime-lowers-provider-world-surface-without-owning-world-state",
"evidencePaths": [
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"web/fixtures/sai-vn-surface.json",
"web/fixtures/aetheria.provider-advertisement.json",
"web/fixtures/eve-world-smoke.provider-advertisement.json"
"src/eve-electron-shell.mjs",
"src/window-host.mjs",
"src/eve-provider-preload.cjs",
"test/shell.test.mjs",
"test/window-host.test.mjs",
"test/preload.test.cjs"
]
}
],
"expectedPaths": [
"runtimes/incubating/eve-electron/package.json",
"runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"runtimes/incubating/eve-electron/eveelectron-split-handoff.json",
"runtimes/incubating/eve-electron/eve-runtime-capability.json",
"scripts/run-eveelectron-lifecycle-smoke.ps1",
"scripts/run-eveelectron-provider-shell-smoke.ps1",
"scripts/run-eveelectron-release-contract-smoke.ps1",
"scripts/run-eveelectron-capture-contract-smoke.ps1",
"scripts/run-eveelectron-capture-smoke.ps1",
"tools/eveelectron/eveelectron-release-contract.mjs",
"tools/eveelectron/eveelectron-release-contract.test.mjs",
"tools/eveelectron/eveelectron-capture-contract.mjs",
"tools/eveelectron/eveelectron-capture-contract.test.mjs",
"tools/eveelectron/eveelectron-capture-artifact.mjs",
"tools/eveelectron/eveelectron-capture-artifact.test.mjs"
"../EveElectron/package.json",
"../EveElectron/package-lock.json",
"../EveElectron/eve-runtime-capability.json",
"../EveElectron/src/eve-electron-shell.mjs",
"../EveElectron/src/window-host.mjs",
"../EveElectron/src/eve-provider-preload.cjs",
"../EveElectron/test/shell.test.mjs",
"../EveElectron/test/window-host.test.mjs",
"../EveElectron/test/preload.test.cjs"
],
"expectedSourceSymbols": [
{
"path": "runtimes/incubating/eve-electron/src/eve-electron-shell.mjs",
"path": "../EveElectron/src/eve-electron-shell.mjs",
"contains": ["EveElectronShell", "selectSurface", "lowerSurface", "createCommandIntent", "normalizeSurfaceDocument", "buildShellNode", "buildPluginProjection", "normalizeEmbeddedDocuments", "embeddedDocuments", "shellElementKind", "sai.vn", "norn.graph", "tex.math", "sidecar-advertised-plugin-abi", "worldInteraction", "commandBoundary", "receiptSchema", "electron-shell"]
},
{
"path": "runtimes/incubating/eve-electron/test/eve-electron-shell.test.mjs",
"contains": ["selects the active advertised provider surface", "lowers provider surface trees into an Electron shell projection", "lowers Sai, Norn, and TeX sidecar plugin shells without owning semantics", "embeddedDocuments", "norn.map", "sai-vn-stage-shell", "norn-graph-shell", "tex-math-shell", "optional-nested", "rejects surface documents that do not match the advertised target", "command intents carry provider-advertised boundaries", "aetheria.daemon.commands", "aetheria.eve_command_acceptance_status.v1"]
"path": "../EveElectron/test/shell.test.mjs",
"contains": ["lowers a non-product interactive world", "fixture.world", "provider-authored-world-surface", "fixture.world.commands"]
},
{
"path": "tools/eveelectron/eveelectron-capture-contract.mjs",
"contains": ["buildElectronCaptureRequest", "gamecult.eve.runtime_capture_request.v1", "loweringTargets", "artifactPattern", "writeCaptureRequest"]
"path": "../EveElectron/src/window-host.mjs",
"contains": ["createEveElectronWindow", "registerEveWindowControls", "contextIsolation", "nodeIntegration", "setWindowOpenHandler"]
},
{
"path": "tools/eveelectron/eveelectron-capture-contract.test.mjs",
"contains": ["builds Electron shell capture request from provider advertisement", "builds Electron shell capture request from a declared generic world provider", "rejects capture request when the surface does not advertise Electron shell", "electron-shell", "aetheria.daemon.commands", "eve.world-smoke.commands"]
},
{
"path": "tools/eveelectron/eveelectron-capture-artifact.mjs",
"contains": ["buildElectronCaptureArtifact", "EveElectronShell", "gamecult.eve.electron_shell_projection.v1", "json-projection", "writeElectronCaptureArtifact", "request-output"]
},
{
"path": "tools/eveelectron/eveelectron-capture-artifact.test.mjs",
"contains": ["builds Electron shell projection capture artifact", "builds Electron shell projection capture artifact from a generic world provider", "gamecult.eve.electron_shell_projection.v1", "electron-shell-projection-json", "eve.world-smoke.commands"]
},
{
"path": "tools/eveelectron/eveelectron-release-contract.mjs",
"contains": ["buildElectronReleaseRequest", "gamecult.eve.runtime_release_request.v1", "eveelectron-release", "writeReleaseRequest"]
},
{
"path": "tools/eveelectron/eveelectron-release-contract.test.mjs",
"contains": ["builds EveElectron release request from package manifest", "eveelectron-v0.1.0", "artifacts/eveelectron-release/0.1.0/eve-electron-0.1.0.zip"]
"path": "../EveElectron/src/eve-provider-preload.cjs",
"contains": ["installEveProviderBridge", "providerAdvertisement", "surface", "document", "submitCommand", "windowControl"]
}
],
"capture": {
"status": "json-projection",
"note": "Electron attaches a provider-advertisement-backed gamecult.eve.electron_shell_projection.v1 JSON projection artifact; packaged window PNG capture remains an EveElectron split blocker.",
"artifacts": [
{
"kind": "json-projection",
"schema": "gamecult.eve.electron_shell_projection.v1",
"path": "artifacts/eveelectron-capture/latest/electron-shell-projection.json",
"runtimeId": "electron-shell",
"providerId": "aetheria",
"surfaceId": "aetheria.daemon.game",
"sourceSurfacePath": "web/fixtures/aetheria-world-surface.json",
"requestPath": "artifacts/eveelectron-capture/latest/capture-request.json"
},
{
"kind": "json-projection",
"schema": "gamecult.eve.electron_shell_projection.v1",
"path": "artifacts/eveelectron-capture/latest/eve-world-smoke-electron-shell-projection.json",
"runtimeId": "electron-shell",
"providerId": "eve.world-smoke",
"surfaceId": "eve.world-smoke.surface",
"sourceSurfacePath": "web/fixtures/eve-world-smoke-surface.json",
"requestPath": "artifacts/eveelectron-capture/latest/eve-world-smoke-capture-request.json"
}
]
"status": "pending-owner-window-capture",
"note": "EveElectron owns capture production; Eve core no longer manufactures runtime projection artifacts on its behalf.",
"artifacts": []
}
},
{