diff --git a/agents/sage/work/vikunja-setup/comment-385-j6-fix.mjs b/agents/sage/work/vikunja-setup/comment-385-j6-fix.mjs new file mode 100644 index 000000000..9d204e459 --- /dev/null +++ b/agents/sage/work/vikunja-setup/comment-385-j6-fix.mjs @@ -0,0 +1,43 @@ +// Sage, 2026-10-20: mos-0882 ("every landing or decision gets a Vikunja comment") and mos-0954 (B-R1 correction). +// Comments on P19 385 correcting comment 345's J6 rollback line. Sage's own key; the sync key reads +// back. Prints no secret. +// Usage: node comment-385-j6-fix.mjs https://tasks.woltje.com SAGE_TOKEN_FILE SYNC_TOKEN_FILE OUT_JSON +import { readFileSync, writeFileSync, existsSync } from "node:fs"; +const [ORIGIN, KEY, SYNC, OUT] = process.argv.slice(2); +if (!/^https:\/\/tasks\.woltje\.com$/.test(ORIGIN)) throw new Error("tasks.woltje.com only"); +if (!OUT || existsSync(OUT)) throw new Error("OUT_JSON missing or exists; refusing"); +const TASK = 385; +const SIG = "Posted by Sage (T3 1ef1e4f8) with Sage's own key (bot user 13)."; +const esc = (s) => s.replace(/&/g, "&").replace(//g, ">"); +const p = (...xs) => xs.map((x) => `

${esc(x)}

`).join("") + `

${esc(SIG)}

`; +const BODY = p( + "For Jason's morning list, a correction to comment 345 (Sage, mos-0954). J6's \"flags off first\" means `activate mosaic-stack --pm --no-proof`, using row 187's --no-proof, then the middleware off. It does not mean a plain rollback. A plain rollback goes to the log's previous distinct copy, 89af38a83 since Part A, and would undo rows 177-185 along with the proof. J1-J6 themselves do not change. The fix goes in the Part B window file, which Mos checks at A2. Plan b05eb85e stays as it is.", +); +const key = readFileSync(KEY, "utf8").trim(), sync = readFileSync(SYNC, "utf8").trim(); +async function api(method, path, body, auth) { + const r = await fetch(ORIGIN + path, { method, headers: { Authorization: `Bearer ${auth}`, "Content-Type": "application/json" }, body: body === undefined ? undefined : JSON.stringify(body), redirect: "error" }); + const t = await r.text(); let json = null; try { json = JSON.parse(t); } catch {} + return { status: r.status, json }; +} +const list = (j) => j?.items ?? (Array.isArray(j) ? j : []); +const rec = { at: new Date().toISOString(), task: TASK, comment: null, problems: [] }; +const save = () => { + const out = JSON.stringify(rec, null, 1) + "\n"; + if (out.includes(key) || out.includes(sync)) throw new Error("secret in the record; not written"); + writeFileSync(OUT, out); +}; +const t = await api("GET", `/api/v2/tasks/${TASK}`, undefined, sync); +if (t.status !== 200 || t.json?.project_id !== 19 || !/X-authentik-username from 127\.0\.0\.1/.test(t.json?.title ?? "")) throw new Error(`task ${TASK}: ${t.status}, not the P19 385 task`); +writeFileSync(OUT, "", { flag: "wx" }); +const c = await api("PUT", `/api/v1/tasks/${TASK}/comments`, { comment: BODY }, key); +rec.comment = { status: c.status, id: c.json?.id ?? null }; +if (c.status >= 300 || !Number.isSafeInteger(c.json?.id)) rec.problems.push(`comment: ${c.status} ${c.json?.message ?? ""}`); +else { + const back = await api("GET", `/api/v2/tasks/${TASK}/comments?per_page=50`, undefined, sync); + const found = list(back.json).find((x) => x.id === c.json.id); + Object.assign(rec.comment, { readBack: back.status, found: Boolean(found) }); + if (back.status !== 200 || !found) rec.problems.push(`read-back: ${back.status}`); +} +save(); +process.stdout.write(JSON.stringify(rec, null, 1) + "\n"); +if (rec.problems.length) process.exit(2); diff --git a/agents/sage/work/vikunja-setup/comment-385-row187.mjs b/agents/sage/work/vikunja-setup/comment-385-row187.mjs new file mode 100644 index 000000000..c338d0621 --- /dev/null +++ b/agents/sage/work/vikunja-setup/comment-385-row187.mjs @@ -0,0 +1,44 @@ +// Sage, 2026-10-20: mos-0882 ("every landing or decision gets a Vikunja comment") and mos-0928 Part B step A0. +// Comments on P19 385 that Part B A0 is row 187 (#1685). Sage's own key; the sync key reads +// back. Prints no secret. +// Usage: node comment-385-row187.mjs https://tasks.woltje.com SAGE_TOKEN_FILE SYNC_TOKEN_FILE OUT_JSON +import { readFileSync, writeFileSync, existsSync } from "node:fs"; +const [ORIGIN, KEY, SYNC, OUT] = process.argv.slice(2); +if (!/^https:\/\/tasks\.woltje\.com$/.test(ORIGIN)) throw new Error("tasks.woltje.com only"); +if (!OUT || existsSync(OUT)) throw new Error("OUT_JSON missing or exists; refusing"); +const TASK = 385; +const SIG = "Posted by Sage (T3 1ef1e4f8) with Sage's own key (bot user 13)."; +const esc = (s) => s.replace(/&/g, "&").replace(//g, ">"); +const p = (...xs) => xs.map((x) => `

${esc(x)}

`).join("") + `

${esc(SIG)}

`; +const BODY = p( + "Part B step A0 is filed (mos-0928): queue row 187, briefed, Gitea #1685, after row 186 (same script). Brief docs/plans/2026-10-20_activate-proof-pair.md, commit 6de3c86be, pushed in 5a768d82c on refactor. Owner Darkwing, reviewer Filbert, gate owner Sage. It builds the tool only: activate --proof-header NAME --proof-file PATH writes the pair into the pointer and the Console unit, --no-proof takes it out, and the script checks the proof file with stat and never reads it. Nothing turns the proof on for the live Console. That stays Part B, which waits for Jason (J1-J6).", + "One correction to Part B's rollback, sent to Mos in sage-1260. A plain rollback goes to the log's previous distinct copy, 89af38a83 since Part A, which predates row 178. It would turn the proof off only by also undoing rows 177-185. The rollback is instead an activate of the live copy with --no-proof. Jason's steps J1-J6 do not change.", +); +const key = readFileSync(KEY, "utf8").trim(), sync = readFileSync(SYNC, "utf8").trim(); +async function api(method, path, body, auth) { + const r = await fetch(ORIGIN + path, { method, headers: { Authorization: `Bearer ${auth}`, "Content-Type": "application/json" }, body: body === undefined ? undefined : JSON.stringify(body), redirect: "error" }); + const t = await r.text(); let json = null; try { json = JSON.parse(t); } catch {} + return { status: r.status, json }; +} +const list = (j) => j?.items ?? (Array.isArray(j) ? j : []); +const rec = { at: new Date().toISOString(), task: TASK, comment: null, problems: [] }; +const save = () => { + const out = JSON.stringify(rec, null, 1) + "\n"; + if (out.includes(key) || out.includes(sync)) throw new Error("secret in the record; not written"); + writeFileSync(OUT, out); +}; +const t = await api("GET", `/api/v2/tasks/${TASK}`, undefined, sync); +if (t.status !== 200 || t.json?.project_id !== 19 || !/X-authentik-username from 127\.0\.0\.1/.test(t.json?.title ?? "")) throw new Error(`task ${TASK}: ${t.status}, not the P19 385 task`); +writeFileSync(OUT, "", { flag: "wx" }); +const c = await api("PUT", `/api/v1/tasks/${TASK}/comments`, { comment: BODY }, key); +rec.comment = { status: c.status, id: c.json?.id ?? null }; +if (c.status >= 300 || !Number.isSafeInteger(c.json?.id)) rec.problems.push(`comment: ${c.status} ${c.json?.message ?? ""}`); +else { + const back = await api("GET", `/api/v2/tasks/${TASK}/comments?per_page=50`, undefined, sync); + const found = list(back.json).find((x) => x.id === c.json.id); + Object.assign(rec.comment, { readBack: back.status, found: Boolean(found) }); + if (back.status !== 200 || !found) rec.problems.push(`read-back: ${back.status}`); +} +save(); +process.stdout.write(JSON.stringify(rec, null, 1) + "\n"); +if (rec.problems.length) process.exit(2); diff --git a/agents/sage/work/vikunja-setup/comment-404-row186.mjs b/agents/sage/work/vikunja-setup/comment-404-row186.mjs new file mode 100644 index 000000000..0b57dadd0 --- /dev/null +++ b/agents/sage/work/vikunja-setup/comment-404-row186.mjs @@ -0,0 +1,44 @@ +// Sage, 2026-10-20: mos-0882 ("every landing or decision gets a Vikunja comment") and mos-0930 (cite #404 in the +// doc follow-up row). Comments on P19 404 that it is now queue row 186 (#1684). Sage's own key; the sync key reads +// back. Prints no secret. +// Usage: node comment-404-row186.mjs https://tasks.woltje.com SAGE_TOKEN_FILE SYNC_TOKEN_FILE OUT_JSON +import { readFileSync, writeFileSync, existsSync } from "node:fs"; +const [ORIGIN, KEY, SYNC, OUT] = process.argv.slice(2); +if (!/^https:\/\/tasks\.woltje\.com$/.test(ORIGIN)) throw new Error("tasks.woltje.com only"); +if (!OUT || existsSync(OUT)) throw new Error("OUT_JSON missing or exists; refusing"); +const TASK = 404; +const SIG = "Posted by Sage (T3 1ef1e4f8) with Sage's own key (bot user 13)."; +const esc = (s) => s.replace(/&/g, "&").replace(//g, ">"); +const p = (...xs) => xs.map((x) => `

${esc(x)}

`).join("") + `

${esc(SIG)}

`; +const BODY = p( + "Owner Sage. Now queue row 186, briefed, Gitea #1684. Brief docs/plans/2026-10-20_plan-backup-line.md, commit f5c72a5c3, pushed with the queue revs in 1d7fd75e2 on refactor. Owner Darkwing, reviewer Filbert, gate owner Sage.", + "N1: the activate plan prints the backup line only when the run reaches the backup; for store-newer and migration-needs-flag it prints that the run rolls back before the backup. N2: docs/TOOLS.md step 3 names the backup line. The run itself does not change. It goes live only with a later re-pin.", +); +const key = readFileSync(KEY, "utf8").trim(), sync = readFileSync(SYNC, "utf8").trim(); +async function api(method, path, body, auth) { + const r = await fetch(ORIGIN + path, { method, headers: { Authorization: `Bearer ${auth}`, "Content-Type": "application/json" }, body: body === undefined ? undefined : JSON.stringify(body), redirect: "error" }); + const t = await r.text(); let json = null; try { json = JSON.parse(t); } catch {} + return { status: r.status, json }; +} +const list = (j) => j?.items ?? (Array.isArray(j) ? j : []); +const rec = { at: new Date().toISOString(), task: TASK, comment: null, problems: [] }; +const save = () => { + const out = JSON.stringify(rec, null, 1) + "\n"; + if (out.includes(key) || out.includes(sync)) throw new Error("secret in the record; not written"); + writeFileSync(OUT, out); +}; +const t = await api("GET", `/api/v2/tasks/${TASK}`, undefined, sync); +if (t.status !== 200 || t.json?.project_id !== 19 || !/stack-release --plan backup line/.test(t.json?.title ?? "")) throw new Error(`task ${TASK}: ${t.status}, not the P19 404 task`); +writeFileSync(OUT, "", { flag: "wx" }); +const c = await api("PUT", `/api/v1/tasks/${TASK}/comments`, { comment: BODY }, key); +rec.comment = { status: c.status, id: c.json?.id ?? null }; +if (c.status >= 300 || !Number.isSafeInteger(c.json?.id)) rec.problems.push(`comment: ${c.status} ${c.json?.message ?? ""}`); +else { + const back = await api("GET", `/api/v2/tasks/${TASK}/comments?per_page=50`, undefined, sync); + const found = list(back.json).find((x) => x.id === c.json.id); + Object.assign(rec.comment, { readBack: back.status, found: Boolean(found) }); + if (back.status !== 200 || !found) rec.problems.push(`read-back: ${back.status}`); +} +save(); +process.stdout.write(JSON.stringify(rec, null, 1) + "\n"); +if (rec.problems.length) process.exit(2); diff --git a/agents/sage/work/vikunja-setup/j6-fix-385-2026-10-20.json b/agents/sage/work/vikunja-setup/j6-fix-385-2026-10-20.json new file mode 100644 index 000000000..b6b0ac332 --- /dev/null +++ b/agents/sage/work/vikunja-setup/j6-fix-385-2026-10-20.json @@ -0,0 +1,11 @@ +{ + "at": "2026-10-20T08:45:11.712Z", + "task": 385, + "comment": { + "status": 201, + "id": 353, + "readBack": 200, + "found": true + }, + "problems": [] +} diff --git a/agents/sage/work/vikunja-setup/row186-404-2026-10-20.json b/agents/sage/work/vikunja-setup/row186-404-2026-10-20.json new file mode 100644 index 000000000..2b6a505d0 --- /dev/null +++ b/agents/sage/work/vikunja-setup/row186-404-2026-10-20.json @@ -0,0 +1,11 @@ +{ + "at": "2026-10-20T08:39:59.441Z", + "task": 404, + "comment": { + "status": 201, + "id": 351, + "readBack": 200, + "found": true + }, + "problems": [] +} diff --git a/agents/sage/work/vikunja-setup/row187-385-2026-10-20.json b/agents/sage/work/vikunja-setup/row187-385-2026-10-20.json new file mode 100644 index 000000000..9e32f9bc6 --- /dev/null +++ b/agents/sage/work/vikunja-setup/row187-385-2026-10-20.json @@ -0,0 +1,11 @@ +{ + "at": "2026-10-20T08:44:35.594Z", + "task": 385, + "comment": { + "status": 201, + "id": 352, + "readBack": 200, + "found": true + }, + "problems": [] +} diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index 337f99851..c1edd6696 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -1336,3 +1336,4 @@ are never rewritten or removed; corrections are new entries. 2026-10-20T07:14:05Z | Sage (Opus 5.5, 1ef1e4f8) | row 185 (#1683) gate and landing; mos-0928 plan draft 2 | landed 490e2771d (author Darkwing) on a green Sage gate (node 2518/0, scripts 422/0, queue 156), patch-id 774cd23186d5 matching Filbert's approved r1 (29404); revs 2189-2190 in 010666074; #1683 closed (29405); plan repin-rows-177-185.md draft 2 sets NEW to 490e2771d and P5 to a four-script diff; Filbert N1/N2 doc follow-ups pending; nothing live touched, stack runs copy 89af38a83afa 2026-10-20T08:28:01Z | darkwing | re-pin window rows 177-185 Part A as tester (plan 9ddd8a92c b05eb85e; OLD 89af38a83, NEW 490e2771d) | P1-P6 and W0-W11 pass, Mos verified each step (mos-0946 to mos-0952); activation 20261020T075800Z-490e2771d3d0, backup SHA256SUMS 399f7105, store 3i; stops at W9 (assistant idle stop at 900 s, mos-0948) and S2b/B (old chief end rows in the backup, by design, mos-0950); matrix-new = matrix-old 93c07e15; STATE.md b586f11c and W.txt edd4622c in 21aa1cab0 (local, not pushed); slip: no interim report 07:58:28Z-08:11:39Z 2026-10-20T08:32:53Z | Sage (Opus 5.5, 1ef1e4f8) | mos-0928 Part A re-pin window rows 177 and 180-185 as lead and checker (plan 9ddd8a92c b05eb85e, OLD 89af38a83, NEW 490e2771d) | pass: NEW live, activation 20261020T075800Z-490e2771d3d0, 3i; checked P1-P6, W0-W10, S2b/B prefix chain and Darkwing's STATE.md (b586f11c, pushed 21aa1cab0); filed W11 on P19 386 comment 350 and #1683 comment 29410, adding the P19 404 cite and Mos's c43b730 stamp bounds STATE.md left out; Vikunja backlog e24a13ad8 | +2026-10-20T08:45:21Z | Sage (Opus 5.5, 1ef1e4f8) | after-window rows for mos-0928: P19 404 doc follow-up and Part B A0 | filed: row 186 (#1684, brief f5c72a5c3, P19 404 comment 351) and row 187 (#1685, brief 6de3c86be, after 186, adds --no-proof), both briefed to Darkwing, reviewer Filbert; B-R1 gap (plain rollback goes to 89af38a83) accepted in mos-0954, fix goes in the Part B window file at A2, P19 385 comments 352 and 353; pushed 5a768d82c