History opens a seat's conversation from the Waiting card, table row and inspector. It pages the whole branch through the CHAT-02 board routes, renders untrusted text inert, polls with the follow cursor, and marks every switch (branch, newer, reconcile, gone). The WebUI proxy passes only the two conversation routes' queries upstream. Dewey authored it. Filbert asked for changes on r1 (24b046af) and approved r2 (d06de6a7) in review 160dd68d. A relaunch shows 'newer', not 'reconcile', a deviation from brief 2.3 item 6 that Filbert accepted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
16 lines
1.3 KiB
JavaScript
16 lines
1.3 KiB
JavaScript
import { mkdirSync, writeFileSync, mkdtempSync, realpathSync, chmodSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { tmpdir } from "node:os";
|
|
import { createReader } from "../../../../packages/conversation/src/reader.mjs";
|
|
const proj = realpathSync(mkdtempSync(join(tmpdir(), "fb-proj-")));
|
|
const mk = (seat) => { const d = join(proj, ".pi", "state", seat, "sessions"); mkdirSync(d, { recursive: true }); writeFileSync(join(d, "s.jsonl"), JSON.stringify({ type: "session", id: "s", cwd: proj, timestamp: "2026-09-26T00:00:00Z" }) + "\n"); return d; };
|
|
const good = mk("good"), bad = mk("bad");
|
|
chmodSync(join(proj, ".pi", "state", "bad"), 0o000);
|
|
const root = (seat, dir) => ({ seat, project: "p", projectRoot: proj, dir, harness: "pi", unsupportedReason: null, engineStartedAt: null });
|
|
const reader = createReader({ roots: [root("good", good), root("bad", bad)] });
|
|
try { const c = reader.catalogue(); console.log("catalogue ok", c.conversations.length, JSON.stringify(c.refusedRoots)); }
|
|
catch (e) { console.log("catalogue THREW", e.code, e.message); }
|
|
try { console.log("open", JSON.stringify(reader.open({ conversation: "pi-" + "0".repeat(32) }).refusal)); }
|
|
catch (e) { console.log("open THREW", e.code); }
|
|
chmodSync(join(proj, ".pi", "state", "bad"), 0o755);
|