530170224f
- clerk phase 0: the paper replaces key/value status - a description set with exact-match lost/gained delta apply (paper-apply), non-blocking, misses relayed back as conflict strings; paper / paper-set (GM override) / paper-ingest (a file's status block at new-game); amend and discard journal prior content and the paper ops journal what they replace (events.prior, the saga rule); seed rejects a status key loudly. Smoke-tested end to end - preset/run split: packages are presets (authored content only - the six state dirs are gone from both), runs are per-deployment instances under runs/ (gitignored); create <package> <run-id> copies the package wholesale (shared prompts included, run.json lineage plus optional model override) and inits state; --run addresses runs; packages and runs list them; config.json names the default package. The seed applies lazily at a fresh run's first window-open - bridge retired before ever going live: bridge.json became server.json (bind, endpoint, models, contextWindow, params - steal #4), example committed, bridge.mjs stays as the loop donor until server mock-parity - prelude.md renamed turn-0.md (GM); mechanical feeders, pink ice as licensed corpo firewall, slop section, Pinky treatment pinned (GM) - harness decisions (ROADMAP The harness): stated goal - a usable RP harness, clone-and-run or invited instance, key on the backend, no secrets in the repo; repo ships code and authored content only; copy-at-creation, editable everything, discipline on the GM; 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 (#4 resolved, #7 dissolved with the bridge, #21 by default) - system.md split ruled (#20): substrate facts / per-project guards / per-run craft, hard limits in the craft copy; name call resolved - keep Rell (#19a) - docs: README gains the goal and deployment model, booting rewritten for the create flow; ROADMAP phasing 0-1 done; HANDOFF and the decision queue current
58 lines
2.3 KiB
SQL
58 lines
2.3 KiB
SQL
PRAGMA foreign_keys = ON;
|
|
|
|
-- ids are AUTOINCREMENT: rows can move between entries and records
|
|
-- (archive / unarchive), and ids must never be reused — journal targets
|
|
-- stay meaningful forever.
|
|
CREATE TABLE IF NOT EXISTS entries (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
ring TEXT NOT NULL CHECK (ring IN ('a', 'b', 'cold')),
|
|
type TEXT NOT NULL CHECK (type IN ('place', 'person', 'fact', 'thread')),
|
|
label TEXT NOT NULL,
|
|
detail TEXT NOT NULL DEFAULT '',
|
|
created TEXT NOT NULL,
|
|
last_touched TEXT NOT NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS entries_ring_touch
|
|
ON entries (ring, last_touched DESC, id DESC);
|
|
|
|
-- the character's files: cards, ledgers, manifests.
|
|
-- detailed, queryable, never bulk-loaded into context.
|
|
-- access is diegetic and per-run: settings.json {"records": bool}
|
|
CREATE TABLE IF NOT EXISTS records (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
kind TEXT NOT NULL,
|
|
label TEXT NOT NULL,
|
|
detail TEXT NOT NULL DEFAULT '',
|
|
created TEXT NOT NULL
|
|
);
|
|
|
|
-- the player's piece of paper: freeform descriptions of her immediate
|
|
-- situation, admitted by the three-part gate (non-normal, acute,
|
|
-- turn-affecting). No keys, no baselines — just what's true right now.
|
|
-- the player mutates it with <lost>/<gained> deltas (exact match);
|
|
-- the GM overrides out-of-band. Descriptions never contain commas:
|
|
-- both the delta lists and the <status> block are comma-separated.
|
|
CREATE TABLE IF NOT EXISTS paper (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
descr TEXT NOT NULL UNIQUE,
|
|
added TEXT NOT NULL
|
|
);
|
|
|
|
-- append-only audit journal; nothing here is ever updated or deleted.
|
|
-- target is 'e<id>' for entries, 'r<id>' for records, 'p<id>' for paper
|
|
-- rows, 'paper' for whole-paper replaces.
|
|
-- prior captures the replaced state of a journaled mutator (the saga
|
|
-- rule): amend/discard carry the old record content, paper ops carry
|
|
-- what was lost — so turn surgery can compensate mechanically.
|
|
CREATE TABLE IF NOT EXISTS events (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
window TEXT NOT NULL,
|
|
op TEXT NOT NULL CHECK (op IN ('insert', 'touch', 'promote', 'demote', 'reword', 'delete', 'evict', 'revive', 'record', 'archive', 'unarchive', 'amend', 'discard', 'paper-add', 'paper-drop', 'paper-set')),
|
|
target TEXT NOT NULL,
|
|
reason TEXT NOT NULL DEFAULT '',
|
|
prior TEXT NOT NULL DEFAULT ''
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS events_window ON events (window);
|