[object Object]

← back to Ticket Action Viewer

viewer: RUN NOW reserves+timestamps the ticket at click, then launches a graph-engineering a2a swarm (N subagents + contrarian gate) in a new iTerm2 window

c465d6a6b70b25b8460fc759922b7dab52c75108 · 2026-08-10 07:58:42 -0700 · Steve Abrams

Files touched

Diff

commit c465d6a6b70b25b8460fc759922b7dab52c75108
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 10 07:58:42 2026 -0700

    viewer: RUN NOW reserves+timestamps the ticket at click, then launches a graph-engineering a2a swarm (N subagents + contrarian gate) in a new iTerm2 window
---
 server.js | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/server.js b/server.js
index b46e8fd..ad2b2d6 100644
--- a/server.js
+++ b/server.js
@@ -80,8 +80,24 @@ const server = http.createServer(async (req, res) => {
     const home = process.env.HOME;
     let dir = path.join(home, 'Projects');
     if (project && fs.existsSync(path.join(home, 'Projects', project))) dir = path.join(home, 'Projects', project);
+    // Reserve + timestamp IMMEDIATELY at click (before the new window boots) so the ticket
+    // is assigned to me and stamped the moment RUN NOW is pressed — no race, no double-work.
+    const when = new Date().toLocaleString('en-US', { timeZone: 'America/Los_Angeles',
+      year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' });
+    await tk(['take', p.id]);
+    await tk(['log', p.id, `▶ STARTED ${when} PT — RESERVED for ${AGENT} + launched in a new iTerm2 window (RUN NOW)`]);
     const sh = path.join('/tmp', `tav-run-${shortId}.sh`);
-    const prompt = `Work ticket ${p.id} (${title}). First run: tk take ${p.id}; tk log ${p.id} "▶ STARTED via RUN NOW". Then read tk show ${p.id}, decide the single highest-value next step, and drive it. Keep gates intact — any customer-facing / deploy / Apple / USPTO / money / prod action drafts to ~/.claude/yolo-queue/pending-approval, never auto-execute.`;
+    const N = Math.max(2, Math.min(8, parseInt(p.agents, 10) || 4)); // fan-out width (2..8, default 4)
+    const prompt = [
+      `Drive ticket ${p.id} (${title}) to DONE using GRAPH ENGINEERING with a2a coordination. It is already assigned to you and stamped STARTED (${when} PT).`,
+      `1) TICKETS + a2a FIRST: run \`tk inbox\` and act on any DMs; run \`tk show ${p.id}\`; scan related/blocking tickets so you don't re-solve a peer's in-flight work.`,
+      `2) PLAN: read the ticket, split the work where it NATURALLY divides into independent parts (delete arrows that don't exist).`,
+      `3) SPLIT: fan out ${N} parallel subagents via the Agent tool, EACH on fresh clean context working ONE independent part, all "working under ${shortId}". Each subagent: checks \`tk inbox\`, @-mentions/\`tk dm\` the owner before editing a shared file, and keeps COPIOUS \`tk log\`/\`tk note\` notes. Match fan-out to the real number of independent parts.`,
+      `4) ARGUE: a SEPARATE contrarian agent (subagent_type "contrarian") adversarially reviews the merged result — never let a producer grade its own work. VERIFY every claimed defect before acting on it (reproduce it); drop phantoms.`,
+      `5) MERGE: synthesize the verified results; commit each success (author steve@designerwallcoverings.com); \`tk log\` every action; \`tk done ${p.id}\` when genuinely complete, else \`tk status ${p.id} blocked\` with the reason.`,
+      `ROBUSTNESS: if stuck or overlapping another agent's surface, \`tk dm <owner> "..." -t ${shortId}\` (or broadcast to \`all\`) and ask for help rather than colliding.`,
+      `HARD GATES (never loosened by delegation): any customer-facing / deploy / Apple / USPTO / money / prod / DNS / send-to-list / remote-push action drafts an APPROVE/REVISE/BLOCK memo to ~/.claude/yolo-queue/pending-approval and STOPS for Steve — never auto-execute.`
+    ].join('\n');
     fs.writeFileSync(sh, `#!/bin/bash\ncd ${dir}\nexport TK_AGENT=${AGENT}\nexec claude ${JSON.stringify(prompt)}\n`);
     fs.chmodSync(sh, 0o755);
     const osa = `tell application "iTerm2"\n activate\n create window with default profile\n tell current session of current window\n  write text "clear; echo '▶ RUN ${shortId} — ${title.replace(/'/g, '')}'; echo 'dir: ${dir}'; bash ${sh}"\n end tell\nend tell`;

← dccd5ab viewer: add RUN NOW — opens a new iTerm2 window with a Claud  ·  back to Ticket Action Viewer  ·  5x sweep 1: serve 204 for /favicon.ico (kills the favicon-40 bbbe42d →