Align Sai live fixture with Eve conformance
This commit is contained in:
parent
826200184c
commit
d9c756eca0
5 changed files with 59 additions and 7 deletions
|
|
@ -18,7 +18,10 @@ The retained operations are:
|
|||
|
||||
- `open`: create or replace a named Ink session and advance it to its first line.
|
||||
- `apply`: apply `story.continue`, `story.choose`, or `story.jump` to that session.
|
||||
- `jump`: exercise a second retained transition without duplicating the ABI's
|
||||
single `apply` conformance contract.
|
||||
- `project`: derive a Sai Eve surface from current session state.
|
||||
- `validate`: identify Sai-owned and foreign component kinds.
|
||||
- `describe`: report the sidecar's owned and optional capabilities.
|
||||
|
||||
Run the owner-side conformance witness with:
|
||||
|
|
|
|||
|
|
@ -10,10 +10,23 @@
|
|||
{
|
||||
"operation": "describe",
|
||||
"expect": {
|
||||
"pluginId": "sai.vn",
|
||||
"componentKinds": ["vn.stage", "panel.dialogue", "text.dialogue", "rail.actions"],
|
||||
"commands": ["story.continue", "story.choose", "story.jump"],
|
||||
"capabilities": ["vn.stage", "story.choose", "story.continue", "story.jump"],
|
||||
"sessionAuthority": "sai-sidecar",
|
||||
"optionalPlugins": ["norn.graph", "tex.math"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"operation": "validate",
|
||||
"input": { "componentKinds": ["vn.stage", "panel.dialogue", "text.dialogue", "rail.actions", "combat.timeline"] },
|
||||
"expect": {
|
||||
"acceptedComponentKinds": ["vn.stage", "panel.dialogue", "text.dialogue", "rail.actions"],
|
||||
"rejectedComponentKinds": ["combat.timeline"],
|
||||
"requiredCapabilities": ["vn.stage", "story.choose", "story.continue", "story.jump"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"operation": "open",
|
||||
"input": { "sessionId": "witness", "storyId": "sai-example", "storyPath": "examples/static-site/story.ink.json" },
|
||||
|
|
@ -29,7 +42,13 @@
|
|||
"expect": {
|
||||
"line": "Then the story should feel like it belongs here, not like a widget escaped from somewhere else.",
|
||||
"revision": 1,
|
||||
"command": "story.choose"
|
||||
"command": "story.choose",
|
||||
"commandEffects": {
|
||||
"story.continue": "advance-story",
|
||||
"story.choose": "choose-branch",
|
||||
"story.jump": "jump-to-knot"
|
||||
},
|
||||
"receiptSchema": "gamecult.eve.command_receipt.v1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -43,8 +62,8 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"operation": "apply",
|
||||
"input": { "sessionId": "witness", "command": "story.jump", "targetPath": "gather" },
|
||||
"operation": "jump",
|
||||
"input": { "sessionId": "witness", "targetPath": "gather" },
|
||||
"expect": {
|
||||
"line": "Good. The brush moves. The scene answers.",
|
||||
"revision": 2,
|
||||
|
|
|
|||
|
|
@ -8,12 +8,15 @@
|
|||
"invocationModel": "executable-sidecar",
|
||||
"contract": "gamecult.eve.plugin_abi.v1",
|
||||
"transports": ["stdio"],
|
||||
"authority": ["renderer-independent", "no-provider-state-mutation", "provider-accepts-or-denies-commands"],
|
||||
"sidecar": {
|
||||
"processKind": "long-running-daemon",
|
||||
"protocol": "stdio-ndjson",
|
||||
"requestSchema": "gamecult.eve.plugin_abi.request.v1",
|
||||
"responseSchema": "gamecult.eve.plugin_abi.response.v1",
|
||||
"operations": ["describe", "open", "apply", "project"],
|
||||
"operations": ["describe", "validate", "open", "apply", "project", "jump"],
|
||||
"commandEnvelope": "gamecult.eve.command_invocation.v1",
|
||||
"receiptSchema": "gamecult.eve.command_receipt.v1",
|
||||
"launch": { "command": "node", "artifact": "src/eve-sidecar.cjs" },
|
||||
"stateAuthority": "sai-sidecar-owns-story-session-provider-owns-command-acceptance"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,14 +13,20 @@
|
|||
"invocationModel": "executable-sidecar",
|
||||
"contract": "gamecult.eve.plugin_abi.v1",
|
||||
"transports": ["stdio"],
|
||||
"authority": ["renderer-independent", "no-provider-state-mutation", "provider-accepts-or-denies-commands"],
|
||||
"sidecar": {
|
||||
"processKind": "long-running-daemon",
|
||||
"protocol": "stdio-ndjson",
|
||||
"operations": ["describe", "open", "apply", "project"],
|
||||
"requestSchema": "gamecult.eve.plugin_abi.request.v1",
|
||||
"responseSchema": "gamecult.eve.plugin_abi.response.v1",
|
||||
"operations": ["describe", "validate", "open", "apply", "project", "jump"],
|
||||
"commandEnvelope": "gamecult.eve.command_invocation.v1",
|
||||
"receiptSchema": "gamecult.eve.command_receipt.v1",
|
||||
"stateAuthority": "sai-sidecar-owns-story-session-provider-owns-command-acceptance"
|
||||
}
|
||||
},
|
||||
"stateSchemas": ["sai.vn.story_session.v1", "sai.vn.visual_manifest.v1"],
|
||||
"abiFixtures": ["plugins/sai-vn.plugin-abi-fixture.json"],
|
||||
"capabilities": {
|
||||
"requires": ["vn.stage", "story.choose", "story.continue", "story.jump"],
|
||||
"optionalPlugins": [
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const SaiEve = require("./eve.js");
|
|||
|
||||
const sessions = new Map();
|
||||
const pluginId = "sai.vn";
|
||||
const operations = ["describe", "open", "apply", "project"];
|
||||
const operations = ["describe", "validate", "open", "apply", "project", "jump"];
|
||||
|
||||
readline.createInterface({ input: process.stdin }).on("line", (line) => {
|
||||
if (!line.trim()) return;
|
||||
|
|
@ -26,11 +26,23 @@ function dispatch(request) {
|
|||
if (request.pluginId !== pluginId) throw new Error(`Expected plugin ${pluginId}.`);
|
||||
if (!operations.includes(request.operation)) throw new Error(`Unsupported operation ${request.operation}.`);
|
||||
if (request.operation === "describe") return describe();
|
||||
if (request.operation === "validate") return validate(request.input);
|
||||
if (request.operation === "open") return openSession(request.input);
|
||||
if (request.operation === "apply") return applyCommand(request.input);
|
||||
if (request.operation === "jump") return applyCommand({ ...request.input, command: "story.jump" });
|
||||
return projectSession(request.input);
|
||||
}
|
||||
|
||||
function validate(input) {
|
||||
const owned = new Set(describe().componentKinds);
|
||||
const requested = Array.isArray(input.componentKinds) ? input.componentKinds : [];
|
||||
return {
|
||||
acceptedComponentKinds: requested.filter((kind) => owned.has(kind)),
|
||||
rejectedComponentKinds: requested.filter((kind) => !owned.has(kind)),
|
||||
requiredCapabilities: describe().capabilities,
|
||||
};
|
||||
}
|
||||
|
||||
function describe() {
|
||||
return {
|
||||
pluginId,
|
||||
|
|
@ -70,7 +82,16 @@ function applyCommand(input) {
|
|||
throw new Error(`Unsupported Sai command ${command}.`);
|
||||
}
|
||||
session.revision += 1;
|
||||
return { ...snapshot(session), command, receiptSchema: "gamecult.eve.command_receipt.v1" };
|
||||
return {
|
||||
...snapshot(session),
|
||||
command,
|
||||
commandEffects: {
|
||||
"story.continue": "advance-story",
|
||||
"story.choose": "choose-branch",
|
||||
"story.jump": "jump-to-knot",
|
||||
},
|
||||
receiptSchema: "gamecult.eve.command_receipt.v1",
|
||||
};
|
||||
}
|
||||
|
||||
function projectSession(input) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue