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:
@@ -63,9 +63,8 @@ or otherwise PC ever needs support, this is the line to revisit.
|
||||
## The deployment (multiuser)
|
||||
|
||||
A deployment is one clone plus `state/` and `runs/` (all gitignored
|
||||
state) and an optional `server.json` -- bind and contwin only; the
|
||||
provider entities live in `state/config.json`, server-written,
|
||||
SPA-managed, zero manual file edits. The inference key lives on the backend
|
||||
state); the provider entities live in `state/config.json`,
|
||||
server-written, SPA-managed, zero manual file edits. The inference key lives on the backend
|
||||
need neither the key nor a local clone. Identity is a token, nothing
|
||||
else: no usernames, no passwords, no external IDPs. A single-use
|
||||
invite code -- spent codes are recorded forever and rejected loudly on
|
||||
@@ -119,13 +118,15 @@ forking makes that cheap -- stories outlive identities by design.
|
||||
an extension point, not built.
|
||||
- All dates and times are UTC everywhere. No time zones, ever.
|
||||
|
||||
Debug mode (`--debug`) is for testing: every request becomes one
|
||||
fixed superuser ("debug") that bypasses the user database entirely --
|
||||
no invite to claim, no token to keep, the SPA opens straight in as
|
||||
the op, and the server binds loopback whatever the config says. It
|
||||
reads normal state (runs, packages) unchanged, so it can inspect a
|
||||
real deployment; it must simply never run on one that faces a
|
||||
network.
|
||||
Debug mode (`--debug`) is for testing: one fixed superuser ("debug")
|
||||
that bypasses the user database entirely -- no invite to claim. The
|
||||
bearer token that signs it in is minted into
|
||||
`state/debug-token.txt` and printed at every boot; paste it into the
|
||||
sign-in box on the claim screen. It reads normal state (runs,
|
||||
packages) unchanged, so it can inspect a real deployment -- and with
|
||||
every request token-gated, a debug server that somehow faces a
|
||||
network is not an open door. It stays testing-only regardless: the
|
||||
debug user is an unlimited superuser.
|
||||
|
||||
## Runs
|
||||
|
||||
@@ -616,9 +617,13 @@ reached mock-parity (2026-11-14).
|
||||
Config is self-healing state, not a hand-edited file (developer, 2026-11-18):
|
||||
the provider entities -- slug, baseUrl, optional key, the op's
|
||||
default model spec -- live in `state/config.json`, written only by
|
||||
the server, managed from the SPA's admin block. `server.json`
|
||||
(gitignored, optional) is the static remainder: `bind` and `contwin`
|
||||
(the context budget in tokens). No legacy config shapes are read:
|
||||
the server, managed from the SPA's admin block. There is no
|
||||
`server.json` (developer, 2026-11-19: it held no meaningful
|
||||
configuration once the bind died): the listen address is code --
|
||||
loopback always, a deployment fronts the server with a proxy -- the
|
||||
port rides the `RP_PORT` env var (default 7350), and the context
|
||||
meter reads the discovered per-model contwin from the registry, never
|
||||
a declared one. No legacy config shapes are read:
|
||||
shape changes come with one-time migrations, not permanent tolerance
|
||||
(the no-legacy rule, developer, 2026-11-18). Boot always succeeds: a fresh clone with nothing comes
|
||||
up serving and mints the superuser invite, and -- the self-heal
|
||||
@@ -882,8 +887,6 @@ test/ the mock smoke, kept next to the code
|
||||
prose, zero-dependency imports, utc discipline, web/
|
||||
static naming (never "api"), the bundle boundary,
|
||||
dateless memory
|
||||
server.example.json copy to server.json (gitignored, optional) --
|
||||
bind, contwin; the providers are SPA-managed state
|
||||
db/
|
||||
schema.sql entries, records, events journal (shared; the status
|
||||
and agenda tables are retired -- the log is their
|
||||
|
||||
Reference in New Issue
Block a user