the debug round: server.json deleted, the bind hardcoded to loopback (RP_PORT for the port), the debug superuser token-gated behind a printed, persisted token, and the context meter reading the discovered per-model contwin
The rulings (developer, 2026-11-19, in conversation): a deployment basically always needs a fronting proxy, so the listen address is code -- loopback, no override (an op who wants otherwise owns their own socat); the port rides the RP_PORT env var (the RP_BASE twin the test scripts use, default 7350, garbage refused loud); server.json is deleted entirely, file and reader both, because it held no meaningful configuration once the bind died -- only the dead bind and the declared contwin; and contwin is provider/model dependent, never a deployment global, so the meter must DISCOVER it, not read a declaration.
The meter: the run detail's context block now derives its window from the registry -- modelState's resolved player spec, findModel, the model's input ceiling -- null when the provider states none or no pick stands, pct computed against that. A dividend named in review: pct is uncapped, so a mid-run re-pick onto a smaller model shows the meter over 100% BEFORE the first send refuses (the endpoint's own context-length 400 is the designed refusal -- no pre-request check, nothing truncates, the failed call lands its req event, the composer keeps the line per the standing rule).
Debug mode reworked around its real purpose (skip the invite dance on a fresh server, mocks in particular): the old shape -- every request the superuser, no auth at all -- left any debug server that somehow reached a network fully open. Now one fixed superuser behind a real bearer token: minted into state/debug-token.txt (the bootstrap-invite precedent -- a raw secret on disk so a restart never invalidates what the tester already pasted; the developer ruled persist), printed at every boot, and the claim screen gains the paste path ("or paste a token": store it, verify through the public /session, land or banner). The paste path is generic surface, not debug-only: tokens are returned once and never listed, so a pasted saved token is the only browser-migration path that existed to build. The public /session carries a debug flag so the claim hint says "paste the token the server printed at boot" instead of pointing at the bootstrap file debug never mints. Debug browser passes now exercise the real auth path (the 401, the u: attribution line) instead of bypassing it.
En-route mock fidelity fix the smoke earned: the mock path never set s.usage (no provider call happens), so every usage and context surface was null under the smoke -- the first cut of the new gauge assertion failed on exactly that. The mock now carries a synthetic usage (the assembled view's chars over 4), riding the msg events like the real path's, so the detail's usage and the context gauge are smoke-assertable: contwin 524288 straight from the mock's registry input ceiling, pct computed.
Verified: typecheck green both programs; smoke ALL PASS (+1, the discovered-gauge assertion); restart + reminder checks green (5 runs again); a browser pass on --mock --debug end to end -- the wrong token banners "token rejected" and stays on claim, the printed token lands as Debug the op, the stored token survives a server restart (the persistence proof), zero console errors; check-repo clean (it caught the round's own "window" in the new README passage -- contwin is the word); the dev machine's server.json deleted and the debug server restarted on the real state (Chloe and Irene rebuilt, the token minted into the real state/). Docs: README's deployment and debug passages, the config passage, and the layout tree (the server.example.json lines gone with the file); DICTIONARY's meter and contwin entries (the config key died with the file -- the dated rename record keeps its day's words); AGENTS's server entry and the two server.json gotchas; HANDOFF's round record and the push-queue count (now eight). The developer's operator-queue line ("revisit the debug mode, hardcode loopback") is struck by them in the same commit. packages/detention stays untracked WIP, untouched.
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
// node test/check-repo.mjs
|
||||
//
|
||||
// 1. ASCII bytes everywhere (developer, 2026-11-15). No unicode in any
|
||||
// tracked file; gitignored state (runs/, state/, server.json) is
|
||||
// tracked file; gitignored state (runs/, state/) is
|
||||
// per-deployment and exempt. The ENCODING is the problem, never
|
||||
// the visual: rendered glyphs travel ASCII-safe (\u escapes in
|
||||
// JS, entities in HTML), never verbatim bytes.
|
||||
|
||||
@@ -363,6 +363,9 @@ ok('gm turn -> variant literature', r.status === 200 && r.data.variants?.count =
|
||||
const pickedStatus = r.data.variants.chosen === 0 ? 'determined' : 'cautious';
|
||||
r = await call(`/runs/${runId}`, { token: op });
|
||||
ok("the picked variant's status applied", r.data.status.includes(pickedStatus), JSON.stringify(r.data.status));
|
||||
ok('the context gauge reads the discovered window (the registry input ceiling, never a declared config)',
|
||||
r.data.context?.contwin === 524288 && r.data.context?.pct === Math.round((100 * r.data.context.used) / 524288),
|
||||
JSON.stringify(r.data.context ?? null));
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user