Candidate build.patch onae428a54, manifest e63e4c4f. Gate onf2f2861b: bus 83, tasks 71, webui 40, every scripts/test-*.sh exit 0. Mutants 16 of 17 killed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
39 lines
3.9 KiB
Bash
39 lines
3.9 KiB
Bash
#!/bin/bash
|
||
# Row 58 (#1547) mutants. 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/r58/tmp
|
||
cd ~/darkwing-scratch/r58/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/r58/tmp/mut-$1.log 2>&1
|
||
echo "$1: rc=$? $(grep -E '^ℹ (pass|fail) ' ~/darkwing-scratch/r58/tmp/mut-$1.log | tr '\n' ' ')"
|
||
grep -E '^✖ ' ~/darkwing-scratch/r58/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"
|