Expose the world approval surface
This commit is contained in:
parent
7f26221c21
commit
b5483242e1
9 changed files with 243 additions and 181 deletions
|
|
@ -805,7 +805,10 @@ therefore leave several stale controls visible even though the kernel rejected
|
|||
them safely. The receipt panel now owns exactly the current approval action.
|
||||
The same audit restored separate composer fields for the visible act or speech
|
||||
and its intended effect; the browser no longer duplicates one sentence into
|
||||
both assessment fields.
|
||||
both assessment fields. The approval preview now exposes its full public
|
||||
decision surface in expandable sections, and a browser-local request lock
|
||||
prevents double-clicks from launching duplicate inference without claiming any
|
||||
world-state authority.
|
||||
|
||||
## Warnings
|
||||
|
||||
|
|
|
|||
|
|
@ -343,7 +343,12 @@ the character's described act or speech and the effect the player wants it to
|
|||
cause. The receipt panel is the sole owner of the current assessment,
|
||||
destination, or fission approval control; rendering a newer receipt removes the
|
||||
older snapshot-bound control instead of accumulating stale confirmations in
|
||||
persistent forms.
|
||||
persistent forms. World-seed approval renders expandable public sections for
|
||||
the player role, initial topology, present cast, institutions, populations,
|
||||
world clocks, and exact evidence-use rationales instead of asking for approval
|
||||
from summary counts. A browser-local interaction lock prevents duplicate paid
|
||||
requests while preserving the kernel mailbox and revision checks as the only
|
||||
world-mutation authority.
|
||||
|
||||
Relationship documents in the schema catalog are revision-bound projections
|
||||
of actor-owned relationship maps; they are not a second relationship writer.
|
||||
|
|
|
|||
|
|
@ -96,4 +96,5 @@
|
|||
{"ts":"2026-08-18T19:20:00Z","type":"verification","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Corrected the scale harness's conflation of active-cell budget with provider concurrency. GHOSTLIGHT_SCALE_PROVIDER_PARALLELISM now defaults to 8 and is recorded in the result. A provider-backed 24-subject budget-8 / parallelism-8 wave completed in 18.35s, covered every subject exactly once, produced ten material actions and one attributed inaction, made no retry, and left the player unmoved. The prior 25.64s budget-8 result used provider parallelism 4. Witness: F:\\GameCult\\GhostlightDungeon\\acceptance\\gestalt-scale-shakedown-b8-p8\\result.json."}
|
||||
{"ts":"2026-08-18T19:05:00Z","type":"implementation","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Pre-human browser audit restored the fiction-first assessment boundary: the composer now sends distinct description and intended_effect fields, so spoken words are not conflated with persuasion or another desired consequence. The receipt panel now exclusively owns the current assessment, destination, or fission approval button; newer snapshot-bound receipts structurally replace stale controls. Vite production build succeeded."}
|
||||
{"ts":"2026-08-18T19:11:00Z","type":"deployment","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Starfire activated immutable release f9b0ffb90e6a8b3e1505d81995e81e09a9c58cd7 with executable SHA-256 66df149fbf548fc5da6658268e1bb53c62d9608ef6c2c306c6cfc9c909dabdfe and rollback 7916ab04936ba962720cfbf4af1b83f9aa8d8b24. Typed health, release manifest, active junction, PID 12212, four persisted campaigns, DeepSeek readiness, and served browser asset index-DCxXqgqF.js agree. Publication did not rotate or consume invitations."}
|
||||
{"ts":"2026-08-18T19:14:00Z","type":"implementation","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"The world-seed preview now renders the full public approval surface—player capabilities/equipment/conditions/obligations, stable topology and routes, cast, institutions, populations, clocks, and exact evidence-use rationales—in compact expandable sections. A browser-local request lock disables only previously enabled controls during compilation or commands and restores those exact controls afterward, preventing accidental duplicate inference while leaving mailbox/revision authority server-side. Vite production build succeeded."}
|
||||
{"ts":"2026-08-18T18:52:00Z","type":"verification","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Exact release 7916ab04936ba962720cfbf4af1b83f9aa8d8b24 made every selected named member exception a mandatory Projector perspective owner, closing the seam where aggregation could erase an actionable individual before Persona choice. The strict provider-backed budget-one golden placed 24 rivals in one arena, attributed migration to member:mira-venn, moved her between depth-two population lineages, produced nine sustained material consequences including seven typed outcomes across six other background subjects, preserved her delta and the player, and automatically promoted the same Mira on return with zero rejected pulses. Witness: F:\\GameCult\\GhostlightDungeon\\acceptance\\gestalt-dynamics-7916ab0-strict\\result.json."}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
153
web/dist/assets/index-Cdu4csne.js
vendored
Normal file
153
web/dist/assets/index-Cdu4csne.js
vendored
Normal file
File diff suppressed because one or more lines are too long
153
web/dist/assets/index-DCxXqgqF.js
vendored
153
web/dist/assets/index-DCxXqgqF.js
vendored
File diff suppressed because one or more lines are too long
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
|
|
@ -1,6 +1,6 @@
|
|||
<!doctype html>
|
||||
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>GhostlightDungeon</title> <script type="module" crossorigin src="/assets/index-DCxXqgqF.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DLoOYHpE.css">
|
||||
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>GhostlightDungeon</title> <script type="module" crossorigin src="/assets/index-Cdu4csne.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B7Qh0xAi.css">
|
||||
</head>
|
||||
<body><header><p class="eyebrow">STARFIRE / PRIVATE VERSE</p><h1>GhostlightDungeon</h1><p id="status" role="status" aria-live="polite">Reading the world…</p></header><main>
|
||||
<section id="compiler" hidden><h2>Compile a world</h2><div class="compiler-grid">
|
||||
|
|
|
|||
|
|
@ -16,6 +16,28 @@ let playerActorId = "";
|
|||
let resolutionEpoch = 0;
|
||||
let providerConfigurationEpoch = 0;
|
||||
let resolutionPins: any[] = [];
|
||||
let requestInFlight = false;
|
||||
const controlsDisabledByRequest = new Set<HTMLButtonElement | HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>();
|
||||
|
||||
async function withInteractionLock<T>(work: () => Promise<T>): Promise<T> {
|
||||
if (requestInFlight) throw new Error("A Ghostlight request is already in progress.");
|
||||
requestInFlight = true;
|
||||
document.body.setAttribute("aria-busy", "true");
|
||||
for (const control of document.querySelectorAll<HTMLButtonElement | HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>("button, input, textarea, select")) {
|
||||
if (!control.disabled) {
|
||||
control.disabled = true;
|
||||
controlsDisabledByRequest.add(control);
|
||||
}
|
||||
}
|
||||
try {
|
||||
return await work();
|
||||
} finally {
|
||||
for (const control of controlsDisabledByRequest) control.disabled = false;
|
||||
controlsDisabledByRequest.clear();
|
||||
document.body.removeAttribute("aria-busy");
|
||||
requestInFlight = false;
|
||||
}
|
||||
}
|
||||
|
||||
function node<K extends keyof HTMLElementTagNameMap>(
|
||||
tag: K,
|
||||
|
|
@ -149,14 +171,16 @@ async function refresh() {
|
|||
}
|
||||
|
||||
async function compilerPost(path: string, body: unknown) {
|
||||
status.textContent = "Retrieving evidence and compiling…";
|
||||
const response = await fetch(path, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) });
|
||||
const value = response.headers.get("content-type")?.includes("json") ? await response.json() : await response.text();
|
||||
if (!response.ok) {
|
||||
status.textContent = typeof value === "string" ? value : String(value?.error ?? "Compilation failed");
|
||||
throw new Error(status.textContent);
|
||||
}
|
||||
return value;
|
||||
return withInteractionLock(async () => {
|
||||
status.textContent = "Retrieving evidence and compiling…";
|
||||
const response = await fetch(path, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) });
|
||||
const value = response.headers.get("content-type")?.includes("json") ? await response.json() : await response.text();
|
||||
if (!response.ok) {
|
||||
status.textContent = typeof value === "string" ? value : String(value?.error ?? "Compilation failed");
|
||||
throw new Error(status.textContent);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
|
||||
function showCards(items: any[], action: string, choose: (item: any) => void) {
|
||||
|
|
@ -174,6 +198,16 @@ function showCards(items: any[], action: string, choose: (item: any) => void) {
|
|||
compilerResults.replaceChildren(cards);
|
||||
}
|
||||
|
||||
function appendDetailList(parent: HTMLElement, summary: string, lines: string[]) {
|
||||
const details = node("details");
|
||||
details.append(node("summary", summary));
|
||||
const list = node("ul");
|
||||
for (const line of lines) list.append(node("li", line));
|
||||
if (lines.length === 0) list.append(node("li", "None declared."));
|
||||
details.append(list);
|
||||
parent.append(details);
|
||||
}
|
||||
|
||||
document.querySelector<HTMLFormElement>("#suggest-form")!.addEventListener("submit", async event => {
|
||||
event.preventDefault();
|
||||
const result = await compilerPost("/api/compiler/openings", { setting: document.querySelector<HTMLInputElement>("#setting")!.value, constraints: [] });
|
||||
|
|
@ -204,6 +238,23 @@ async function showPreview(result: any) {
|
|||
? `Evidence use: ${evidenceCounts.direct_seed ?? 0} direct · ${evidenceCounts.setting_background ?? 0} background · ${evidenceCounts.excluded ?? 0} excluded`
|
||||
: "Evidence use: no retrieved sources were admitted to this seed.", "quiet"),
|
||||
);
|
||||
const role = preview.player_role ?? {};
|
||||
appendDetailList(card, `Player role · ${role.name ?? "unnamed"}`, [
|
||||
`Starts at ${role.location_id ?? "an unspecified location"}`,
|
||||
...(role.capabilities ?? []).map((value: string) => `Capability: ${value}`),
|
||||
...(role.equipment ?? []).map((value: string) => `Equipment: ${value}`),
|
||||
...(role.conditions ?? []).map((value: string) => `Condition: ${value}`),
|
||||
...(role.obligations ?? []).map((value: string) => `Obligation: ${value}`),
|
||||
]);
|
||||
appendDetailList(card, `Initial topology · ${preview.locations?.length ?? 0} locations`, (preview.locations ?? []).map((location: any) => {
|
||||
const routes = Object.keys(location.routes ?? {});
|
||||
return `${location.name} · ${location.id}${location.container_id ? ` · inside ${location.container_id}` : ""}${routes.length ? ` · routes to ${routes.join(", ")}` : " · no compiled route"}`;
|
||||
}));
|
||||
appendDetailList(card, `Present cast · ${preview.cast?.length ?? 0}`, (preview.cast ?? []).map((actor: any) => `${actor.name} · ${actor.id} · at ${actor.location_id}`));
|
||||
appendDetailList(card, `Institutions · ${preview.institutions?.length ?? 0}`, (preview.institutions ?? []).map((institution: any) => `${institution.name} · ${institution.id}`));
|
||||
appendDetailList(card, `Populations · ${preview.populations?.length ?? 0}`, (preview.populations ?? []).map((population: any) => `${population.name} · ${population.id} · at ${population.home_location_id}`));
|
||||
appendDetailList(card, `World clocks · ${preview.clocks?.length ?? 0}`, (preview.clocks ?? []).map((clock: any) => `${clock.name} · ${clock.progress}/${clock.threshold} · ${clock.trigger}`));
|
||||
appendDetailList(card, `Evidence coverage · ${coverage.length}`, coverage.map((item: any) => `${item.source_id} · ${String(item.lane).replaceAll("_", " ")} · ${item.rationale}`));
|
||||
const approve = node("button", "Approve and enter");
|
||||
approve.type = "button";
|
||||
approve.addEventListener("click", async () => { await compilerPost(`/api/compiler/approve/${result.preview_id}`, {}); await refresh(); });
|
||||
|
|
@ -212,7 +263,7 @@ async function showPreview(result: any) {
|
|||
status.textContent = "Preview compiled. Nothing has entered world state yet.";
|
||||
}
|
||||
|
||||
async function send(command: unknown) { status.textContent = "The world is considering the command…"; const response = await fetch("/api/command", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(command) }); const body = await response.json(); renderCommandReceipt(body); if (!response.ok) { status.textContent = body.error ?? "The command was refused."; await refresh(); return body; } await refresh(); return body; }
|
||||
async function send(command: unknown) { return withInteractionLock(async () => { status.textContent = "The world is considering the command…"; const response = await fetch("/api/command", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(command) }); const body = await response.json(); renderCommandReceipt(body); if (!response.ok) { status.textContent = body.error ?? "The command was refused."; await refresh(); return body; } await refresh(); return body; }); }
|
||||
function installAssessment(result: any) {
|
||||
if (result?.kind !== "assessed") return;
|
||||
const button = document.createElement("button");
|
||||
|
|
@ -262,19 +313,21 @@ document.querySelector<HTMLInputElement>("#provider-parallelism")!.addEventListe
|
|||
});
|
||||
document.querySelector<HTMLFormElement>("#provider-parallelism-form")!.addEventListener("submit", async event => {
|
||||
event.preventDefault();
|
||||
status.textContent = "Applying the provider concurrency limit…";
|
||||
const response = await fetch("/api/operator/provider-parallelism", {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
expected_provider_configuration_epoch: providerConfigurationEpoch,
|
||||
provider_parallelism: Number(document.querySelector<HTMLInputElement>("#provider-parallelism")!.value),
|
||||
}),
|
||||
await withInteractionLock(async () => {
|
||||
status.textContent = "Applying the provider concurrency limit…";
|
||||
const response = await fetch("/api/operator/provider-parallelism", {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
expected_provider_configuration_epoch: providerConfigurationEpoch,
|
||||
provider_parallelism: Number(document.querySelector<HTMLInputElement>("#provider-parallelism")!.value),
|
||||
}),
|
||||
});
|
||||
const body = await response.json();
|
||||
showSummary(response.ok ? "Provider concurrency updated" : "Provider concurrency refused", [response.ok ? `Parallel requests: ${body.receipt?.provider_parallelism ?? body.provider_parallelism ?? "updated"}` : body.error ?? "The operator limit was refused."]);
|
||||
if (!response.ok) status.textContent = body.error ?? "The operator limit was refused.";
|
||||
await refresh();
|
||||
});
|
||||
const body = await response.json();
|
||||
showSummary(response.ok ? "Provider concurrency updated" : "Provider concurrency refused", [response.ok ? `Parallel requests: ${body.receipt?.provider_parallelism ?? body.provider_parallelism ?? "updated"}` : body.error ?? "The operator limit was refused."]);
|
||||
if (!response.ok) status.textContent = body.error ?? "The operator limit was refused.";
|
||||
await refresh();
|
||||
});
|
||||
document.querySelector<HTMLFormElement>("#pin-form")!.addEventListener("submit", async event => {
|
||||
event.preventDefault();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:opsz,wght@8..144,400;8..144,600&family=IBM+Plex+Mono:wght@400;600&display=swap');
|
||||
:root{color-scheme:dark;font-family:"Crimson Pro",serif;background:#0c1110;color:#e8e1cf}body{margin:0;min-height:100vh;background:radial-gradient(circle at 15% 0,#253229 0,transparent 38rem),linear-gradient(145deg,#0c1110,#111513)}header,main{width:min(920px,calc(100% - 2rem));margin:auto}header{padding:3rem 0 1.25rem;border-bottom:1px solid #66543d}h1{font-size:clamp(2.6rem,8vw,5.5rem);font-weight:400;letter-spacing:-.045em;margin:.1rem 0}.eyebrow,#status,label,button,pre{font-family:"IBM Plex Mono",monospace}.eyebrow{color:#d49b58;letter-spacing:.18em;font-size:.72rem}#status{color:#9aa69f;font-size:.78rem}main{padding:1.5rem 0 5rem}#surface{min-height:15rem}form,.card{margin-top:1.5rem;padding:1rem;border:1px solid #66543d;background:#17201ddd}label{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.12em;margin-bottom:.65rem}textarea,input,select{box-sizing:border-box;width:100%;resize:vertical;background:#0b0f0d;color:#f2e7d0;border:1px solid #4a5148;padding:.9rem;margin:.35rem 0;font:1.05rem/1.4 "Crimson Pro",serif}input[type="range"]{padding:.25rem;accent-color:#d49b58}textarea{min-height:7rem}button{margin:.8rem .5rem 0 0;padding:.65rem 1rem;border:1px solid #d49b58;background:#d49b58;color:#17120c;cursor:pointer}button+button{background:transparent;color:#d49b58}pre{white-space:pre-wrap;padding:1rem;background:#080b09;color:#aeb9af;overflow:auto;font-size:.72rem}.compiler-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.cards{display:grid;gap:.7rem}.card h3{margin:.1rem 0}.card p{color:#b9c0b7}.warning{color:#e4a86a!important}code{font-family:"IBM Plex Mono",monospace;color:#d49b58}@media(max-width:700px){.compiler-grid{grid-template-columns:1fr}}@media(max-width:600px){header{padding-top:2rem}h1{font-size:3rem}}
|
||||
.form-heading{font:600 .72rem "IBM Plex Mono",monospace;text-transform:uppercase;letter-spacing:.12em;color:#d49b58}.quiet{color:#9aa69f!important}#receipt h3{margin:.1rem 0 .75rem}#receipt ul{margin:.6rem 0;padding-left:1.25rem}#receipt li{margin:.25rem 0;color:#c8d0c8}
|
||||
:root{color-scheme:dark;font-family:"Crimson Pro",serif;background:#0c1110;color:#e8e1cf}body{margin:0;min-height:100vh;background:radial-gradient(circle at 15% 0,#253229 0,transparent 38rem),linear-gradient(145deg,#0c1110,#111513)}header,main{width:min(920px,calc(100% - 2rem));margin:auto}header{padding:3rem 0 1.25rem;border-bottom:1px solid #66543d}h1{font-size:clamp(2.6rem,8vw,5.5rem);font-weight:400;letter-spacing:-.045em;margin:.1rem 0}.eyebrow,#status,label,button,pre{font-family:"IBM Plex Mono",monospace}.eyebrow{color:#d49b58;letter-spacing:.18em;font-size:.72rem}#status{color:#9aa69f;font-size:.78rem}main{padding:1.5rem 0 5rem}#surface{min-height:15rem}form,.card{margin-top:1.5rem;padding:1rem;border:1px solid #66543d;background:#17201ddd}label{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.12em;margin-bottom:.65rem}textarea,input,select{box-sizing:border-box;width:100%;resize:vertical;background:#0b0f0d;color:#f2e7d0;border:1px solid #4a5148;padding:.9rem;margin:.35rem 0;font:1.05rem/1.4 "Crimson Pro",serif}input[type="range"]{padding:.25rem;accent-color:#d49b58}textarea{min-height:7rem}button{margin:.8rem .5rem 0 0;padding:.65rem 1rem;border:1px solid #d49b58;background:#d49b58;color:#17120c;cursor:pointer}button+button{background:transparent;color:#d49b58}button:disabled,input:disabled,textarea:disabled,select:disabled{cursor:wait;opacity:.58}pre{white-space:pre-wrap;padding:1rem;background:#080b09;color:#aeb9af;overflow:auto;font-size:.72rem}.compiler-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.cards{display:grid;gap:.7rem}.card h3{margin:.1rem 0}.card p{color:#b9c0b7}.warning{color:#e4a86a!important}code{font-family:"IBM Plex Mono",monospace;color:#d49b58}@media(max-width:700px){.compiler-grid{grid-template-columns:1fr}}@media(max-width:600px){header{padding-top:2rem}h1{font-size:3rem}}
|
||||
.form-heading{font:600 .72rem "IBM Plex Mono",monospace;text-transform:uppercase;letter-spacing:.12em;color:#d49b58}.quiet{color:#9aa69f!important}.card details{margin:.65rem 0;border-top:1px solid #354039;padding-top:.65rem}.card summary{cursor:pointer;font:600 .76rem "IBM Plex Mono",monospace;color:#d49b58}.card ul{margin:.6rem 0;padding-left:1.25rem}.card li{margin:.25rem 0;color:#c8d0c8}#receipt h3{margin:.1rem 0 .75rem}
|
||||
|
|
|
|||
Loading…
Reference in a new issue