spa modules and terminology: app.mjs split into flat es modules (router lifecycle, shared widgets, views own their state), mock smoke in test/; DICTIONARY.md rules the terms, four renames swept clean through the machinery - paper->status (run summary command is report now), window->session, wrap->housekeeping, context window->contwin; no dual-accepts by ruling, old data migrates once in the clerk (restore self-heals old dumps)

This commit is contained in:
2026-11-14 23:48:27 +00:00
parent 89a2c161b3
commit c51d31078e
36 changed files with 2643 additions and 1779 deletions
+126 -54
View File
@@ -9,6 +9,57 @@ file is the "where did we leave off" map.
## Where we are
- **DICTIONARY.md exists — the terms of art, one source of truth
(2026-11-14, GM-ruled).** A rename rules there first, then sweeps.
The full round is DONE: **paper → status, window → session, wrap →
housekeeping, context window → contwin** — swept on every surface
INCLUDING the machinery (element ids, routes, response fields, db
tables, journal ops), with one-time data-preserving migrations in
the clerk and **no dual-accepts** (the no-legacy convention is
recorded in the dictionary's Conventions). Two costs to remember:
the clerk's run summary is **`report`** now (`status` is the tier
verb, JSON), and Irene's pre-rename session log carries old-kind
notes that no longer render — cosmetic, data intact.
- **The SPA is refactored into modules (2026-11-14, GM-ruled).** The
1378-line app.mjs is gone; web/ is now flat ES modules like
server/: `app.mjs` (thin entry), `router.mjs` (path routing + the
view enter/leave lifecycle — each view owns its teardown, show()
never hand-resets panes), `client.mjs` (the fetch choke point —
named client, NOT api: a web file named api.mjs 404s, the static
guard matches the /api prefix), `state.mjs` (me/seq/runId only —
everything else is module-local to its view), `chrome.mjs`,
`log.mjs`, `widgets.mjs` (armedButton — the two-click confirm,
per-button arm state, fixing the shared-arm bug where arming one
user-revoke armed them all; paneEditor — the status/agenda twins as
one factory, two instances; modelsBox — the setup/play-aside
duplicate), `transcript.mjs`, and one `view-*.mjs` per view. The
mock smoke moved into the repo (`test/`). Verified: smoke 58/58,
reminder elision, restart check, and a full browser pass (claim,
home + admin, new run + name roll, setup editor + models box,
start, play: pane editors end to end, GM turn -> ask modal ->
answer, two-click housekeeping -> poll -> applied + log, the
auto-restarted session, spectator mode on Irene) — zero console
errors. Found en route, pre-existing, unfixed: **the dry-run
replay button is dead after a housekeeping pass** — housekeeping
auto-restarts the next session, so the latest session (the replay default) is the
fresh empty one and the call 409s ("no exchange to review"); the
closed session needs naming. Server-side semantics, GM's call.
- **The multiuser server, the agenda, and the per-turn reminder are
built, mock-proven, and committed (2026-11-14, through `89a2c16`).**
Token identity with single-use invites (no usernames, no passwords,
no external IDPs; the bootstrap invite auto-mints on the fresh
deployment to state/bootstrap-invite.txt and the console);
owner-gated runs with fork (atomic copy, owner replaced, no
lineage); system/user packages; per-run model selection (player +
housekeeper over the server.json defaults); spectator mode (read
everything, mutate nothing); the agenda — the player's second
status, `<add>`/`<drop>` deltas over a cap-5 recency queue, with
conflicts self-healing as their own message; and the reminder — the
GM-written turn-composition procedure riding every GM turn as its
own system chunk, one live copy. Design lives in ROADMAP ("The
multiuser server") and QUESTIONS #22-34, all resolved. **No users
exist yet:** the next server start mints the real bootstrap invite.
The server is stopped.
- **The GM surface rework is complete and live-proven (2026-11-14).**
Home lists runs by display name with live state; new run walks a
package picker into a naming form (package display name + a
@@ -17,10 +68,10 @@ file is the "where did we leave off" map.
first, then the editable craft in bundle order — handbook, backdrop,
character, seed, turn-0 — then read-only config; sigil/var
highlighting; $TOKENs declared by the prompts surface as inputs and
gate start; drafts two-click deletable); start opens the window and
gate start; drafts two-click deletable); start opens the session and
sends turn-0 as the first GM turn. Play carries: the GM notepad
(gm.md — auto-saved, never model-facing), the paper as a compact
comma block with a GM edit button (paper-set, journaled),
(gm.md — auto-saved, never model-facing), her status as a compact
comma block with a GM edit button (status-set, journaled),
housekeeping with a dry-run replay button, diagnostics on both
sides of the wire (server request log + a sessionStorage event log
behind the header's "log" button), busy indicators, and hardened
@@ -31,7 +82,7 @@ file is the "where did we leave off" map.
display is "La Caramba / Rell". Postulates: female PCs only;
boutique dormant AND defunct. Exposure rule: bundle parts are
inspectable read-only; agent prompts (housekeeper.md, repo-fed at
wrap, never copied) are never exposed.
housekeeping, never copied) are never exposed.
- **Dates left the rings (GM, 2026-11-14).** No model-facing surface
renders a date — the old rendered date was the touch stamp
(referencing a memory rewrote its "when"), and records search
@@ -41,16 +92,16 @@ file is the "where did we leave off" map.
housekeeper produced a clean dateless manifest first try.
- **The first real story is live: "La Caramba / Irene"** (run
4f261452, gitignored state). Window one open, 44+ exchanges at ~23K
prompt tokens — 9% of the window; the economy holds because
prompt tokens — 9% of the contwin; the economy holds because
thinking never goes back, old status rides strip, and the bundle
floor is ~4.2K tokens. The GM ran the wrap dry-run on it: works
floor is ~4.2K tokens. The GM ran the housekeeping dry-run on it: works
mechanically, output not yet as expected — housekeeper.md review
pending (the GM has not read the prompt yet).
- **The MVP substrate is complete (2026-11-14): all four phases built,
mock-proven, and live-proven.** Clerk (paper model, presets/runs),
server (REST spine, session machine, view renderer), housekeeping
job (async chain with autorestart), SPA (full v1 scope). The tool/
bridge is deleted. Two real housekeeping wraps ran clean (both
bridge is deleted. Two real housekeeping passes ran clean (both
manifests sound: correct ring-B classification, first-person voice,
precise touches); a full session was driven through the UI end to
end. **The server is stopped** (state as of this commit). Start it:
@@ -63,7 +114,7 @@ file is the "where did we leave off" map.
- **Prompt split in force (GM's cut, 2026-11-14):** `system.md` =
opening + guards (glossary, purpose, input validation — repo-fed,
per-project); `invariants.md` = substrate (syntax markers, tools,
memory, records, the paper + its gate — repo-fed, travels with the
memory, records, the status + its gate — repo-fed, travels with the
code); `handbook.md` = craft copy (shape of play, thoughts, purview,
time skips, continuity, stance, hard limits — copied per run,
editable to taste). One system message: system → invariants → the
@@ -85,7 +136,7 @@ file is the "where did we leave off" map.
quantified). Name call resolved: keep "Rell". Optional seed voice
touch-up may be revisited (QUESTIONS #19c, non-blocking). The seed
is authored but NOT applied — it rides the run copy at creation and
applies lazily at the first window-open.
applies lazily at the first session-open.
- Build history in brief (details in ROADMAP phasing): phase 0 clerk
paper migration (2026-11-13), phase 1 preset/run split
(2026-11-13), phase 2 server (2026-11-14), phase 3 housekeeping job
@@ -107,49 +158,56 @@ file is the "where did we leave off" map.
package wholesale into `runs/<id>/` (shared prompts included, run.json
lineage + optional model override) and inits state; `--run` addresses
runs; `packages`/`runs` list; `bridge.json` → `server.json`
(bind, endpoint, models, contextWindow, params; example committed,
(bind, endpoint, models, contwin, params; example committed,
key carried over, gitignored); `config.json` now names the default
package. Smoke-tested: create → seed → turn-0 ingest → delta apply →
status, re-seed refuses, smoke run deleted. `prelude.md` renamed
`turn-0.md` by the GM (comment dropped); clerk and docs follow.
- Boutique: dormant — a stub that never reached its design step
(concept brief in `packages/boutique/gm.md`).
- No runs exist in this deployment yet; both packages render clean as
presets (`packages` lists them).
- One run exists: Irene (4f261452, see above). Both packages render
clean as presets (`packages` lists them).
- **Substrate design round complete (2026-11-13)** — rulings recorded in
ROADMAP ("The harness"): the stated goal (a usable RP harness;
clone-and-run or invited instance, key on the backend, no secrets in
the repo), repo ships code + authored content only (state is
per-deployment), packages are presets copied wholesale into `runs/<id>/`
at creation (editable everything, discipline on the GM), lazy seed at
first window-open, per-run model selection with an upstream `/models`
listing, audit as per-wrap dump snapshots inside the run
(commit-per-wrap retired), zero-dep stack (QUESTIONS #4, #7 resolved).
first session-open, per-run model selection with an upstream `/models`
listing, audit as per-pass dump snapshots inside the run
(commit-per-pass retired), zero-dep stack (QUESTIONS #4, #7 resolved).
## Immediate next steps, in order
1. **The first real wrap — the memory test begins.** Close-and-
housekeep the Irene window when the GM is ready; review the
manifest and the window log against the dump diff (the audit
1. **First start under multiuser (op, one-time).** Start the server,
claim the bootstrap invite (`state/bootstrap-invite.txt` and the
console both carry it), then hand-stamp Irene's `run.json` with
`"owner": "<your user id>"` — the SPA header tooltip shows the id.
No migration code exists, by ruling; this is the op's one manual
act.
2. **The first real housekeeping pass — the memory test begins.**
Close-and-housekeep the Irene session when the GM is ready; review
the manifest and the session log against the dump diff (the audit
surface). Everything from the story so far (the shipwreck, Molly,
the island) lives only in context and on the paper until this
lands.
2. **Housekeeper prompt review (GM-led).** The GM's dry-run verdict:
the island) lives only in context and in her status until this
lands. Note: Irene's OPEN session still carries her old handbook
copy (craft edits land at session-open) — the housekeeping itself is
unaffected, but the clean reminder/agenda experiment starts at her
next session.
3. **Housekeeper prompt review (GM-led).** The GM's dry-run verdict:
works mechanically, output not as expected, and the prompt itself
is unseen so far. Iterate: read housekeeper.md, tweak, replay —
the dry-run button re-runs the wrap over the session log with
the dry-run button re-runs housekeeping over the session log with
nothing applied.
3. ~~**Status discipline**~~ — RESOLVED BY REDIRECT (2026-11-14,
QUESTIONS #32/#33): the paper's thread-tracking drift got its own
channel. The agenda (`<agenda>`/`<add>`/`<drop>`, cap-5 recency
queue, invariants.md GM-written) is built end to end; the gate
fight is over by design. The test is the next live window: watch
cross-channel drift and drop off-by-ones alongside observables
#12/#14.
4. **Keep playing.** Observables #12 (does the paper stay small and
match the transcripts) and #14 (one thing per turn vs lengthening
turns — completions grew 103 to 668 chars across window one) are
live now.
4. **Keep playing — and watch the experiments.** Observables #12 (the
status stays small and matches the transcripts) and #14 (turn
lengthening — the reminder is the countermeasure under test), plus
the fresh watchables: does thread-tracking move to the agenda;
drop off-by-ones; cross-channel drift; whether description-only
"empty turns" stay on her side of the purview line.
(Resolved en route: the status-discipline fight — the agenda gave the
drift its own channel, QUESTIONS #32/#33.)
## The multiuser build (2026-11-14) — DONE
@@ -164,12 +222,12 @@ Design round closed (ROADMAP "The multiuser server", QUESTIONS
2. **Ownership + fork + packages** — owner gating on every mutation
and every model call; per-run activity locks (turn, ask, turn0,
housekeeping job, fork); `POST /api/runs/:id/fork` (staged copy,
atomic swap, owner replaced, `forked` stamped, window state
atomic swap, owner replaced, `forked` stamped, session state
mirrored); clerk learns the second packages root (`state/packages`)
and `save-package`; user packages published to all. Ownership is
resolved, never maintained (GM ruling): run.json keeps dead owner
ids, the API reads them as absent; revocation is a db delete plus
closing the revoked user's open windows.
closing the revoked user's open sessions.
3. **SPA** — claim view, identity in the header, superuser admin on
home, spectator mode (read everything, mutate nothing, fork CTA),
save-as-package on setup, origin in the package picker, garnish
@@ -185,7 +243,7 @@ Design round closed (ROADMAP "The multiuser server", QUESTIONS
Gotcha learned while testing: the a11y snapshot races async renders —
wait for text that only exists POST-render (a card name, the
window-info line), never the static skeleton; and CSS text-transform
session-info line), never the static skeleton; and CSS text-transform
still uppercases wait targets.
Model selection wired (GM, same day): run.json now carries
@@ -214,13 +272,18 @@ the public user shape only (it was leaking the token hash). Smoke
56/56, UI verified end to end.
The per-turn reminder built (GM-ruled, QUESTIONS #34, steal #11 DONE):
`reminder.md` (repo-shared, agent-drafted extraction of the turn-
composition protocol, awaiting the GM's edit + handbook cut) rides
after every GM turn as its own system chunk; one live copy — older
elide from the view, the SPA shows one collapsed card for the newest,
housekeeping never sees it. Smoke 58/58 plus an elision unit check
(log keeps 5, view carries exactly one, positioned at the freshest
end). The next live window is the experiment for observable #14.
`reminder.md` (repo-shared) rides after every GM turn as its own
system chunk; one live copy — older elide from the view, the SPA shows
one collapsed card for the newest, housekeeping never sees it. The
GM's rewrite superseded the agent's extraction draft: it is a
*procedure* (understand -> decide -> compose -> adjust your papers),
not a rule list — new material throughout, including the per-class
turn budget (zero or one of thoughts/dialogue/actions) and the
dice-tiebreak. The handbook's "one thing per turn" was cut to "short
turns" in step (the budget lives in the reminder now). Smoke 58/58
plus an elision unit check (the log keeps every copy, the view carries
exactly one, at the freshest end). The next live window is the
experiment for observable #14.
## Working agreements with the GM
@@ -253,24 +316,33 @@ are open questions for the drafting session with the GM).
- `server.json` (gitignored) holds the real key; it mirrors opencode's
`dv` provider (config at `~/.config/opencode/opencode.jsonc`, auth at
`~/.local/share/opencode/auth.json`).
- Resetting a run: `Remove-Item packages/<story>/db/memory.db` then `init`.
- Resetting a run: `Remove-Item runs/<id>/db/memory.db` then `init`.
`--force` flags are only for disposable pre-story states.
- Sessions log to `packages/<story>/sessions/<stamp>.jsonl` — housekeeping's
- Sessions log to `runs/<id>/sessions/<stamp>.jsonl` — housekeeping's
transcript, and the future watcher agent's food (see ROADMAP).
- The `--mock` mode has caught two real bugs already (dump column
rename, readline line-loss). Run it before any live first-use.
- The mock smoke lives in the repo (`test/` — the scripts moved in
from the temp dir at the GM's ask, 2026-11-14; no broader
test-infra ruling is attached): `smoke.mjs` (the 58-step
multiuser/agenda/reminder pass), `check-reminder.mjs` (the elision
unit check), `restart-check.mjs` (post-restart rebuild). They
expect a CLEAN state/ plus a running `--mock` server; smoke prints
its run ids and leaves a temp token file for the restart check.
Clean up state/ and the smoke runs afterwards — only the real runs
stay.
## Not yet exercised (expect first-use friction)
- **First start under multiuser** (step 1 above) — nothing live has
touched the auth spine, invites, fork, or spectator mode yet; all
are mock-proven only.
- ask_gm in live flow (pause/resume is mock-proven; the live model
simply made its own choices so far — by design), the conflict-carry
path in flow, records tools through the server (needs a
records-enabled run).
- The housekeeping chain is live-proven once (see `live-smoke`); a
rejection in live flow, and the recovery-apply path on a real
simply made its own choices so far — by design), the self-heal
conflict path in live flow (mock-proven; capped at 3 heals a turn),
the agenda and the reminder against a live model, records tools
through the server (needs a records-enabled run).
- A live housekeeping rejection, and the recovery-apply path on a real
manifest, remain first-use items.
- The in-flow missed-update prediction (ROADMAP, system-1 entry) —
measurable from the second real window on. The `live-smoke` run
(2026-11-14) is the first real session: two turns + the first real
wrap; window two is open on it now — the run is disposable but
usable for a test drive.
measurable from the second real session on.