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
+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()) {