Files
stack/agents/darkwing/work/queue-58/out/r2/mutants.sh
T
jason.woltjeandClaude Opus 5.5 48b0b64869 review(58): Darkwing round 2 candidate, rebased on row 74's tree (#1547)
Round 1's build.patch applies cleanly on 424ada49 (row 74 landed as 351464ce).
Only packages/webui/README.md's digest changes; the bullet text is the same.
Manifest eb2b26c1. Gate 23:41:10Z-23:44:25Z: bus 83, tasks 71, webui 61, every
scripts/test-*.sh green. 16 of 17 mutants fail, output identical to round 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 18:49:52 -05:00

39 lines
4.0 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Row 58 (#1547) round 2 mutants, on row 74's tree. Each edits one source file in the build worktree, runs the test file that
# should fail it, then restores the file from the worktree index, which holds the candidate. Only
# the one test file runs, since other seats' suites shared the machine; the gate runs every suite.
export TMPDIR=~/darkwing-scratch/r58r2/tmp
cd ~/darkwing-scratch/r58r2/wt
B=packages/bus/src/broker.mjs; W=packages/webui/src/public/bus.js
BT=packages/bus/tests/task-read.test.mjs; WE=packages/webui/tests/bus.test.mjs; WB=packages/webui/tests/bus-browser.test.mjs
run() { # name file sed-expr test-file
sed -i "$3" "$2"
if git diff --quiet -- "$2"; then echo "$1: MUTATION DID NOT APPLY"; return; fi
env -u NODE_TEST_CONTEXT node --test --test-timeout=60000 "$4" > ~/darkwing-scratch/r58r2/tmp/mut-$1.log 2>&1
echo "$1: rc=$? $(grep -E '^ℹ (pass|fail) ' ~/darkwing-scratch/r58r2/tmp/mut-$1.log | tr '\n' ' ')"
grep -E '^✖ ' ~/darkwing-scratch/r58r2/tmp/mut-$1.log | sed 's/ ([0-9.]*ms)$//; s/^/ /' | sort -u | head -4
git checkout -q -- "$2"
}
# The broker's 'tasks' rows.
run tasks-verb-unchanged $B 's/ if (verb === .tasks.) return this.#taskRows(s.business);/ if (verb === "tasks") return this.#store.all("SELECT * FROM task_current WHERE business=? ORDER BY task_ref", s.business).map((r) => ({ ...r, fields: JSON.parse(r.fields) }));/' $BT
run no-priority $B 's/ const priority = fields.priority ?? null;/ const priority = null;/' $BT
run zero-priority-null $B 's/ const priority = fields.priority ?? null;/ const priority = fields.priority || null;/' $BT
run tombstone-priority-zero $B 's/ const priority = fields.priority ?? null;/ const priority = fields.priority ?? 0;/' $BT
run requirement-by-ref $B "s/ const taskId = (ref) => ref.slice(ref.indexOf('\/') + 1);/ const taskId = (ref) => ref;/" $BT
run requirement-last-wins $B 's/ if (!requirement.has(taskId(e.subject))) requirement.set/ requirement.set/' $BT
run requirement-any-business $B "s/ FROM events WHERE business=? AND kind='task.created' ORDER BY seq\",/ FROM events WHERE (business=? OR 1) AND kind='task.created' ORDER BY seq\",/" $BT
run requirement-undefined $B 's/requirement: requirement.get(taskId(r.task_ref)) ?? null }/requirement: requirement.get(taskId(r.task_ref)) }/' $BT
run task-view-adds-keys $B 's/ const parse = (r) => ({ ...r, fields: JSON.parse(r.fields) });/ const parse = (r) => ({ ...r, fields: JSON.parse(r.fields), priority: null, requirement: null });/' $BT
# The endpoint passes both keys through.
run endpoint-drops-keys $B 's/ return { ...r, fields, priority, requirement: requirement.get(taskId(r.task_ref)) ?? null };/ return { ...r, fields };/' $WE
# The Tasks view.
run list-requirement-from-trail $W 's/ requirement: row.requirement ?? created?.body?.requirement ?? null,/ requirement: created?.body?.requirement ?? null,/' $WB
run no-requirement-column $W "s/\['Task', 'Requirement', 'Assignees'/['Task', 'Assignees'/; s|<td>\${t.requirement ? txt(t.requirement) : '<span class=\"muted\">none</span>'}</td>||" $WB
run priority-default-zero $W 's/priority: row.priority ?? shape.priority ?? null,/priority: row.priority ?? shape.priority ?? 0,/' $WB
run tombstone-no-fallback $W 's/priority: row.priority ?? shape.priority ?? null,/priority: row.priority ?? null,/' $WB
run detail-priority-raw $W 's|<dt>Priority</dt><dd>${priority(t.priority)}</dd>|<dt>Priority</dt><dd>${esc(PRIORITY[t.priority] \|\| t.priority)}</dd>|' $WB
run list-priority-raw $W 's|<td>${due(t.due)}</td><td>${priority(t.priority)}</td>|<td>${due(t.due)}</td><td>${esc(PRIORITY[t.priority] \|\| t.priority)}</td>|' $WB
# Expected to survive: for a live row the bus priority is fields.priority, which shape is too.
run ignore-row-priority $W 's/priority: row.priority ?? shape.priority ?? null,/priority: shape.priority ?? null,/' $WB
git diff --quiet -- $B $W && echo "restored: sources match the candidate index" || echo "NOT RESTORED"