variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// test/smoke.mjs -- end-to-end multiuser pass against the --mock
2026-11-14 23:48:27 +00:00
// server. Covers: bootstrap, claim, spent-invite rejection, second
2026-11-19 09:56:56 +00:00
// user, the provider round (developer, 2026-11-18: the self-heal boot --
2026-11-19 08:35:23 +00:00
// the empty provider list auto-added and discovered; the op acts
// ride the per-provider surface -- the binary add choice, the o/f
// singleton's authless guard, the selection {model, effort} that
// names the refine curator, per-provider refine with the meter and
// the receipt, the spec-keyed adjudication cache, the run spec
// picks {provider, model, effort} with no unset effort, the
// invalidation surface -- a removed provider blocks its runs until
// the GM re-picks, the removal guard on the singleton, the request
// record -- resolved spec + effective params on
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// every turn, the pass log's model), the mind verb (the player sets
// its sampling for its next turn: one-shot, JSON, bounds enforced,
// conflict-healed, carried unconsumed across a session boundary,
2026-11-19 09:56:56 +00:00
// inherited by a fork), the rewind (developer, 2026-11-17: the send that
2026-11-18 17:24:37 +00:00
// carries it replaces its target GM turn -- physical truncation, the
// frozen-opening floor, the sheet records of the dead range reverting,
// the staleness guard on every send), the conflict channel's
2026-11-19 09:56:56 +00:00
// persistence (developer, 2026-11-18: conflicts stay in the contwin and are
2026-11-18 17:24:37 +00:00
// self-contained -- the offending emission quoted, because the block
// it answers strips from the view), the full-block protocol
// (whole-list status
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// and agenda sets, absent = unchanged, the silent over-cap eviction,
// the view stamping at the canon point, the <model> display blocks,
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
2026-11-16 22:49:50 +00:00
// the emitted-<model> guard, GM prose pure), the state scan (the log
// is the one truth -- no db tier; the GM's block edit rides its turn
// as the override and composes over her newest blocks, the boundary
// state note rides the carry head), the session lifecycle
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// (create dormant -> start -> live ->
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// stop -> dormant -> re-run -> start -> the auto-send rule -> the
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// start lint), the draft's memory.json (authored while draft, the
// start gate applies it, provenance once live), the OOC GM turn,
// non-owner 403s, fork, save-package,
// create-from-user-package, revocation, ownerless state, the
// reminder ride, variant
// literature (the random pick, the /table projection, the variance
// metric), the slidwin (move-at-stop, exactly-one-jsonl), and the
// whole-story /story render with no doubles.
2026-11-14 23:48:27 +00:00
// Prints PASS/FAIL per step; exit code carries the verdict.
//
// Expects a CLEAN state/ (no users) and a running --mock server:
// node server/main.mjs --mock
// node test/smoke.mjs
// Leaves its token + run ids in a temp file for restart-check.mjs.
// Clean up afterwards: Remove-Item state/, delete the smoke runs.
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
import { readFileSync , writeFileSync , appendFileSync } from 'node:fs' ;
2026-11-14 23:48:27 +00:00
import { fileURLToPath } from 'node:url' ;
import { join , dirname } from 'node:path' ;
import { tmpdir } from 'node:os' ;
2026-11-19 08:35:23 +00:00
import { renderView , lintCarryover } from '../server/session.mjs' ;
2026-11-14 23:48:27 +00:00
const ROOT = join ( dirname ( fileURLToPath ( import . meta . url )), '..' );
const BASE = process . env . RP_BASE ?? 'http://127.0.0.1:7350' ;
2026-11-15 14:46:00 +00:00
export const TOKEN_FILE = join ( tmpdir (), 'tiny-worlds-smoke-token.txt' );
2026-11-14 23:48:27 +00:00
let failures = 0 ;
const ok = ( name , cond , extra = '' ) => {
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
console . log ( ` ${ cond ? 'PASS' : 'FAIL' } ${ name }${ extra !== '' ? ` -- ${ extra } ` : '' } ` );
2026-11-14 23:48:27 +00:00
if ( ! cond ) failures ++ ;
};
const call = async ( path , { method = 'GET' , token , body } = {}) => {
const res = await fetch ( ` ${ BASE } /api ${ path } ` , {
method ,
headers : {
...( body !== undefined ? { 'content-type' : 'application/json' } : {}),
...( token ? { authorization : `Bearer ${ token } ` } : {}),
},
body : body !== undefined ? JSON . stringify ( body ) : undefined ,
});
const data = await res . json (). catch (() => ({}));
return { status : res . status , data };
};
const meta = ( id ) => JSON . parse ( readFileSync ( ` ${ ROOT } /runs/ ${ id } /run.json` , 'utf8' ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
const jsonl = ( id , n , f ) => readFileSync ( ` ${ ROOT } /runs/ ${ id } /sessions/ ${ String ( n ) } / ${ f } ` , 'utf8' )
. trim (). split ( '\n' ). filter ( Boolean ). map (( l ) => JSON . parse ( l ));
2026-11-14 23:48:27 +00:00
// 1. fresh deployment
let r = await call ( '/session' );
ok ( 'fresh session' , r . status === 200 && r . data . user === null && r . data . fresh === true );
// 2. auth required
r = await call ( '/runs' );
ok ( 'runs need auth' , r . status === 401 );
// 3. bootstrap invite on disk
const code = readFileSync ( ` ${ ROOT } /state/bootstrap-invite.txt` , 'utf8' ). trim ();
ok ( 'bootstrap file' , code . length === 24 , code );
// 4. claim superuser
r = await call ( '/claim' , { method : 'POST' , body : { code , name : 'Op' } });
ok ( 'claim op' , r . status === 200 && r . data . user . superuser === true , r . data . error ?? '' );
const op = r . data . token ;
const opId = r . data . user . id ;
// 5. invite reuse rejected
r = await call ( '/claim' , { method : 'POST' , body : { code , name : 'Sneak' } });
ok ( 'spent invite rejected' , r . status === 400 && /already used/ . test ( r . data . error ));
// 6. mint invite -> second user
r = await call ( '/invites' , { method : 'POST' , token : op , body : {} });
ok ( 'mint invite' , r . status === 200 && r . data . code ? . length === 24 , r . data . error ?? r . data . code );
const inviteCode = r . data . code ;
r = await call ( '/claim' , { method : 'POST' , body : { code : inviteCode , name : 'Ash' } });
ok ( 'claim ash' , r . status === 200 && r . data . user . superuser === false , r . data . error ?? '' );
const ash = r . data . token ;
const ashId = r . data . user . id ;
// 7. ash cannot mint
r = await call ( '/invites' , { method : 'POST' , token : ash , body : {} });
ok ( 'invite mint is op-only' , r . status === 403 );
2026-11-19 08:35:23 +00:00
// 7b. providers and the registry: the fresh deployment self-heals
// (the empty provider list is auto-added and discovered at boot),
// the op's acts ride the per-provider surface (selection, discover,
// refine), the adjudication cache survives churn, and model use
// stays registry-gated
{
r = await call ( '/models' , { token : op });
let boot = r . data . providers ?? [];
for ( let i = 0 ; i < 50 && boot . filter (( p ) => p . models . length > 0 ). length < 2 ; i ++ ) {
await new Promise (( res ) => setTimeout ( res , 100 ));
r = await call ( '/models' , { token : op });
boot = r . data . providers ?? [];
}
ok ( 'the self-heal boot: the empty provider list is auto-added and discovered' ,
boot . length === 2 && boot . every (( p ) => [ 'mock-a' , 'mock-b' ]. includes ( p . slug ) && p . phase === 'preliminary' && p . models . length > 0 ),
JSON . stringify ( boot . map (( p ) => [ p . slug , p . phase , p . models . length ])));
const cfgFile = JSON . parse ( readFileSync ( ` ${ ROOT } /state/config.json` , 'utf8' ));
ok ( 'the config file holds the provider entities (server-written state)' ,
cfgFile . providers . length === 2 && cfgFile . providers . every (( p ) => typeof p . slug === 'string' && typeof p . baseUrl === 'string' ),
JSON . stringify ( cfgFile . providers ? . map (( p ) => p . slug )));
// the op's acts are op-only
r = await call ( '/providers' , { method : 'POST' , token : ash , body : { slug : 'nope' , baseUrl : 'https://x.example/v1' } });
ok ( 'provider add is op-only' , r . status === 403 );
// the add flow: bad inputs refuse
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'Bad Slug' , baseUrl : 'https://x.example/v1' } });
ok ( 'a bad slug refuses' , r . status === 400 && /slug/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-a' , baseUrl : 'https://x.example/v1' } });
ok ( 'a duplicate slug refuses' , r . status === 409 , r . data . error ?? '' );
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'nope' , baseUrl : 'not a url' } });
ok ( 'a bad baseUrl refuses' , r . status === 400 && /baseUrl/ . test ( r . data . error ), r . data . error ?? '' );
// the binary choice: the o/f singleton adds and discovers (the
// mock surface serves any slug), and never takes a key
r = await call ( '/providers' , { method : 'POST' , token : op , body : { builtin : true } });
ok ( 'the o/f singleton adds and discovers' , r . status === 200 && r . data . provider === 'opencode/free' && r . data . models > 0 , JSON . stringify ( r . data ));
r = await call ( '/providers' , { method : 'POST' , token : op , body : { builtin : true } });
ok ( 'the singleton is single' , r . status === 409 && /already/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( `/providers/ ${ encodeURIComponent ( 'opencode/free' ) } /auth` , { method : 'POST' , token : op , body : { apiKey : 'sk-x' } });
ok ( 'the o/f singleton never takes a key' , r . status === 403 && /anonymous/ . test ( r . data . error ), r . data . error ?? '' );
// the selection: the provider's default {model, effort} -- also
// the refine curator
r = await call ( '/providers/mock-a/refine' , { method : 'POST' , token : op , body : {} });
ok ( 'refine requires the selection (the default is the curator)' , r . status === 409 && /select/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( '/providers/mock-a/default' , { method : 'POST' , token : op , body : { model : 'nope' , effort : 'max' } });
ok ( 'a selection outside the registry refuses' , r . status === 400 && /registry/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( '/providers/mock-a/default' , { method : 'POST' , token : op , body : { model : 'mock' , effort : 'turbo' } });
ok ( 'a bogus effort level refuses' , r . status === 400 && /must be one of/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( '/providers/mock-a/default' , { method : 'POST' , token : op , body : { model : 'mock' , effort : 'max' } });
ok ( 'the selection lands (the provider default)' , r . status === 200 && JSON . stringify ( r . data . default ) === '{"model":"mock","effort":"max"}' , JSON . stringify ( r . data ));
r = await call ( '/providers/mock-b/default' , { method : 'POST' , token : op , body : { model : 'mock-cheap' , effort : 'high' } });
ok ( 'the second provider selects too' , r . status === 200 , r . data . error ?? '' );
// refine: per provider, the meter, the receipt, the verdicts
r = await call ( '/providers/mock-a/refine' , { method : 'POST' , token : op , body : {} });
ok ( 'refine starts the job' , r . status === 200 && r . data . state === 'running' , r . data . error ?? JSON . stringify ( r . data ));
let jobA = null ;
for ( let i = 0 ; i < 40 ; i ++ ) {
r = await call ( '/models' , { token : op });
jobA = ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-a' ) ? . job ?? null ;
if ( jobA ? . state !== 'running' ) break ;
await new Promise (( res ) => setTimeout ( res , 100 ));
}
ok ( 'refine applied' , jobA ? . state === 'applied' , JSON . stringify ( jobA ?? null ));
ok ( 'the refine meter closed its steps (one per model + the curator\'s two)' , jobA ? . steps ? . total === 4 && jobA ? . steps ? . done === 4 ,
JSON . stringify ( jobA ? . steps ?? null ));
ok ( 'the refine receipt logged every battery and the curator' ,
( jobA ? . lines ?? []). length === 3
&& jobA . lines . some (( l ) => l . includes ( 'mock: reasoning deep' ))
&& jobA . lines . some (( l ) => l . includes ( 'mock-tie: reasoning deep' ))
&& jobA . lines . some (( l ) => l . includes ( 'curator (mock): curated' )),
JSON . stringify ( jobA ? . lines ?? null ));
r = await call ( '/providers/mock-b/refine' , { method : 'POST' , token : op , body : {} });
ok ( 'the second provider refines' , r . status === 200 , r . data . error ?? '' );
for ( let i = 0 ; i < 40 ; i ++ ) {
r = await call ( '/models' , { token : op });
if (( r . data . providers ?? []). find (( p ) => p . slug === 'mock-b' ) ? . job ? . state !== 'running' ) break ;
await new Promise (( res ) => setTimeout ( res , 100 ));
}
const refined = ( r . data . providers ?? []);
const secA = refined . find (( p ) => p . slug === 'mock-a' );
const secB = refined . find (( p ) => p . slug === 'mock-b' );
ok ( 'the refined sections carry verdicts and curation' ,
secA ? . phase === 'refined' && secA . models . some (( m ) => m . id === 'mock' && m . inference === true && m . reasoning === 'deep' && m . label === 'Mock' && m . family === 'mock' )
&& secA . models . some (( m ) => m . id === 'mock-tie' && m . reasoning === 'deep' && m . label === 'Mock (tie)' )
&& secB ? . phase === 'refined' && secB . models . some (( m ) => m . id === 'mock-cheap' && m . reasoning === 'standard' ),
JSON . stringify ({ a : secA ? . models . map (( m ) => [ m . id , m . label ]), b : secB ? . models . map (( m ) => [ m . id , m . label ]) }));
ok ( 'the curator\'s recommendation is intel on the section (never auto-applied)' ,
JSON . stringify ( secA ? . recommendation ?? null ) === '{"model":"mock","effort":"max"}' && JSON . stringify ( secA . default ) === '{"model":"mock","effort":"max"}' ,
JSON . stringify ({ recommendation : secA ? . recommendation , default : secA . default }));
ok ( 'the effort probe: measured ladders and the max-mean defaults' ,
secA ? . models . some (( m ) => m . id === 'mock' && m . effortDefault === 'max' && m . efforts ? . max === 500 && m . efforts ? . none === 0 )
&& secB ? . models . some (( m ) => m . id === 'mock-cheap' && m . effortDefault === 'high' && m . efforts ? . max === undefined ),
JSON . stringify ([...( secA ? . models ?? []), ...( secB ? . models ?? [])]. filter (( m ) => m . efforts ). map (( m ) => ({ id : m . id , effortDefault : m . effortDefault }))));
const regFile = JSON . parse ( readFileSync ( ` ${ ROOT } /state/models.json` , 'utf8' ));
ok ( 'the registry file is per-provider sections (the section names the route)' ,
regFile . providers ? .[ 'mock-a' ] ? . models ? . length === 2 && regFile . providers ? .[ 'mock-b' ] ? . models ? . length === 1
&& regFile . providers [ 'mock-b' ]. models [ 0 ]. id === 'mock-cheap'
&& regFile . providers [ 'mock-a' ]. models . every (( m ) => m . endpoint === undefined ),
JSON . stringify ( Object . entries ( regFile . providers ?? {}). map (([ s , x ]) => [ s , x . models . length ])));
// the adjudication cache: a re-refine over the same tuple reuses
// every entry -- churn is the point (o/f rotates models; the
// survivors keep their measured selves between refines)
r = await call ( '/providers/mock-a/refine' , { method : 'POST' , token : op , body : {} });
ok ( 'a re-refine starts' , r . status === 200 , r . data . error ?? '' );
let jobC = null ;
for ( let i = 0 ; i < 40 ; i ++ ) {
r = await call ( '/models' , { token : op });
jobC = ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-a' ) ? . job ?? null ;
if ( jobC ? . state !== 'running' ) break ;
await new Promise (( res ) => setTimeout ( res , 100 ));
}
ok ( 'the cached re-refine applied' , jobC ? . state === 'applied' , JSON . stringify ( jobC ?? null ));
ok ( 'the cache served both models' ,
( jobC ? . lines ?? []). filter (( l ) => l . includes ( 'from cache' )). length === 2
&& jobC . lines . some (( l ) => l . includes ( 'curator' )),
JSON . stringify ( jobC ? . lines ?? null ));
const cacheFile = JSON . parse ( readFileSync ( ` ${ ROOT } /state/refine-cache.json` , 'utf8' ));
const cacheKeys = Object . keys ( cacheFile . entries ?? {}). filter (( k ) => k . startsWith ( 'mock-a::' ));
ok ( 'the cache file holds the adjudications under their spec tuples' ,
cacheKeys . length === 2 && cacheKeys . every (( k ) => k . startsWith ( 'mock-a::' ) && k . includes ( '::max::mock::max' )),
JSON . stringify ( Object . keys ( cacheFile . entries ?? {})));
}
2026-11-19 09:56:56 +00:00
// 7c. the add-flow machine (developer, 2026-11-19): discovery is the probe.
2026-11-19 08:35:23 +00:00
// A keyless working endpoint never sees a key field; a 401/403 stands
// the provider broken and opens the key path (checked on reception,
// saved on success, asked again on refusal -- a failed candidate
// never saves); every other failure refuses the add outright,
// nothing stands. The key removal probes again, and o/f never asks.
{
// the add takes no key -- the auth route is the only key path
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-keyed' , baseUrl : 'https://k.example/v1' , apiKey : 'sk-x' } });
ok ( 'apiKey on the add refuses' , r . status === 400 && /apiKey/ . test ( r . data . error ), r . data . error ?? '' );
// a dead endpoint: the add is refused outright, nothing stands
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-dead' , baseUrl : 'https://dead.example/v1' } });
ok ( 'a non-auth discovery failure refuses the add' , r . status === 500 && /did not answer/ . test ( r . data . error ), ` ${ r . status } ${ r . data . error ?? '' } ` );
r = await call ( '/models' , { token : op });
ok ( 'the refused add left no card behind' , ! ( r . data . providers ?? []). some (( p ) => p . slug === 'mock-dead' ), JSON . stringify (( r . data . providers ?? []). map (( p ) => p . slug )));
const cfgNoDead = JSON . parse ( readFileSync ( ` ${ ROOT } /state/config.json` , 'utf8' ));
ok ( 'the refused add never reached the config' , ! cfgNoDead . providers . some (( p ) => p . slug === 'mock-dead' ), '' );
// an auth-shaped refusal: the provider stands broken, the ask opens
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-auth' , baseUrl : 'https://auth.example/v1' } });
ok ( 'a 401 listing stands the provider broken' , r . status === 401 && /refused/ . test ( r . data . error ), ` ${ r . status } ${ r . data . error ?? '' } ` );
r = await call ( '/models' , { token : op });
const authCard = ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-auth' );
ok ( 'the broken card carries the probe record (the ask)' , authCard ? . phase === 'none' && authCard ? . probe ? . outcome === 'auth' && authCard ? . hasKey === false , JSON . stringify ( authCard ? . probe ?? null ));
// the key path: checked on reception, saved on success
r = await call ( '/providers/mock-auth/auth' , { method : 'POST' , token : op , body : { apiKey : 'sk-mock' } });
ok ( 'a working key lands (probe-then-save)' , r . status === 200 && r . data . models > 0 , JSON . stringify ( r . data ));
const cfgKeyed = JSON . parse ( readFileSync ( ` ${ ROOT } /state/config.json` , 'utf8' ));
ok ( 'the successful key saved' , cfgKeyed . providers . find (( p ) => p . slug === 'mock-auth' ) ? . apiKey === 'sk-mock' , '' );
r = await call ( '/models' , { token : op });
ok ( 'the keyed card reads working' , ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-auth' ) ? . probe ? . outcome === 'ok' , '' );
// a key that still meets the refusal is never saved
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-lock' , baseUrl : 'https://lock.example/v1' } });
ok ( 'the locked provider stands broken too' , r . status === 401 && /refused/ . test ( r . data . error ), ` ${ r . status } ${ r . data . error ?? '' } ` );
r = await call ( '/providers/mock-lock/auth' , { method : 'POST' , token : op , body : { apiKey : 'sk-nope' } });
ok ( 'a refused key is not saved (the ask repeats)' , r . status === 401 && /refuses every listing/ . test ( r . data . error ), ` ${ r . status } ${ r . data . error ?? '' } ` );
const cfgLock = JSON . parse ( readFileSync ( ` ${ ROOT } /state/config.json` , 'utf8' ));
ok ( 'the failed key never reached the config' , cfgLock . providers . find (( p ) => p . slug === 'mock-lock' ) ? . apiKey === undefined , '' );
// the key removal: the control for a provider gone public (or the
// first half of a replacement -- the ask re-opens on the 401)
r = await call ( '/providers/mock-auth/auth' , { method : 'DELETE' , token : op , body : {} });
ok ( 'the key removes' , r . status === 200 , JSON . stringify ( r . data ));
const cfgUnkeyed = JSON . parse ( readFileSync ( ` ${ ROOT } /state/config.json` , 'utf8' ));
ok ( 'the key left the config' , cfgUnkeyed . providers . find (( p ) => p . slug === 'mock-auth' ) ? . apiKey === undefined , '' );
r = await call ( '/models' , { token : op });
ok ( 'the keyless probe re-met the 401 (the ask re-opened)' , ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-auth' ) ? . probe ? . outcome === 'auth' , '' );
r = await call ( '/providers/mock-lock/auth' , { method : 'DELETE' , token : op , body : {} });
ok ( 'removing a missing key refuses' , r . status === 404 , ` ${ r . status } ` );
r = await call ( `/providers/ ${ encodeURIComponent ( 'opencode/free' ) } /auth` , { method : 'DELETE' , token : op , body : {} });
ok ( 'the o/f singleton never loses a key it never had' , r . status === 403 && /anonymous/ . test ( r . data . error ), r . data . error ?? '' );
// the machine's fixtures leave before the later counts
for ( const slug of [ 'mock-auth' , 'mock-lock' ]) {
await call ( `/providers/ ${ slug } ` , { method : 'DELETE' , token : op , body : {} });
}
r = await call ( '/models' , { token : op });
ok ( 'the fixtures cleaned up' , ! ( r . data . providers ?? []). some (( p ) => p . slug === 'mock-auth' || p . slug === 'mock-lock' ), '' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
}
// 8. op creates a run -- dormant session one, memory.json waits for
// the start gate
2026-11-19 08:35:23 +00:00
r = await call ( '/runs' , { method : 'POST' , token : op , body : { package : 'la-caramba' , pc : 'Smokina' , name : 'Smoke Story' , spec : { provider : 'mock-a' , model : 'mock' , effort : 'max' } } });
2026-11-14 23:48:27 +00:00
ok ( 'create run' , r . status === 200 && !! r . data . run ? . id , r . data . error ?? r . data . run ? . id );
const runId = r . data . run ? . id ;
ok ( 'owner stamped' , meta ( runId ). owner === opId );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'born dormant' , r . data . phase === 'dormant' && r . data . sessions === 1 && r . data . draft === true ,
JSON . stringify ({ phase : r . data . phase , sessions : r . data . sessions }));
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the draft holds no rings yet (memory.json waits for the start gate)' , r . data . fill . a === 0 && r . data . fill . b === 0 , JSON . stringify ( r . data . fill ));
the progress round: the provider streams, and the two long waits get honest meters -- the refine battery and her turn. The provider (provider.mjs): every completion now streams (vLLM SSE, probed live first: reasoning_content deltas arrive before content deltas, stream_options include_usage puts the full usage on the tail chunk) and assembles back into the one ChatResponse shape every caller already consumed -- content and reasoning in order, tool_calls stitched by index (id and name on the first fragment, arguments concatenated from shards, the assembled arguments parse), usage from the tail; a malformed data line fails loud where a skipped one would silently truncate, the log still records the assembled message whole, and an optional fifth param onProgress({phase, chars}) fires per delta as the meters' feed (ChatResponse names finish_reason, the wire shape the old typedef omitted). One cosmetic wire delta, named: streamed messages carry no provider_specific_fields (vLLM's duplicate reasoning channel plus refusal:null) -- nothing reads it. The refine meter (discovery.mjs + the home admin block): the job carries steps {total, done, label, chars} where the total is the scrape's model count plus the curator's two (thinking, writing), known the moment the scrape lands; the bar moves ONLY on real completions (GM, 2026-11-17: no step has a knowable duration, the point is meaningful feedback, not smooth fill), the label names the running call down to the effort-ladder sample, every completion lands a receipt line (elapsed seconds + the battery verdict), and the lines SURVIVE the job -- the receipt renders until the next refine (GM ruling: no reason to delete the log) and a rejected pass keeps its post-mortem; the curator's thinking step closes at the first prose delta (the streaming boundary -- why the provider went first), writing at the call's resolve, and a dead call closes both honestly; the 2s poll stays the transport (GM-ruled; SSE was rejected -- EventSource cannot send the Bearer header, and tokens in query strings are worse). The turn meter (loop.mjs + the progress route + the play view): the session carries a live progress record, one per provider call (a heal or tool round restarts it), fed by the streaming callback and cleared at every exit (the ask pause, the 422, the completing return, the failed request); GET /runs/:id/progress (owner-only, never queued) returns it plus the scale the bar guesstimates against -- the only true budget is max_tokens when the knobs set one (reasoning counts inside it, the usage arithmetic proves it; the route mirrors the loop's own param resolution at ~4 chars a token), else her own history: the longest past assistant turn in chars, thinking and prose both, the authored opening included (GM: a guesstimate, but an informed one). The 100% crossing pushes back geometrically: the scale grows by a quarter until the count fits, so the bar re-lands in the 80-100% band and climbs again, the same arithmetic every poll, never pinning (a count just under a grown bracket can still round to 100% for a moment -- named and accepted). No scale at all falls to the chunk-driven fallback: a twelve-segment strip, one lit, stepping ONLY when characters actually arrived -- never a free-running spinner, which would claim liveness the stream may not have; a stall shows as a stall. NO live partial prose in the transcript (the log is the one truth; streaming raw text would leak unpicked variants and half-formed heals onto the surface that shows them composed) -- the placeholder is a live div at the transcript foot, rebuilt when a render wipes it, sticking to bottom only when the scroller was already there, and the poll runs at 1s for turns (2s for refine). Verified: the provider live-probed against the real endpoint (prose+usage, thinking+progress transitions, a forced tool call with parseable arguments, the 403 path), a REAL refine run end to end on the GM's authorization (13 models, 541s, the meter exactly to spec with the curator's thinking ticking 4k-17k chars across polls) which also landed the effort measurements the registry was waiting for -- the deterministic re-pick is glm-5.3-max, and server.json's own pin still beats it until the op edits it -- smoke ALL PASS with the new assertions (the refine steps closed, the receipt's lines, the meter idle on a dormant run, idle-between-turns scaled by history, owner-gating; the first cut of the receipt assertion named the wrong mock tie-winner and the first cut of the dormant check clobbered a shared response variable -- both assertion bugs, the code was right), restart + reminder + repo checks green, typecheck green on both programs, and a disposable live run (created, three real turns, housekept, deleted) proving the meter in the browser with zero console errors: chars ticking, the phase flip at the streaming boundary, the scale re-anchoring to her new longest after each turn. Live findings on record: the measured effort default now rides every unset turn, and the test run's turns thought 12.1k/3.9k/6.5k chars against ~1.4k prose -- the max-observable default working as ruled, and the fresh-run decision the GM will make with the knob one click away; and the browser lesson pinned in AGENTS: the meter's DOM is invisible to a11y wait-text matching, so a whole frozen-meter scare during testing was a sampling artifact (the waits matched instantly against unrelated text) -- probe such widgets by DOM, never by wait
2026-11-17 02:21:38 +00:00
r = await call ( `/runs/ ${ runId } /progress` , { token : op });
ok ( 'the turn meter on a dormant run: idle, no scale' , r . status === 200 && r . data . inFlight === false && r . data . scale === null ,
JSON . stringify ( r . data ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /files` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the draft editor surface' , r . data . files [ 'carryover.jsonl' ] ? . mode === 'rw' && r . data . files [ 'memory.json' ] ? . mode === 'rw'
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
&& r . data . files [ 'handbook.md' ] ? . mode === 'rw' , JSON . stringify ( Object . fromEntries ( Object . entries ( r . data . files ). map (([ k , v ]) => [ k , v . mode ]))));
2026-11-14 23:48:27 +00:00
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// 8b. the draft's starting memories: memory.json is authored material
// -- a save is a plain file write, and the start gate applies it
const memBefore = r . data . files [ 'memory.json' ]. content ;
const memParsed = JSON . parse ( memBefore );
const memEdited = JSON . stringify ({
... memParsed ,
insert : [... memParsed . insert , { ring : 'a' , type : 'fact' , label : 'The smoke fact' , detail : 'the draft edit landed' , reason : 'the draft edit test' }],
}, null , 2 ) + '\n' ;
r = await call ( `/runs/ ${ runId } /files/memory.json` , { method : 'PUT' , token : op , body : { content : memEdited } });
ok ( 'memory.json saves while draft' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /files/memory.json` , { method : 'PUT' , token : op , body : { content : '{ not json' } });
ok ( 'a broken memory.json refuses at save' , r . status === 400 && /JSON object/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /files/memory.json` , { method : 'PUT' , token : op , body : { content : JSON . stringify ({ session : '0' , summary : 'bad on purpose' , insert : [{ ring : 'x' , type : 'fact' , label : 'L' , reason : 'r' }] }) } });
ok ( 'a bad manifest still saves (the start gate judges it)' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
ok ( 'the start gate refuses the bad manifest' , r . status === 422 && /insert\[0\]\.ring must be a\|b/ . test ( JSON . stringify ( r . data . detail ?? {})),
JSON . stringify ( r . data ). slice ( 0 , 160 ));
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'the refused start landed nothing' , r . data . phase === 'dormant' && r . data . draft === true , JSON . stringify ({ phase : r . data . phase }));
r = await call ( `/runs/ ${ runId } /files/memory.json` , { method : 'PUT' , token : op , body : { content : memEdited } });
ok ( 'the good edit goes back in' , r . status === 200 , r . data . error ?? '' );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// 9. start: lint, freeze, consume -- the carryover lands behind the
// bundle. It ends on her turn, so no auto-send: the table waits.
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'start' , r . status === 200 && r . data . session === 1 && r . data . autoSend === false , r . data . error ?? JSON . stringify ( r . data ));
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'live' , r . data . phase === 'live' && r . data . open === true );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the draft edit is what she starts with' , r . data . fill . a === 5 && r . data . fill . b === 1 , JSON . stringify ( r . data . fill ));
const filesLive = await call ( `/runs/ ${ runId } /files` , { token : op });
ok ( 'memory.json is provenance once live' , filesLive . data . files [ 'memory.json' ] ? . mode === 'ro' , filesLive . data . files [ 'memory.json' ] ? . mode ?? 'missing' );
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
2026-11-16 22:49:50 +00:00
ok ( 'her authored blocks are the seed (the scan derives them)' , JSON . stringify ( r . data . status ) === '["cuffed","belted","naked","barefoot","worried"]' , JSON . stringify ( r . data . status ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /table` , { token : op });
ok ( 'the opening renders on the table' , r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /Modesty, decency or respect/ . test ( e . m . content ?? '' )));
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the opening event is retired (her authored blocks are the seed)' , r . data . entries . every (( e ) => e . t !== 'opening' ), 'an opening event rode the log' );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'the sigil expanded at start' , r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /Smokina was staring/ . test ( e . m . content ?? '' )), 'a raw @PC reached the table' );
2026-11-14 23:48:27 +00:00
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// 10. the exchanges (mock: variant literature with per-variant status
// blocks, the ask, the whole-list sets, the silent eviction, the
// model guard, the mind)
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*The tide comes in.*' } });
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'gm turn -> variant literature' , r . status === 200 && r . data . variants ? . count === 2 && [ 0 , 1 ]. includes ( r . data . variants . chosen ), r . data . error ?? JSON . stringify ( r . data . variants ?? null ));
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
const pickedStatus = r . data . variants . chosen === 0 ? 'determined' : 'cautious' ;
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } ` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( "the picked variant's status applied" , r . data . status . includes ( pickedStatus ), JSON . stringify ( r . data . status ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /session` , { token : op });
ok ( 'raw session keeps the whole block' , r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /<variants>/ . test ( e . m . content ?? '' )), 'no <variants> in the raw log' );
const pickNote = r . data . entries . find (( e ) => e . t === 'note' && e . kind === 'pick' );
ok ( 'pick note logged (the metric)' , !! pickNote && pickNote . count === 2 && [ 0 , 1 ]. includes ( pickNote . chosen ), JSON . stringify ( pickNote ?? null ));
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
const viaMsg = r . data . entries . find (( e ) => e . t === 'msg' && e . m . role === 'assistant' && e . via );
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)
2026-11-16 23:52:58 +00:00
ok ( 'the request record rides the turn (resolved model + effective params, the measured effort default included)' ,
2026-11-19 08:35:23 +00:00
!! viaMsg && viaMsg . via . model === 'mock' && viaMsg . via . provider === 'mock-a' && JSON . stringify ( viaMsg . via . params ) === '{"reasoning_effort":"max"}' , JSON . stringify ( viaMsg ? . via ?? null ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /table` , { token : op });
ok ( 'the table carries only the picked variant' , r . data . entries . every (( e ) => e . t !== 'msg' || e . m . role !== 'assistant' || ! /<\/?variants?>/ . test ( e . m . content ?? '' )), 'variant syntax leaked into the table' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the picked turn is her turn on the table' , r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && e . m . content . includes ( `<status>cuffed, belted, naked, barefoot, ${ pickedStatus } </status>` )), pickedStatus );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'the table drops thinking' , r . data . entries . every (( e ) => e . m ? . reasoning_content === undefined ));
ok ( 'the variance metric' , r . data . variance . picks === 1 && r . data . variance . offered === 2 && r . data . variance . maxVariants === 2 , JSON . stringify ( r . data . variance ));
the progress round: the provider streams, and the two long waits get honest meters -- the refine battery and her turn. The provider (provider.mjs): every completion now streams (vLLM SSE, probed live first: reasoning_content deltas arrive before content deltas, stream_options include_usage puts the full usage on the tail chunk) and assembles back into the one ChatResponse shape every caller already consumed -- content and reasoning in order, tool_calls stitched by index (id and name on the first fragment, arguments concatenated from shards, the assembled arguments parse), usage from the tail; a malformed data line fails loud where a skipped one would silently truncate, the log still records the assembled message whole, and an optional fifth param onProgress({phase, chars}) fires per delta as the meters' feed (ChatResponse names finish_reason, the wire shape the old typedef omitted). One cosmetic wire delta, named: streamed messages carry no provider_specific_fields (vLLM's duplicate reasoning channel plus refusal:null) -- nothing reads it. The refine meter (discovery.mjs + the home admin block): the job carries steps {total, done, label, chars} where the total is the scrape's model count plus the curator's two (thinking, writing), known the moment the scrape lands; the bar moves ONLY on real completions (GM, 2026-11-17: no step has a knowable duration, the point is meaningful feedback, not smooth fill), the label names the running call down to the effort-ladder sample, every completion lands a receipt line (elapsed seconds + the battery verdict), and the lines SURVIVE the job -- the receipt renders until the next refine (GM ruling: no reason to delete the log) and a rejected pass keeps its post-mortem; the curator's thinking step closes at the first prose delta (the streaming boundary -- why the provider went first), writing at the call's resolve, and a dead call closes both honestly; the 2s poll stays the transport (GM-ruled; SSE was rejected -- EventSource cannot send the Bearer header, and tokens in query strings are worse). The turn meter (loop.mjs + the progress route + the play view): the session carries a live progress record, one per provider call (a heal or tool round restarts it), fed by the streaming callback and cleared at every exit (the ask pause, the 422, the completing return, the failed request); GET /runs/:id/progress (owner-only, never queued) returns it plus the scale the bar guesstimates against -- the only true budget is max_tokens when the knobs set one (reasoning counts inside it, the usage arithmetic proves it; the route mirrors the loop's own param resolution at ~4 chars a token), else her own history: the longest past assistant turn in chars, thinking and prose both, the authored opening included (GM: a guesstimate, but an informed one). The 100% crossing pushes back geometrically: the scale grows by a quarter until the count fits, so the bar re-lands in the 80-100% band and climbs again, the same arithmetic every poll, never pinning (a count just under a grown bracket can still round to 100% for a moment -- named and accepted). No scale at all falls to the chunk-driven fallback: a twelve-segment strip, one lit, stepping ONLY when characters actually arrived -- never a free-running spinner, which would claim liveness the stream may not have; a stall shows as a stall. NO live partial prose in the transcript (the log is the one truth; streaming raw text would leak unpicked variants and half-formed heals onto the surface that shows them composed) -- the placeholder is a live div at the transcript foot, rebuilt when a render wipes it, sticking to bottom only when the scroller was already there, and the poll runs at 1s for turns (2s for refine). Verified: the provider live-probed against the real endpoint (prose+usage, thinking+progress transitions, a forced tool call with parseable arguments, the 403 path), a REAL refine run end to end on the GM's authorization (13 models, 541s, the meter exactly to spec with the curator's thinking ticking 4k-17k chars across polls) which also landed the effort measurements the registry was waiting for -- the deterministic re-pick is glm-5.3-max, and server.json's own pin still beats it until the op edits it -- smoke ALL PASS with the new assertions (the refine steps closed, the receipt's lines, the meter idle on a dormant run, idle-between-turns scaled by history, owner-gating; the first cut of the receipt assertion named the wrong mock tie-winner and the first cut of the dormant check clobbered a shared response variable -- both assertion bugs, the code was right), restart + reminder + repo checks green, typecheck green on both programs, and a disposable live run (created, three real turns, housekept, deleted) proving the meter in the browser with zero console errors: chars ticking, the phase flip at the streaming boundary, the scale re-anchoring to her new longest after each turn. Live findings on record: the measured effort default now rides every unset turn, and the test run's turns thought 12.1k/3.9k/6.5k chars against ~1.4k prose -- the max-observable default working as ruled, and the fresh-run decision the GM will make with the knob one click away; and the browser lesson pinned in AGENTS: the meter's DOM is invisible to a11y wait-text matching, so a whole frozen-meter scare during testing was a sampling artifact (the waits matched instantly against unrelated text) -- probe such widgets by DOM, never by wait
2026-11-17 02:21:38 +00:00
r = await call ( `/runs/ ${ runId } /progress` , { token : op });
ok ( 'the turn meter reads idle between turns, scaled by her history' ,
r . status === 200 && r . data . inFlight === false && r . data . scaleKind === 'history' && typeof r . data . scale === 'number' && r . data . scale > 0 ,
JSON . stringify ( r . data ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*She sets off.*' } });
2026-11-14 23:48:27 +00:00
ok ( 'gm turn -> pending ask' , r . status === 200 && !! r . data . pendingAsk , r . data . error ?? r . data . pendingAsk );
r = await call ( `/runs/ ${ runId } /ask` , { method : 'POST' , token : op , body : { answer : 'yes, clear toward the bow' } });
ok ( 'ask answered' , r . status === 200 , r . data . error ?? '' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// 10b. the full-block protocol: a present block is a whole-list SET
// (absent = unchanged, never blank); an over-cap agenda evicts from
// the bottom silently -- to her; the note shows the GM
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } ` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the agenda block sets the whole list' , JSON . stringify ( r . data . agenda ) === '["find fresh water","signal any passing ship","build a shelter"]' , JSON . stringify ( r . data . agenda ));
ok ( 'the status block sets the whole list' , JSON . stringify ( r . data . status . slice ( - 2 )) === '["settled","curious about the clicking"]' , JSON . stringify ( r . data . status ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*Evening comes.*' } });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'a restated agenda replaces the list' , r . status === 200 , r . data . error ?? '' );
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } ` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'agenda after restatement' , JSON . stringify ( r . data . agenda ) === '["signal any passing ship","build a shelter"]' , JSON . stringify ( r . data . agenda ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*Night falls.*' } });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the over-cap turn is clean (eviction is silent)' , r . status === 200 && ! r . data . conflicts , r . data . error ?? JSON . stringify ( r . data . conflicts ?? null ));
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } ` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'an over-cap agenda keeps the top five' , JSON . stringify ( r . data . agenda ) === '["item one","item two","item three","item four","item five"]' , JSON . stringify ( r . data . agenda ));
ok ( 'the omitted status means unchanged' ,
JSON . stringify ( r . data . status ) === '["cuffed","belted","naked","barefoot","settled","curious about the clicking"]' , JSON . stringify ( r . data . status ));
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } /session` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
const evictNote = r . data . entries . find (( e ) => e . t === 'note' && e . kind === 'agenda' && e . evicted ? . length );
ok ( 'the eviction is visible to the GM (the note)' ,
!! evictNote && JSON . stringify ( evictNote . evicted ) === '["item six","item seven"]' , JSON . stringify ( evictNote ?? null ));
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
2026-11-16 22:49:50 +00:00
ok ( 'the log keeps all seven items (raw is the only place they live)' ,
r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /- item six\n- item seven/ . test ( e . m . content ?? '' )), 'her emission was capped in the log' );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*Dawn breaks.*' } });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'next gm turn is clean' , r . status === 200 && ! r . data . conflicts , r . data . error ?? JSON . stringify ( r . data . conflicts ?? null ));
// 10c. the <model> guard: display-only -- the conflict points at
// <mind>, the heal restates plain, and the turn heals in the same turn
r = await call ( `/runs/ ${ runId } /session` , { token : op });
const guardConflict = r . data . entries . find (( e ) => e . conflictOnly && /read-only display/ . test ( e . m . content ));
ok ( 'an emitted <model> block conflicts' , !! guardConflict , guardConflict ? . m . content ?? 'no conflict' );
ok ( 'the guard conflict healed in the same turn' ,
!! guardConflict && r . data . entries . slice ( r . data . entries . indexOf ( guardConflict )). some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /watching the water/ . test ( e . m . content ?? '' )),
'no heal' );
// 10d. the mind verb: <mind>{"temperature": 1.2}</mind> sets her
// sampling for her NEXT turn (one-shot, JSON, max_tokens excluded)
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } /session` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
const mindSetter = r . data . entries . filter (( e ) => e . t === 'msg' && e . m . role === 'assistant' ). find (( e ) => / race ahead of her feet / . test ( e . m . content ?? '' ));
ok ( 'the mind verb: the setting turn does not ride at it (next turn only)' ,
mindSetter ? . via ? . params ? . temperature === undefined , JSON . stringify ( mindSetter ? . via ?? null ));
ok ( 'the mind verb: the note records the statement' ,
r . data . entries . some (( e ) => e . t === 'note' && e . kind === 'mind' && e . params ? . temperature === 1.2 ), 'no mind note' );
const guardTurn = r . data . entries . find (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /squints at the horizon/ . test ( e . m . content ?? '' ));
ok ( 'the mind verb: her next turn rides at the stated mind' ,
guardTurn ? . via ? . params ? . temperature === 1.2 , JSON . stringify ( guardTurn ? . via ?? null ));
2026-11-14 23:48:27 +00:00
const lastGm = [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && e . m . role === 'user' && ! e . conflictOnly );
ok ( 'no conflict attached to the GM turn' , ! /<conflict>/ . test ( lastGm . m . content ), lastGm . m . content . slice ( - 100 ));
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'GM prose goes pure' , ! /<\/?(status|agenda)>/ . test ( lastGm . m . content ), lastGm . m . content . slice ( - 120 ));
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
2026-11-16 22:49:50 +00:00
r = await call ( `/runs/ ${ runId } /status` , { method : 'POST' , token : op , body : { items : [] } });
ok ( 'the out-of-band status route is retired' , r . status === 404 , ` ${ r . status } ` );
r = await call ( `/runs/ ${ runId } /agenda` , { method : 'POST' , token : op , body : { items : [] } });
ok ( 'the out-of-band agenda route is retired' , r . status === 404 , ` ${ r . status } ` );
2026-11-14 23:48:27 +00:00
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// 10d. an OOC GM turn: the paren channel carries no cache blocks -- an
// OOC exchange does not move her state, the next IC turn re-carries them
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '( mock GM checking in )' } });
ok ( 'ooc gm turn sends' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /session` , { token : op });
const oocGm = [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && e . m . role === 'user' && ! e . conflictOnly );
ok ( 'the ooc turn carries no cache blocks' , /\( mock GM checking in \)/ . test ( oocGm . m . content ) && ! /<\/?(status|agenda)>/ . test ( oocGm . m . content ), oocGm . m . content . slice ( - 90 ));
// the OOC reply states an out-of-bounds mind: the conflict names the
// range, the heal restates -- and the turn after the riding turn is
// back at defaults (one-shot)
const scatterTurn = r . data . entries . find (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /thoughts scatter/ . test ( e . m . content ?? '' ));
ok ( 'the mind is one-shot (the turn after the riding turn is at defaults)' ,
scatterTurn ? . via ? . params ? . temperature === undefined , JSON . stringify ( scatterTurn ? . via ?? null ));
const mindConflict = r . data . entries . find (( e ) => e . conflictOnly && /must be at least 0 and up to 2/ . test ( e . m . content ));
ok ( 'an out-of-bounds mind conflicts with the range named' , !! mindConflict , mindConflict ? . m . content ?? 'no conflict' );
ok ( 'the mind conflict healed in-turn' ,
!! mindConflict && r . data . entries . slice ( r . data . entries . indexOf ( mindConflict )). some (( e ) => e . t === 'note' && e . kind === 'mind' && e . params ? . temperature === 1.2 ),
'no healed restatement' );
ok ( 'the mind statements number two (the refused one never stashed)' ,
r . data . entries . filter (( e ) => e . t === 'note' && e . kind === 'mind' ). length === 2 , 'wrong count' );
// 10e. the view policy (the full-block protocol): render the session
// log through the same renderer the loop uses and assert the stamping
const view1 = renderView ({ lines : jsonl ( runId , 1 , 'log.jsonl' ), pendingAsk : null });
const her1 = view1 . filter (( m ) => m . role === 'assistant' );
const lastHer = [... her1 ]. reverse (). find (( m ) => typeof m . content === 'string' && /breathes until the numbers behave/ . test ( m . content ));
ok ( 'the view stamps the newest status and agenda at her latest turn' ,
!! lastHer && /<status>cuffed, belted, naked, barefoot, settled, curious about the clicking<\/status>/ . test ( lastHer . content )
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
2026-11-16 22:49:50 +00:00
&& /<agenda>\n- item one\n- item two\n- item three\n- item four\n- item five\n<\/agenda>/ . test ( lastHer . content ),
( lastHer ? . content ?? 'none' ). slice ( - 260 ));
ok ( 'the capped agenda is what derives (the eviction stays silent to her)' ,
!! lastHer && ( lastHer . content . match ( /<agenda>/g ) ?? []). length === 1 && ! /item (six|seven)/ . test ( lastHer . content ),
'the stamp leaked the over-cap items' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'superseded copies strip from the view' ,
her1 . filter (( m ) => m !== lastHer ). every (( m ) => ! /<\/?(status|agenda)>/ . test ( String ( m . content ?? '' ))), '' );
ok ( 'her mind tags are write-only (stripped from the view)' ,
her1 . every (( m ) => ! /<mind>/ . test ( String ( m . content ?? '' ))), '' );
ok ( 'an emitted <model> block strips from the view' ,
her1 . every (( m ) => ! /\n<model>/ . test ( String ( m . content ?? '' ))), '' );
2026-11-18 17:24:37 +00:00
const viewConflicts = view1 . filter (( m ) => m . role === 'user' && /^<conflict>/ . test ( String ( m . content ?? '' )));
2026-11-19 09:56:56 +00:00
ok ( 'past conflicts stay in the context (a mistake remains visible, developer 2026-11-18)' ,
2026-11-18 17:24:37 +00:00
viewConflicts . length === 2 , ` ${ viewConflicts . length } render` );
ok ( 'a conflict describes its problem in full (the stripped emission quoted)' ,
viewConflicts . some (( m ) => / yours said : \ { "temperature" : 0 \ . 1 \ } / . test ( String ( m . content ?? '' ))), '' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'each past turn carries its <model> block when params rode' ,
her1 . some (( m ) => String ( m . content ?? '' ). startsWith ( '<model>{"temperature":1.2}</model>' )), '' );
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)
2026-11-16 23:52:58 +00:00
ok ( 'the <model> block hides the effort knob (not her call)' ,
her1 . every (( m ) => ! /reasoning_effort/ . test ( String ( m . content ?? '' ))), 'the effort leaked into her display' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'GM prose goes pure in the view' ,
view1 . filter (( m ) => m . role === 'user' ). every (( m ) => ! /<\/?(status|agenda)>/ . test ( String ( m . content ?? '' ))), '' );
2026-11-14 23:48:27 +00:00
// 10c. the reminder: a system chunk after every GM turn, one live copy
r = await call ( `/runs/ ${ runId } /session` , { token : op });
const reminders = r . data . entries . filter (( e ) => e . reminder );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'reminder rode every GM turn' , reminders . length === 6 && reminders . every (( x ) => x . m . role === 'system' ), ` ${ reminders . length } in the log` );
2026-11-14 23:48:27 +00:00
ok ( 'reminder carries the turn protocol' , /How to compose your turn/i . test ( reminders [ 0 ] ? . m . content ?? '' ), ( reminders [ 0 ] ? . m . content ?? '' ). slice ( 0 , 60 ));
r = await call ( `/runs/ ${ runId } /status` , { token : op });
ok ( 'status endpoint carries both' , Array . isArray ( r . data . status ) && Array . isArray ( r . data . agenda ), JSON . stringify ( r . data ). slice ( 0 , 120 ));
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28 's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
// 11. ash in another's run: the story is the reading surface, all
// else is the owner's
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } ` , { token : ash });
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28 's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
ok ( 'ash detail 403' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /table` , { token : ash });
ok ( 'ash table 403' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /session` , { token : ash });
ok ( 'ash raw session 403' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /carryover` , { token : ash });
ok ( 'ash carryover 403' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /files` , { token : ash });
ok ( 'ash files 403' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /status` , { token : ash });
ok ( 'ash status 403' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /notes` , { token : ash });
ok ( 'ash notes 403 (#28 overturned)' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /housekeeping` , { token : ash });
ok ( 'ash housekeeping state 403' , r . status === 403 );
r = await call ( `/runs/ ${ runId } /housekeeping/log` , { token : ash });
ok ( 'ash housekeeping log 403' , r . status === 403 );
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : ash , body : { line : 'hi' } });
ok ( 'ash turn 403' , r . status === 403 );
the progress round: the provider streams, and the two long waits get honest meters -- the refine battery and her turn. The provider (provider.mjs): every completion now streams (vLLM SSE, probed live first: reasoning_content deltas arrive before content deltas, stream_options include_usage puts the full usage on the tail chunk) and assembles back into the one ChatResponse shape every caller already consumed -- content and reasoning in order, tool_calls stitched by index (id and name on the first fragment, arguments concatenated from shards, the assembled arguments parse), usage from the tail; a malformed data line fails loud where a skipped one would silently truncate, the log still records the assembled message whole, and an optional fifth param onProgress({phase, chars}) fires per delta as the meters' feed (ChatResponse names finish_reason, the wire shape the old typedef omitted). One cosmetic wire delta, named: streamed messages carry no provider_specific_fields (vLLM's duplicate reasoning channel plus refusal:null) -- nothing reads it. The refine meter (discovery.mjs + the home admin block): the job carries steps {total, done, label, chars} where the total is the scrape's model count plus the curator's two (thinking, writing), known the moment the scrape lands; the bar moves ONLY on real completions (GM, 2026-11-17: no step has a knowable duration, the point is meaningful feedback, not smooth fill), the label names the running call down to the effort-ladder sample, every completion lands a receipt line (elapsed seconds + the battery verdict), and the lines SURVIVE the job -- the receipt renders until the next refine (GM ruling: no reason to delete the log) and a rejected pass keeps its post-mortem; the curator's thinking step closes at the first prose delta (the streaming boundary -- why the provider went first), writing at the call's resolve, and a dead call closes both honestly; the 2s poll stays the transport (GM-ruled; SSE was rejected -- EventSource cannot send the Bearer header, and tokens in query strings are worse). The turn meter (loop.mjs + the progress route + the play view): the session carries a live progress record, one per provider call (a heal or tool round restarts it), fed by the streaming callback and cleared at every exit (the ask pause, the 422, the completing return, the failed request); GET /runs/:id/progress (owner-only, never queued) returns it plus the scale the bar guesstimates against -- the only true budget is max_tokens when the knobs set one (reasoning counts inside it, the usage arithmetic proves it; the route mirrors the loop's own param resolution at ~4 chars a token), else her own history: the longest past assistant turn in chars, thinking and prose both, the authored opening included (GM: a guesstimate, but an informed one). The 100% crossing pushes back geometrically: the scale grows by a quarter until the count fits, so the bar re-lands in the 80-100% band and climbs again, the same arithmetic every poll, never pinning (a count just under a grown bracket can still round to 100% for a moment -- named and accepted). No scale at all falls to the chunk-driven fallback: a twelve-segment strip, one lit, stepping ONLY when characters actually arrived -- never a free-running spinner, which would claim liveness the stream may not have; a stall shows as a stall. NO live partial prose in the transcript (the log is the one truth; streaming raw text would leak unpicked variants and half-formed heals onto the surface that shows them composed) -- the placeholder is a live div at the transcript foot, rebuilt when a render wipes it, sticking to bottom only when the scroller was already there, and the poll runs at 1s for turns (2s for refine). Verified: the provider live-probed against the real endpoint (prose+usage, thinking+progress transitions, a forced tool call with parseable arguments, the 403 path), a REAL refine run end to end on the GM's authorization (13 models, 541s, the meter exactly to spec with the curator's thinking ticking 4k-17k chars across polls) which also landed the effort measurements the registry was waiting for -- the deterministic re-pick is glm-5.3-max, and server.json's own pin still beats it until the op edits it -- smoke ALL PASS with the new assertions (the refine steps closed, the receipt's lines, the meter idle on a dormant run, idle-between-turns scaled by history, owner-gating; the first cut of the receipt assertion named the wrong mock tie-winner and the first cut of the dormant check clobbered a shared response variable -- both assertion bugs, the code was right), restart + reminder + repo checks green, typecheck green on both programs, and a disposable live run (created, three real turns, housekept, deleted) proving the meter in the browser with zero console errors: chars ticking, the phase flip at the streaming boundary, the scale re-anchoring to her new longest after each turn. Live findings on record: the measured effort default now rides every unset turn, and the test run's turns thought 12.1k/3.9k/6.5k chars against ~1.4k prose -- the max-observable default working as ruled, and the fresh-run decision the GM will make with the knob one click away; and the browser lesson pinned in AGENTS: the meter's DOM is invisible to a11y wait-text matching, so a whole frozen-meter scare during testing was a sampling artifact (the waits matched instantly against unrelated text) -- probe such widgets by DOM, never by wait
2026-11-17 02:21:38 +00:00
r = await call ( `/runs/ ${ runId } /progress` , { token : ash });
ok ( 'ash progress 403' , r . status === 403 );
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } /notes` , { method : 'PUT' , token : ash , body : { content : 'mine' } });
ok ( 'ash notes write 403' , r . status === 403 );
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28 's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
r = await call ( `/runs/ ${ runId } /story` , { token : ash });
ok ( 'ash reads the story' , r . status === 200 && !! r . data . display && Array . isArray ( r . data . sessions ), r . data . error ?? '' );
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ runId } /housekeeping/replay` , { method : 'POST' , token : ash , body : {} });
ok ( 'ash replay 403 (spends a call)' , r . status === 403 );
// 12. ash forks
r = await call ( `/runs/ ${ runId } /fork` , { method : 'POST' , token : ash , body : {} });
ok ( 'fork' , r . status === 200 && !! r . data . run , r . data . error ?? r . data . run );
const forkId = r . data . run ;
const fm = meta ( forkId );
ok ( 'fork owner + forked stamp' , fm . owner === ashId && Number . isInteger ( fm . forked ) && fm . created === meta ( runId ). created ,
`owner= ${ fm . owner } forked= ${ fm . forked } created= ${ fm . created } ` );
r = await call ( `/runs/ ${ forkId } ` , { token : ash });
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'fork live session carried over' , r . status === 200 && r . data . open === true , r . data . error ?? '' );
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ forkId } /turn` , { method : 'POST' , token : ash , body : { line : '*She looks around.*' } });
ok ( 'ash turns on the fork' , r . status === 200 , r . data . error ?? '' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
r = await call ( `/runs/ ${ forkId } /session` , { token : ash });
const forkReply = [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && e . m . role === 'assistant' );
ok ( 'the fork inherits her unconsumed mind' , forkReply ? . via ? . params ? . temperature === 1.2 , JSON . stringify ( forkReply ? . via ?? null ));
2026-11-14 23:48:27 +00:00
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
2026-11-16 22:49:50 +00:00
// 10f. the GM's block edit rides its turn (the override): the log
// records the field, the composition overwrites her newest blocks
// with it, the log keeps her words verbatim, and the model never
// sees an override as an act -- only as state
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*A cooler wind picks up.*' , agenda : [ 'climb the ridge' , 'rest' ] } });
ok ( 'the override turn sends' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /session` , { token : op });
const ovrTurn = [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && e . m . role === 'user' && e . override );
ok ( 'the override rides its GM turn as the record' ,
!! ovrTurn && JSON . stringify ( ovrTurn . override . agenda ) === '["climb the ridge","rest"]' && ovrTurn . override . status === undefined ,
JSON . stringify ( ovrTurn ? . override ?? null ));
ok ( 'the override turn\'s prose stays pure' , ! /<\/?(status|agenda)>/ . test ( String ( ovrTurn ? . m . content ?? '' )), String ( ovrTurn ? . m . content ?? '' ). slice ( - 80 ));
r = await call ( `/runs/ ${ runId } /status` , { token : op });
ok ( 'the composed agenda is the override' , JSON . stringify ( r . data . agenda ) === '["climb the ridge","rest"]' , JSON . stringify ( r . data . agenda ));
ok ( 'the untouched status derives unchanged' ,
JSON . stringify ( r . data . status ) === '["cuffed","belted","naked","barefoot","settled","curious about the clicking"]' , JSON . stringify ( r . data . status ));
const view1b = renderView ({ lines : jsonl ( runId , 1 , 'log.jsonl' ), pendingAsk : null });
const lastHerB = [... view1b ]. reverse (). find (( m ) => m . role === 'assistant' && typeof m . content === 'string' && m . content . trim ());
ok ( 'the composition stamps the override at her canon point' ,
/<agenda>\n- climb the ridge\n- rest\n<\/agenda>/ . test ( lastHerB . content ), String ( lastHerB . content ). slice ( - 180 ));
ok ( 'the log keeps her words verbatim (the over-cap emission is intact)' ,
jsonl ( runId , 1 , 'log.jsonl' ). some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /- item six\n- item seven/ . test ( e . m . content ?? '' )),
'her emission was rewritten' );
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '( ooc with an edit )' , status : [ 'x' ] } });
ok ( 'an override cannot ride an OOC turn' , r . status === 400 && /OOC/ . test ( r . data . error ), r . data . error ?? '' );
2026-11-19 08:35:23 +00:00
// 12b. models: the run's spec picks {provider, model, effort},
2026-11-19 09:56:56 +00:00
// registry-gated, owner-only. The per-run params layer is gone (developer,
2026-11-19 08:35:23 +00:00
// 2026-11-18): the <mind> verb is the only sampling source, per-turn
r = await call ( `/runs/ ${ forkId } /model` , { method : 'POST' , token : ash , body : { player : { provider : 'mock-b' , model : 'mock-cheap' , effort : 'low' }, housekeeper : { provider : 'mock-a' , model : 'mock-tie' , effort : 'max' } } });
ok ( 'set spec picks' ,
r . status === 200 && JSON . stringify ( r . data . models . player ) === '{"provider":"mock-b","model":"mock-cheap","effort":"low"}'
&& JSON . stringify ( r . data . models . housekeeper ) === '{"provider":"mock-a","model":"mock-tie","effort":"max"}' ,
JSON . stringify ( r . data ));
ok ( 'the specs are stamped in run.json' , JSON . stringify ( meta ( forkId ). models ? . player ) === '{"provider":"mock-b","model":"mock-cheap","effort":"low"}' );
r = await call ( `/runs/ ${ forkId } /model` , { method : 'POST' , token : ash , body : { player : { provider : 'mock-b' , model : 'mock-cheap' , effort : 'turbo' } } });
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)
2026-11-16 23:52:58 +00:00
ok ( 'a bogus effort level refuses' , r . status === 400 && /must be one of/ . test ( r . data . error ), r . data . error ?? '' );
2026-11-19 08:35:23 +00:00
r = await call ( `/runs/ ${ forkId } /model` , { method : 'POST' , token : ash , body : { player : { provider : 'nope' , model : 'x' , effort : 'low' } } });
ok ( 'an unconfigured provider refuses' , r . status === 400 && /no provider named/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( `/runs/ ${ forkId } /model` , { method : 'POST' , token : ash , body : { player : { provider : 'mock-b' , model : 'not-a-model' , effort : 'low' } } });
ok ( 'a model outside the registry refuses' , r . status === 400 && /not usable/ . test ( r . data . error ), r . data . error ?? '' );
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ forkId } /model` , { method : 'POST' , token : ash , body : { housekeeper : null } });
2026-11-19 08:35:23 +00:00
ok ( 'clear a role (the housekeeper inherits the player provider\'s default)' ,
r . status === 200 && r . data . models . housekeeper === undefined && r . data . modelState ? . housekeeper ? . ok === true && r . data . modelState . housekeeper . inherited === true ,
JSON . stringify ( r . data . modelState ?? null ));
r = await call ( `/runs/ ${ forkId } /model` , { method : 'POST' , token : op , body : { player : { provider : 'mock-a' , model : 'mock' , effort : 'max' } } });
2026-11-14 23:48:27 +00:00
ok ( 'model set is owner-only' , r . status === 403 );
r = await call ( `/runs/ ${ forkId } /model` , { method : 'POST' , token : ash , body : { bard : 'x' } });
ok ( 'unknown role rejected' , r . status === 400 );
r = await call ( `/runs/ ${ forkId } ` , { token : ash });
2026-11-19 08:35:23 +00:00
ok ( 'detail exposes the picks, their health, and the provider defaults' ,
JSON . stringify ( r . data . run . models ? . player ) === '{"provider":"mock-b","model":"mock-cheap","effort":"low"}'
&& r . data . run . modelState ? . player ? . ok === true
&& Array . isArray ( r . data . run . providerDefaults ) && r . data . run . providerDefaults . length >= 2 ,
JSON . stringify ({ models : r . data . run . models , modelState : r . data . run . modelState }));
// a turn on the re-picked run: the recording proves what was sent --
// the spec's effort riding under the mind layer (her restated mind is
// the only params source, layered over nothing)
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
r = await call ( `/runs/ ${ forkId } /turn` , { method : 'POST' , token : ash , body : { line : '*She keeps watch.*' } });
2026-11-19 08:35:23 +00:00
ok ( 'gm turn on the fork (post-picks)' , r . status === 200 , r . data . error ?? '' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
r = await call ( `/runs/ ${ forkId } /session` , { token : ash });
const viaTurn = [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && e . m . role === 'assistant' );
2026-11-19 08:35:23 +00:00
ok ( 'the recorded request carries the spec under the mind layer' ,
!! viaTurn ? . via && viaTurn . via . model === 'mock-cheap' && viaTurn . via . provider === 'mock-b'
&& viaTurn . via . params . temperature === 1.2 && viaTurn . via . params . reasoning_effort === 'low' ,
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
JSON . stringify ( viaTurn ? . via ?? null ));
2026-11-14 23:48:27 +00:00
r = await call ( '/models' , { token : ash });
2026-11-19 08:35:23 +00:00
ok ( 'model listing (the per-provider registry)' ,
r . status === 200 && ( r . data . providers ?? []). some (( p ) => p . slug === 'mock-a' && p . phase === 'refined' && p . models . some (( m ) => m . id === 'mock' && m . label === 'Mock' )),
JSON . stringify (( r . data . providers ?? []). map (( p ) => [ p . slug , p . phase ])));
2026-11-14 23:48:27 +00:00
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// 13. ash saves a draft as a package (save-package is a draft act --
// the played-run refusal is checked at the end)
r = await call ( '/runs' , { method : 'POST' , token : ash , body : { package : 'la-caramba' , pc : 'Ashling' , name : 'Ash Draft' } });
ok ( 'ash creates a draft' , r . status === 200 && !! r . data . run ? . id , r . data . error ?? r . data . run ? . id );
const draftId = r . data . run ? . id ;
r = await call ( '/packages' , { method : 'POST' , token : ash , body : { from : draftId , name : 'Ash Pack' } });
2026-11-14 23:48:27 +00:00
ok ( 'save-package' , r . status === 200 && !! r . data . package ? . id , r . data . error ?? r . data . package ? . id );
const pkgId = r . data . package ? . id ;
r = await call ( '/packages' , { token : op });
const saved = r . data . find (( p ) => p . name === pkgId );
ok ( 'package listed with origin' , !! saved && saved . origin === 'user' && saved . ownerName === 'Ash'
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
&& saved . pc === null && saved . display === 'Ash Pack' , JSON . stringify ( saved ));
2026-11-14 23:48:27 +00:00
// 14. op creates a run from the user package
r = await call ( '/runs' , { method : 'POST' , token : op , body : { package : pkgId , pc : 'Secondina' , name : 'Second Story' } });
ok ( 'create from user package' , r . status === 200 && !! r . data . run ? . id , r . data . error ?? r . data . run ? . id );
const secondId = r . data . run ? . id ;
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// 15. op revokes ash -- identity destroyed, data stays
2026-11-14 23:48:27 +00:00
r = await call ( `/users/ ${ ashId } /revoke` , { method : 'POST' , token : op , body : {} });
ok ( 'revoke ash' , r . status === 200 , r . data . error ?? '' );
r = await call ( '/runs' , { token : ash });
ok ( 'ash token dead' , r . status === 401 );
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28 's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
r = await call ( '/runs' , { token : op });
const goneFork = Array . isArray ( r . data ) ? r . data . find (( x ) => x . id === forkId ) : null ;
ok ( 'fork now ownerless, session closed' , !! goneFork && goneFork . owner === null && goneFork . ownerName === null && goneFork . open === false ,
JSON . stringify ( goneFork )); // the detail it used to ride is owner-only now -- the list carries the facts
2026-11-14 23:48:27 +00:00
r = await call ( `/runs/ ${ forkId } /turn` , { method : 'POST' , token : op , body : { line : 'x' } });
ok ( 'ownerless turn 403 even for op' , r . status === 403 && /ownerless/ . test ( r . data . error ));
r = await call ( '/packages' , { token : op });
const saved2 = r . data . find (( p ) => p . name === pkgId );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'user package survives, ownerless' , !! saved2 && saved2 . owner === null && saved2 . ownerName === null && saved2 . display === 'Ash Pack' ,
2026-11-14 23:48:27 +00:00
JSON . stringify ( saved2 ));
r = await call ( `/runs/ ${ forkId } /fork` , { method : 'POST' , token : op , body : {} });
ok ( 'op forks the ownerless run' , r . status === 200 && !! r . data . run , r . data . error ?? r . data . run );
const reforkId = r . data . run ;
2026-11-19 08:35:23 +00:00
ok ( 'fork carries the model specs' , JSON . stringify ( meta ( reforkId ). models ? . player ) === '{"provider":"mock-b","model":"mock-cheap","effort":"low"}' );
2026-11-14 23:48:27 +00:00
// 16. users list, self-revoke refused
r = await call ( '/users' , { token : op });
ok ( 'users list' , r . status === 200 && r . data . users . length === 1 && r . data . users [ 0 ]. id === opId );
r = await call ( `/users/ ${ opId } /revoke` , { method : 'POST' , token : op , body : {} });
ok ( 'self-revoke refused' , r . status === 409 );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// 17. stop: the tail MOVES into dormant session 2 (the slidwin),
// housekeeping runs over what remains, the re-run rebases, start
// consumes the carry behind the bundle
const stopAndSettle = async ( label ) => {
r = await call ( `/runs/ ${ runId } /housekeeping` , { method : 'POST' , token : op , body : {} });
ok ( ` ${ label } triggered` , r . status === 200 && r . data . state === 'running' , r . data . error ?? JSON . stringify ( r . data ));
let hk = null ;
for ( let i = 0 ; i < 40 ; i ++ ) {
hk = await call ( `/runs/ ${ runId } /housekeeping` , { token : op });
if ( hk . data . state !== 'running' ) break ;
await new Promise (( res ) => setTimeout ( res , 100 ));
}
ok ( ` ${ label } applied` , hk . data . state === 'applied' , JSON . stringify ( hk . data ));
return hk ;
};
await stopAndSettle ( 'stop (session 1)' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'dormant after stop' , r . data . phase === 'dormant' && r . data . sessions === 2 && r . data . ready === true ,
JSON . stringify ({ phase : r . data . phase , sessions : r . data . sessions , ready : r . data . ready }));
r = await call ( `/runs/ ${ runId } /housekeeping` , { token : op });
ok ( 'the job names the pass and the target' , r . data . state === 'applied' && r . data . session === 1 && r . data . target === 2 , JSON . stringify ( r . data ));
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
r = await call ( `/runs/ ${ runId } /housekeeping/log` , { token : op });
ok ( 'the pass log names its model' , r . status === 200 && /housekeeper: mock/ . test ( r . data . content ), r . status === 200 ? r . data . content . split ( '\n' ). slice ( 0 , 3 ). join ( ' / ' ) : r . data . error );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// the move: each line exists in exactly one jsonl, ever
const log1 = jsonl ( runId , 1 , 'log.jsonl' );
const carry2 = jsonl ( runId , 2 , 'carryover.jsonl' );
ok ( 'the tail moved out of session 1' , carry2 . length > 0 && log1 . every (( e ) => ! carry2 . some (( c ) => JSON . stringify ( c ) === JSON . stringify ( e ))),
` ${ carry2 . length } carried lines` );
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
2026-11-16 22:49:50 +00:00
ok ( 'the boundary state note rides the carry head' ,
carry2 [ 0 ] ? . t === 'note' && carry2 [ 0 ] ? . kind === 'state'
&& JSON . stringify ( carry2 [ 0 ] ? . agenda ) === '["climb the ridge","rest"]'
&& JSON . stringify ( carry2 [ 0 ] ? . status ) === '["cuffed","belted","naked","barefoot","settled","curious about the clicking"]' ,
JSON . stringify ( carry2 [ 0 ] ?? null ));
ok ( 'the carry holds whole exchanges' , carry2 [ 1 ] ? . t === 'msg' && carry2 [ 1 ] ? . m ? . role === 'user' && ! carry2 [ 1 ] ? . conflictOnly
&& carry2 . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' ), carry2 [ 1 ] ? . t ?? 'nothing carried' );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'the carry ends on her turn (no auto-send)' , [... carry2 ]. reverse (). find (( e ) => e . t === 'msg' && ! e . reminder ) ? . m ? . role === 'assistant' );
ok ( 'no markers anywhere in the logs' , log1 . concat ( carry2 ). every (( e ) => e . carried === undefined ));
r = await call ( `/runs/ ${ runId } /carryover` , { token : op });
ok ( 'the dormant preview renders the carry' , r . status === 200 && r . data . session === 2 && r . data . ends === 'player' && r . data . entries . length === carry2 . length ,
JSON . stringify ({ ends : r . data . ends , n : r . data . entries ? . length }));
// the story reads whole, through dormancy, with no doubles
r = await call ( `/runs/ ${ runId } /story` , { token : op });
const gmTexts = r . data . sessions . flatMap (( s ) => s . turns . filter (( t ) => t . who === 'gm' ). map (( t ) => t . text ));
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
2026-11-16 22:49:50 +00:00
ok ( 'the story has every GM turn exactly once' , gmTexts . length === 6 && new Set ( gmTexts ). size === 6 , ` ${ gmTexts . length } gm turns across ${ r . data . sessions . length } sessions` );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the story carries no OOC' , r . data . sessions . every (( s ) => s . turns . every (( t ) => ! /^\(/ . test ( t . text ) && ! /\( mock GM checking in \)/ . test ( t . text ))), 'OOC leaked into the story' );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'the story reads the dormant carryover at the live edge' , r . data . sessions . some (( s ) => s . turns . length >= 10 ));
const storyPlayer = r . data . sessions . flatMap (( s ) => s . turns . filter (( t ) => t . who === 'player' ). map (( t ) => t . text ));
the sheet round: the GM's ledger of arbitrated run state -- the second state channel, split from status and agenda by truth model (GM, 2026-11-17). The rulings first: status and agenda are narrative self-report (their truth is "she said so", the scan caches her latest words); the sheet is actual run state (its truth is "the GM set so", the record IS the truth event -- nothing cached from anyone's words). The override channel promoted to a standing section, and that precedent decided the presentation: the sheet renders as its OWN authoritative system chunk at the freshest end, never a canon-point stamp, which would read as her words -- the same reason the override composes as hers and the sheet never does. Schemaless JSON in the tag (the mind-verb philosophy: the substrate teaches the channel, the package teaches the vocabulary -- the invariants rule the GM wrote is one universal paragraph with deliberately non-box examples, clothes and grades, and the propose-additions line as her schema-evolution channel); details learnt in-place; NO package gating -- the channel is universal and "optional, if given" makes the invariant forward-compatible in every bundle that never sets one. The build: a sheet record rides the GM turn like the override (readSheet: object-ness is the route's only law, 400 loud on arrays and scalars, nothing appended; OOC turns refuse it exactly like block edits); scanState derives newest-wins whole-set -- an absent key drops, never keeps, and {} is a live empty ledger (a truthy check, never falsy); the boundary state note carries it across stops and the dormant read path serves it; renderView appends the chunk once per assembly so one live copy holds by construction; the guard is the <model> sibling (an emitted <sheet> conflicts with "the GM's ledger -- propose changes in prose", healed in-turn, cap 3, and her emission never applies -- the scan holds the GM's record); every strip surface learned the tag (the view's STRIP_HERS, the story's verbs, the table's chip regex -- the standing grep-every-strip-list lesson, applied); and the web gains sheetEditor, the paneEditor's JSON sibling in widgets.mjs (same stage/pending/discard pattern, bad JSON refuses at the stage), the third pane in the aside, the send attaching body.sheet, and [sheet] machinery lines on both table and raw walks. The mock's sheet-guard branch is CUE-KEYED, not position-keyed: the carried tail shifts the script's counts (session 4's log starts the script over -- the battery's first attempt landed on the ask position and crashed renderView on the unpaired call; the battery now answers the script ask and moves on), while a marked GM turn is immune to every shift -- mockModel reads the view, the marked turn earns the emission, the conflict it earns earns the plain-prose heal. check-reminder is sheet-aware (the chunk is a legitimate third system surface; the count and freshest-end assertions tolerate exactly one, and the freshest-end check now allows her latest reply and/or the chunk to follow the reminder). Verified: smoke ALL PASS with +15 sheet assertions (newest-wins, whole-set semantics, the chunk one-live-copy -- ANCHORED with startsWith because the invariants bundle itself mentions the tag and a bare regex matches it twice, an honest test bug caught by an honest test), the guard's conflict and heal with her emission kept verbatim in the raw log and never applied, the view and story strips, the empty ledger rendering its chunk, the boundary note carrying the sheet, the dormant read deriving it, and session 5 deriving it from the carried note end to end), restart + reminder checks green, typecheck green on both programs, check-repo clean (it caught the round's own prose twice: "window" is a retired term in README, the contwin vocabulary wins), and a browser pass over the pane end to end with zero console errors -- staging, the pending marker, the ride, the scan re-render, and both machinery lines on the table. Docs: README's protocol passage carries the sheet with the numbers-live-on-the-sheet line (prose numbers die with the contwin; sheet numbers ride the scan forever) -- NOT in the memory tiers table, where the first draft wrongly put it (the GM's ruling: the sheet belongs in neither memories nor records); the identity tier lost its loose "character sheet" name now that the term is technical; DICTIONARY gains the sheet entry with the history line (dice retired into variant literature, sheets arrived as the state machinery -- the tabletop metaphor completing while its realism stays advisory, players hold their own pencils in the real thing and we don't, for drift); ROADMAP parks the bookkeeper extension (the housekeeper's arithmetic sibling: reads the setting's rules prose and the latest turns, computes the ledger delta from a purchase in her prose, lands it as a STAGED edit -- applied on the GM's next turn or discarded; sheet-only authority, curator fallback, per-package opt-in because an agent cannot bookkeep what is not arithmetic). The GM's prompt-side edits ride the same commit: invariants' "Character's sheet" section (the universal rule, the trailing-clause flag taken in review), the reminder's inventory line gaining "the sheet (optional)", and la caramba's gm.md lore updates. The box package (the first consumer) and detention stay untracked WIP, untouched. The 2026-11-17 roadmap audit rides the same commit (GM: "done items can retire"): retired outright -- the SPA-vs-bridge and voice-examples decisions (long resolved) and steal items #1 , #3 , #4 , #8 , #11 (done, or in #8 's case never work -- the housekeeper model is per-run selection, built); retired with tombstones -- the multiuser section (built 2026-11-14, the rulings live in DECISIONS #22-31 and README, the lifecycle tail kept visible) and the SPA v1 section (all four phases done, the API sketch superseded by README's living API docs, the substrate doctrine in README), with the one unbuilt design it held -- the turn-surgery saga rule -- surviving as its own bullet cross-referenced at steal #2 ; amended in place, dated -- seed.json (dead, successors named: the authored carryover and memory.json), turn-0.md (dead: her authored opening turn), the upstream model listing (never queried in play since discovery), the delta-tag transport (the full-block protocol, the sheet named), the service step (multiuser built, hosting remains), the carryover editor (the raw file-editor surface exists, the purpose-built UI stays deferred); kept -- the operator's queue, the landscape and receipts, the live constraints, the open steals with numbering preserved so cross-references resolve, the deferred tasks, the distant points, the rejections, the notes. 582 lines to 338; the first deletion pass duplicated the steal-list header and the verification re-read caught it
2026-11-17 22:35:44 +00:00
ok ( 'the story strips the verbs' , storyPlayer . every (( t ) => ! /<\/?(lost|gained|add|drop|mind|status|agenda|model|sheet)>/ . test ( t )), '' );
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'the story carries no variant syntax' , storyPlayer . every (( t ) => ! /<\/?variants?>/ . test ( t )), '' );
ok ( 'the story strips the rides from GM prose' , r . data . sessions . every (( s ) => s . turns . every (( t ) => t . who !== 'gm' || ! /<\/?(status|agenda)>/ . test ( t . text ))), '' );
// the re-run: a fresh pass, rebased -- never double-applying
await stopAndSettle ( 're-run housekeeping (session 1)' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'still dormant, still ready' , r . data . phase === 'dormant' && r . data . sessions === 2 && r . data . ready === true );
r = await call ( `/runs/ ${ runId } ` , { token : op });
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
ok ( 'the rebase kept the rings single-applied' , r . data . fill . b === 2 && r . data . fill . a === 5 , JSON . stringify ( r . data . fill )); // 4 packaged + 1 draft edit + 1 inserted, once
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// start session 2: the carry lands behind the bundle
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
ok ( 'start session 2' , r . status === 200 && r . data . session === 2 && r . data . autoSend === false , r . data . error ?? JSON . stringify ( r . data ));
r = await call ( `/runs/ ${ runId } /table` , { token : op });
ok ( 'the carry landed behind the bundle' , r . data . entries . some (( e ) => e . t === 'bundle' && e . part === 'ring-a' )
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
&& r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /breathes until the numbers behave/ . test ( e . m . content ?? '' )));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
ok ( 'the frozen bundle is session 2\'s own' , r . data . entries . some (( e ) => e . t === 'bundle' ) && r . data . session === 2 );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'her agenda carried across the stop' , r . data . agenda . includes ( 'climb the ridge' ), JSON . stringify ( r . data . agenda ));
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*She wakes on the sand.*' } });
ok ( 'session 2 plays on' , r . status === 200 && !! r . data . player , r . data . error ?? '' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
// her last stated mind, unconsumed in the carried log, rode that turn
r = await call ( `/runs/ ${ runId } /session` , { token : op });
const s2Reply = [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && e . m . role === 'assistant' );
ok ( 'an unconsumed mind carries across the session boundary' ,
s2Reply ? . via ? . params ? . temperature === 1.2 , JSON . stringify ( s2Reply ? . via ?? null ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// 18. the auto-send rule: stop again, hand-append a GM turn to the
// carryover (the future editor's one edit), start -- the turn fires
await stopAndSettle ( 'stop (session 2)' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'session 3 dormant' , r . data . phase === 'dormant' && r . data . sessions === 3 );
appendFileSync ( ` ${ ROOT } /runs/ ${ runId } /sessions/3/carryover.jsonl` ,
JSON . stringify ({ t : 'msg' , m : { role : 'user' , content : '*A sail on the horizon.*' } }) + '\n' );
r = await call ( `/runs/ ${ runId } /carryover` , { token : op });
ok ( 'the carryover now ends on a GM turn' , r . data . ends === 'gm' , r . data . ends ?? 'none' );
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
ok ( 'start auto-sends the GM-ending carryover' , r . status === 200 && r . data . autoSend === true && !! r . data . player ,
r . data . error ?? JSON . stringify ({ autoSend : r . data . autoSend , player : r . data . player ? . slice ( 0 , 40 ) }));
r = await call ( `/runs/ ${ runId } /session` , { token : op });
ok ( 'her reply answered the carried cue' , [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && ! e . reminder ) ? . m ? . role === 'assistant' );
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00
const s3Reply = [... r . data . entries ]. reverse (). find (( e ) => e . t === 'msg' && e . m . role === 'assistant' );
ok ( 'the mind is one-shot (spent by the turn that rode it)' ,
s3Reply ? . via ? . params ? . temperature === undefined , JSON . stringify ( s3Reply ? . via ?? null ));
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
// 19. the start lint: a malformed carryover refuses, nothing starts
await stopAndSettle ( 'stop (session 3)' );
writeFileSync ( ` ${ ROOT } /runs/ ${ runId } /sessions/4/carryover.jsonl` ,
JSON . stringify ({ t : 'tool' , m : { role : 'tool' , tool_call_id : 'x' , content : 'nope' } }) + '\n' );
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
ok ( 'the start refuses an orphaned tool event' , r . status === 422 && /conversation events only|orphaned tool result/ . test ( r . data . detail ? . errors ? . join ( ' ' ) ?? r . data . error ?? '' ),
JSON . stringify ( r . data . detail ? . errors ?? r . data . error ));
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'nothing started' , r . data . phase === 'dormant' && r . data . session === null );
// 20. the deliberate-skip override: session 4 is ready, but flip it
// back by hand and the guard demands the override
const s4meta = ` ${ ROOT } /runs/ ${ runId } /sessions/4/session.json` ;
writeFileSync ( s4meta , JSON . stringify ({ phase : 'dormant' , ready : false }, null , 2 ) + '\n' );
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
ok ( 'the unhousekept guard refuses' , r . status === 409 && /never housekept/ . test ( r . data . error ) && !! r . data . detail ? . hint , r . data . error ?? '' );
writeFileSync ( s4meta , JSON . stringify ({ phase : 'dormant' , ready : true }, null , 2 ) + '\n' );
writeFileSync ( ` ${ ROOT } /runs/ ${ runId } /sessions/4/carryover.jsonl` ,
JSON . stringify ({ t : 'msg' , m : { role : 'assistant' , content : '*She watches the sail.*' } }) + '\n' );
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
ok ( 'start session 4 after the fix' , r . status === 200 && r . data . session === 4 , r . data . error ?? '' );
// 21. save-package is a draft act: a played run refuses
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 ?? '' );
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
2026-11-15 23:45:15 +00:00
// 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 ));
2026-11-19 09:56:56 +00:00
// 23. the sheet (developer, 2026-11-17): the GM's ledger of arbitrated run
the sheet round: the GM's ledger of arbitrated run state -- the second state channel, split from status and agenda by truth model (GM, 2026-11-17). The rulings first: status and agenda are narrative self-report (their truth is "she said so", the scan caches her latest words); the sheet is actual run state (its truth is "the GM set so", the record IS the truth event -- nothing cached from anyone's words). The override channel promoted to a standing section, and that precedent decided the presentation: the sheet renders as its OWN authoritative system chunk at the freshest end, never a canon-point stamp, which would read as her words -- the same reason the override composes as hers and the sheet never does. Schemaless JSON in the tag (the mind-verb philosophy: the substrate teaches the channel, the package teaches the vocabulary -- the invariants rule the GM wrote is one universal paragraph with deliberately non-box examples, clothes and grades, and the propose-additions line as her schema-evolution channel); details learnt in-place; NO package gating -- the channel is universal and "optional, if given" makes the invariant forward-compatible in every bundle that never sets one. The build: a sheet record rides the GM turn like the override (readSheet: object-ness is the route's only law, 400 loud on arrays and scalars, nothing appended; OOC turns refuse it exactly like block edits); scanState derives newest-wins whole-set -- an absent key drops, never keeps, and {} is a live empty ledger (a truthy check, never falsy); the boundary state note carries it across stops and the dormant read path serves it; renderView appends the chunk once per assembly so one live copy holds by construction; the guard is the <model> sibling (an emitted <sheet> conflicts with "the GM's ledger -- propose changes in prose", healed in-turn, cap 3, and her emission never applies -- the scan holds the GM's record); every strip surface learned the tag (the view's STRIP_HERS, the story's verbs, the table's chip regex -- the standing grep-every-strip-list lesson, applied); and the web gains sheetEditor, the paneEditor's JSON sibling in widgets.mjs (same stage/pending/discard pattern, bad JSON refuses at the stage), the third pane in the aside, the send attaching body.sheet, and [sheet] machinery lines on both table and raw walks. The mock's sheet-guard branch is CUE-KEYED, not position-keyed: the carried tail shifts the script's counts (session 4's log starts the script over -- the battery's first attempt landed on the ask position and crashed renderView on the unpaired call; the battery now answers the script ask and moves on), while a marked GM turn is immune to every shift -- mockModel reads the view, the marked turn earns the emission, the conflict it earns earns the plain-prose heal. check-reminder is sheet-aware (the chunk is a legitimate third system surface; the count and freshest-end assertions tolerate exactly one, and the freshest-end check now allows her latest reply and/or the chunk to follow the reminder). Verified: smoke ALL PASS with +15 sheet assertions (newest-wins, whole-set semantics, the chunk one-live-copy -- ANCHORED with startsWith because the invariants bundle itself mentions the tag and a bare regex matches it twice, an honest test bug caught by an honest test), the guard's conflict and heal with her emission kept verbatim in the raw log and never applied, the view and story strips, the empty ledger rendering its chunk, the boundary note carrying the sheet, the dormant read deriving it, and session 5 deriving it from the carried note end to end), restart + reminder checks green, typecheck green on both programs, check-repo clean (it caught the round's own prose twice: "window" is a retired term in README, the contwin vocabulary wins), and a browser pass over the pane end to end with zero console errors -- staging, the pending marker, the ride, the scan re-render, and both machinery lines on the table. Docs: README's protocol passage carries the sheet with the numbers-live-on-the-sheet line (prose numbers die with the contwin; sheet numbers ride the scan forever) -- NOT in the memory tiers table, where the first draft wrongly put it (the GM's ruling: the sheet belongs in neither memories nor records); the identity tier lost its loose "character sheet" name now that the term is technical; DICTIONARY gains the sheet entry with the history line (dice retired into variant literature, sheets arrived as the state machinery -- the tabletop metaphor completing while its realism stays advisory, players hold their own pencils in the real thing and we don't, for drift); ROADMAP parks the bookkeeper extension (the housekeeper's arithmetic sibling: reads the setting's rules prose and the latest turns, computes the ledger delta from a purchase in her prose, lands it as a STAGED edit -- applied on the GM's next turn or discarded; sheet-only authority, curator fallback, per-package opt-in because an agent cannot bookkeep what is not arithmetic). The GM's prompt-side edits ride the same commit: invariants' "Character's sheet" section (the universal rule, the trailing-clause flag taken in review), the reminder's inventory line gaining "the sheet (optional)", and la caramba's gm.md lore updates. The box package (the first consumer) and detention stay untracked WIP, untouched. The 2026-11-17 roadmap audit rides the same commit (GM: "done items can retire"): retired outright -- the SPA-vs-bridge and voice-examples decisions (long resolved) and steal items #1 , #3 , #4 , #8 , #11 (done, or in #8 's case never work -- the housekeeper model is per-run selection, built); retired with tombstones -- the multiuser section (built 2026-11-14, the rulings live in DECISIONS #22-31 and README, the lifecycle tail kept visible) and the SPA v1 section (all four phases done, the API sketch superseded by README's living API docs, the substrate doctrine in README), with the one unbuilt design it held -- the turn-surgery saga rule -- surviving as its own bullet cross-referenced at steal #2 ; amended in place, dated -- seed.json (dead, successors named: the authored carryover and memory.json), turn-0.md (dead: her authored opening turn), the upstream model listing (never queried in play since discovery), the delta-tag transport (the full-block protocol, the sheet named), the service step (multiuser built, hosting remains), the carryover editor (the raw file-editor surface exists, the purpose-built UI stays deferred); kept -- the operator's queue, the landscape and receipts, the live constraints, the open steals with numbering preserved so cross-references resolve, the deferred tasks, the distant points, the rejections, the notes. 582 lines to 338; the first deletion pass duplicated the steal-list header and the verification re-read caught it
2026-11-17 22:35:44 +00:00
// state -- records ride GM turns newest-wins, render as their own
// authoritative chunk (never a stamp at her canon point), cross the
// boundary on the state note, and stay read-only for her (the guard)
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*The ledger opens.*' , sheet : { gp : 10 , bp : 0 } } });
ok ( 'a turn with a sheet record sends' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'the scan derives the sheet newest-wins' , JSON . stringify ( r . data . sheet ) === '{"gp":10,"bp":0}' , JSON . stringify ( r . data . sheet ));
// session 4's log starts the script over, so this turn lands on the
// script's ask position -- answer it, then the view asserts (pairing
// must be whole for renderView)
if ( r . data . pendingAsk ) {
2026-11-18 17:24:37 +00:00
const preAsk = await call ( `/runs/ ${ runId } /session` , { token : op });
r = await call ( `/runs/ ${ runId } /ask` , { method : 'POST' , token : op , body : { answer : 'clear enough' , expect : preAsk . data . entries . length } });
ok ( 'the sheet battery answers the script ask (a fresh expect passes)' , r . status === 200 , r . data . error ?? '' );
the sheet round: the GM's ledger of arbitrated run state -- the second state channel, split from status and agenda by truth model (GM, 2026-11-17). The rulings first: status and agenda are narrative self-report (their truth is "she said so", the scan caches her latest words); the sheet is actual run state (its truth is "the GM set so", the record IS the truth event -- nothing cached from anyone's words). The override channel promoted to a standing section, and that precedent decided the presentation: the sheet renders as its OWN authoritative system chunk at the freshest end, never a canon-point stamp, which would read as her words -- the same reason the override composes as hers and the sheet never does. Schemaless JSON in the tag (the mind-verb philosophy: the substrate teaches the channel, the package teaches the vocabulary -- the invariants rule the GM wrote is one universal paragraph with deliberately non-box examples, clothes and grades, and the propose-additions line as her schema-evolution channel); details learnt in-place; NO package gating -- the channel is universal and "optional, if given" makes the invariant forward-compatible in every bundle that never sets one. The build: a sheet record rides the GM turn like the override (readSheet: object-ness is the route's only law, 400 loud on arrays and scalars, nothing appended; OOC turns refuse it exactly like block edits); scanState derives newest-wins whole-set -- an absent key drops, never keeps, and {} is a live empty ledger (a truthy check, never falsy); the boundary state note carries it across stops and the dormant read path serves it; renderView appends the chunk once per assembly so one live copy holds by construction; the guard is the <model> sibling (an emitted <sheet> conflicts with "the GM's ledger -- propose changes in prose", healed in-turn, cap 3, and her emission never applies -- the scan holds the GM's record); every strip surface learned the tag (the view's STRIP_HERS, the story's verbs, the table's chip regex -- the standing grep-every-strip-list lesson, applied); and the web gains sheetEditor, the paneEditor's JSON sibling in widgets.mjs (same stage/pending/discard pattern, bad JSON refuses at the stage), the third pane in the aside, the send attaching body.sheet, and [sheet] machinery lines on both table and raw walks. The mock's sheet-guard branch is CUE-KEYED, not position-keyed: the carried tail shifts the script's counts (session 4's log starts the script over -- the battery's first attempt landed on the ask position and crashed renderView on the unpaired call; the battery now answers the script ask and moves on), while a marked GM turn is immune to every shift -- mockModel reads the view, the marked turn earns the emission, the conflict it earns earns the plain-prose heal. check-reminder is sheet-aware (the chunk is a legitimate third system surface; the count and freshest-end assertions tolerate exactly one, and the freshest-end check now allows her latest reply and/or the chunk to follow the reminder). Verified: smoke ALL PASS with +15 sheet assertions (newest-wins, whole-set semantics, the chunk one-live-copy -- ANCHORED with startsWith because the invariants bundle itself mentions the tag and a bare regex matches it twice, an honest test bug caught by an honest test), the guard's conflict and heal with her emission kept verbatim in the raw log and never applied, the view and story strips, the empty ledger rendering its chunk, the boundary note carrying the sheet, the dormant read deriving it, and session 5 deriving it from the carried note end to end), restart + reminder checks green, typecheck green on both programs, check-repo clean (it caught the round's own prose twice: "window" is a retired term in README, the contwin vocabulary wins), and a browser pass over the pane end to end with zero console errors -- staging, the pending marker, the ride, the scan re-render, and both machinery lines on the table. Docs: README's protocol passage carries the sheet with the numbers-live-on-the-sheet line (prose numbers die with the contwin; sheet numbers ride the scan forever) -- NOT in the memory tiers table, where the first draft wrongly put it (the GM's ruling: the sheet belongs in neither memories nor records); the identity tier lost its loose "character sheet" name now that the term is technical; DICTIONARY gains the sheet entry with the history line (dice retired into variant literature, sheets arrived as the state machinery -- the tabletop metaphor completing while its realism stays advisory, players hold their own pencils in the real thing and we don't, for drift); ROADMAP parks the bookkeeper extension (the housekeeper's arithmetic sibling: reads the setting's rules prose and the latest turns, computes the ledger delta from a purchase in her prose, lands it as a STAGED edit -- applied on the GM's next turn or discarded; sheet-only authority, curator fallback, per-package opt-in because an agent cannot bookkeep what is not arithmetic). The GM's prompt-side edits ride the same commit: invariants' "Character's sheet" section (the universal rule, the trailing-clause flag taken in review), the reminder's inventory line gaining "the sheet (optional)", and la caramba's gm.md lore updates. The box package (the first consumer) and detention stay untracked WIP, untouched. The 2026-11-17 roadmap audit rides the same commit (GM: "done items can retire"): retired outright -- the SPA-vs-bridge and voice-examples decisions (long resolved) and steal items #1 , #3 , #4 , #8 , #11 (done, or in #8 's case never work -- the housekeeper model is per-run selection, built); retired with tombstones -- the multiuser section (built 2026-11-14, the rulings live in DECISIONS #22-31 and README, the lifecycle tail kept visible) and the SPA v1 section (all four phases done, the API sketch superseded by README's living API docs, the substrate doctrine in README), with the one unbuilt design it held -- the turn-surgery saga rule -- surviving as its own bullet cross-referenced at steal #2 ; amended in place, dated -- seed.json (dead, successors named: the authored carryover and memory.json), turn-0.md (dead: her authored opening turn), the upstream model listing (never queried in play since discovery), the delta-tag transport (the full-block protocol, the sheet named), the service step (multiuser built, hosting remains), the carryover editor (the raw file-editor surface exists, the purpose-built UI stays deferred); kept -- the operator's queue, the landscape and receipts, the live constraints, the open steals with numbering preserved so cross-references resolve, the deferred tasks, the distant points, the rejections, the notes. 582 lines to 338; the first deletion pass duplicated the steal-list header and the verification re-read caught it
2026-11-17 22:35:44 +00:00
}
{
const view = renderView ({ lines : jsonl ( runId , 4 , 'log.jsonl' ), pendingAsk : null });
const chunk = [... view ]. reverse (). find (( m ) => m . role === 'system' && /<sheet>/ . test ( String ( m . content )));
ok ( 'the sheet renders as its own authoritative chunk at the freshest end' ,
!! chunk && chunk . content === '<sheet>{"gp":10,"bp":0}</sheet>' , chunk ? . content ?? 'no chunk' );
ok ( 'the sheet chunk is the one live copy' ,
view . filter (( m ) => m . role === 'system' && String ( m . content ?? '' ). startsWith ( '<sheet>' )). length === 1 , '' );
}
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*The ledger moves.*' , sheet : { gp : 7 } } });
ok ( 'a second sheet record sends' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'a sheet record is a whole set (absent key dropped, never kept)' , JSON . stringify ( r . data . sheet ) === '{"gp":7}' , JSON . stringify ( r . data . sheet ));
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '( ooc sheet test' , sheet : { gp : 1 } } });
ok ( 'a sheet record cannot ride an OOC turn' , r . status === 400 && /OOC/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*No ledger here.*' , sheet : 'not an object' } });
ok ( 'a malformed sheet refuses the turn' , r . status === 400 && /JSON object/ . test ( r . data . error ), r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'the refused turns landed nothing (the sheet stands)' , JSON . stringify ( r . data . sheet ) === '{"gp":7}' , JSON . stringify ( r . data . sheet ));
// the guard: she emits a <sheet> -- display-only, the conflict points
// at prose, the heal completes the turn, and her emission never applies
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*She eyes the floating numbers.*' } });
ok ( 'the sheet-guard turn completes via the heal' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /session` , { token : op });
ok ( 'an emitted <sheet> conflicts with the pointer at prose' ,
r . data . entries . some (( e ) => e . t === 'msg' && e . conflictOnly && /GM's ledger -- propose changes in prose/ . test ( String ( e . m . content ?? '' ))),
'no conflict found' );
ok ( 'the log keeps her emitted sheet verbatim (the raw surface)' ,
r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'assistant' && /<sheet>\{"gp": 99\}<\/sheet>/ . test ( String ( e . m . content ?? '' ))), 'her emission was rewritten' );
ok ( 'her emitted sheet never applies (the scan holds the GM\'s record)' ,
JSON . stringify (( await call ( `/runs/ ${ runId } ` , { token : op })). data . sheet ) === '{"gp":7}' , '' );
{
const view = renderView ({ lines : jsonl ( runId , 4 , 'log.jsonl' ), pendingAsk : null });
ok ( 'the view strips her emitted sheet (the chunk alone carries it)' ,
view . every (( m ) => m . role !== 'assistant' || ! /<sheet>/ . test ( String ( m . content ?? '' ))), 'her emission rode the view' );
2026-11-18 17:24:37 +00:00
const sheetConf = view . find (( m ) => m . role === 'user' && /GM's ledger/ . test ( String ( m . content ?? '' )));
ok ( 'the sheet guard quotes her emission (self-contained)' ,
!! sheetConf && /yours said: \{"gp": 99\}/ . test ( String ( sheetConf ? . content ?? '' )), String ( sheetConf ? . content ?? 'no conflict in the view' ));
the sheet round: the GM's ledger of arbitrated run state -- the second state channel, split from status and agenda by truth model (GM, 2026-11-17). The rulings first: status and agenda are narrative self-report (their truth is "she said so", the scan caches her latest words); the sheet is actual run state (its truth is "the GM set so", the record IS the truth event -- nothing cached from anyone's words). The override channel promoted to a standing section, and that precedent decided the presentation: the sheet renders as its OWN authoritative system chunk at the freshest end, never a canon-point stamp, which would read as her words -- the same reason the override composes as hers and the sheet never does. Schemaless JSON in the tag (the mind-verb philosophy: the substrate teaches the channel, the package teaches the vocabulary -- the invariants rule the GM wrote is one universal paragraph with deliberately non-box examples, clothes and grades, and the propose-additions line as her schema-evolution channel); details learnt in-place; NO package gating -- the channel is universal and "optional, if given" makes the invariant forward-compatible in every bundle that never sets one. The build: a sheet record rides the GM turn like the override (readSheet: object-ness is the route's only law, 400 loud on arrays and scalars, nothing appended; OOC turns refuse it exactly like block edits); scanState derives newest-wins whole-set -- an absent key drops, never keeps, and {} is a live empty ledger (a truthy check, never falsy); the boundary state note carries it across stops and the dormant read path serves it; renderView appends the chunk once per assembly so one live copy holds by construction; the guard is the <model> sibling (an emitted <sheet> conflicts with "the GM's ledger -- propose changes in prose", healed in-turn, cap 3, and her emission never applies -- the scan holds the GM's record); every strip surface learned the tag (the view's STRIP_HERS, the story's verbs, the table's chip regex -- the standing grep-every-strip-list lesson, applied); and the web gains sheetEditor, the paneEditor's JSON sibling in widgets.mjs (same stage/pending/discard pattern, bad JSON refuses at the stage), the third pane in the aside, the send attaching body.sheet, and [sheet] machinery lines on both table and raw walks. The mock's sheet-guard branch is CUE-KEYED, not position-keyed: the carried tail shifts the script's counts (session 4's log starts the script over -- the battery's first attempt landed on the ask position and crashed renderView on the unpaired call; the battery now answers the script ask and moves on), while a marked GM turn is immune to every shift -- mockModel reads the view, the marked turn earns the emission, the conflict it earns earns the plain-prose heal. check-reminder is sheet-aware (the chunk is a legitimate third system surface; the count and freshest-end assertions tolerate exactly one, and the freshest-end check now allows her latest reply and/or the chunk to follow the reminder). Verified: smoke ALL PASS with +15 sheet assertions (newest-wins, whole-set semantics, the chunk one-live-copy -- ANCHORED with startsWith because the invariants bundle itself mentions the tag and a bare regex matches it twice, an honest test bug caught by an honest test), the guard's conflict and heal with her emission kept verbatim in the raw log and never applied, the view and story strips, the empty ledger rendering its chunk, the boundary note carrying the sheet, the dormant read deriving it, and session 5 deriving it from the carried note end to end), restart + reminder checks green, typecheck green on both programs, check-repo clean (it caught the round's own prose twice: "window" is a retired term in README, the contwin vocabulary wins), and a browser pass over the pane end to end with zero console errors -- staging, the pending marker, the ride, the scan re-render, and both machinery lines on the table. Docs: README's protocol passage carries the sheet with the numbers-live-on-the-sheet line (prose numbers die with the contwin; sheet numbers ride the scan forever) -- NOT in the memory tiers table, where the first draft wrongly put it (the GM's ruling: the sheet belongs in neither memories nor records); the identity tier lost its loose "character sheet" name now that the term is technical; DICTIONARY gains the sheet entry with the history line (dice retired into variant literature, sheets arrived as the state machinery -- the tabletop metaphor completing while its realism stays advisory, players hold their own pencils in the real thing and we don't, for drift); ROADMAP parks the bookkeeper extension (the housekeeper's arithmetic sibling: reads the setting's rules prose and the latest turns, computes the ledger delta from a purchase in her prose, lands it as a STAGED edit -- applied on the GM's next turn or discarded; sheet-only authority, curator fallback, per-package opt-in because an agent cannot bookkeep what is not arithmetic). The GM's prompt-side edits ride the same commit: invariants' "Character's sheet" section (the universal rule, the trailing-clause flag taken in review), the reminder's inventory line gaining "the sheet (optional)", and la caramba's gm.md lore updates. The box package (the first consumer) and detention stay untracked WIP, untouched. The 2026-11-17 roadmap audit rides the same commit (GM: "done items can retire"): retired outright -- the SPA-vs-bridge and voice-examples decisions (long resolved) and steal items #1 , #3 , #4 , #8 , #11 (done, or in #8 's case never work -- the housekeeper model is per-run selection, built); retired with tombstones -- the multiuser section (built 2026-11-14, the rulings live in DECISIONS #22-31 and README, the lifecycle tail kept visible) and the SPA v1 section (all four phases done, the API sketch superseded by README's living API docs, the substrate doctrine in README), with the one unbuilt design it held -- the turn-surgery saga rule -- surviving as its own bullet cross-referenced at steal #2 ; amended in place, dated -- seed.json (dead, successors named: the authored carryover and memory.json), turn-0.md (dead: her authored opening turn), the upstream model listing (never queried in play since discovery), the delta-tag transport (the full-block protocol, the sheet named), the service step (multiuser built, hosting remains), the carryover editor (the raw file-editor surface exists, the purpose-built UI stays deferred); kept -- the operator's queue, the landscape and receipts, the live constraints, the open steals with numbering preserved so cross-references resolve, the deferred tasks, the distant points, the rejections, the notes. 582 lines to 338; the first deletion pass duplicated the steal-list header and the verification re-read caught it
2026-11-17 22:35:44 +00:00
}
r = await call ( `/runs/ ${ runId } /story` , { token : op });
ok ( 'the story strips her emitted sheet' ,
r . data . sessions . every (( s ) => s . turns . every (( t ) => ! /<\/?sheet>/ . test ( t . text ))), 'leaked into the story' );
// the empty ledger is live, not absent: {} renders its chunk
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*The ledger empties.*' , sheet : {} } });
ok ( 'an empty sheet record sends (a deliberate empty ledger)' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'the empty ledger derives as itself' , JSON . stringify ( r . data . sheet ) === '{}' , JSON . stringify ( r . data . sheet ));
{
const view = renderView ({ lines : jsonl ( runId , 4 , 'log.jsonl' ), pendingAsk : null });
const chunk = [... view ]. reverse (). find (( m ) => m . role === 'system' && /<sheet>/ . test ( String ( m . content )));
ok ( 'the empty ledger renders its chunk' , chunk ? . content === '<sheet>{}</sheet>' , chunk ? . content ?? 'no chunk' );
}
// the boundary: the note carries the sheet, the new session derives it
await stopAndSettle ( 'stop (session 4)' );
{
const carry5 = jsonl ( runId , 5 , 'carryover.jsonl' );
ok ( 'the boundary note carries the sheet' , carry5 [ 0 ] ? . t === 'note' && carry5 [ 0 ] ? . kind === 'state' && JSON . stringify ( carry5 [ 0 ] ? . sheet ) === '{}' , JSON . stringify ( carry5 [ 0 ] ?? null ));
}
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'the dormant read derives the sheet (the note is the live edge)' , JSON . stringify ( r . data . sheet ) === '{}' , JSON . stringify ( r . data . sheet ));
r = await call ( `/runs/ ${ runId } /sessions` , { method : 'POST' , token : op , body : {} });
ok ( 'start session 5' , r . status === 200 && r . data . session === 5 && r . data . autoSend === false , r . data . error ?? JSON . stringify ( r . data ));
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'the sheet crossed the boundary (the note feeds the new session\'s scan)' , JSON . stringify ( r . data . sheet ) === '{}' , JSON . stringify ( r . data . sheet ));
{
const view = renderView ({ lines : jsonl ( runId , 5 , 'log.jsonl' ), pendingAsk : null });
const chunk = [... view ]. reverse (). find (( m ) => m . role === 'system' && /<sheet>/ . test ( String ( m . content )));
ok ( 'session 5 renders the sheet chunk from the carried note' , chunk ? . content === '<sheet>{}</sheet>' , chunk ? . content ?? 'no chunk' );
}
2026-11-19 09:56:56 +00:00
// 23b. the sheet's transport at the lint (the box round, developer, 2026-11-19):
2026-11-19 08:35:23 +00:00
// the record is the only channel, the tag is view machinery -- the
// authored gate names every wrong shape, the boundary note is checked
// on both kinds, and her carried emission stays legitimate history
{
const la = ( a ) => lintCarryover ( a , { authored : true });
ok ( 'lint: a scalar sheet record is named' , la ([
{ t : 'msg' , m : { role : 'assistant' , content : 'x' } },
{ t : 'msg' , m : { role : 'user' , content : 'y' }, sheet : 'nope' },
]). some (( e ) => e . includes ( 'sheet record must be a JSON object' )), '' );
ok ( 'lint: an array sheet record is named' , la ([
{ t : 'msg' , m : { role : 'assistant' , content : 'x' } },
{ t : 'msg' , m : { role : 'user' , content : 'y' }, sheet : [ 'nope' ] },
]). some (( e ) => e . includes ( 'sheet record must be a JSON object' )), '' );
ok ( 'lint: a sheet record on her turn is named' , la ([
{ t : 'msg' , m : { role : 'assistant' , content : 'x' }, sheet : {} },
]). some (( e ) => e . includes ( 'rides GM turns only' )), '' );
ok ( 'lint: the tag in her authored turn is named' , la ([
{ t : 'msg' , m : { role : 'assistant' , content : 'x <sheet>{}</sheet>' } },
]). some (( e ) => e . includes ( 'never authored' )), '' );
ok ( 'lint: the tag in GM prose is named' , la ([
{ t : 'msg' , m : { role : 'assistant' , content : 'x' } },
{ t : 'msg' , m : { role : 'user' , content : 'y <sheet>{}</sheet>' } },
]). some (( e ) => e . includes ( 'never authored' )), '' );
ok ( 'lint: a good sheet record passes clean' , la ([
{ t : 'msg' , m : { role : 'assistant' , content : 'x' } },
{ t : 'msg' , m : { role : 'user' , content : 'y' }, sheet : { GP : 0 } },
]). length === 0 , '' );
ok ( 'lint: a scalar sheet on a boundary note is named (both kinds)' , lintCarryover ([
{ t : 'note' , kind : 'state' , status : [], sheet : 7 },
], { authored : false }). some (( e ) => e . includes ( 'state.sheet must be a JSON object' )), '' );
ok ( 'lint: her emitted sheet in a carried tail is legitimate history' , lintCarryover ([
{ t : 'msg' , m : { role : 'user' , content : 'y' } },
{ t : 'msg' , m : { role : 'assistant' , content : 'x <sheet>{"gp": 99}</sheet>' } },
], { authored : false }). length === 0 , '' );
}
2026-11-19 09:56:56 +00:00
// 24. the rewind (developer, 2026-11-17): the GM's take-back. The send that
2026-11-18 17:24:37 +00:00
// carries rewind replaces the target GM turn -- the target and
// everything after it leave the log (physical truncation; fork is the
// preservation story). The floor is the start marker (the frozen
// opening), and every send guards against a stale view via expect.
{
// the floor marker rides session 5's log, after the carry
const s5 = jsonl ( runId , 5 , 'log.jsonl' );
const marker = s5 . map (( e , i ) => ( e . t === 'note' && e . kind === 'start' ? i : - 1 )). filter (( i ) => i >= 0 ). pop ();
ok ( 'the start marker rides the log (the rewind floor)' , marker != null && marker >= 0 , String ( marker ?? 'none' ));
// two turns with ledger records: the rewind will revert the second
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*Rewind battery one.*' , sheet : { rb : 1 } } });
ok ( 'rewind battery: turn one sends' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*Rewind battery two.*' , sheet : { rb : 2 } } });
ok ( 'rewind battery: turn two sends' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( 'rewind battery: the second record leads' , JSON . stringify ( r . data . sheet ) === '{"rb":2}' , JSON . stringify ( r . data . sheet ));
const now = await call ( `/runs/ ${ runId } /session` , { token : op });
const len = now . data . entries . length ;
const target = now . data . entries . findIndex (( e ) => e . t === 'msg' && e . m . role === 'user' && ! e . conflictOnly && /Rewind battery one\./ . test ( String ( e . m . content ?? '' )));
ok ( 'the target GM turn is addressed by log index' , target >= 0 , String ( target ));
// the staleness guard: a wrong expect refuses before anything rides
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*Stale.*' , expect : len - 1 } });
ok ( 'a stale expect refuses the send' , r . status === 409 && /stale/ . test ( r . data . error ), r . data . error ?? '' );
// her turn is not a valid target
const herIdx = now . data . entries . map (( e , i ) => ( e . t === 'msg' && e . m . role === 'assistant' && ! e . m . tool_calls ? . length ? i : - 1 )). filter (( i ) => i >= 0 ). pop ();
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*No.*' , rewind : herIdx , expect : len } });
ok ( 'her turn is not a rewind target' , r . status === 400 && /your turns/ . test ( r . data . error ), r . data . error ?? '' );
// the frozen opening: a carried GM turn (above the marker) refuses
const carriedGm = now . data . entries . findIndex (( e , i ) => e . t === 'msg' && e . m . role === 'user' && ! e . conflictOnly && i < ( marker ?? 0 ));
ok ( 'the battery found a carried GM turn above the floor' , carriedGm >= 0 , 'none before the marker' );
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*No.*' , rewind : carriedGm , expect : len } });
ok ( 'the frozen opening refuses the rewind' , r . status === 400 && /frozen/ . test ( r . data . error ), r . data . error ?? '' );
// the refusals landed nothing
r = await call ( `/runs/ ${ runId } /session` , { token : op });
ok ( 'the refused rewinds touched nothing' , r . data . entries . length === len , ` ${ len } -> ${ r . data . entries . length } ` );
// the rewind send itself: the edited turn replaces its target, the
// ledger record restated as part of the rewrite
r = await call ( `/runs/ ${ runId } /turn` , { method : 'POST' , token : op , body : { line : '*Rewind battery one, edited.*' , sheet : { rb : 1 }, rewind : target , expect : len } });
ok ( 'the rewind send lands' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ runId } /session` , { token : op });
ok ( 'the log truncated (the target replaced, everything after it gone)' ,
r . data . entries . some (( e ) => e . t === 'msg' && e . m . role === 'user' && /Rewind battery one, edited/ . test ( String ( e . m . content ?? '' )))
&& r . data . entries . every (( e ) => ! /Rewind battery (one\.|two)/ . test ( JSON . stringify ( e )))
&& r . data . entries . length < len ,
` ${ len } -> ${ r . data . entries . length } ` );
ok ( 'the marker survives the cut (the floor holds)' , r . data . entries . some (( e ) => e . t === 'note' && e . kind === 'start' ), '' );
r = await call ( `/runs/ ${ runId } ` , { token : op });
ok ( "the dead range's records re-derive away (the sheet reverts)" , JSON . stringify ( r . data . sheet ) === '{"rb":1}' , JSON . stringify ( r . data . sheet ));
r = await call ( `/runs/ ${ runId } /story` , { token : op });
ok ( 'the story drops the cut range' , r . data . sessions . every (( s ) => s . turns . every (( t ) => ! /Rewind battery two/ . test ( t . text ))), 'the dropped prose survived in the story' );
}
2026-11-19 09:56:56 +00:00
// 24b. invalidation and the removal guard (developer, 2026-11-18): a run's
2026-11-19 08:35:23 +00:00
// picks are settings the run came with -- when the server stops
// carrying them (the provider removed), the run blocks until the GM
// sets them up again; and the o/f singleton is removable only while
// another provider stands in its place (the empty list is an error
// state; the fallback is what keeps it unreachable)
{
// a custom provider, a run riding it
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-c' , baseUrl : 'https://mock.c.example/v1' } });
ok ( 'a custom provider adds and discovers' , r . status === 200 && r . data . models > 0 , JSON . stringify ( r . data ));
2026-11-19 09:56:56 +00:00
// the failures-never-cache rule (developer, 2026-11-19): a failure is the
2026-11-19 08:35:23 +00:00
// absence of a measurement, not a measurement -- mock-fail lands
// its verdict fresh at every refine, while the passing models
// persist from the cache
r = await call ( '/providers/mock-c/default' , { method : 'POST' , token : op , body : { model : 'mock' , effort : 'max' } });
ok ( 'the custom provider selects its curator' , r . status === 200 , r . data . error ?? '' );
r = await call ( '/providers/mock-c/refine' , { method : 'POST' , token : op , body : {} });
ok ( 'the custom provider refines' , r . status === 200 , r . data . error ?? '' );
let jobCC = null ;
for ( let i = 0 ; i < 40 ; i ++ ) {
r = await call ( '/models' , { token : op });
jobCC = ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-c' ) ? . job ?? null ;
if ( jobCC ? . state !== 'running' ) break ;
await new Promise (( res ) => setTimeout ( res , 100 ));
}
ok ( 'the mock-c refine applied' , jobCC ? . state === 'applied' , JSON . stringify ( jobCC ? . reason ?? null ));
ok ( 'the failing model landed its verdict with the no-cache marker' ,
( jobCC ? . lines ?? []). some (( l ) => l . includes ( 'mock-fail: failed the tool probe' ) && l . includes ( 'never cached' )),
JSON . stringify ( jobCC ? . lines ?? null ));
const cacheFail = JSON . parse ( readFileSync ( ` ${ ROOT } /state/refine-cache.json` , 'utf8' ));
ok ( 'the failure is absent from the cache' ,
! Object . keys ( cacheFail . entries ?? {}). some (( k ) => k . startsWith ( 'mock-c::mock-fail::' )),
JSON . stringify ( Object . keys ( cacheFail . entries ?? {}). filter (( k ) => k . startsWith ( 'mock-c::' ))));
r = await call ( '/providers/mock-c/refine' , { method : 'POST' , token : op , body : {} });
ok ( 'the re-refine starts' , r . status === 200 , r . data . error ?? '' );
for ( let i = 0 ; i < 40 ; i ++ ) {
r = await call ( '/models' , { token : op });
jobCC = ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-c' ) ? . job ?? null ;
if ( jobCC ? . state !== 'running' ) break ;
await new Promise (( res ) => setTimeout ( res , 100 ));
}
ok ( 'the re-refine re-probed the failure (never from cache)' ,
( jobCC ? . lines ?? []). some (( l ) => l . includes ( 'mock-fail: failed the tool probe' ))
&& ! ( jobCC ? . lines ?? []). some (( l ) => l . includes ( 'mock-fail: from cache' )),
JSON . stringify ( jobCC ? . lines ?? null ));
ok ( 'the passing models served from cache on the re-refine' ,
( jobCC ? . lines ?? []). filter (( l ) => l . includes ( 'from cache' )). length === 3 ,
JSON . stringify ( jobCC ? . lines ?? null ));
const failRun = await call ( '/runs' , { method : 'POST' , token : op , body : { package : 'la-caramba' , pc : 'Failcheck' , name : 'Fail Check' , spec : { provider : 'mock-c' , model : 'mock-fail' , effort : 'max' } } });
ok ( 'the failing model is not selectable (the registry gates it)' , failRun . status === 400 , 'a failed model was selectable' );
if ( failRun . status === 200 ) await call ( `/runs/ ${ failRun . data . run . id } ` , { method : 'DELETE' , token : op , body : {} }); // never expected -- the backstop
r = await call ( '/runs' , { token : op });
ok ( 'the refused create left no orphan run (validate before anything lands)' , ! ( r . data ?? []). some (( x ) => x . pc === 'Failcheck' ), 'an orphan dir survived the refusal' );
r = await call ( `/runs/ ${ reforkId } /model` , { method : 'POST' , token : op , body : { player : { provider : 'mock-c' , model : 'mock' , effort : 'high' } } });
ok ( 'the refork re-picks onto the custom provider' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ reforkId } /turn` , { method : 'POST' , token : op , body : { line : '*Riding the custom provider.*' } });
ok ( 'the turn rides the custom provider' , r . status === 200 , r . data . error ?? '' );
// the removal: the run invalidates, loudly, on every surface
r = await call ( '/providers/mock-c' , { method : 'DELETE' , token : op , body : {} });
ok ( 'the custom provider removes' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ reforkId } ` , { token : op });
ok ( 'the run\'s health carries the note (the invalidation surface)' ,
r . data . run . modelState ? . player ? . ok === false && /no longer configured/ . test ( r . data . run . modelState . player . note ?? '' ),
JSON . stringify ( r . data . run . modelState ?? null ));
r = await call ( `/runs/ ${ reforkId } /turn` , { method : 'POST' , token : op , body : { line : '*No.*' } });
ok ( 'the send refuses with the same note' , r . status === 409 && /no longer configured/ . test ( r . data . error ), r . data . error ?? '' );
const goneFile = JSON . parse ( readFileSync ( ` ${ ROOT } /state/models.json` , 'utf8' ));
ok ( 'the provider\'s registry section went with it' , goneFile . providers ? .[ 'mock-c' ] === undefined , JSON . stringify ( Object . keys ( goneFile . providers ?? {})));
const goneCache = JSON . parse ( readFileSync ( ` ${ ROOT } /state/refine-cache.json` , 'utf8' ));
ok ( 'the provider\'s cache entries went with it' , ! Object . keys ( goneCache . entries ?? {}). some (( k ) => k . startsWith ( 'mock-c::' )), JSON . stringify ( Object . keys ( goneCache . entries ?? {})));
// the GM sets it up again: the run unblocks
r = await call ( `/runs/ ${ reforkId } /model` , { method : 'POST' , token : op , body : { player : { provider : 'mock-a' , model : 'mock' , effort : 'max' } } });
ok ( 'the re-pick lands' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/runs/ ${ reforkId } /turn` , { method : 'POST' , token : op , body : { line : '*Back on the stand-ins.*' } });
ok ( 'the run plays again after the re-pick' , r . status === 200 , r . data . error ?? '' );
// the removal guard: pare down to the singleton, then it holds
r = await call ( '/providers/mock-b' , { method : 'DELETE' , token : op , body : {} });
ok ( 'mock-b removes (a stand-in, not the fallback)' , r . status === 200 , r . data . error ?? '' );
r = await call ( '/providers/mock-a' , { method : 'DELETE' , token : op , body : {} });
ok ( 'mock-a removes' , r . status === 200 , r . data . error ?? '' );
r = await call ( `/providers/ ${ encodeURIComponent ( 'opencode/free' ) } ` , { method : 'DELETE' , token : op , body : {} });
ok ( 'the singleton holds while it is all that stands' , r . status === 409 && /fallback/ . test ( r . data . error ), r . data . error ?? '' );
// restore the mock world for the restart checks: re-add, rediscover,
// re-select, re-refine (fresh -- the cache purged with the provider)
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-a' , baseUrl : 'https://mock.a.example/v1' } });
ok ( 'mock-a re-adds' , r . status === 200 , r . data . error ?? '' );
r = await call ( '/providers' , { method : 'POST' , token : op , body : { slug : 'mock-b' , baseUrl : 'https://mock.b.example/v1' } });
ok ( 'mock-b re-adds' , r . status === 200 , r . data . error ?? '' );
r = await call ( '/providers/mock-a/default' , { method : 'POST' , token : op , body : { model : 'mock' , effort : 'max' } });
ok ( 'mock-a re-selects' , r . status === 200 , r . data . error ?? '' );
r = await call ( '/providers/mock-b/default' , { method : 'POST' , token : op , body : { model : 'mock-cheap' , effort : 'high' } });
ok ( 'mock-b re-selects' , r . status === 200 , r . data . error ?? '' );
r = await call ( '/providers/mock-a/refine' , { method : 'POST' , token : op , body : {} });
ok ( 'mock-a re-refines (fresh probes -- the cache purged)' , r . status === 200 , r . data . error ?? '' );
let jobR = null ;
for ( let i = 0 ; i < 40 ; i ++ ) {
r = await call ( '/models' , { token : op });
jobR = ( r . data . providers ?? []). find (( p ) => p . slug === 'mock-a' ) ? . job ?? null ;
if ( jobR ? . state !== 'running' ) break ;
await new Promise (( res ) => setTimeout ( res , 100 ));
}
ok ( 'the restored world refined' , jobR ? . state === 'applied' , JSON . stringify ( jobR ?? null ));
}
2026-11-18 17:24:37 +00:00
console . log ( `\nrun ids: source= ${ runId } draft= ${ draftId } fork= ${ forkId } second= ${ secondId } refork= ${ reforkId } ` );
2026-11-14 23:48:27 +00:00
writeFileSync ( TOKEN_FILE , ` ${ op } ${ reforkId } ${ secondId } ` );
console . log ( failures ? `\n ${ failures } FAILURES` : '\nALL PASS' );
process . exit ( failures ? 1 : 0 );