the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
This commit is contained in:
+81
-6
@@ -131,6 +131,86 @@ export function renderContent(target, text, { extract }) {
|
||||
return { status, conflict, agenda };
|
||||
}
|
||||
|
||||
// the note line, shared by both walks
|
||||
/** @param {NoteEvent} e @returns {?string} */
|
||||
function noteText(e) {
|
||||
if (e.kind === 'session') return `session ${e.n} opened`;
|
||||
if (e.kind === 'ask') return `ask_gm: ${e.question}`;
|
||||
if (e.kind === 'status') return `status: lost ${JSON.stringify(e.applied?.lost ?? [])}, gained ${JSON.stringify(e.applied?.gained ?? [])}`;
|
||||
if (e.kind === 'agenda') return `agenda: added ${JSON.stringify(e.applied?.added ?? [])}, dropped ${JSON.stringify(e.applied?.dropped ?? [])}`;
|
||||
if (e.kind === 'pick') return `variant literature: ${e.count} offered, #${e.chosen + 1} picked`;
|
||||
return null;
|
||||
}
|
||||
|
||||
// the raw walk: the audit surface over the same log -- everything as
|
||||
// it rode the wire. Thinking, whole variant blocks, every reminder
|
||||
// copy, full tool results, the rides inline in the GM prose; plain
|
||||
// labeled blocks, no register rendering -- the table is the reading
|
||||
// surface, this is the wire.
|
||||
/** @param {LogEvent[]} entries */
|
||||
export function renderRaw(entries) {
|
||||
const t = $('transcript');
|
||||
t.textContent = '';
|
||||
/** @param {string} who @returns {HTMLElement} */
|
||||
const block = (who) => {
|
||||
const d = el('div', 'raw-block');
|
||||
d.appendChild(el('div', 'who', who));
|
||||
t.appendChild(d);
|
||||
return d;
|
||||
};
|
||||
for (const e of entries) {
|
||||
if (e.t === 'bundle') {
|
||||
// the bundle rides collapsed here too -- it is the same content
|
||||
// the table shows, and it is huge
|
||||
const d = el('details', 'bundle');
|
||||
d.appendChild(el('summary', null, `bundle -- ${e.part}`));
|
||||
d.appendChild(el('pre', null, e.m.content));
|
||||
t.appendChild(d);
|
||||
continue;
|
||||
}
|
||||
if (e.t === 'opening') {
|
||||
t.appendChild(el('div', 'machinery', `her opening status: ${JSON.stringify(e.status)}`));
|
||||
continue;
|
||||
}
|
||||
if (e.t === 'note') {
|
||||
const text = noteText(e);
|
||||
if (text) t.appendChild(el('div', 'machinery', text));
|
||||
continue;
|
||||
}
|
||||
if (e.t === 'tool') {
|
||||
const d = block(e.ask ? 'ruling' : 'tool result');
|
||||
d.appendChild(el('pre', null, String(e.m.content)));
|
||||
continue;
|
||||
}
|
||||
if (e.t === 'msg' && e.reminder) {
|
||||
// every copy shows: the raw log keeps each as-sent chunk, and
|
||||
// the audit surface keeps them all (the table elides superseded
|
||||
// ones)
|
||||
const d = el('details', 'bundle');
|
||||
d.appendChild(el('summary', null, 'turn reminder -- as sent'));
|
||||
d.appendChild(el('pre', null, String(e.m.content ?? '')));
|
||||
t.appendChild(d);
|
||||
continue;
|
||||
}
|
||||
if (e.t === 'msg' && e.m.role === 'user') {
|
||||
const d = block(e.conflictOnly ? 'gm -- conflict only' : 'gm');
|
||||
d.appendChild(el('pre', null, String(e.m.content ?? '')));
|
||||
continue;
|
||||
}
|
||||
if (e.t === 'msg' && e.m.role === 'assistant') {
|
||||
const d = block('player');
|
||||
if (e.m.reasoning_content) d.appendChild(el('pre', 'raw-thinking', e.m.reasoning_content));
|
||||
d.appendChild(el('pre', null, String(e.m.content ?? '')));
|
||||
for (const c of e.m.tool_calls ?? []) {
|
||||
d.appendChild(el('div', 'machinery', `[tool call] ${c.function.name}`));
|
||||
if (c.function.arguments) d.appendChild(el('pre', null, String(c.function.arguments)));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
t.scrollTop = t.scrollHeight;
|
||||
}
|
||||
|
||||
// the entry walk. onConflict receives a conflict block found on a GM
|
||||
// turn -- the play view owns where it lands (the status pane). The
|
||||
// opening event (her opening status) renders as machinery, mirroring
|
||||
@@ -222,12 +302,7 @@ export function renderTranscript(entries, { onConflict } = {}) {
|
||||
}
|
||||
/** @param {NoteEvent} e */
|
||||
function renderNote(e) {
|
||||
let text = null;
|
||||
if (e.kind === 'session') text = `session ${e.n} opened`;
|
||||
else if (e.kind === 'ask') text = `ask_gm: ${e.question}`;
|
||||
else if (e.kind === 'status') text = `status: lost ${JSON.stringify(e.applied?.lost ?? [])}, gained ${JSON.stringify(e.applied?.gained ?? [])}`;
|
||||
else if (e.kind === 'agenda') text = `agenda: added ${JSON.stringify(e.applied?.added ?? [])}, dropped ${JSON.stringify(e.applied?.dropped ?? [])}`;
|
||||
else if (e.kind === 'pick') text = `variant literature: ${e.count} offered, #${e.chosen + 1} picked`;
|
||||
const text = noteText(e);
|
||||
if (text) t.appendChild(el('div', 'machinery', text));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user