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:
@@ -127,8 +127,11 @@ noun -- a registry entry, never a seat.
|
||||
- `node:sqlite` prints an ExperimentalWarning on every clerk call --
|
||||
harmless, filtered in bridge context.
|
||||
- Session logs, dumps, and views are generated; never hand-edit them.
|
||||
- `server.json` (gitignored) holds the real key; it mirrors opencode's
|
||||
`dv` provider (config at `~/.config/opencode/opencode.jsonc`, auth at
|
||||
- There is no server.json (deleted 2026-11-19 -- it held only the
|
||||
dead bind and the declared contwin): the provider entities live in
|
||||
state/config.json, and the op's real key for the `dv` provider is
|
||||
whatever the config carries (opencode's own config sits at
|
||||
`~/.config/opencode/opencode.jsonc`, auth at
|
||||
`~/.local/share/opencode/auth.json`).
|
||||
- The repo lives at `C:\data\opencode\tiny-worlds` (renamed from
|
||||
`rp-test` with the project name, 2026-11-15). The rename could not
|
||||
@@ -166,10 +169,10 @@ noun -- a registry entry, never a seat.
|
||||
browser timers resolve to node's overloads, so annotate them
|
||||
`?ReturnType<typeof setTimeout>` and `clearTimeout(x ??
|
||||
undefined)`.
|
||||
- A fresh git worktree has neither server.json (gitignored) nor
|
||||
node_modules: copy server.json in from the main repo before the
|
||||
mock server starts (it exits without one), and run npm.cmd
|
||||
install before typecheck (2026-11-15, this worktree).
|
||||
- A fresh git worktree has no node_modules: run npm.cmd
|
||||
install before typecheck (2026-11-15, this worktree). No config
|
||||
file is needed to boot -- the server comes up on loopback:7350
|
||||
(RP_PORT overrides) with whatever state/ holds.
|
||||
- The remote (2026-11-15, developer): origin at
|
||||
`ssh://code@code.fleshless.org:2290/hackmaster/tiny-worlds.git`,
|
||||
branch mistress tracks origin/mistress. The ssh key takes a
|
||||
@@ -742,9 +745,11 @@ noun -- a registry entry, never a seat.
|
||||
inspector, book export, service step) plus whatever the first real
|
||||
story surfaces.
|
||||
Server entry: `node server/main.mjs [--mock] [--debug]` (--debug:
|
||||
every request is a fixed superuser, the users db bypassed, no
|
||||
invite dance, loopback-bound regardless of config -- testing
|
||||
only); SPA at
|
||||
one fixed superuser behind the printed token -- minted into
|
||||
state/debug-token.txt, printed every boot, pasted on the claim
|
||||
screen's token field; the users db bypassed, no invite dance --
|
||||
testing only); the bind is loopback always, the port rides RP_PORT
|
||||
(default 7350); SPA at
|
||||
http://127.0.0.1:7350/; POST bodies from PowerShell need
|
||||
Invoke-RestMethod (curl.exe mangles quotes); background start/stop
|
||||
via Start-Process -PassThru with a PID file in $env:TEMP.
|
||||
|
||||
Reference in New Issue
Block a user