gm-input expansion built from the roadmap (DECISIONS #9's strictness ruling): the GM's line and ask answers expand at ingestion -- @PC/@Package and $vars resolve before the log, an unresolved token refuses the turn with a 400 naming it and nothing appended; the log records the expanded line, keeping continuation carryovers expansion-free by construction; smoke +4 (the $Bogus refusal, the log provably unchanged, a live sigil turn, the expanded line in the log) -- 115/115 all pass; the GM input gains a highlight overlay (the setup editor's stack pattern transplanted): *italics* render italic, **bold** renders bold, @PC/@Package gold, $vars green, every character kept on screen (the asterisks too) so the caret never desyncs, bold/italics matched per-line like the transcript renderer; the box rekeys -- Enter is a plain newline, Ctrl+Space sends, placeholder updated; and a pre-existing bug the live pass caught: failed-action banners were wiped by the render() that follows every action (the runGone trap) -- sendTurn, sendAnswer, and startRun now set the banner after the render; browser-proven end to end: tokens highlight in place, Enter newlines, the refusal loop shows the banner and restores the line un-eaten and still highlighted, the sigil expands in the log, zero console errors; the roadmap item struck as built, DECISIONS #9 amended to same-day-built, README's substitution paragraph and AGENTS' identity-model bullet carry the live-input rule; typecheck green on both programs, check-repo clean
This commit is contained in:
@@ -372,6 +372,19 @@ ok('start session 4 after the fix', r.status === 200 && r.data.session === 4, r.
|
||||
r = await call('/packages', { method: 'POST', token: op, body: { from: runId, name: 'Nope' } });
|
||||
ok('save-package refuses a played run', r.status === 400 && /draft act/.test(r.data.error), r.data.error ?? '');
|
||||
|
||||
// 22. GM-input expansion: strict at ingestion, the refused line hands back
|
||||
r = await call(`/runs/${runId}/session`, { token: op });
|
||||
const beforeCount = r.data.entries.length;
|
||||
r = await call(`/runs/${runId}/turn`, { method: 'POST', token: op, body: { line: 'she mutters $Bogus under her breath' } });
|
||||
ok('an unresolved $var refuses the turn', r.status === 400 && /unresolved token/.test(r.data.error), r.data.error ?? '');
|
||||
r = await call(`/runs/${runId}/session`, { token: op });
|
||||
ok('the refused line never landed', r.data.entries.length === beforeCount, `${beforeCount} -> ${r.data.entries.length}`);
|
||||
r = await call(`/runs/${runId}/turn`, { method: 'POST', token: op, body: { line: '*She says her own name out loud: @PC.*' } });
|
||||
ok('a live turn with a sigil sends', r.status === 200, r.data.error ?? '');
|
||||
r = await call(`/runs/${runId}/session`, { token: op });
|
||||
const liveGm = [...r.data.entries].reverse().find((e) => e.t === 'msg' && e.m.role === 'user' && !e.conflictOnly);
|
||||
ok('the log records the expanded line', /name out loud: Smokina/.test(String(liveGm?.m.content ?? '')) && !/@PC\b/.test(String(liveGm?.m.content ?? '')), String(liveGm?.m.content ?? '').slice(0, 90));
|
||||
|
||||
console.log(`\nrun ids: source=${runId} fork=${forkId} second=${secondId} refork=${reforkId}`);
|
||||
writeFileSync(TOKEN_FILE, `${op} ${reforkId} ${secondId}`);
|
||||
console.log(failures ? `\n${failures} FAILURES` : '\nALL PASS');
|
||||
|
||||
Reference in New Issue
Block a user