the state-scan round: the log is the one truth for status and agenda, the db tiers retired -- scanState (server/session.mjs) derives each kind newest-wins across her emissions (the picked variant's text), the GM's override records, and the boundary state notes; the panes, the run detail, and the stamp all read it, GET /status and detail.status are derived reads, no clerk call, no db copy; the agenda cap is a derivation rule (GM, 2026-11-16: we log all seven items on reception, but the only way to see all seven is the raw event -- at no point an over-cap list can be derived), the reception note still shows the GM what sank; the stamp renders the canonical grammar -- status comma-separated, agenda markdown bullets, matching the line the GM added to invariants; the GM's block edits are overrides (GM, 2026-11-16: mutate during the contwin composition, the logs record the overrides arriving with the GM's turn as they should, the model sees the blocks overwritten with GM's edits attached to her turn, append if empty): the pane editors STAGE (paneEditor reworked -- no save callback, staged state, pending marker, discard), the send attaches them to POST /turn, node logs the override field on the GM turn, the composition renders it as hers -- the log never mutates, her words stay verbatim, the raw surfaces show the record; OOC turns refuse edits client and server both, the out-of-band POST /status and /agenda routes retired; stop writes the boundary state note at the carry head always (the crash-reconcile filters it before comparing), the start gate's n=1 seeding is dead (her authored opening turn IS the seed, the lint keeps requiring it), continuation carryovers are writable in the file editor during dormancy -- the review window's one editing surface, blocks included, no new pane; the clerk lost the tiers wholesale (schema tables, four verbs, canon status/agenda views, dump sections, report fields; the events CHECK keeps the historical op names; old dbs keep dead tables, never read, never dropped -- Irene is hands-off, and by the same day's ruling she is broken and never runs again: logs and db kept as they are, no replay, no continuation, no compatibility designed for her); Chloe hand-migrated to the new protocol -- her most recent turn carries the whole-list blocks applied from her db's exact values, her next context stamps them, her older lost/gained tags stay as history; the mock's agenda blocks went bullet, a new script position for the override turn's reply restates the mind so the boundary assert holds; smoke reworked to the scan battery (+ the 10f override block: the record rides its turn, the composition stamps at her canon point, the log keeps her emission verbatim, the OOC refusal, the boundary note at the carry head, the retired routes 404) -- ALL PASS; restart + reminder + repo checks green; the browser pass caught and fixed two real bugs (the pending marker's display:flex beat the hidden attribute -- any display rule needs a [hidden] override; setEditable(true) never ran the widget sync so the edit button stayed hidden) and proved the whole UX end to end with zero console errors -- staging, send-with-turn, the machinery lines on the table and raw, the OOC gate banner, discard, dormant read-only panes, the boundary note in the dormant preview; typecheck green on both programs; README/DICTIONARY carry the single-truth design, HANDOFF the round record and the Irene rewording, AGENTS the state pointer and the browser lessons
This commit is contained in:
+24
-10
@@ -27,7 +27,10 @@ let rawOpen = false;
|
||||
|
||||
// her two blocks, split along the seam: how she is (the status) vs
|
||||
// what she means to do (the agenda). Both render compact, mirroring
|
||||
// the wire formats the model cites.
|
||||
// the wire formats the model cites. The edit button stages a block
|
||||
// edit -- it rides the next GM turn as the override (the composition
|
||||
// overwrites her newest blocks; the panes then show the composed
|
||||
// truth the scan derives).
|
||||
const statusPane = paneEditor({
|
||||
section: 'status-pane',
|
||||
body: 'status',
|
||||
@@ -39,7 +42,6 @@ const statusPane = paneEditor({
|
||||
fromText: (text) => text
|
||||
.split('\n').flatMap((l) => l.replace(/^\s*[-*]\s+/, '').split(','))
|
||||
.map((x) => x.trim()).filter(Boolean),
|
||||
save: (items) => api(`/runs/${state.runId}/status`, { method: 'POST', body: { items } }),
|
||||
});
|
||||
const agendaPane = paneEditor({
|
||||
section: 'agenda-pane',
|
||||
@@ -47,14 +49,13 @@ const agendaPane = paneEditor({
|
||||
empty: 'a clear head',
|
||||
placeholder: 'one item per line, top first -- empty clears the agenda',
|
||||
rows: 4,
|
||||
// the pane renders bullets; the wire keeps the numbered form the
|
||||
// model cites (drops reference the indexes it was shown)
|
||||
// the pane renders bullets; the block grammar is the bullet list
|
||||
// invariants teaches
|
||||
format: (items) => items.map((d) => `- ${d}`).join('\n'),
|
||||
toText: (items) => items.join('\n'),
|
||||
fromText: (text) => text
|
||||
.split('\n').flatMap((l) => l.replace(/^\s*[-*]\s+\d*[.:)]?\s*/, '').split(','))
|
||||
.map((x) => x.trim()).filter(Boolean),
|
||||
save: (items) => api(`/runs/${state.runId}/agenda`, { method: 'POST', body: { items } }),
|
||||
});
|
||||
|
||||
const models = modelsBox('models-pane', { title: 'models' });
|
||||
@@ -102,10 +103,12 @@ async function refreshPlay(id, seq) {
|
||||
agendaPane.set(detail.agenda);
|
||||
$('conflict').hidden = true;
|
||||
|
||||
// the owner's table: everything here edits -- anyone else was
|
||||
// redirected to the story above
|
||||
statusPane.setEditable(true);
|
||||
agendaPane.setEditable(true);
|
||||
// the owner's table, live only for the panes: a block edit rides a
|
||||
// turn, and turns need a live session -- dormancy edits the
|
||||
// carryover (the review window's one editing surface). Anyone else
|
||||
// was redirected to the story above.
|
||||
statusPane.setEditable(detail.phase === 'live');
|
||||
agendaPane.setEditable(detail.phase === 'live');
|
||||
/** @type {HTMLTextAreaElement} */ ($('gm-notes')).readOnly = false;
|
||||
|
||||
$('table-tabs').hidden = true; // the tabs are the live session's
|
||||
@@ -338,13 +341,24 @@ function setInput(ok) {
|
||||
async function sendTurn() {
|
||||
const line = /** @type {HTMLInputElement} */ ($('gm-input')).value.trim();
|
||||
if (!line || !state.runId) return;
|
||||
// staged block edits ride the turn (the override): only the kinds
|
||||
// staged attach, whole-list
|
||||
/** @type {{ line: string, status?: string[], agenda?: string[] }} */ const body = { line };
|
||||
if (statusPane.staged) body.status = statusPane.staged;
|
||||
if (agendaPane.staged) body.agenda = agendaPane.staged;
|
||||
if ((body.status || body.agenda) && line.startsWith('(')) {
|
||||
banner('a block edit cannot ride an OOC turn -- send it as a normal GM turn, or discard the edit');
|
||||
return; // the line stays in the box, the staging stays staged
|
||||
}
|
||||
/** @type {HTMLInputElement} */ ($('gm-input')).value = '';
|
||||
renderInputHl();
|
||||
setInput(false);
|
||||
setBusy(true);
|
||||
let failed = null;
|
||||
try {
|
||||
await api(`/runs/${state.runId}/turn`, { method: 'POST', body: { line } });
|
||||
await api(`/runs/${state.runId}/turn`, { method: 'POST', body });
|
||||
statusPane.clearStaged(); // sent -- the panes re-render from the scan
|
||||
agendaPane.clearStaged();
|
||||
} catch (e) {
|
||||
failed = e.message;
|
||||
/** @type {HTMLInputElement} */ ($('gm-input')).value = line; // a failed send must not eat the line
|
||||
|
||||
Reference in New Issue
Block a user