Files
jason.woltjeandClaude Opus 5.5 8b4cad1f2a agents: Dewey row 136 round 2 packet, rebased onto 277d1fa21 with the pre-121 thread test (#1630)
Candidate db463a7b…ab89 (5 files) on 277d1fa21. Adds the note-2 test for a thread
decision raised before row 121; mutants 6 of 6 killed after fixing the test to
supersede an open decision (first run left M6 alive, recorded). Owner's gate exit 0;
gate.sh now sets COMPOSE_PROJECT_NAME=dewey-r136 and removes its network at exit.

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

27 lines
1.8 KiB
Python

import subprocess, sys, os, shutil
W=os.path.expanduser('~/dewey-scratch/r136/wt')
src=os.path.join(W,'packages/bus/src/broker.mjs')
orig=open(src).read()
shutil.copy(src, os.path.expanduser('~/dewey-scratch/r136/mut/broker.orig.mjs'))
M={
'M1-authority-thread': (" this.#raisedThread(d) !== s.thread ||\n", ""),
'M2-supersede-role': ("if (old.raised_by_role !== s.role || this.#raisedThread(old)", "if (this.#raisedThread(old)"),
'M3-supersede-thread': (" || this.#raisedThread(old) !== s.thread || this.#closed(old.id))", " || this.#closed(old.id))"),
'M4-authority-role': (" d.raised_by_role !== s.role ||\n this.#raisedThread(d)", " this.#raisedThread(d)"),
'M5-authority-null-any-thread': (" this.#raisedThread(d) !== s.thread ||\n", " (this.#raisedThread(d) ?? s.thread) !== s.thread ||\n"),
'M6-supersede-null-any-thread': (" || this.#raisedThread(old) !== s.thread || ", " || (this.#raisedThread(old) ?? s.thread) !== s.thread || "),
}
files=['packages/bus/tests/approval-binding.test.mjs','packages/bus/tests/single-use.test.mjs','packages/bus/tests/broker.test.mjs']
env=dict(os.environ, TMPDIR=os.path.expanduser('~/dewey-scratch/tmp'))
try:
for name,(a,b) in M.items():
assert orig.count(a)==1, name
open(src,'w').write(orig.replace(a,b))
r=subprocess.run(['node','--test',*files],cwd=W,env=env,capture_output=True,text=True,timeout=300)
fails=[l for l in r.stdout.splitlines() if l.startswith('✖') and 'failing tests' not in l]
print(name, 'KILLED' if r.returncode!=0 else 'SURVIVED', 'rc=%d'%r.returncode, '| '+' | '.join(sorted(set(fails)))[:400])
open(os.path.expanduser(f'~/dewey-scratch/r136/mut/{name}.log'),'w').write(r.stdout+r.stderr)
finally:
open(src,'w').write(orig)
print('restored', open(src).read()==orig)