substrate: spa v1 plan, rewrite-here surgery, status redesign

- ROADMAP: SPA v1 decisions recorded - the story lives in the session
  logs (publishing is a later export), sessions outlive the browser via
  boot-rebuild from the jsonl, loopback single-human, ask_gm as a modal
  that survives refresh, context meter loud past 85 percent, status pane
  always visible, housekeeping is the window-close ritual with
  autorestart (rejection holds the restart; review is async via logs),
  synchronous REST as the full substrate with the SPA strictly a
  client; phasing 0-3 and the API spine; steals #2 and #3 decided
- rewrite-here turn surgery: an unfortunate GM turn is edited and the
  session restarts from there; window-scoped only (post-housekeeping
  edits are retcons); the saga rule - every player tool is either
  session-pure or a journaled mutator with recorded prior state, so
  compensation is mechanical; trivial typos tolerated
- status redesign (QUESTIONS #17): the paper holds freeform
  descriptions admitted by a three-part gate (non-normal, acute,
  turn-affecting); the full paper rides every GM turn as a status
  block - reads are state, writes are deltas via lost/gained tags in
  the player's turn, exact match, non-blocking, misses relayed back as
  conflict blocks; no cap; normalization drift is the housekeeper's to
  place; status leaves the opening bundle and the bundle copy of old
  blocks elides from the live view; the initial paper rides the prelude
- system.md: Status section rewritten for the paper model; records
  cross-reference fixed
- housekeeper.md: entries are personal memories now - first person, her
  voice, labels stay terse handles; status blocks and player thinking
  named as inputs, evidence never fiction; the paper watch rule (place
  drift: facts to rings, identity to open questions)
- la-caramba: GM red-pen of the seed (first-person sensory entries,
  status key dropped, typo fixed) and prelude (trailing status block
  seeds the paper at new-game)
- QUESTIONS: queue churn throughout - items 5, 6, 8, 15, 17, 18
  resolved; 15 through 18 added
This commit is contained in:
2026-11-12 13:42:37 +00:00
parent 9bc16afb60
commit 3d4c374894
6 changed files with 242 additions and 78 deletions
+65 -17
View File
@@ -39,19 +39,19 @@ Zero-dependency `node:http` + a no-build vanilla SPA (the repo ethos: no
package.json, everything hand-rolled) vs a framework. Recommendation on
the table: zero-dep. (2026-11-12)
### 5. ask_gm mid-loop resumption — OPEN
The play loop blocks on GM input at `ask_gm`. REST shape: a turn returns
`{state: ask_gm, question}`, the server holds the in-flight loop,
`POST /api/ask` resumes it — no long-lived connections. Alternative:
SSE/websocket streaming. Recommendation on the table: pause/resume state
machine, single GM, single run in memory. (2026-11-12)
### 5. ask_gm mid-loop resumption — RESOLVED (2026-11-12)
Pause/resume, no streaming: the turn request returns with the pending
question, the server holds the in-flight loop, the SPA shows a modal
(re-presented after a refresh via GET /api/session), and the answer
call resumes it. Synchronous REST; the SPA is strictly a client.
### 6. First-cut scope — OPEN
Play surface only (run picker, transcript, ask_gm prompt, live status
panel, tool activity) vs also the housekeeping job runner / memory
browser / context inspector (ROADMAP steals #6–#7). Recommendation on
the table: play surface first; housekeeping stays manual until the live
loop is proven. (2026-11-12)
### 6. First-cut scope — RESOLVED (2026-11-12)
v1 per GM: play surface (transcript with voice/narration/OOC visually
distinct, GM line input), ask_gm modal, always-visible status pane with
contents, context meter (loud past 85%), and a manual housekeeping
action runnable at any time. Book formatting, memory browser, context
inspector, watcher: out of scope. Turn surgery scope still open
(item 15).
### 7. Bridge vs server code sharing — OPEN
Refactor the loop core (clerk dispatch, message assembly, logging,
@@ -60,11 +60,13 @@ leave the bridge untouched and let the server grow alongside.
Recommendation on the table: shared core before duplication sets in.
(2026-11-12)
### 8. Per-turn status digest (ROADMAP steal #3) — DEFERRED
"For the time being" status rides the opening bundle, after ring-a. The
digest arrives with the substrate: transient, in the API view only,
re-read from `canon/status.md` each call, never logged. Open detail:
does the bundle copy of status then go away entirely? (2026-11-12)
### 8. Per-turn status digest (ROADMAP steal #3) — RESOLVED (2026-11-12)
Promoted into SPA v1: a fresh digest rides every turn, re-read from the
clerk before each call, and the injected digest is logged per turn —
provenance, rewrite-here compensation snapshots, and status evolution
as housekeeper evidence (observable #12). Status leaves the opening
bundle: system, backdrop, character, ring-b, ring-a (+ prelude on a
new game).
## Small / non-blocking
@@ -100,3 +102,49 @@ scene's opening are the GM's, while her side of the gap — actions,
thoughts, interiority — is hers to summarise in past. Purview amended
accordingly: skips moved from Never to Propose. Cuts are diegetic —
no OOC announcement needed.
### 15. Turn surgery — RESOLVED IN PRINCIPLE (2026-11-12)
Rewrite-here for GM turns: edit a turn, truncate everything after,
restart the live context from there. Forks rejected. Window-scoped:
post-housekeeping edits are proper retcons. Trivial typos tolerated
(publishing pass catches them). ROADMAP steal #2 updated to DECIDED.
Open details: (a) player-turn retry — same truncate with a re-call;
recommended yes, near-zero cost; (b) log representation — proposed:
the jsonl stays append-only and records surgery as typed entries;
live context, housekeeping transcript, and story export render the
effective view; (c) tool side effects in the lost range — resolved by the saga rule
(ROADMAP): session-pure tools (roll, ask_gm, search) vanish with the
turns; journaled mutators are compensated mechanically — status restored from
the status block of the last surviving GM turn, filings discarded by
rid, amends reversed via the journal once the clerk records prior
content (phase 0); (d) surgery blocked while an ask_gm is pending.
### 16. Housekeeping model configuration — OPEN
The housekeeping job runs server-side on a fresh model invocation.
Same endpoint as the player, second model entry in bridge.json
(ROADMAP steal #8 — cheap-model housekeeping one config away)? Which
model? (The housekeeper.md line on reading thinking blocks as
attention evidence, not fiction, is in — 2026-11-12.)
### 18. Ring entry voice — RESOLVED (2026-11-12)
Ruled: entries are personal memories — first person, her voice,
attitude included; labels stay terse handles. housekeeper.md aligned
(memory model, manifest example, ring-pointer example, testimony
example), seed typo fixed. While in there, the stale baseline-era
status paragraph was rewritten for the paper model (the housekeeper
places normalization drift: facts to the rings, identity to open
questions) and the Inputs list now names status blocks and thinking as
evidence, never fiction (closing the housekeeper.md half of #16).
### 17. Status redesign — RESOLVED (2026-11-12)
Adopted and written into system.md: freeform descriptions admitted by
the three-part gate (non-normal, acute, turn-affecting); the full paper
rides every GM turn as a status block — reads are state, writes are
deltas; the player mutates via lost/gained tags in its own turn,
exact-match, non-blocking, misses relayed back via a conflict block; no
cap; normalization drift goes to the card or the rings, never the
player's call. GM turns never carry deltas; GM override stays
out-of-band. The initial paper rides the prelude (seed.json dropped its
status key). Old status blocks elide from the live context view like
old tool results; the log keeps every as-sent block. The clerk/bridge
migration is latent (seed unapplied) and lands in phase 0.