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
This commit is contained in:
+52
-18
@@ -20,13 +20,24 @@ export {};
|
||||
/** A chat message exactly as it rides the wire (OpenAI-compatible). */
|
||||
/** @typedef {{ role: Role, content: ?string, tool_calls?: ToolCall[], reasoning_content?: string }} WireMessage */
|
||||
|
||||
/** Token usage, as the provider reports it and the log records it. */
|
||||
/** @typedef {{ prompt_tokens: number, completion_tokens: number }} Usage */
|
||||
/** Token usage, as the provider reports it and the log records it.
|
||||
* completion_tokens_details carries the reasoning split when the
|
||||
* provider states it (the discovery battery measures it). */
|
||||
/** @typedef {{ prompt_tokens: number, completion_tokens: number, completion_tokens_details?: { reasoning_tokens?: ?number } }} Usage */
|
||||
|
||||
/** msg: one recorded turn (m is exactly what the wire carried). The
|
||||
* reminder and conflictOnly flags are the only server-side marks --
|
||||
* everything else about a turn lives in its content. */
|
||||
/** @typedef {{ t: 'msg', m: WireMessage, reminder?: boolean, conflictOnly?: boolean, usage?: Usage }} MsgEvent */
|
||||
* everything else about a turn lives in its content. via is the
|
||||
* request record: the resolved model and the effective params (the
|
||||
* merged layer actually sent) -- model-facing surfaces never render
|
||||
* it, the raw surfaces always do. */
|
||||
/** @typedef {{ t: 'msg', m: WireMessage, reminder?: boolean, conflictOnly?: boolean, usage?: Usage, via?: { model: string, params: RoleParams } }} MsgEvent */
|
||||
|
||||
/** req: a failed provider request -- the resolved model, the
|
||||
* effective params, and the failure. No message resulted (the turn
|
||||
* fails loud, the retry is the user's); this is the record of what
|
||||
* was attempted, surfaced on the raw surfaces like a note. */
|
||||
/** @typedef {{ t: 'req', model: string, params: RoleParams, fail: string }} ReqEvent */
|
||||
|
||||
/** tool: a tool result, paired to its call (pairing is a context
|
||||
* invariant, checked at render). */
|
||||
@@ -34,14 +45,15 @@ export {};
|
||||
|
||||
/** note: the machine's own annotations -- never shown to the model,
|
||||
* rendered as garnish in the SPA. Historical logs carry older kind
|
||||
* names from before renames; readers must not assume this union is
|
||||
* exhaustive. */
|
||||
* names and the delta-shaped fields from before the full-block
|
||||
* protocol; readers must not assume this union is exhaustive. */
|
||||
/** @typedef {{ t: 'note', kind: 'session', n: number }} SessionNote */
|
||||
/** @typedef {{ t: 'note', kind: 'ask', question: string }} AskNote */
|
||||
/** @typedef {{ t: 'note', kind: 'pick', chosen: number, count: number }} PickNote */
|
||||
/** @typedef {{ t: 'note', kind: 'status', applied: { lost: string[], gained: string[] }, conflicts?: string[] }} StatusNote */
|
||||
/** @typedef {{ t: 'note', kind: 'agenda', applied: { added: string[], dropped: string[], evicted: string[] }, conflicts?: string[] }} AgendaNote */
|
||||
/** @typedef {SessionNote|AskNote|PickNote|StatusNote|AgendaNote} NoteEvent */
|
||||
/** @typedef {{ t: 'note', kind: 'status', applied?: { lost: string[], gained: string[] }, set?: string[], conflicts?: string[] }} StatusNote */
|
||||
/** @typedef {{ t: 'note', kind: 'agenda', applied?: { added: string[], dropped: string[], evicted: string[] }, set?: string[], evicted?: string[], conflicts?: string[] }} AgendaNote */
|
||||
/** @typedef {{ t: 'note', kind: 'mind', params: RoleParams }} MindNote */
|
||||
/** @typedef {SessionNote|AskNote|PickNote|StatusNote|AgendaNote|MindNote} NoteEvent */
|
||||
|
||||
/** bundle: one frozen prompt part (system, backdrop, character, rings). */
|
||||
/** @typedef {{ t: 'bundle', m: { role: 'user'|'system', content: string }, part: string }} BundleEvent */
|
||||
@@ -50,17 +62,37 @@ export {};
|
||||
/** @typedef {{ t: 'opening', status: string[] }} OpeningEvent */
|
||||
|
||||
/** Any line of a session log or carryover, in either direction. */
|
||||
/** @typedef {MsgEvent|ToolEvent|NoteEvent|BundleEvent|OpeningEvent} LogEvent */
|
||||
/** @typedef {MsgEvent|ToolEvent|NoteEvent|BundleEvent|OpeningEvent|ReqEvent} LogEvent */
|
||||
|
||||
/** The pending ask, held on the session object while a turn waits. */
|
||||
/** @typedef {{ callId: string, question: string, calls: ToolCall[] }} PendingAsk */
|
||||
|
||||
/** A live session: the log in memory, its derived state, the appender.
|
||||
* The log is the truth; everything on this object is rebuilt from it. */
|
||||
/** @typedef {{ runId: string, n: number, stamp: string, file: string, lines: LogEvent[], pendingAsk: ?PendingAsk, usage: ?{ promptTokens: number, completionTokens: number }, append: (entry: LogEvent) => void }} LiveSession */
|
||||
* The log is the truth; everything on this object is rebuilt from it.
|
||||
* mind is the one-shot mind layer (the <mind> verb): the params her
|
||||
* NEXT turn rides at, cleared when that turn completes -- derived
|
||||
* from the last mind note, so a restart mid-window loses nothing. */
|
||||
/** @typedef {{ runId: string, n: number, stamp: string, file: string, lines: LogEvent[], pendingAsk: ?PendingAsk, mind: ?RoleParams, usage: ?{ promptTokens: number, completionTokens: number }, append: (entry: LogEvent) => void }} LiveSession */
|
||||
|
||||
/** run.json: lineage, ownership, per-run model overrides. */
|
||||
/** @typedef {{ package: string, created: string, owner?: ?string, forked?: number, models?: { player?: ?string, housekeeper?: ?string } }} RunMeta */
|
||||
/** run.json: lineage, ownership, per-run model overrides and knobs. */
|
||||
/** @typedef {{ package: string, created?: string, owner?: ?string, forked?: number, models?: { player?: ?string, housekeeper?: ?string }, params?: { player?: ?RoleParams, housekeeper?: ?RoleParams } }} RunMeta */
|
||||
|
||||
/** The named sampling knobs, per role -- the well-known, widely
|
||||
* supported set. Numbers ride the wire verbatim; null clears. */
|
||||
/** @typedef {{ temperature?: number, top_p?: number, top_k?: number, repetition_penalty?: number, max_tokens?: number }} RoleParams */
|
||||
|
||||
/** One model of the discovered registry. Preliminary entries carry
|
||||
* the scrape only (status unrefined); refined entries carry the
|
||||
* battery's verdicts and the curator's presentation. think is the
|
||||
* battery's best measured thinking-token count -- the pick rule
|
||||
* ranks on it (the bucket is display). */
|
||||
/** @typedef {{ id: string, input: ?number, output: ?number, status?: 'unrefined', inference?: boolean, fail?: string, think?: ?number, reasoning?: 'off'|'low'|'standard'|'deep'|null, offSwitch?: Record<string, unknown>|null, latency?: ?number, family?: ?string, label?: ?string, description?: ?string, roles?: { player: boolean, housekeeper: boolean } }} RegistryModel */
|
||||
|
||||
/** state/models.json: the deployment's model registry -- the truth of
|
||||
* what is selectable. Written by discovery (the scrape) and refine
|
||||
* (the battery + the curator pass); read by the selectors, the model
|
||||
* routes, and the turn loop. */
|
||||
/** @typedef {{ phase: 'preliminary'|'refined', endpoint: ?string, discovered: string, refined: ?string, defaults: { player: ?string, housekeeper: ?string }, models: RegistryModel[], curator?: string }} ModelRegistry */
|
||||
|
||||
/** settings.json: identity (pc/name are the @ sigils), declared vars,
|
||||
* the records flag. */
|
||||
@@ -73,8 +105,9 @@ export {};
|
||||
/** @typedef {{ type: string, label: string, detail: string }} RecordOp */
|
||||
/** @typedef {{ session: string, summary: string, insert?: InsertOp[], touch?: RefOp[], promote?: RefOp[], demote?: RefOp[], reword?: RewordOp[], delete?: RefOp[], archive?: RefOp[], record?: RecordOp[], inventions?: string[], open_questions?: string[] }} Manifest */
|
||||
|
||||
/** The housekeeping job state (GET /housekeeping). */
|
||||
/** @typedef {{ state: 'idle'|'running'|'applied'|'pending'|'rejected', phase?: 'stop'|'rerun', session?: number, target?: number, started?: string, stopped?: boolean, manifest?: string, reason?: string }} JobState */
|
||||
/** The housekeeping job state (GET /housekeeping); discovery's refine
|
||||
* job reuses the shape under its own map key. */
|
||||
/** @typedef {{ state: 'idle'|'running'|'applied'|'pending'|'rejected', phase?: 'stop'|'rerun'|'refine', session?: number, target?: number, started?: string, stopped?: boolean, manifest?: string, reason?: string }} JobState */
|
||||
|
||||
/** The clerk boundary's result: exit code plus separated streams. */
|
||||
/** @typedef {{ code: number, out: string, err: string }} ClerkResult */
|
||||
@@ -100,8 +133,9 @@ export {};
|
||||
/** The provider client (provider.mjs's own return type). */
|
||||
/** @typedef {ReturnType<typeof import('./provider.mjs').makeProvider>} Provider */
|
||||
|
||||
/** server.json as parsed. */
|
||||
/** @typedef {{ bind?: string, port?: number, endpoint?: { baseUrl?: string, apiKey?: string, apiKeyEnv?: string }, models: { player?: ?string, housekeeper?: ?string }, contwin?: number, contextWindow?: number, params?: Record<string, unknown> }} ServerCfg */
|
||||
/** server.json as parsed. params is per-role sampling knobs -- the
|
||||
* deployment-default layer the run's own params override. */
|
||||
/** @typedef {{ bind?: string, port?: number, endpoint?: { baseUrl?: string, apiKey?: string, apiKeyEnv?: string }, models: { player?: ?string, housekeeper?: ?string }, contwin?: number, contextWindow?: number, params?: { player?: RoleParams, housekeeper?: RoleParams } }} ServerCfg */
|
||||
|
||||
/** The server context: the one object threaded through every module.
|
||||
* locks/enqueue are the per-run activity lock (main.mjs). */
|
||||
|
||||
Reference in New Issue
Block a user