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
+43 -30
View File
@@ -131,10 +131,12 @@ export function fmtCeiling(tokens) {
// A select's "" value means "deployment default"; a current override
// missing from the registry stays selectable, so a stale pick never
// silently rewrites itself. The registry's usable models group by
// family; the label is the curator's (or the id before refinement),
// and the input ceiling rides along -- the user picks against the
// contwin, so the context limit belongs in the open.
// silently rewrites itself. One plain list, sorted by id (GM,
// 2026-11-16: the family grouping left the user guessing what a
// family name means, and the curator's tier labels only made sense
// inside their groups -- the id is the self-describing name). The
// input ceiling rides along -- the user picks against the contwin,
// so the context limit belongs in the open.
/** @param {HTMLSelectElement} sel @param {?string} current @param {import('./shapes.mjs').ModelsRegistryResponse} reg @param {?string} [def] */
function fillSelect(sel, current, reg, def) {
sel.textContent = '';
@@ -147,23 +149,9 @@ function fillSelect(sel, current, reg, def) {
mk('', `deployment default${def ? ` -- ${def}` : ' (unset)'}`);
const usableModels = reg.models.filter((m) => m.inference !== false && (m.roles?.player ?? true));
const extras = current && !usableModels.some((m) => m.id === current) ? [current] : [];
/** @type {Record<string, import('../server/shapes.mjs').RegistryModel[]>} */ const byFamily = {};
for (const m of usableModels) {
const f = m.family ?? m.id;
(byFamily[f] ??= []).push(m);
}
const families = Object.keys(byFamily).sort();
for (const f of families) {
const group = /** @type {HTMLOptGroupElement} */ (el('optgroup'));
group.label = f;
for (const m of byFamily[f]) {
const label = m.label ?? m.id;
const ceil = fmtCeiling(m.input);
const o = /** @type {HTMLOptionElement} */ (el('option', null, ceil ? `${label} \u00b7 ${ceil}` : label));
o.value = m.id;
group.appendChild(o);
}
sel.appendChild(group);
for (const m of [...usableModels].sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))) {
const ceil = fmtCeiling(m.input);
mk(m.id, ceil ? `${m.id} \u00b7 ${ceil}` : m.id);
}
for (const x of extras) mk(x, `${x} (not in the registry)`);
sel.value = current ?? '';
@@ -171,7 +159,10 @@ function fillSelect(sel, current, reg, def) {
// the models box: player/housekeeper selects over the registry, the
// sampling knobs per role (one shared hint bar under both rows), and
// one save. The mount keeps its id -- the CSS panels it.
// one save. The mount keeps its id -- the CSS panels it. The knob
// rows rebuild when the model select changes: the effort knob's
// default is measured per model, so switching the model switches the
// honest default.
/** @param {string|HTMLElement} mount @param {{ title: string }} opts */
export function modelsBox(mount, { title }) {
const root = typeof mount === 'string' ? $(mount) : mount;
@@ -186,11 +177,37 @@ export function modelsBox(mount, { title }) {
root.appendChild(pField);
root.appendChild(hField);
const knobHint = el('div', 'knob-hint'); // one bar, both roles
/** @type {{ wrap: HTMLElement, read: () => Record<string, number|null> }} */ let playerKnobs = knobsBox('player', undefined, undefined, knobHint);
/** @type {{ wrap: HTMLElement, read: () => Record<string, number|null> }} */ let houseKnobs = knobsBox('housekeeper', undefined, undefined, knobHint);
/** @type {{ wrap: HTMLElement, read: () => Record<string, number|string|null> }} */ let playerKnobs = knobsBox('player', undefined, undefined, knobHint);
/** @type {{ wrap: HTMLElement, read: () => Record<string, number|string|null> }} */ let houseKnobs = knobsBox('housekeeper', undefined, undefined, knobHint);
root.appendChild(playerKnobs.wrap);
root.appendChild(houseKnobs.wrap);
root.appendChild(knobHint);
// the latest fill's inputs -- the select-change refresh rebuilds
// the knob rows against them (the effort context follows the
// newly-picked model)
/** @type {?{ params: ?{ player?: ?import('../server/shapes.mjs').RoleParams, housekeeper?: ?import('../server/shapes.mjs').RoleParams }, paramDefaults: ?{ player?: ?import('../server/shapes.mjs').RoleParams, housekeeper?: ?import('../server/shapes.mjs').RoleParams }, reg: import('./shapes.mjs').ModelsRegistryResponse }} */ let last = null;
// the effort knob's context: the currently-selected model's
// measured ladder (null when the registry has none for it)
/** @param {'player'|'housekeeper'} role @param {import('./shapes.mjs').ModelsRegistryResponse} reg @returns {?{ measured: Record<string, number>, fallback: ?string }} */
const effortOf = (role, reg) => {
const id = (role === 'player' ? playerSel.value : houseSel.value)
|| reg.defaults?.[role] || null;
const m = id ? reg.models.find((x) => x.id === id) : null;
return m?.efforts ? { measured: m.efforts, fallback: m.effortDefault ?? null } : null;
};
/** rebuild both knob rows against the current selects and the
* latest fill (fill and select-change both land here) */
function rebuildKnobs() {
if (!last) return;
const pk = knobsBox('player', last.params?.player ?? undefined, last.paramDefaults?.player ?? undefined, knobHint, effortOf('player', last.reg));
const hk = knobsBox('housekeeper', last.params?.housekeeper ?? undefined, last.paramDefaults?.housekeeper ?? undefined, knobHint, effortOf('housekeeper', last.reg));
playerKnobs.wrap.replaceWith(pk.wrap);
houseKnobs.wrap.replaceWith(hk.wrap);
playerKnobs = pk;
houseKnobs = hk;
}
playerSel.addEventListener('change', rebuildKnobs);
houseSel.addEventListener('change', rebuildKnobs);
if (!root.querySelector('.registry-hint')) {
const hint = el('div', 'hint registry-hint', '');
root.appendChild(hint);
@@ -224,12 +241,8 @@ export function modelsBox(mount, { title }) {
fill(models, defaults, params, paramDefaults, reg) {
fillSelect(playerSel, models?.player ?? null, reg, defaults?.player);
fillSelect(houseSel, models?.housekeeper ?? null, reg, defaults?.housekeeper);
const pk = knobsBox('player', params?.player ?? undefined, paramDefaults?.player ?? undefined, knobHint);
const hk = knobsBox('housekeeper', params?.housekeeper ?? undefined, paramDefaults?.housekeeper ?? undefined, knobHint);
playerKnobs.wrap.replaceWith(pk.wrap);
houseKnobs.wrap.replaceWith(hk.wrap);
playerKnobs = pk;
houseKnobs = hk;
last = { params: params ?? null, paramDefaults: paramDefaults ?? null, reg };
rebuildKnobs();
const hint = root.querySelector('.registry-hint');
if (hint) {
hint.textContent = reg.phase === 'none'