the provider round and the provider-flow round, plus the template and box packages
the provider round (2026-11-18, batteries-included): providers are first-class entities, the config is server-written state (state/config.json), and a fresh clone boots playable -- the opencode/free singleton auto-added and discovered on the empty list, playable with zero secrets. Every request resolves a full spec {provider, model, effort}: no unset effort, the per-run params layer retired, the mind verb the only sampling source. The registry is per-provider sections (state/models.json), refine caches adjudications under the double spec tuple (state/refine-cache.json), run picks are invalidatable (a removed provider or drifted model blocks the run with the note naming what died), and the housekeeper inherits the player spec's provider default (#16 closed). The no-legacy pass died the same day it shipped: bootImport deleted (server.json is bind + contwin), the registry's v1/v2 in-memory migrations deleted (models.json rewritten on disk into the per-provider shape), bare-string model picks deleted (Chloe's run.json migrated to spec objects, shape-preserving), the clerk's create model arg deleted, apiKeyEnv and the contextWindow alias gone. The live arc proven from a bare boot: invite minted, o/f auto-added, a custom provider with a bogus key (the recognizable 401), the auth fixed (13 models), the default pair selected, and a real glm-5.3 turn through the full path. Two live findings: opencode.ai serves 89 models keyless but 401s an empty Bearer header (the auth header rides only when a key exists), and the failure log line rides stderr.
the provider-flow round (2026-11-19, GM-designed): discovery IS the probe. The add takes only the endpoint -- {slug, baseUrl} or {builtin: true}, an apiKey in the body 400s (the auth route is the only key path) -- and a working keyless listing never sees a key field. A 401/403 stands the provider broken: the entity carries a probe record (outcome ok/auth/error, detail, at), the card opens the ask, and only the explicit acts move the record -- add, key, remove-key, discover; usage errors are transient and the op's to fix, nothing in the runtime flips provider state. The auth route is probe-then-save: the candidate key checks on reception, saves only on success -- a still-refused key never reaches the config, the previous state returns, the ask repeats. Every other discovery failure refuses the add outright with rollback: an endpoint that cannot answer is not a provider, nothing stands (the old code let it stand on any failure). The remove-key control (custom providers, armed) clears and re-probes: a provider gone public lands working keyless, a locked one re-opens the ask -- which is the key-replacement path. o/f never asks in any state: its auth failures are upstream breakage to show, not a prompt. The universal retry rule: NO automatic retries anywhere -- every inference call is user-initiated (the send, the housekeeping run, the refine) and every act has its manual retry; the curator's one auto-retry (the 2026-11-17 hiccup lesson) is deleted, the machine-label fallback the designed outcome. And failures never cache (GM: a failure is the absence of a measurement, not a measurement) -- the adjudication cache skips inference:false entries, the receipt line says "never cached, retried at every refine", and a transient battery error can never pin a false verdict; gev's 400s cost one cheap probe per refine and self-heal the day the backend learns tools. En-route fix the smoke earned: the create route validated body.spec AFTER the clerk built the run dir -- a refused spec left an orphan run (restart-check's exact count caught the sixth run); the spec validates first now, nothing lands on refusal.
the sheet's transport at the lint: the record is the only channel, the tag is view machinery composed by renderView, never authored by anyone -- the authored gate names the tag in any content (hers would never apply and primes the guarded emission; GM prose rides the view and story raw, the GM-side strips do not know it), names a sheet record on her turn, and checks object-ness on GM-turn records and boundary state notes both kinds; her emitted sheet in a carried tail stays legitimate history (the log keeps guard-conflicted emissions verbatim, and a stop can move one into the slidwin). The carryover editor teaches its own format now: a per-file hint between the editor and the save bar (one JSON object per line; status and agenda ride her turns; the sheet rides yours as the "sheet" field, never as a tag; the sigils and $VARS expand at start on the authored opening only).
the packages: template (the base for new packages -- the mood-indexed voice examples, the settings comment convention, non-playable as-is) and box (the sheet's first consumer: an incremental-game economy as ERP, GP and BP as two currencies with the room pushing her to fund her own punishments; the opening turn third-person per the typography ruling, ending on the display that needs a second read; the amnesiac rings empty by design; the erased name reading "(redacted)" after sigil expansion). The review found and fixed: both carryovers were pretty-printed JSON with duplicate keys -- unstartable under every per-line reader, flattened to true JSONL; the box's opening sheet rode her authored prose -- dead on every surface (the scan reads GM-turn records only, the strips eat it) and priming the exact emission the guard conflicts -- moved to the GM turn's sheet record, the override's shape; the gm.md "take of leave" typo fixed in all three packages.
the lint's rule 4 scoped to the substrate (GM, 2026-11-19): a banned word in a package's prose is fine -- the packages are the fiction and their words are the story's; README and the root prompts stay patrolled, and the box's "Or windows" is an architectural plural in a padded cell.
verified: typecheck green both programs; smoke ALL PASS (+27 the provider-flow battery: apiKey-on-add 400, the dead-endpoint refusal with config rollback, the auth-standing card with its probe record, probe-then-save both ways, the remove-key round trip, the o/f guards, the failures-never-cache proof over mock-fail -- verdict with the marker, absent from the cache file, re-probed fresh while the passing three serve from cache, not selectable, no orphan run; +8 the sheet-transport lint battery); restart + reminder checks green; a browser pass driving the whole add-flow machine on a mock+debug server (the hidden key field opening on the 401, the key landing through the auth route, the remove-key round trip re-opening the ask, the dead add refusing with the banner and no card, zero console errors beyond the expected 401/500 resource lines); check-repo clean with the box's windows. detention stays untracked WIP, untouched.
This commit is contained in:
+77
-36
@@ -30,17 +30,20 @@ export {};
|
||||
* 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. override is the GM's block edit,
|
||||
* arriving with a non-OOC GM turn: the log's record of it. The
|
||||
* composition overwrites her newest blocks with these values (the
|
||||
* scan reads it newest-wins); the log itself never changes. */
|
||||
/** @typedef {{ t: 'msg', m: WireMessage, reminder?: boolean, conflictOnly?: boolean, usage?: Usage, via?: { model: string, params: RoleParams }, override?: { status?: string[], agenda?: string[] }, sheet?: Record<string, unknown> }} MsgEvent */
|
||||
* it, the raw surfaces always do. via.model is the bare model id;
|
||||
* via.provider names the route (absent in pre-spec logs). override
|
||||
* is the GM's block edit, arriving with a non-OOC GM turn: the log's
|
||||
* record of it. The composition overwrites her newest blocks with
|
||||
* these values (the scan reads it newest-wins); the log itself never
|
||||
* changes. */
|
||||
/** @typedef {{ t: 'msg', m: WireMessage, reminder?: boolean, conflictOnly?: boolean, usage?: Usage, via?: { model: string, provider?: string, params: RoleParams }, override?: { status?: string[], agenda?: string[] }, sheet?: Record<string, unknown> }} 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 */
|
||||
/** req: a failed provider request -- the resolved model (and its
|
||||
* provider route), 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, provider?: string, params: RoleParams, fail: string }} ReqEvent */
|
||||
|
||||
/** tool: a tool result, paired to its call (pairing is a context
|
||||
* invariant, checked at render). */
|
||||
@@ -92,32 +95,56 @@ export {};
|
||||
/** The turn meter's live record: what the streaming callback knows. `phase` is what is arriving now; `started` is the provider call's epoch ms. */
|
||||
/** @typedef {{ phase: 'thinking'|'prose', thinking: number, prose: number, started: number }} TurnProgress */
|
||||
|
||||
/** 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 */
|
||||
/** One model spec: the complete inference request identity (GM,
|
||||
* 2026-11-18) -- which provider routes it, the model id, and the
|
||||
* reasoning effort, all three required (there is no unset effort:
|
||||
* it substantially changes inference quality, so it is a property
|
||||
* of the model pick, never a free-floating knob). The fourth spec
|
||||
* member, sampling params, is optional and never stored: the <mind>
|
||||
* verb sets it for one specific turn. */
|
||||
/** @typedef {{ provider: string, model: string, effort: string }} ModelSpec */
|
||||
|
||||
/** The named sampling knobs, per role -- the well-known, widely
|
||||
* supported set, plus the reasoning-effort enum (GM, 2026-11-16:
|
||||
* first-class, hidden from the model -- not her call). Numbers ride
|
||||
* the wire verbatim; null clears; reasoning_effort is one of the
|
||||
* effort ladder's levels. */
|
||||
/** run.json: lineage, ownership, and the run's model picks -- full
|
||||
* specs, per role. (The retired per-run params layer is gone
|
||||
* entirely, GM, 2026-11-18: params are per-turn via <mind>, and the
|
||||
* no-legacy rule migrated the last carrier away.) */
|
||||
/** @typedef {{ package: string, created?: string, owner?: ?string, forked?: number, models?: { player?: ?ModelSpec, housekeeper?: ?ModelSpec } }} RunMeta */
|
||||
|
||||
/** The named sampling knobs -- the <mind> verb's four (hers to set
|
||||
* for one turn), plus the wire-side extras the substrate itself
|
||||
* rides: reasoning_effort always comes from the model spec, never
|
||||
* the mind layer (hidden from the model, not her call). Numbers
|
||||
* ride the wire verbatim. */
|
||||
/** @typedef {{ temperature?: number, top_p?: number, top_k?: number, repetition_penalty?: number, max_tokens?: number, reasoning_effort?: string }} 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). efforts is the
|
||||
* reasoning-effort probe: the measured mean thinking per level of
|
||||
* the ladder; effortDefault is the level with the highest observed
|
||||
* mean (GM, 2026-11-16: maximum thinking by default, overridable)
|
||||
* -- null when the model shows no thinking or no level moved it. */
|
||||
/** One model of a discovered provider's registry section. Preliminary
|
||||
* entries carry the scrape only (status unrefined); refined entries
|
||||
* carry the battery's verdicts and the curator's presentation. The
|
||||
* section key is the provider slug -- no routing tag needed, the
|
||||
* section names the route. think is the battery's best measured
|
||||
* thinking-token count. efforts is the reasoning-effort probe: the
|
||||
* measured mean thinking per level of the ladder; effortDefault is
|
||||
* the level with the highest observed mean -- pre-fill and hint
|
||||
* only (GM, 2026-11-18: with effort a property of the pick, nothing
|
||||
* rides implicitly anymore; it pre-selects the selection prompt's
|
||||
* dropdown and informs the curator's recommendation, no more). */
|
||||
/** @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, efforts?: ?Record<string, number>, effortDefault?: ?string, 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 */
|
||||
/** One provider's registry section (state/models.json): written by
|
||||
* that provider's discovery and refine alone, deletable whole on
|
||||
* provider removal. recommendation is the curator's overall-best
|
||||
* {model, effort} -- intel only, shown post-refine, applied by the
|
||||
* op's click, never auto-landed and never deterministic on a bad
|
||||
* model day (GM, 2026-11-18: on a bad day the op gets no advice,
|
||||
* not machine advice). */
|
||||
/** @typedef {{ phase: 'preliminary'|'refined', discovered: string, refined: ?string, models: RegistryModel[], curator?: ?string, recommendation?: ?{ model: string, effort: string } }} RegistrySection */
|
||||
|
||||
/** state/models.json: the per-provider registry -- the truth of what
|
||||
* is selectable, one section per configured provider slug. A
|
||||
* provider absent from the config has no section (removal deletes
|
||||
* it); a provider not yet discovered has none either. The singular
|
||||
* and flat-vector era shapes migrate in memory on open. */
|
||||
/** @typedef {{ providers: Record<string, RegistrySection> }} ModelRegistry
|
||||
|
||||
/** settings.json: identity (pc/name are the @ sigils), declared vars,
|
||||
* the records flag. */
|
||||
@@ -158,10 +185,24 @@ export {};
|
||||
/** The provider client (provider.mjs's own return type). */
|
||||
/** @typedef {ReturnType<typeof import('./provider.mjs').makeProvider>} Provider */
|
||||
|
||||
/** 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 */
|
||||
/** One configured provider: a slug, a baseUrl, optional auth, and
|
||||
* the op's default model spec for it ({model, effort} -- params are
|
||||
* per-turn via <mind>, never in the provider default). The
|
||||
* opencode/free singleton is this shape with the slug and baseUrl
|
||||
* fixed and auth structurally absent. */
|
||||
/** @typedef {{ slug: string, baseUrl: string, apiKey?: string, default?: ?{ model: string, effort: string }, probe?: ?{ outcome: 'ok' | 'auth' | 'error', detail: string, at: string } }} ProviderCfg */
|
||||
|
||||
/** state/config.json: the deployment's provider entities -- server
|
||||
* written only (the SPA is the surface, zero hand edits). */
|
||||
/** @typedef {{ providers: ProviderCfg[] }} DeployCfg */
|
||||
|
||||
/** server.json as parsed -- the static, non-secret remainder of the
|
||||
* old config: bind and contwin. */
|
||||
/** @typedef {{ bind?: string, port?: number, contwin?: number }} ServerCfg */
|
||||
|
||||
/** The server context: the one object threaded through every module.
|
||||
* locks/enqueue are the per-run activity lock (main.mjs). */
|
||||
/** @typedef {{ mock: boolean, cfg: ServerCfg, provider: Provider, sessions: Map<string, LiveSession>, jobs: Map<string, JobState>, runMeta: (runId: string) => ?RunMeta, locks: Map<string, Promise<void>>, enqueue: <T>(runId: string, fn: () => Promise<T>) => Promise<T> }} Ctx */
|
||||
* locks/enqueue are the per-run activity lock (main.mjs). providers
|
||||
* is the provider clients keyed by slug (the config's truth,
|
||||
* rebuilt on every config mutation); providerCfg is the config
|
||||
* itself. */
|
||||
/** @typedef {{ mock: boolean, cfg: ServerCfg, providerCfg: DeployCfg, providers: Map<string, Provider>, sessions: Map<string, LiveSession>, jobs: Map<string, JobState>, runMeta: (runId: string) => ?RunMeta, locks: Map<string, Promise<void>>, enqueue: <T>(runId: string, fn: () => Promise<T>) => Promise<T> }} Ctx */
|
||||
|
||||
Reference in New Issue
Block a user