From 364fd1b42590d79ac25f30e993cc9825c8fb0ac7 Mon Sep 17 00:00:00 2001 From: Carlos Arias Date: Fri, 24 Jul 2026 00:20:52 +0000 Subject: [PATCH] web designer: guard ignores uploaded media assets (app/public/media) --- agents/console/server.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/agents/console/server.mjs b/agents/console/server.mjs index 84d0a21..701bf88 100644 --- a/agents/console/server.mjs +++ b/agents/console/server.mjs @@ -493,8 +493,15 @@ async function runDesignTask(task) { // Pre-flight: the auto-publish commit is scoped to GIT_SCOPE, so a dirty tree // would get swept into this task's commit. Refuse rather than clobber WIP. + // Uploaded assets under app/public/media/ are expected (they're this task's + // images) and get committed with it, so they don't count as "dirty". const pre = await git(["status", "--porcelain", "--", ...GIT_SCOPE]); - if (pre.tail.trim() !== "") { + const dirty = pre.tail + .split("\n") + .map((l) => l.slice(3).trim()) // strip the "XY " status prefix + .filter(Boolean) + .filter((p) => !p.startsWith("app/public/media/")); + if (dirty.length) { return { ok: false, error: "Working tree wasn't clean — commit or discard pending changes before running the queue." }; }