the roles inventory: every human and inferencer seat named, the vocabulary swept, and the duties audit

the inventory (GM-designed in conversation, 2026-11-19): six human roles -- the developer (maintains the repo, and is the system packages author by consequence: system packages ship in the repo), the deployment operator (maintains a deployment: identities, providers, the registry; filesystem access as recovery; never a reader of runs' private surfaces -- owner-gating holds even against the superuser), the deployment user (any claimed identity; the only reach is the API -- no filesystem, no keys, ever), the package author (an off-platform seat: authorship travels with the files, the machinery sees only the publisher), a run's GM (maintains a run they own -- the same person the machinery records as the run's owner, one role two names, never split; the fork creates a second GM seat over a branching canon), and the reader (defined by the act, membership-free: on-platform any signed-in user, off-platform anyone the story text reaches). The inferencer roles: the assistant, the player, the housekeeper, the curator, the clerk (code, never a model), and the bookkeeper (parked). The example that pinned the mappings: Alice the op forking Bob's Faye into her Kate (hats stack, seats don't), Charlie authoring package files Bob publishes (the author-publisher split), Dave reading the exported story with no invite at all (the reader needs nothing).

the naming convention, stated in AGENTS's header and DICTIONARY both: "GM" always means a run's GM, everywhere; ruling attributions name the developer; the assistant is the assistant; the op stays the op. The role line that is never crossed (developer, 2026-11-19): the assistant is NOT the player -- player-facing instructions are for the assistant to understand how the player would interpret them, never to follow. The root prompts and every model-facing string were already correct (GM there was always the run's GM) and are untouched; the packages' fiction is exempt from the term lint (rule 4 scopes to the substrate: README and the root prompts); the records keep their day's words -- DECISIONS gained one dated header note mapping the old usage instead of a rewrite ("GM" in a ruling attribution is the developer, "the agent" is the assistant).

the sweep: 125+ ruling attributions rewritten across living prose and code comments in every spelling the repo used (paren-wrapped, date-first, mid-sentence, line-wrapped); AGENTS.md fully re-voiced (the header rewritten, "the agent" gone, the developer-meaning prose fixed line by line); README's "invited players" became "invited users"; the gm.md carve-out made precise everywhere (the file is the run's GM's private file, the flagging target is the developer, the non-editor is the assistant).

the word retirements, both lint-banned in rule 4 exactly like "window": "agent" (the word did too many jobs at once; every seat is named; the filename AGENTS.md consumed as-is, "Windows" the OS the precedent) and "LLM" (the class word is "inferencer(s)"; "model" kept as the machinery's noun -- a registry entry, never a seat: a model is what the registry lists, an inferencer is who a seat is). The fixes the bans forced: the exposure rule's "internal agents" -> "internal inferencers", the hypothetical "status-keeper agent" -> invocation, the bookkeeper shed its "agent" tag, "player-model" fell to "the player" everywhere including housekeeper.md's one prompt hit, README's "inference key" and its Roles section re-voiced, the #22 attribution comments at the three call sites, and the runtime log markers renamed (llm -> inferencer, a meaning-preserving log rename under the no-legacy rule). DICTIONARY's renames section carries both retirement entries.

the duties audit (along the what-hats-do lines: the developer maintains the repo, the op maintains a deployment, a user's only reach is the API, a run's GM maintains their run). Found and fixed: README's Housekeeping section was pre-split era text -- "every housekeeping pass should end in a commit" and "confess in the commit message" (runs/ is gitignored; the developer's commit duty was assigned to the run flow), the dead packages/<story>/dumps and packages/<story>/db paths (the dump is per-session under runs/<id>/sessions/<n>/), "canon/ stays committed", and "single-human" (multiuser since 2026-11-14) -- rewritten to the current paths with the audit's hat named: the dump cross-check is the operator side's, a run's GM reviews a pass through the server (the housekeeping log, the rendered rings, the story). The CLI-attributed-to-the-GM lines now say what they are: deployment-side filesystem reach, --gm-authorized writes, whoever's hand runs it (the protocol passage, quickstart step 7 -- which also dropped its "commit" -- and the booting intro now names its hat switches: the author's files, the deployment-side create with its API twin named, the GM's start). "The host" -> "the op" in the pitch. One mechanical fiction PARKED on the ROADMAP deferred list instead of fixed: the memory tiers table promises records access "none -- until the GM unlocks it in the story", but no channel exists (records is a creation-time settings bool, settings.json is read-only in the file API) -- build the channel or fix the promise, later. Verified consistent by the audit: the notepad (ONE notepad -- the run's gm.md, owner-writable through its route, seeded from the package copy), the op's non-reader boundary, every provider act, the spec attributions, the reader, the prompts.

verified: typecheck green both programs, check-repo ALL CLEAN with both new bans active, the ban regexes proven by direct test (agent/agents/multi-agent and LLM/LLMs caught; AGENTS.md and the assistant pass), and final greps confirming every remaining "GM" is a protocol term and every remaining "agent"/"LLM" is a quoting entry or a record's day-words. The developer's own edits ride along: the operator queue strike (the inventory line done, the loopback typo, "external sec review"), and the handoff prepared -- the queue renumbered, the fresh-run item's garbled line repaired, the commit count brought current (seven await the push), template and box marked committed, a stray paragraph break fixed. detention stays untracked WIP, untouched.
This commit is contained in:
2026-11-19 09:56:56 +00:00
parent e60fd63d2b
commit ccdd9ea129
28 changed files with 529 additions and 285 deletions
+1 -1
View File
@@ -190,7 +190,7 @@ const RECORD_TOOLS = [
/** @param {string} runId @returns {import('./shapes.mjs').ToolDef[]} */
export function toolList(runId) {
// Records are OFF for now (GM, 2026-11-17): their verbs mutate the
// Records are OFF for now (developer, 2026-11-17): their verbs mutate the
// session db, and a rewind does not compensate db state -- until the
// verbs are rewind-compatible the manifest carries ask_gm alone,
// whatever the run's settings say. The CLI's --gm path is
+1 -1
View File
@@ -39,7 +39,7 @@ function visibleBytes(lines, eff, i) {
return String(e.m.content ?? '').replace(STRIP_BLOCKS, '').length;
}
if (e.m.role === 'user') {
// conflict traffic stays in the contwin (GM, 2026-11-18) -- a
// conflict traffic stays in the contwin (developer, 2026-11-18) -- a
// carried conflict renders in the new session, so it costs like
// the prose it now is
return String(e.m.content ?? '').length;
+12 -12
View File
@@ -1,7 +1,7 @@
// server/discovery.mjs -- model discovery: the per-provider registry.
//
// Two steps, both op acts from the SPA's admin block, both per
// provider (GM, 2026-11-18):
// provider (developer, 2026-11-18):
// - discover: scrape one provider's surface (GET /models) -- API
// metadata only, zero inference. Writes that provider's registry
// section, resetting it to preliminary; the other sections are
@@ -75,7 +75,7 @@ function bucket(tokens) {
* configured provider slug. A provider absent from the config has
* no section (removal deletes it); a provider not yet discovered
* has none either. No legacy shapes are read (the no-legacy rule,
* GM, 2026-11-18): shape changes come with one-time migrations of
* developer, 2026-11-18): shape changes come with one-time migrations of
* the file, not permanent tolerance in the reader.
* @returns {?ModelRegistry} */
export function registry() {
@@ -220,7 +220,7 @@ async function thinkingTokens(ctx, slug, id, params) {
* (two samples, the battery's granularity). The default is the
* level with the highest observed mean -- `none` is never a
* candidate, it is the off switch. A model that shows no thinking,
* or that no level moves, gets null. Pre-fill and hint only (GM,
* or that no level moves, gets null. Pre-fill and hint only (developer,
* 2026-11-18): with effort a property of the model pick, the
* measured default never rides a turn implicitly -- it pre-selects
* the selection dropdown and informs the curator's recommendation.
@@ -305,7 +305,7 @@ async function probeOne(ctx, slug, m, say = () => {}, effort = '') {
/** The cache key: the full spec tuples on both sides -- the probed
* model at the effort the deployment will actually send, and the
* curator at its own spec. Reasoning effort substantially changes
* inference quality (GM, 2026-11-18), so an entry adjudicated under
* inference quality (developer, 2026-11-18), so an entry adjudicated under
* one tuple never speaks for another.
* @param {string} slug @param {string} id @param {string} effort @param {string} cm @param {string} ce @returns {string} */
function cacheKey(slug, id, effort, cm, ce) {
@@ -373,9 +373,9 @@ async function curate(ctx, slug, probed, curatorSpec, user, onProgress = null) {
{ role: 'system', content: fs.readFileSync(CURATOR_PROMPT, 'utf8').trim() },
{ role: 'user', content: JSON.stringify(facts, null, 2) },
]);
// attribution (#22): every LLM call names the acting user
console.log(`${new Date().toISOString().slice(11, 19)} llm ${curatorSpec.model} u:${user?.id ?? '?'}`);
// no automatic retries (GM, 2026-11-19): every inference call is
// attribution (#22): every inferencer call names the acting user
console.log(`${new Date().toISOString().slice(11, 19)} inferencer ${curatorSpec.model} u:${user?.id ?? '?'}`);
// no automatic retries (developer, 2026-11-19): every inference call is
// user-initiated and every act has its manual retry -- the refine
// button again. A dead call lands the fallback, which is the
// designed outcome, not a degraded one
@@ -409,7 +409,7 @@ async function curate(ctx, slug, probed, curatorSpec, user, onProgress = null) {
if (!list.length) return { list: [], note: 'fallback: the curator listed nothing', recommendation: null };
// the recommendation: intel only, strictly validated -- a passing
// model at a ladder level. Anything else is no advice, never
// machine advice (GM, 2026-11-18: on a bad model day the op gets
// machine advice (developer, 2026-11-18: on a bad model day the op gets
// no recommendation, not a deterministic stand-in)
let recommendation = null;
const r = /** @type {{ model?: unknown, effort?: unknown }|null|undefined} */ (parsed.recommend);
@@ -432,7 +432,7 @@ export function refine(ctx, slug, user) {
if (!provider) throw new HttpError(404, `no such provider: ${slug}`);
const section = sectionOf(slug);
if (!section) throw new HttpError(409, `nothing to refine on '${slug}' -- run its discovery first`);
// the curator IS the selected default (GM, 2026-11-18) -- refine
// the curator IS the selected default (developer, 2026-11-18) -- refine
// requires the selection
const curatorSpec = provider.default;
if (!curatorSpec) {
@@ -445,7 +445,7 @@ export function refine(ctx, slug, user) {
// the meter: one step per model's battery (a cache hit closes its
// step instantly -- it is a completion, not a wait) plus the
// curator's two (thinking, writing). No step has a duration to
// guess at (GM, 2026-11-17): the bar moves only on real
// guess at (developer, 2026-11-17): the bar moves only on real
// completions, the label names the call running now, and every
// completion lands a receipt line -- the lines survive the job, so
// a rejected pass keeps its post-mortem
@@ -484,7 +484,7 @@ export function refine(ctx, slug, user) {
} else {
probed.push(await probeOne(ctx, slug, m, (s) => say(`battery ${i + 1}/${scraped.length}: ${m.id} -- ${s}`), curatorSpec.effort));
fresh.push(probed[probed.length - 1]);
// failures never cache (GM, 2026-11-19): a failure is the
// failures never cache (developer, 2026-11-19): a failure is the
// absence of a measurement, not a measurement -- the next
// refine always re-probes it, so the receipt says so
line(`${m.id}: ${verdict(probed[probed.length - 1])}${probed[probed.length - 1].inference === false ? ' -- never cached, retried at every refine' : ''}`);
@@ -543,7 +543,7 @@ export function refine(ctx, slug, user) {
// the cache write-back: every final PASSING entry lands under
// its key -- the labeled result, not the bare probe (the cached
// entry IS the verdict, curation included), a re-probe refreshes
// in place, the survivors persist. Failures never cache (GM,
// in place, the survivors persist. Failures never cache (developer,
// 2026-11-19): only a measurement is worth keeping -- a failure
// is retried at every refine until it stops being one
for (const [i, m] of models.entries()) {
+4 -4
View File
@@ -6,7 +6,7 @@
// carryover, freeze the finished one, then run the pass. With a
// dormant latest it is the RE-RUN: rebase the dormant session's db
// from the finished one's frozen copy and apply a fresh manifest.
// Re-enterable by ruling: a fresh LLM call each time (non-
// Re-enterable by ruling: a fresh inferencer call each time (non-
// idempotent), but never double-applying -- the rebase resets, and
// hand edits made in between are overwritten (the armed button warns).
//
@@ -233,7 +233,7 @@ async function runPass(ctx, runId, n, user) {
async function callHousekeeper(ctx, runId, messages, user) {
const meta = ctx.runMeta?.(runId) ?? /** @type {RunMeta} */ ({});
// the run's own housekeeper pick, else the player spec's provider's
// default (GM, 2026-11-18: the housekeeper inherits -- per-provider
// default (developer, 2026-11-18: the housekeeper inherits -- per-provider
// defaults mean no separate deployment default exists to fall to)
let spec = specFromMeta(meta.models?.housekeeper, 'housekeeper');
if (!spec) {
@@ -244,8 +244,8 @@ async function callHousekeeper(ctx, runId, messages, user) {
if (!spec) throw new Error('no housekeeper model resolved (the run\'s housekeeper pick, or its player provider\'s default)');
gateSpec(ctx, spec, 'housekeeper');
const params = { reasoning_effort: spec.effort };
// attribution (#22): every LLM call names the acting user
console.log(`${new Date().toISOString().slice(11, 19)} llm ${spec.model} u:${user?.id ?? '?'}`);
// attribution (#22): every inferencer call names the acting user
console.log(`${new Date().toISOString().slice(11, 19)} inferencer ${spec.model} u:${user?.id ?? '?'}`);
const data = await providerFor(ctx, spec.provider).chat(spec.model, messages, undefined, params);
return { content: data.choices[0].message.content ?? '', model: spec.model };
}
+14 -14
View File
@@ -4,7 +4,7 @@
// pauses mid-turn -- the whole tool-call batch waits (pairing stays
// sound), the request returns with the pending question, and the
// answer call resumes the loop. GM prose goes pure (the full-block
// protocol, GM 2026-11-16): no cache blocks ride any turn -- her
// protocol, developer 2026-11-16): no cache blocks ride any turn -- her
// <status>/<agenda>/<mind> blocks ride at her own tail, the view
// stamps the scan's newest values at her most recent turn, and the
// log is the one truth (the state scan -- the db holds no copy). A
@@ -61,7 +61,7 @@ function needSession(ctx, runId) {
export async function gmTurn(ctx, runId, line, user, override = null, sheet = null, send = null) {
const s = needSession(ctx, runId);
if (s.pendingAsk) throw new HttpError(409, 'a question is pending -- answer it first (POST /ask)');
// the staleness guard (GM, 2026-11-17): the client states the log it
// the staleness guard (developer, 2026-11-17): the client states the log it
// composed against. The log only moves through sends, so a mismatch
// means a stale tab -- refuse before anything rides, rewind or not
if (send?.expect != null && send.expect !== s.lines.length) {
@@ -77,7 +77,7 @@ export async function gmTurn(ctx, runId, line, user, override = null, sheet = nu
} catch (e) {
throw new HttpError(400, `the line was not sent -- ${e.message}`);
}
// the rewind (GM, 2026-11-17): the target GM turn and everything
// the rewind (developer, 2026-11-17): the target GM turn and everything
// after it leave the log, and this send takes its place. The commit
// happens here -- after the line expanded cleanly, so a refusal
// truncates nothing -- and as one landing with the turn: the log is
@@ -151,7 +151,7 @@ async function runLoop(ctx, runId, user) {
for (;;) {
const view = renderView(s);
// the request's resolved spec: the full inference identity
// {provider, model, effort} (GM, 2026-11-18) -- there is no unset
// {provider, model, effort} (developer, 2026-11-18) -- there is no unset
// effort, it is a property of the pick. The mind layer is the
// only params source now: per-turn, hers, spent on completion
// (the per-run knob layer is retired). The current call's
@@ -179,8 +179,8 @@ async function runLoop(ctx, runId, user) {
via = { model: spec.model, provider: spec.provider, params };
} else {
via = { model: spec.model, provider: spec.provider, params };
// attribution (#22): every LLM call names the acting user
console.log(`${new Date().toISOString().slice(11, 19)} llm ${spec.model} u:${user?.id ?? '?'}`);
// attribution (#22): every inferencer call names the acting user
console.log(`${new Date().toISOString().slice(11, 19)} inferencer ${spec.model} u:${user?.id ?? '?'}`);
// the turn meter's live record: one per provider call (a heal
// or tool round restarts it), fed by the streaming deltas
s.progress = { phase: 'thinking', thinking: 0, prose: 0, started: Date.now() };
@@ -246,7 +246,7 @@ async function runLoop(ctx, runId, user) {
}
// the status and agenda ride the turn text (the picked variant's,
// for variant literature). The full-block protocol (GM,
// for variant literature). The full-block protocol (developer,
// 2026-11-16): a present block is a whole-list SET -- absent
// means unchanged, never blank; a present-but-empty block is a
// deliberate clear. Same-verb blocks combine into one set. No
@@ -275,9 +275,9 @@ async function runLoop(ctx, runId, user) {
}
// the <model> block is display-only: the read side of the mind
// verb, never hers to emit. The <sheet> block is the same
// (GM, 2026-11-17) -- the GM's ledger, changes propose in prose.
// (developer, 2026-11-17) -- the GM's ledger, changes propose in prose.
// Both guards quote the offending emission: a conflict must be
// self-contained (GM, 2026-11-18) -- it stays in the contwin, and
// self-contained (developer, 2026-11-18) -- it stays in the contwin, and
// the block it answers strips from the view, so the quote is the
// only visible trace of what went wrong
if (/<model>/.test(text)) {
@@ -308,7 +308,7 @@ async function runLoop(ctx, runId, user) {
}
/** A model spec as run.json carries it: the {provider, model,
* effort} object (the no-legacy rule, GM, 2026-11-18 -- the
* effort} object (the no-legacy rule, developer, 2026-11-18 -- the
* bare-string era migrated away in the same pass). Malformed
* records refuse loud.
* @param {unknown} raw @param {'player'|'housekeeper'} role @returns {?import('./shapes.mjs').ModelSpec} */
@@ -324,7 +324,7 @@ function specFromMeta(raw, role) {
throw new HttpError(409, `the run's ${role} model record is malformed -- set it again in the model box`);
}
/** The invalidation gate (GM, 2026-11-18): the settings the run
/** The invalidation gate (developer, 2026-11-18): the settings the run
* came with must still be carried. A provider gone from the
* config, a model gone from its provider's registry, a model the
* battery disqualified -- all one state: the run blocks until the
@@ -359,11 +359,11 @@ export { specFromMeta, gateSpec, resolveSpec };
// --- the mind verb ------------------------------------------------------------
//
// <mind>{"temperature": 1.4}</mind> -- the player sets its own sampling
// knobs for its NEXT turn, to reflect the character's mind (GM,
// knobs for its NEXT turn, to reflect the character's mind (developer,
// 2026-11-16: tag form, one-shot, no GM lock; the block carries a
// JSON object -- models emit JSON natively; the parameters need no
// model-facing explanation, they live native in base training).
// max_tokens is excluded by ruling (GM, 2026-11-16) -- it is a
// max_tokens is excluded by ruling (developer, 2026-11-16) -- it is a
// budget, not a mind. A substrate verb like the deltas: parsed from
// the picked variant's text after the final message, merged over the
// run and deployment layers for every call of the next turn, then
@@ -411,7 +411,7 @@ function quote(s) {
* all blocks combined (last wins per key, the same-verb rule). Every
* wrong thing is named -- the caller rides the conflict path, and
* she heals by restating. The errors carry what she wrote: a
* conflict must describe its problem in full (GM, 2026-11-18), even
* conflict must describe its problem in full (developer, 2026-11-18), even
* when the problem originates in the turn it immediately follows --
* the block itself strips from the view, the conflict is what
* remains.
+11 -11
View File
@@ -42,7 +42,7 @@ const MOCK = process.argv.includes('--mock');
const DEBUG = process.argv.includes('--debug'); // identity bypass: everyone is the superuser
// server.json is the static, non-secret remainder: bind and contwin.
// Optional (GM, 2026-11-18) -- the provider entities live in
// Optional (developer, 2026-11-18) -- the provider entities live in
// state/config.json (server-written, SPA-managed). Nothing here gates
// the boot: a fresh deployment with no config at all comes up
// serving, mints the superuser invite, and shows the global
@@ -60,7 +60,7 @@ if (fs.existsSync(SERVER_JSON)) {
}
}
let providerCfg = providers.readConfig();
// the self-heal rule (GM, 2026-11-18), stated broadly: an error that
// the self-heal rule (developer, 2026-11-18), stated broadly: an error that
// can be mechanically fixed to a reasonable degree without requiring
// human input gets fixed. The empty provider list is one: the
// anonymous fallback is added and discovered, as a background job --
@@ -90,7 +90,7 @@ const ctxBase = { mock: MOCK, cfg, providerCfg, providers: providersMap, session
/** @type {Ctx} */
const ctx = /** @type {Ctx} */ (ctxBase);
// the auto-added providers discover in the background -- no LLM
// the auto-added providers discover in the background -- no inferencer
// calls, one GET each, zero cost; a dead network shows as the probe
// record on the card (o/f's auth failure reads as upstream breakage,
// never a prompt) plus the banner, whose fix path is the same add act
@@ -453,7 +453,7 @@ route('GET', '/api/providers', async ({ user }) => {
};
});
// the probe (GM, 2026-11-19): discovery IS the health check -- every
// the probe (developer, 2026-11-19): discovery IS the health check -- every
// path that scrapes a provider records the outcome on the entity, so
// the card reads the last probe, never a stored machine. 401/403 is
// the ask (custom providers only -- an auth failure on o/f is
@@ -486,7 +486,7 @@ async function runProbe(slug) {
}
}
// add a provider (GM, 2026-11-19): {builtin: true} or {slug,
// add a provider (developer, 2026-11-19): {builtin: true} or {slug,
// baseUrl} -- never a key (the auth route is the only key path).
// Discovery is the probe: an auth refusal (401/403) leaves the
// provider standing broken -- the SPA asks for the key, checked on
@@ -532,7 +532,7 @@ route('POST', '/api/providers', async ({ body, user }) => {
// set or replace a custom provider's key (the o/f singleton never
// takes one -- its purpose is to be the anonymous fallback; a 401
// from it is upstream breakage, not a prompt). Probe-then-save (GM,
// from it is upstream breakage, not a prompt). Probe-then-save (developer,
// 2026-11-19): the candidate key is checked on reception -- a key
// that still meets the refusal is never saved, the previous state
// returns, and the ask stays open for the next attempt.
@@ -563,7 +563,7 @@ route('POST', '/api/providers/:slug/auth', async ({ params, body, user }) => {
}
});
// remove a custom provider's key (GM, 2026-11-19): the op's control
// remove a custom provider's key (developer, 2026-11-19): the op's control
// for a provider that went public -- or the first half of a key
// replacement, the second half being the ask, which re-opens when
// the keyless probe meets the 401 again. The removal stands whatever
@@ -1199,7 +1199,7 @@ function readOverride(body) {
return override;
}
// The sheet record (GM, 2026-11-17): the GM's ledger of arbitrated run
// The sheet record (developer, 2026-11-17): the GM's ledger of arbitrated run
// state, riding the GM turn like the override. Schemaless by ruling --
// a plain JSON object, any fields, semantics living in the setting's
// prose; the route's only law is object-ness (an array or a scalar is
@@ -1214,7 +1214,7 @@ function readSheet(body) {
return /** @type {Record<string, unknown>} */ (body.sheet);
}
// The rewind and the staleness guard (GM, 2026-11-17), both optional
// The rewind and the staleness guard (developer, 2026-11-17), both optional
// fields on the send, both native API with no UX rules riding here:
// rewind names the GM turn (a log line index) this send replaces --
// the target and everything after it leave the log; expect states the
@@ -1261,13 +1261,13 @@ route('POST', '/api/runs/:id/ask', async ({ params, body, user }) => {
return { ok: true, ...(await ctx.enqueue(params.id, async () => answerAsk(ctx, params.id, answer, user, expect))) };
});
// the turn meter's read (GM, 2026-11-17): the live progress record
// the turn meter's read (developer, 2026-11-17): the live progress record
// the streaming callback feeds, plus the scale the bar guesstimates
// against -- the session's own history: her longest past turn in
// characters (thinking and prose both, the units the meter counts).
// No history means no scale: the client falls back to the
// chunk-driven animation. (The old max_tokens budget layer is gone
// with the per-run params: no surface sets one anymore -- GM,
// with the per-run params: no surface sets one anymore -- developer,
// 2026-11-18.) Owner-only machinery; a plain read, never queued.
route('GET', '/api/runs/:id/progress', async ({ params, user }) => {
requireOwner(user, params.id);
+3 -3
View File
@@ -1,13 +1,13 @@
// server/providers.mjs -- the provider entities.
//
// A provider is a first-class thing (GM, 2026-11-18): a user-named
// A provider is a first-class thing (developer, 2026-11-18): a user-named
// slug, a baseUrl, optional auth, and the op's default model spec for
// it -- {model, effort}, never params (those are per-turn, the <mind>
// verb's alone). state/config.json is the truth, written only by the
// server; the SPA is the surface, zero hand edits. No legacy shapes
// are read: the config is born in this shape, and shape changes come
// with one-time migrations, not permanent tolerance (the no-legacy
// rule, GM, 2026-11-18).
// rule, developer, 2026-11-18).
//
// The built-in singleton: opencode/free -- the anonymous, keyless
// fallback, the harness thesis in one entry (playable with zero
@@ -106,7 +106,7 @@ export function addBuiltin(cfg) {
return p;
}
/** The removal guard (GM, 2026-11-18): the singleton goes only when
/** The removal guard (developer, 2026-11-18): the singleton goes only when
* a custom provider stands in its place -- the empty list is an
* error state, and the fallback is what keeps it unreachable.
* @param {DeployCfg} cfg @param {string} slug @returns {string} an error message, or '' when removable */
+12 -12
View File
@@ -20,7 +20,7 @@
// (the last few and every ask_gm answer stay), old GM-side
// <status>/<conflict> blocks elide from GM prose -- the current status
// rides the newest GM turn -- and conflict messages never elide: a
// mistake stays visible so it is not made again (GM, 2026-11-18).
// mistake stays visible so it is not made again (developer, 2026-11-18).
/** @typedef {import('./shapes.mjs').LogEvent} LogEvent */
/** @typedef {import('./shapes.mjs').LiveSession} LiveSession */
/** @typedef {import('./shapes.mjs').PendingAsk} PendingAsk */
@@ -254,7 +254,7 @@ export function cleanBlockList(text, kind) {
/** The state scan: newest-wins across her emissions (the picked
* variant's text), the GM's records, and the boundary note. The sheet
* (GM, 2026-11-17) is the second channel: arbitrated run state, never
* (developer, 2026-11-17) is the second channel: arbitrated run state, never
* her words -- its sources are the GM's turn records and the note,
* each record a whole set (absent key means dropped, never kept), and
* it never caps, never cleans: the GM's ledger is exactly what the GM
@@ -367,7 +367,7 @@ export function findStalledStop(runId) {
return null;
}
// --- rewind: the GM's take-back (GM, 2026-11-17) ------------------------------
// --- rewind: the GM's take-back (developer, 2026-11-17) ------------------------------
//
// The in-place rollback of the live session, deliberately destructive:
// the target GM turn and everything after it leave the log, and the
@@ -421,7 +421,7 @@ export function rewindTo(s, idx) {
// the authored carryover's event vocabulary: her opening as msg
// events (user = the GM, assistant = her). The opening event is
// RETIRED (GM, 2026-11-16): old carryovers keep theirs as inert
// RETIRED (developer, 2026-11-16): old carryovers keep theirs as inert
// history -- tolerated here, never applied. A continuation
// carryover is real conversation: msg, tool, note, and req events
// (a failed request's record is machinery like a note), read as
@@ -447,7 +447,7 @@ export function lintCarryover(lines, { authored }) {
if (m.reasoning_content) errors.push(`${at}: thinking is runtime metadata`);
if (e.reminder) errors.push(`${at}: the reminder rides every GM turn on its own`);
if (e.conflictOnly) errors.push(`${at}: conflict traffic is runtime machinery`);
// the sheet's transport (GM, 2026-11-19, the box round): the
// the sheet's transport (developer, 2026-11-19, the box round): the
// record is the only channel -- the tag is view machinery,
// composed by renderView, never authored by anyone. Hers would
// never apply (the scan holds the GM's record) and primes the
@@ -506,7 +506,7 @@ export function lintCarryover(lines, { authored }) {
}
});
if (authored && openings > 1) errors.push('at most one opening event');
// the full-block protocol (GM, 2026-11-16): the initial status rides
// the full-block protocol (developer, 2026-11-16): the initial status rides
// her last turn in the carryover -- an authored carryover without
// model turns has no canon point to stamp
if (authored && !lines.some((e) => e.t === 'msg' && e.m?.role === 'assistant')) {
@@ -629,7 +629,7 @@ export function startSession(runId, { override = false } = {}) {
errors: [(mr.err || mr.out || 'reapply failed').split('\n')[0]],
});
}
// the full-block protocol (GM, 2026-11-16): the initial state
// the full-block protocol (developer, 2026-11-16): the initial state
// rides her last authored turn -- the scan reads her blocks, the
// stamp renders them, the panes derive them. No seeding, no
// second home: her opening turn IS the seed. The opening event
@@ -653,7 +653,7 @@ export function startSession(runId, { override = false } = {}) {
{ t: 'bundle', m: system, part: 'system' },
...bundle.map((m, i) => /** @type {LogEvent} */ ({ t: 'bundle', m, part: partNames[i] })),
...carry,
// the rewind floor (GM, 2026-11-17): the opening -- authored or
// the rewind floor (developer, 2026-11-17): the opening -- authored or
// carried -- is frozen; live play starts at this line, and a
// rewind may only ever target GM turns below it
{ t: 'note', kind: 'start' },
@@ -709,7 +709,7 @@ export function renderView(s, keepToolResults = 4) {
// override, the boundary note -- the state scan's newest-wins).
// The status is the game world as of her turn; after it the GM's
// turn happens, then her new turn -- the context must read as that
// same sequence of events (GM, 2026-11-16)
// same sequence of events (developer, 2026-11-16)
const st = scanState(s.lines);
let lastProse = -1;
s.lines.forEach((e, i) => {
@@ -744,7 +744,7 @@ export function renderView(s, keepToolResults = 4) {
content = content.replace(STRIP_HERS, '').trim();
if (e.via && Object.keys(e.via.params ?? {}).length) {
// the via-derived block is the mind verb's read side:
// reasoning_effort is hidden from her (GM, 2026-11-16 --
// reasoning_effort is hidden from her (developer, 2026-11-16 --
// not her call), it rides the raw surfaces only
const shownVia = { ...e.via.params };
delete shownVia.reasoning_effort;
@@ -769,7 +769,7 @@ export function renderView(s, keepToolResults = 4) {
if (e.m.tool_calls?.length) m.tool_calls = e.m.tool_calls;
msgs.push(m);
} else if (e.conflictOnly) {
// the self-heal channel stays in the contwin (GM, 2026-11-18):
// the self-heal channel stays in the contwin (developer, 2026-11-18):
// a mistake remains visible so it is not made again. This is
// why conflicts must be self-contained -- describe the problem
// in full, quoting the offending emission, because the
@@ -790,7 +790,7 @@ export function renderView(s, keepToolResults = 4) {
}
}
}
// the sheet chunk (GM, 2026-11-17): arbitrated run state renders as
// the sheet chunk (developer, 2026-11-17): arbitrated run state renders as
// its OWN authoritative system chunk at the freshest end -- never a
// canon-point stamp, which would read as her words. One live copy by
// construction (assembled once per view, not logged per turn). An
+5 -5
View File
@@ -66,7 +66,7 @@ export {};
* scan reads it newest-wins (it loses to any emission inside the
* tail by position). */
/** @typedef {{ t: 'note', kind: 'state', status?: string[], agenda?: string[], sheet?: Record<string, unknown> }} StateNote */
/** start: the frozen-opening boundary (rewind, GM, 2026-11-17) --
/** start: the frozen-opening boundary (rewind, developer, 2026-11-17) --
* written once at start, right after the consumed carryover: the
* opening (authored or carried) above it is what a rewind can never
* reach. A session whose log predates the build carries none, and
@@ -95,7 +95,7 @@ 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 */
/** One model spec: the complete inference request identity (GM,
/** One model spec: the complete inference request identity (developer,
* 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
@@ -106,7 +106,7 @@ export {};
/** 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
* entirely, developer, 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 */
@@ -125,7 +125,7 @@ export {};
* 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
* only (developer, 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 */
@@ -135,7 +135,7 @@ export {};
* 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,
* model day (developer, 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 */
+1 -1
View File
@@ -3,7 +3,7 @@
// A player turn may be variant literature: several complete candidate
// turns in one <variants> block (one <variant> each), each carrying
// its own substrate verbs. The loop picks one at random on reception
// -- genuine chaos over curation, by GM ruling -- and only the picked
// -- genuine chaos over curation, by developer ruling -- and only the picked
// variant ever renders on a model-facing surface; the unpicked rest
// survive in the session log alone (she must not remember roads not
// taken; the housekeeper must not file fiction-that-never-was).