per-turn reminder: turn-composition protocol as its own system chunk after every GM turn, one live copy elided like the papers; handbook cut follows (short turns)
This commit is contained in:
@@ -88,7 +88,11 @@ memory the agent owes itself across sessions.
|
||||
and per-browser — no sign-out (lifecycle is a ROADMAP extension
|
||||
point). The agenda (QUESTIONS #32): second player paper, `<add>`/
|
||||
`<drop>` deltas, cap-5 recency queue; Irene's events journal
|
||||
migrated (CHECK widened) — her db is agenda-ready.
|
||||
migrated (CHECK widened) — her db is agenda-ready. The per-turn
|
||||
reminder (QUESTIONS #34, steal #11 done): reminder.md is repo-shared,
|
||||
rides after every GM turn as its own system chunk, one live copy
|
||||
(older elide); its CONTENT is the GM's — my draft is a proposal,
|
||||
the handbook duplicate-cut is their red pen.
|
||||
- Substrate design round complete (2026-11-13); rulings live in ROADMAP
|
||||
("The harness") and HANDOFF. Bridge retired before ever going live;
|
||||
REST + SPA is the MVP; runs are per-deployment instances copied from
|
||||
|
||||
@@ -213,6 +213,15 @@ parser follows it. Session-route fix rode along: /api/session returns
|
||||
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.
|
||||
|
||||
## Working agreements with the GM
|
||||
|
||||
- **"I draft, you cut"** for all creative content.
|
||||
|
||||
@@ -185,6 +185,20 @@ be strict without fighting the model — states go to the paper,
|
||||
intentions to the agenda, each channel's copy states what it is. The
|
||||
first live window with both channels is the test.
|
||||
|
||||
### 34. The per-turn reminder — RESOLVED (2026-11-14, GM)
|
||||
The opencode analogy: the harness re-injects its instructions every
|
||||
turn (recency against attention decay, robustness to context
|
||||
reconstruction). Steal #11 demanded measured decay first — observable
|
||||
#14 delivered it (completions lengthening across window one). Ruled:
|
||||
not a distillation and not a system-header re-send — a REFACTOR. The
|
||||
small "how to compose your turn" protocol extracted into `reminder.md`
|
||||
(repo-shared, never per-package), sent after the GM's prose as its own
|
||||
`role: system` chunk every turn; superseded copies elide (one live
|
||||
copy, freshest position). Agent drafted the extraction proposal; the
|
||||
GM edits the file and cuts the duplicates from the handbook (their red
|
||||
pen). Absent/empty file = no ride. The reminder is now the experiment:
|
||||
#14's curve with it in the window.
|
||||
|
||||
### 31. Run display identity — RESOLVED (2026-11-14)
|
||||
Fork broke the (package, pc) uniqueness that made "Package / PC" a safe
|
||||
identifier — a fork copies both, and the pc name cannot change without
|
||||
|
||||
@@ -180,7 +180,10 @@ window, and sends turn-0 as the first GM turn in one action.
|
||||
else arrives as GM messages (user role), one message
|
||||
per file: `backdrop.md`, `character.md`, `canon/ring-b.md`,
|
||||
`canon/ring-a.md` — identity first, then memory, ring A in the
|
||||
recency slot. On a new game, `turn-0.md` is the opening beat: its
|
||||
recency slot. Every GM turn is followed by the reminder —
|
||||
`reminder.md` (repo-fed) as its own `role: system` chunk carrying
|
||||
the turn-composition protocol; superseded copies elide from the
|
||||
live view, so exactly one exists, always at the freshest end. On a new game, `turn-0.md` is the opening beat: its
|
||||
trailing `<status>` block is ingested as her opening paper at
|
||||
window-open, and the beat itself is sent as the first GM turn when
|
||||
play starts — a separate message through the turn path, not part of
|
||||
@@ -457,6 +460,10 @@ housekeeper.md the wrap prompt — repo-fed at wrap, never copied
|
||||
internal housekeeper agent, never the bundle
|
||||
(system.md and invariants.md are bundle parts and
|
||||
are inspectable read-only in the SPA)
|
||||
reminder.md the per-turn reminder: the turn-composition protocol,
|
||||
repo-shared, never copied into a run — sent after the
|
||||
GM's prose as its own system chunk every turn, one
|
||||
live copy (older elide). Absent/empty = no ride
|
||||
HANDOFF.md working state — where did we leave off, next steps, gotchas
|
||||
ROADMAP.md SOTA review and steal list, worked point by point
|
||||
QUESTIONS.md the decision queue — open questions, pending calls
|
||||
|
||||
+15
-14
@@ -480,20 +480,21 @@ Current answer: close the window. Fine for the test; revisit if real
|
||||
sessions regularly overflow.
|
||||
Status: DEFERRED.
|
||||
|
||||
### 11. Periodic system-prompt re-injection — OPEN
|
||||
If the system prompt gets disregarded as it sinks into distant context,
|
||||
try sending it again every X turns. The transport exists: the endpoint
|
||||
accepts and honors mid-stream system messages (probed 2026-11-12), and
|
||||
the status block already re-rides every GM turn — the same trick at a
|
||||
slower cadence. This is the "last resort" the system-1 decision
|
||||
anticipated (prompt-nagging mid-flow), so it stays conditional on
|
||||
observed decay: measure first — observable #14 (narrative discipline)
|
||||
and the context meter mark when drift starts, and X should come from
|
||||
that data, not guesswork. Open details: fixed cadence vs
|
||||
decay-triggered; system message vs GM-turn attachment; whether
|
||||
superseded copies elide from the live view (like old status blocks) or
|
||||
accumulate.
|
||||
Status: OPEN (2026-11-13).
|
||||
### 11. Periodic system-prompt re-injection — DONE (2026-11-14)
|
||||
Built as the per-turn reminder, GM-ruled: not the whole system header
|
||||
re-sent (uncalled for), but the small "how to compose your turn"
|
||||
protocol extracted into `reminder.md` (repo-shared, never copied into
|
||||
a run). It rides after the GM's prose as its own `role: system`
|
||||
session chunk on every turn; superseded copies elide from the live
|
||||
view, so exactly one exists, always at the freshest position — the
|
||||
same single-copy policy as the papers. Absent/empty file = no ride
|
||||
(the feature sleeps). The measured trigger arrived first: observable
|
||||
#14's completions lengthening across window one. The reminder is now
|
||||
the experiment: does the lengthening flatten with it in the window.
|
||||
Housekeeping never sees it (fresh context per wrap); the SPA shows one
|
||||
collapsed card for the newest copy, mirroring the policy.
|
||||
Status: DONE (content is the GM's, extracted from the handbook — the
|
||||
duplicate handbook cut is the GM's red pen).
|
||||
|
||||
## Rejected, with reasons
|
||||
|
||||
|
||||
+1
-4
@@ -2,11 +2,8 @@
|
||||
|
||||
- GM narrates, you respond as your character. Mirror the GM's format, not
|
||||
the length: GM turns carry the world, yours carry one move.
|
||||
- **One thing per turn** — an action, a thought, one coherent beat of
|
||||
description. Frequent beats keep the story's flow dynamic and allow for
|
||||
- **Short turns.** Frequent beats keep the story's flow dynamic and allow for
|
||||
better alignment. Note that this isn't about length, it's about rhythm.
|
||||
End your turn when you want the world to react. If your character is
|
||||
giving a talk to a camera, feel free to speak as long as you want.
|
||||
- **No hedging.** Never offer GM alternatives ("she could either… or…").
|
||||
Choose and commit. If the choice is genuinely non-obvious, pick one
|
||||
arbitrarily and see where it goes. Reminder: the point isn't to "win",
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
# How to compose your turn
|
||||
|
||||
## Asking GM
|
||||
|
||||
You may choose to ask GM instead of making a turn. Use the tool if given, else compose an OOC message.
|
||||
|
||||
## Understand the world around your character
|
||||
|
||||
You are given the memories, the status, the agenda and the prose of the current session. Build a coherent picture. If you can't, ask GM.
|
||||
|
||||
## Decide on the turn's objectives
|
||||
|
||||
Your character may do zero or one thing from each of these classes:
|
||||
|
||||
- Thoughts
|
||||
- Dialogue
|
||||
- Actions
|
||||
|
||||
An empty turn is valid, if it only contains descriptions.
|
||||
|
||||
Things to consider when making the decision:
|
||||
|
||||
- What seems logical to a reader? Your character has to make sense.
|
||||
- What makes the story better? Avoiding risk for your character introduces risk for the story.
|
||||
|
||||
If you have several equal options, pick at random (check your tools for a dice roll).
|
||||
|
||||
If you can't proceed, ask GM.
|
||||
|
||||
## Dialogue
|
||||
|
||||
"One thing" rule for dialogue means this:
|
||||
|
||||
- If your character asks a non-rhetorical question and expects an answer, this is a natural boundary.
|
||||
- If your character is making a pause and you expect the world to react, this is a natural boundary.
|
||||
|
||||
GM can't skip a turn. GM can't put a turn inside your turn. End dialogue when the story would read better with GM's prose after yours.
|
||||
|
||||
## Compose descriptions
|
||||
|
||||
Dialogue goes verbatim, thoughts and actions require narration. Decorate the turn with additional flavour when it seems appropriate.
|
||||
|
||||
## Adjust your papers
|
||||
|
||||
Your status and agenda blocks keep their contents between your turns. Now that you know what your turn describes, add and remove items from
|
||||
both lists to make them reflect the new reality your turn creates.
|
||||
@@ -102,6 +102,18 @@ export function assembleSystem(runId) {
|
||||
return expandVars(runId, [system, invariants, handbook].join('\n\n'));
|
||||
}
|
||||
|
||||
// the per-turn reminder: the small turn-composition protocol, repo-
|
||||
// shared (never copied into a run), sent after the GM's prose as its
|
||||
// own system chunk every turn. Older copies elide from the view, so
|
||||
// exactly one lives at the freshest position (ROADMAP steal #11).
|
||||
// Absent or empty file = no ride; the feature sleeps until written.
|
||||
export function assembleReminder(runId) {
|
||||
const p = path.join(ROOT, 'reminder.md');
|
||||
if (!fs.existsSync(p)) return null;
|
||||
const text = fs.readFileSync(p, 'utf8').trim();
|
||||
return text ? expandVars(runId, text) : null;
|
||||
}
|
||||
|
||||
// the bundle: GM messages, one per file. turn-0 never rides it — the
|
||||
// opening beat is a GM turn (sent on start), not context.
|
||||
export function assembleBundle(runId) {
|
||||
|
||||
@@ -31,6 +31,7 @@ export function renderTranscript(lines) {
|
||||
const L = [];
|
||||
for (const e of lines) {
|
||||
if (e.t === 'bundle') continue; // context, not exchange — provided as separate inputs
|
||||
if (e.t === 'msg' && e.reminder) continue; // identical every turn — context, not exchange
|
||||
if (e.t === 'msg') {
|
||||
if (e.m.role === 'user' && e.conflictOnly) {
|
||||
L.push('[conflict — answered in-band]', e.m.content.replace(/<\/?conflict>/g, '').trim(), '');
|
||||
|
||||
+5
-1
@@ -10,7 +10,7 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { clerkJson } from './clerk.mjs';
|
||||
import { toolList, runTool, readSettings, runDir, expandVars } from './bundle.mjs';
|
||||
import { toolList, runTool, readSettings, runDir, expandVars, assembleReminder } from './bundle.mjs';
|
||||
import { renderView } from './session.mjs';
|
||||
|
||||
export class HttpError extends Error {
|
||||
@@ -36,6 +36,10 @@ export async function gmTurn(ctx, runId, line, user) {
|
||||
const agendaWire = agenda.map((d, i) => `${i}. ${d}`).join('; ');
|
||||
const content = `${line.trim()}\n\n<status>${paper.join(', ')}</status>\n<agenda>${agendaWire}</agenda>`;
|
||||
s.append({ t: 'msg', m: { role: 'user', content } });
|
||||
// the reminder follows the GM's prose as its own system chunk —
|
||||
// every turn, one live copy (older ones elide in the view)
|
||||
const reminder = assembleReminder(runId);
|
||||
if (reminder) s.append({ t: 'msg', m: { role: 'system', content: reminder }, reminder: true });
|
||||
return runLoop(ctx, runId, user);
|
||||
}
|
||||
|
||||
|
||||
+11
-7
@@ -267,13 +267,17 @@ route('POST', '/api/packages', async ({ body, user }) => {
|
||||
return { package: JSON.parse(r.out) };
|
||||
});
|
||||
|
||||
// the repo-fed prompts, read-only: per-project opening + guards and
|
||||
// substrate invariants — never copied into a run, so the editor shows
|
||||
// them as context, not as something to edit
|
||||
route('GET', '/api/prompts', async () => ({
|
||||
system: fs.readFileSync(path.join(ROOT, 'system.md'), 'utf8').trim(),
|
||||
invariants: fs.readFileSync(path.join(ROOT, 'invariants.md'), 'utf8').trim(),
|
||||
}));
|
||||
// the repo-fed prompts, read-only: per-project opening + guards,
|
||||
// substrate invariants, and the per-turn reminder — never copied into
|
||||
// a run, so the editor shows them as context, not as something to edit
|
||||
route('GET', '/api/prompts', async () => {
|
||||
const readOpt = (f) => (fs.existsSync(path.join(ROOT, f)) ? fs.readFileSync(path.join(ROOT, f), 'utf8').trim() : null);
|
||||
return {
|
||||
system: readOpt('system.md'),
|
||||
invariants: readOpt('invariants.md'),
|
||||
reminder: readOpt('reminder.md'),
|
||||
};
|
||||
});
|
||||
|
||||
// the clerk's list, enriched with what the server already knows: the
|
||||
// open window, the pending ask, and the housekeeping bookkeeping. A
|
||||
|
||||
+9
-1
@@ -165,18 +165,26 @@ const STRIP_BLOCKS = /\n?<(status|conflict|agenda)>[\s\S]*?<\/\1>\n?/g;
|
||||
|
||||
export function renderView(s, keepToolResults = 4) {
|
||||
const toolIdx = [];
|
||||
const reminderIdx = [];
|
||||
let lastGmIdx = -1;
|
||||
s.lines.forEach((e, i) => {
|
||||
if (e.t === 'tool') toolIdx.push(i);
|
||||
if (e.t === 'msg' && e.m.role === 'user') lastGmIdx = i;
|
||||
if (e.t === 'msg' && e.reminder) reminderIdx.push(i);
|
||||
});
|
||||
const keep = new Set(toolIdx.slice(-keepToolResults));
|
||||
const newestReminder = reminderIdx.length ? reminderIdx[reminderIdx.length - 1] : -1;
|
||||
const msgs = [];
|
||||
for (const [i, e] of s.lines.entries()) {
|
||||
if (e.t === 'bundle') {
|
||||
msgs.push({ role: e.m.role, content: e.m.content });
|
||||
} else if (e.t === 'msg') {
|
||||
if (e.m.role === 'assistant') {
|
||||
if (e.reminder) {
|
||||
// the per-turn reminder: only the newest copy lives in the
|
||||
// context — superseded ones elide (identical content, freshest
|
||||
// position, exactly like the papers)
|
||||
if (i === newestReminder) msgs.push({ role: 'system', content: e.m.content.trim() });
|
||||
} else if (e.m.role === 'assistant') {
|
||||
// thinking never goes back; the log keeps it
|
||||
const m = { role: 'assistant', content: e.m.content ?? null };
|
||||
if (e.m.tool_calls?.length) m.tool_calls = e.m.tool_calls;
|
||||
|
||||
+20
-2
@@ -234,6 +234,19 @@ function renderTranscript(entries) {
|
||||
continue;
|
||||
}
|
||||
flushBundle();
|
||||
if (e.t === 'msg' && e.reminder) {
|
||||
// the turn reminder: the transcript mirrors the live-context
|
||||
// policy — one collapsed card for the newest copy, superseded
|
||||
// ones elide (the log keeps every as-sent chunk)
|
||||
const newest = [...entries].reverse().find((x) => x.reminder);
|
||||
if (e === newest) {
|
||||
const d = el('details', 'bundle');
|
||||
d.appendChild(el('summary', null, 'turn reminder — rides every GM turn'));
|
||||
d.appendChild(el('pre', null, e.m.content));
|
||||
t.appendChild(d);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (e.t === 'msg') {
|
||||
if (e.m.role === 'user' && e.conflictOnly) {
|
||||
// the self-heal message: error traffic on its own, never GM prose
|
||||
@@ -653,6 +666,7 @@ async function saveModels(playerSel, housekeeperSel, stateEl) {
|
||||
const EDIT_LIST = [
|
||||
{ name: 'system.md', mode: 'ro', source: 'repo' },
|
||||
{ name: 'invariants.md', mode: 'ro', source: 'repo' },
|
||||
{ name: 'reminder.md', mode: 'ro', source: 'repo' }, // rides every turn as its own system chunk
|
||||
{ name: 'handbook.md', mode: 'rw', source: 'run' },
|
||||
{ name: 'backdrop.md', mode: 'rw', source: 'run' },
|
||||
{ name: 'character.md', mode: 'rw', source: 'run' },
|
||||
@@ -666,7 +680,7 @@ const EDIT_LIST = [
|
||||
// file (repo-fed or run copy) becomes a fillable input in setup
|
||||
function scanVars(prompts, files) {
|
||||
const texts = [
|
||||
prompts.system, prompts.invariants,
|
||||
prompts.system, prompts.invariants, prompts.reminder,
|
||||
files['handbook.md']?.content,
|
||||
files['backdrop.md']?.content, files['character.md']?.content, files['turn-0.md']?.content,
|
||||
];
|
||||
@@ -717,7 +731,11 @@ async function viewSetup(id, seq) {
|
||||
if (detail.run.owner !== state.me.id) return navigate(`/runs/${id}`); // not yours: read-only — fork to edit
|
||||
|
||||
state.files = files.files;
|
||||
state.repoPrompts = { 'system.md': prompts.system, 'invariants.md': prompts.invariants };
|
||||
state.repoPrompts = {
|
||||
'system.md': prompts.system ?? '',
|
||||
'invariants.md': prompts.invariants ?? '',
|
||||
'reminder.md': prompts.reminder ?? '',
|
||||
};
|
||||
$('setup-title').textContent = detail.display;
|
||||
$('setup-state').textContent = `${detail.run.package} · ${id} — draft; edits land when the window opens`;
|
||||
$('setup-start').disabled = false;
|
||||
|
||||
Reference in New Issue
Block a user