From 949dce822b890ec59bca063ad083b750dc5dbf8b Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 24 Apr 2026 14:16:03 -0700 Subject: [PATCH] =?UTF-8?q?piece-runs:=20fix=20log=20phase=20payload=20sha?= =?UTF-8?q?pe=20=E2=80=94=20nest=20events=20under=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /api/piece-log's log branch reads data.events, but disk.mjs was posting { events } at the top level, so the server always saw an empty array and never $pushed anything. Verified against prod: 0 of 8669 piece-runs had an events field. Both call sites (per-tick flush and end-of-piece complete) now wrap events in { data: { events } }, matching start's { meta } and complete's { data: {...summary} } shapes. This unblocks the cam/init and cam/frame diagnostics from cap.mjs — they can now actually be read back via ac-piece-logs-events. --- system/public/aesthetic.computer/lib/disk.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/public/aesthetic.computer/lib/disk.mjs b/system/public/aesthetic.computer/lib/disk.mjs index 1055f13e78..846a48c46f 100644 --- a/system/public/aesthetic.computer/lib/disk.mjs +++ b/system/public/aesthetic.computer/lib/disk.mjs @@ -1021,7 +1021,7 @@ const pieceRuns = (() => { if (run.flushTimer) { clearTimeout(run.flushTimer); run.flushTimer = null; } if (run.events.length) { const events = run.events.splice(0, run.events.length); - post("log", run.pieceId, { events }); + post("log", run.pieceId, { data: { events } }); } post("complete", run.pieceId, { data: { duration: Date.now() - run.startedAt, ...summary }, @@ -1046,7 +1046,7 @@ const pieceRuns = (() => { if (run.flushTimer) { clearTimeout(run.flushTimer); run.flushTimer = null; } if (!run.events.length) return; const events = run.events.splice(0, run.events.length); - post("log", run.pieceId, { events }); + post("log", run.pieceId, { data: { events } }); }; current = run; post("start", pieceId, { -- 2.51.2