Files
stack/agents/darkwing/work/slice1-s0-review/cells.mjs
T
jason.woltjeandClaude Opus 5.5 1abebe5321 docs(review): row 34 S0 round 1, changes (darkwing)
Record for #1516 comment 26725: 34/34 cases reproduce, and a wrapped
Claude command hook fails closed on crash, missing path, noexec and hang.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 22:51:00 -05:00

18 lines
1.8 KiB
JavaScript

// Darkwing's row 34 check: one line per evidence case, from outcome.txt, gate.log, mock.jsonl, stdout and stderr.
import { readFileSync, existsSync, readdirSync } from "node:fs";
const ev = process.argv[2];
const read = (p) => (existsSync(p) ? readFileSync(p, "utf8") : "");
for (const c of readdirSync(ev, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort()) {
const d = `${ev}/${c}`;
const o = Object.fromEntries(read(`${d}/outcome.txt`).split(/\s+/).filter((x) => x.includes("=")).map((x) => x.split("=")));
const reqs = read(`${d}/mock.jsonl`).split("\n").filter(Boolean).map((l) => JSON.parse(l)).filter((x) => x.method === "POST");
const res = reqs.flatMap((r) => r.toolResults ?? []).map((t) => `${t.is_error}:${String(typeof t.content === "string" ? t.content : JSON.stringify(t.content)).replace(/\n*<system-reminder>[\s\S]*<\/system-reminder>/, "").replace(/\s+/g, " ").slice(0, 150)}`);
const gl = read(`${d}/gate.log`).split("\n").filter(Boolean).map((l) => (l.match(/(loaded|invoked)[^{]*|mode=\S+/) || [""])[0].trim());
const out = read(`${d}/stdout.txt`);
const hooks = [...out.matchAll(/"subtype":"hook_response"[^}]*?"exit_code":(-?\d+)[^}]*?"outcome":"(\w+)"/g)].map((m) => `${m[1]}/${m[2]}`);
const agentEnd = /"type":"agent_end"/.test(out);
const types = [...new Set([...out.matchAll(/^\{"type":"([a-z_]+)"(?:,"subtype":"([a-z_]+)")?/gm)].map((m) => m[1] + (m[2] ? ":" + m[2] : "")))];
const err = read(`${d}/stderr.txt`).trim().split("\n").filter(Boolean);
console.log(`${c} | exit=${o.exit} ms=${o.elapsed_ms} target=${o.target} gate=${gl.join(",") || "-"} reqs=${reqs.length} tools=${JSON.stringify(reqs[0]?.tools ?? [])} | saw=${JSON.stringify(res)} | hooks=${hooks.join(",") || "-"} agent_end=${agentEnd} | types=${types.join(",")} | stderr=${err.length}:${(err[0] || "").slice(0, 140)}`);
}