the night rounds: the GM-input rework and the reasoning-effort knob -- the workbench renders no faces: the composer overlay and the transcript share colour-only tokens (.narration dim, .emph accent), source verbatim, asterisks tinted and kept on screen, so the input's caret can never drift (the old overlay's real bold/italic shifted advance widths -- keeping every character preserved count, not width; the scrollbar-gutter match killed the second drift source); the story view carries its OWN renderer (view-story storyBody/storySpans) -- the book keeps real bold/italic with the asterisks spent, narration italic via #story-scoped CSS, one rule for the tool and typography for the deliverable, deliberately separate; the composer is turn-shaped: rows=6 floor, field-sizing: content grows it with the turn (the thing the GM remembered Firefox doing -- it was never in use), max-height 50vh caps with internal scroll, the footer moved under the transcript's column only so the input's width is the pane's; the transcript's stick-to-bottom was DEAD CODE all along (#transcript has no height or overflow -- main is the scroller, the scrollTop assignments were no-ops in every browser): stickBottom scrolls main and re-asserts next frame (Firefox's scroll anchoring can reclaim a same-tick scroll around a content wipe), main carries overflow-anchor: none; the prose pane drops its machinery by ruling: the status/agenda chips and the retired delta tags strip (the panes carry the derived state), the reminder card never renders (it is the same every turn -- the raw tab keeps every copy), and the status/agenda note receipts (the old delta applies and the whole-list sets alike) skip the prose walk while the raw keeps them; the model dropdown collapsed to one plain list of ids sorted, ceilings riding along (the family grouping left the user guessing what a family name means, and the curator's tier labels only made sense inside their groups); and the reasoning-effort round: the battery probes the ladder (probeEfforts -- each of none/minimal/low/medium/high/xhigh/max measured for mean thinking, two samples, efforts recorded per model, effortDefault the argmax mean over minimal..max, 'none' never a candidate -- it is the off switch; null when the model shows no thinking), the knob is first-class and the GM's alone (GM, 2026-11-16: hidden from the model, not her call -- never in the mind verb, never in the <model> display block, and renderView's via-derived block filters it too, both surfaces; it rides the via record for the raw surfaces), its unset state SENDS the measured max-mean default (the one knob with an honestly nameable default -- the registry measured it; layers run override > deployment > registry per-model, explicit null clears to nothing), the first non-numeric knob (RoleParams carries the string, the /model route validates against the ladder, the knob row a select whose unset label names what rides and rebuilds on model-select change); the GLM ladder verified live by hand before the build (low suppresses to a third of baseline, max elevates about double, the whole ladder accepted on both families without 400s, and reasoning_effort 'none' doubles as a standardized thinking-off switch); the model dropdown, the composer, and the knob UX browser-proven with zero console errors (the pass caught the unreachable-helpers bug: code after a factory's return never runs, a hoisted function referencing the uninitialized const throws silently mid-fill and stale rows render); smoke ALL PASS with the effort battery (the canned mock ladders, the default riding a bare turn's via, the override riding the next turn, the bogus-level 400, the null clear, no reasoning_effort in any <model> block) + restart + reminder + repo checks green, typecheck green on both programs; ROADMAP gains the distant extension point (n-choice inference composed by a turn-editor agent) and the operator's queue moved there from QUESTIONS by the GM; HANDOFF prepared as the handoff (the typing-round bullet trimmed into the rounds list, the server line now truthful -- the debug server runs, the registry bullet carries the six-knob state and the pending-effort refine)

This commit is contained in:
2026-11-16 23:52:58 +00:00
parent 5ffecee935
commit eebc1993dd
19 changed files with 571 additions and 179 deletions
+50 -29
View File
@@ -4,9 +4,11 @@
// The transcript renders three registers by the ruled markers: plain
// text is speech, *italics* is narration, a line opening with `(` is
// OOC (closing paren optional; a lone paren is an empty OOC line and
// is skipped). The <status>/<agenda> blocks riding GM turns and the
// delta tags on player turns are machinery, not prose -- they render
// as chips and pane state, mirroring the live-context policy.
// is skipped). The machinery never shows here: the status and agenda
// blocks (and the retired delta tags) strip from the prose -- the
// dedicated panes carry the derived state -- and the reminder rides
// only on the raw tab. The mind chip is the one exception: the mind
// is write-only, the chip is its display.
/** @typedef {import('../server/shapes.mjs').LogEvent} LogEvent */
/** @typedef {import('../server/shapes.mjs').BundleEvent} BundleEvent */
@@ -15,21 +17,20 @@
import { $, el } from './dom.mjs';
// splits text into spans: *italics* = narration, **bold** = emphasis
// splits text into spans: *italics* = narration, **bold** = emphasis.
// Colour-only (GM, 2026-11-16): the workbench renders no faces --
// same glyphs, same widths, only paint differs, and the input's
// caret can never drift from what it overlays. The asterisks stay
// on screen: the authored text is the rendered text
/** @param {HTMLElement} target @param {string} text */
function renderSpans(target, text) {
const parts = String(text).split(/(\*\*[^*]+\*\*|\*[^*\n]+\*)/g);
for (const p of parts) {
if (!p) continue;
if (p.startsWith('**') && p.endsWith('**')) {
const b = document.createElement('strong');
b.textContent = p.slice(2, -2);
target.appendChild(b);
target.appendChild(el('span', 'emph', p));
} else if (p.startsWith('*') && p.endsWith('*') && p.length > 2) {
const i = document.createElement('em');
i.className = 'narration';
i.textContent = p.slice(1, -1);
target.appendChild(i);
target.appendChild(el('span', 'narration', p));
} else {
target.appendChild(document.createTextNode(p));
}
@@ -38,10 +39,12 @@ function renderSpans(target, text) {
// one content block (a GM or player turn) -> DOM lines. extract pulls
// the riding blocks (status/conflict/agenda) out of GM prose; the
// delta tags on player turns always render as chips. Exported for
// the story view, which renders the same registers.
// delta tags on player turns always render as chips. The workbench's
// register renderer -- colour-only, source verbatim; the story view
// carries its own (view-story.mjs), the book's typography is not the
// tool's (GM, 2026-11-16).
/** @param {HTMLElement} target @param {?string} text @param {{ extract?: boolean }} opts @returns {{ status: ?string, conflict: ?string, agenda: ?string }} */
export function renderContent(target, text, { extract }) {
function renderContent(target, text, { extract }) {
let body = String(text ?? '');
let status = null;
let conflict = null;
@@ -122,10 +125,16 @@ export function renderContent(target, text, { extract }) {
renderSpans(d, content);
target.appendChild(d);
}
if (tags.length) {
if (tags.some((t) => t.kind === 'mind')) {
// only the mind chips: it is write-only, the chip is its one
// table-side display. The state machinery (status, agenda, the
// retired delta tags) renders nowhere in the prose pane -- the
// dedicated panes carry the derived state, the transcript
// carries the prose (GM, 2026-11-16)
const wrap = document.createElement('div');
wrap.className = 'tags';
for (const t of tags) {
if (t.kind !== 'mind') continue;
for (const item of t.items) {
const c = document.createElement('span');
c.className = `chip ${t.kind}`;
@@ -142,7 +151,7 @@ export function renderContent(target, text, { extract }) {
// params as sent (the merged layer actually sent). Shared by the raw
// walk and the per-turn raw control. fail is present when the call
// failed -- no message resulted.
/** @param {{ model: string, params?: Record<string, number> }} via @param {?string} [fail] @returns {string} */
/** @param {{ model: string, params?: Record<string, number|string> }} via @param {?string} [fail] @returns {string} */
export function viaLine(via, fail = null) {
const ks = Object.entries(via.params ?? {});
const p = ks.length ? ` -- ${ks.map(([k, v]) => `${k}: ${v}`).join(', ')}` : ' (no knobs set)';
@@ -186,6 +195,18 @@ function noteText(e) {
return null;
}
// the transcript's stick-to-bottom: the div itself just grows -- main
// is the scroller. Firefox can also reclaim a same-tick programmatic
// scroll around a content wipe (scroll anchoring re-anchoring after
// the rebuild), so the position re-asserts on the next frame
/** @param {HTMLElement} t */
function stickBottom(t) {
const sc = t.closest('main');
if (!sc) return;
sc.scrollTop = sc.scrollHeight;
requestAnimationFrame(() => { sc.scrollTop = sc.scrollHeight; });
}
// the raw walk: the audit surface over the same log -- everything as
// it rode the wire. Thinking, whole variant blocks, every reminder
// copy, full tool results, the rides inline in the GM prose; plain
@@ -259,7 +280,7 @@ export function renderRaw(entries) {
continue;
}
}
t.scrollTop = t.scrollHeight;
stickBottom(t);
}
// the entry walk. onConflict receives a conflict block found on a GM
@@ -299,16 +320,9 @@ export function renderTranscript(entries, { onConflict, onRaw } = {}) {
}
flushBundle();
if (e.t === 'msg' && e.reminder) {
// the turn reminder: the transcript mirrors the live-context
// policy -- one collapsed card for the newest copy, superseded
// ones elide (the log keeps every as-sent chunk)
const newest = [...entries].reverse().find((x) => x.t === 'msg' && x.reminder);
if (e === newest) {
const d = el('details', 'bundle');
d.appendChild(el('summary', null, 'turn reminder -- rides every GM turn'));
d.appendChild(el('pre', null, e.m.content));
t.appendChild(d);
}
// the reminder never renders in the prose pane (GM, 2026-11-16):
// it is the same every turn -- the raw tab keeps every copy,
// the audit surface is its home
continue;
}
if (e.t === 'opening') {
@@ -330,10 +344,17 @@ export function renderTranscript(entries, { onConflict, onRaw } = {}) {
t.appendChild(el('div', 'machinery', `${e.ask ? '[ruling] ' : '[tool result] '}${String(e.m.content).split('\n')[0]}`));
continue;
}
if (e.t === 'note') renderNote(e);
if (e.t === 'note') {
// the state receipts never render in the prose pane (GM,
// 2026-11-16): the status/agenda notes -- the old delta applies
// and the whole-list sets alike -- duplicate the panes; the raw
// tab keeps every receipt
if (e.kind === 'status' || e.kind === 'agenda') continue;
renderNote(e);
}
}
flushBundle();
t.scrollTop = t.scrollHeight;
stickBottom(t);
/** @param {MsgEvent} e @param {number} idx @param {string} who */
function gmTurn(e, idx, who) {