sage: row 163 packet (candidate 4be3f6aec on 580500699: diff, manifest 430212299beb, gate passed, mutants K1-K33 killed after four survivors got tests)

This commit is contained in:
jason.woltje committed 2026-10-20 09:44:55 -05:00
1 parent 5b298bd00b
commit 51f67f1f87
6 files changed
+1343

No files matched your search

@@ -0,0 +1,10 @@
04d72e5ef4d8d5fc85a4f11aa51331354696cc7cf66af2ed7540cf6cfc0153b9 agents/sage/work/queue-163/BUILD.md
5bd1bc697cd56e57b00e60c0e80be72cd1043a55a6d2fc0b9e2ccdd0c5cf9802 docs/TOOLS.md
52597d7fa1469510fcf8e6dfd63664ad4c492bc17039885aa839231798693058 packages/cli/src/cli.mjs
5492ebb5aa3c9c85874e4c7de7b65fc37733e2db636690c11fe2d2fdf72c2dd0 packages/cli/src/launcher.mjs
e9ce0e0f7368d3fb2e1edbd4ebc724513ec19d7bac0c993f8be0d9494427be07 packages/cli/tests/host.test.mjs
42519898b5bcf84c21088647e161a86934d4fe351207f736b9b120b6e1c2b91b packages/cli/tests/launcher.test.mjs
4dfeefa1bb3c11e8633d75df4f628497ebd427ebf8402ba5efc3e5c7fd030057 packages/cli/tests/stack-release.test.mjs
5abdeab8bc6b63d291d0054124a4311a2260b590c68f758daa142a9deb2f4a72 packages/seat/src/session.mjs
741883e399d77d429cc29a87beef6db9c51c1759669b025006f037001d101eb6 packages/seat/tests/session.test.mjs
5bb3ac40102ce515f1acdcbc5670feb161ce40a193e94e2f8b104ebf98eddc38 scripts/stack-release.sh
File diff suppressed because it is too large. Load diff
+28
View File
@@ -0,0 +1,28 @@
base 580500699 dirty 0 DOCKER_HOST=unset
pkg-bus rc=0 ℹ pass 451 ℹ fail 0 | ℹ duration_ms 3051.98676
pkg-business rc=0 ℹ pass 149 ℹ fail 0 | ℹ duration_ms 1933.965446
pkg-cli rc=0 ℹ pass 470 ℹ fail 0 | ℹ duration_ms 337885.04401
pkg-control-board rc=0 ℹ pass 124 ℹ fail 0 | ℹ duration_ms 585.587135
pkg-conversation rc=0 ℹ pass 182 ℹ fail 0 | ℹ duration_ms 33296.254589
pkg-discord rc=0 ℹ pass 183 ℹ fail 0 | ℹ duration_ms 2624.332987
pkg-harness rc=0 ℹ pass 133 ℹ fail 0 | ℹ duration_ms 11808.615207
pkg-ledger rc=0 ℹ pass 89 ℹ fail 0 | ℹ duration_ms 12902.241615
pkg-mosaic rc=0 ℹ pass 69 ℹ fail 0 | ℹ duration_ms 2051.760841
pkg-plugins rc=0 ℹ pass 111 ℹ fail 0 | ℹ duration_ms 247.493374
pkg-project rc=0 ℹ pass 40 ℹ fail 0 | ℹ duration_ms 1031.233595
pkg-runs rc=0 ℹ pass 43 ℹ fail 0 | ℹ duration_ms 727.865986
pkg-seat rc=0 ℹ pass 152 ℹ fail 0 | ℹ duration_ms 5858.066276
pkg-tasks rc=0 ℹ pass 97 ℹ fail 0 | ℹ duration_ms 1147.333901
pkg-webui rc=0 ℹ pass 269 ℹ fail 0 | ℹ duration_ms 46548.273469
script-auth rc=0 | selftest: 15 passed, 0 failed
script-conductor rc=0 | selftest: 17 passed, 0 failed
script-config rc=0 | selftest: 24 passed, 0 failed
script-discord rc=0 | discord suite: 78 passed, 0 failed
script-extension-package rc=0 | extension package selftest: 18 passed, 0 failed
script-foundation rc=0 | selftest: 44 passed, 0 failed
script-land-work rc=0 | land-work selftests: 86 passed, 0 failed
script-queue rc=0 ℹ pass 156 ℹ fail 0 | queue suite: 28 passed, 0 failed
script-release rc=0 | selftest: 14 passed, 0 failed
script-task rc=0 | selftest: 98 passed, 0 failed
GATE_PASSED
removed network sage-r163_default
@@ -0,0 +1,5 @@
KILLED K11 bus-status pid check dropped (rc 1)
KILLED K21 scratch store links the backup (rc 1)
KILLED K27 ticker runs under --no-launch (rc 1)
KILLED K31 cli --no-launch not passed to the launcher (rc 1)
ALL_KILLED
@@ -0,0 +1,34 @@
KILLED K1 credential-ref-live dropped (rc 1)
KILLED K2 tracker-configured dropped (rc 1)
KILLED K3 data-root-live dropped (rc 1)
KILLED K4 sessions-live dropped (rc 1)
KILLED K5 notify-off dropped (rc 1)
KILLED K6 no-session dropped (rc 1)
KILLED K7 copy-match dropped (rc 1)
KILLED K8 role credential swap dropped (rc 1)
KILLED K9 @sync swap dropped (rc 1)
KILLED K10 business tracker strip dropped (rc 1)
SURVIVED K11 bus-status pid check dropped (rc 0)
KILLED K12 host-released-store dropped (rc 1)
KILLED K13 SIGKILL counted as a pass (rc 1)
KILLED K14 healthz always ok (rc 1)
KILLED K15 port-reserved dropped (rc 1)
KILLED K16 port-in-use dropped (rc 1)
KILLED K17 backup-sums dropped (rc 1)
KILLED K18 copy-without-no-launch dropped (rc 1)
KILLED K19 migration skipped (rc 1)
KILLED K20 migrate failure ignored (rc 1)
SURVIVED K21 scratch store links the backup (rc 0)
KILLED K22 scratch config keeps the live dataRoot (rc 1)
KILLED K23 host started without --no-launch (rc 1)
KILLED K24 start() launches under --no-launch (rc 1)
KILLED K25 session launch request allowed under --no-launch (rc 1)
KILLED K26 recover() ends sessions under --no-launch (rc 1)
SURVIVED K27 ticker runs under --no-launch (rc 0)
KILLED K28 registry writes under --no-launch (rc 1)
KILLED K29 Registry readOnly writes anyway (rc 1)
KILLED K30 Registry readOnly add() allowed (rc 1)
SURVIVED K31 cli --no-launch not passed to the launcher (rc 0)
KILLED K32 cli --pm with --no-launch allowed (rc 1)
KILLED K33 cli host-up line drops launches disabled (rc 1)
SOME_SURVIVED
+70
View File
@@ -0,0 +1,70 @@
#!/usr/bin/env python3
# Row 163 mutants: each one drops or weakens one behaviour; the named tests must then fail.
import hashlib, os, shutil, subprocess, sys, signal
W = '/mnt/storage/scratch/sage-b163'
OUT = '/mnt/storage/scratch/sage-b163-gate/mutants'
os.makedirs(OUT, exist_ok=True)
SR = 'scripts/stack-release.sh'
T = 'packages/cli/tests/stack-release.test.mjs'
M = [
('K1 credential-ref-live dropped', SR, 'if(f===null||phr===null||path.dirname(f)!==phr)fail("credential-ref-live"', 'if(false)fail("credential-ref-live"', T, '^R9 '),
('K2 tracker-configured dropped', SR, 'if(config.trackers!==undefined)fail(', 'if(false)fail(', T, '^R10 '),
('K3 data-root-live dropped', SR, 'if(root===real(live))fail(', 'if(false)fail(', T, '^R11 '),
('K4 sessions-live dropped', SR, 'if(running.length)fail(', 'if(false)fail(', T, '^R11 '),
('K5 notify-off dropped', SR, 'fail("notify-off",`${nf} is not {', 'void("notify-off",`${nf} is not {', T, '^R12 '),
('K6 no-session dropped', SR, 'if [ -z "$found" ]; then r_pass no-session', 'if true; then r_pass no-session', T, '^R4 '),
('K7 copy-match dropped', SR, ' R_GATE=copy-match\n', ' R_GATE=""; return 0\n', T, '^R7 '),
('K8 role credential swap dropped', SR, 'strip(r?.vars);swap(name,r?.credentials)}', 'strip(r?.vars)}', T, '^R1 '),
('K9 @sync swap dropped', SR, 'swap("@sync",b.tracker?.sync?.credentials);', '', T, '^R1 '),
('K10 business tracker strip dropped', SR, '\nstrip(b.vars);\n', '\n', T, '^R1 '),
('K11 bus-status pid check dropped', SR, 'String(s.host.pid)!==main?`host pid ${s.host.pid} is not ${main}, the host this run', 'false?`host pid ${s.host.pid} is not ${main}, the host this run', T, '^R4 '),
('K12 host-released-store dropped', SR, 'if [ -e "$R/data/bus/writer.lock" ]; then', 'if false; then', T, '^R4 '),
('K13 SIGKILL counted as a pass', SR, 'kill -KILL "$pid" 2>/dev/null || true; r_fail "$name-stopped"', 'kill -KILL "$pid" 2>/dev/null || true; r_pass "$name-stopped"', T, '^R5 '),
('K14 healthz always ok', SR, '.then((r)=>process.exit(r.status===200?0:1),()=>process.exit(1));\' -- "$R_PORT"', '.then(()=>process.exit(0),()=>process.exit(0));\' -- "$R_PORT"', T, '^R6 '),
('K15 port-reserved dropped', SR, '[ "$((10#$R_PORT))" != "$i" ] || r_abort port-reserved', 'true || r_abort port-reserved', T, '^R8 '),
('K16 port-in-use dropped', SR, 'r_port_free "$R_PORT" || r_abort port-in-use', 'true || r_abort port-in-use', T, '^R8 '),
('K17 backup-sums dropped', SR, 'sha256sum -c --quiet ../SHA256SUMS) >/dev/null 2>&1 ||', 'true) >/dev/null 2>&1 ||', T, '^R13 '),
('K18 copy-without-no-launch dropped', SR, 'grep -qF -- \'"--no-launch"\' "$COPIES/$TO/packages/cli/src/cli.mjs" 2>/dev/null ||', 'true ||', T, '^R13 '),
('K19 migration skipped', SR, 'if [ "$v" = "$T_SCHEMA" ]; then r_pass migration', 'if true; then r_pass migration', T, '^R2 '),
('K20 migrate failure ignored', SR, '[ "$rc" = 0 ] && [ "$(tail -n 1 <<< "$out")" = "bus schema $T_SCHEMA ready" ] || r_abort migrate "', 'true || r_abort migrate "', T, '^R3 '),
('K21 scratch store links the backup', SR, 'cp "$R_BK"/bus/* "$R/data/bus/" &&', 'ln -s "$R_BK"/bus/* "$R/data/bus/" &&', T, '^R1 '),
('K22 scratch config keeps the live dataRoot', SR, 'c.dataRoot=data;', '', T, '^R1 '),
('K23 host started without --no-launch', SR, '"$COPIES/$TO/scripts/mosaic" bus start "$BUSINESS" --no-launch >', '"$COPIES/$TO/scripts/mosaic" bus start "$BUSINESS" >', T, '^R1 '),
('K24 start() launches under --no-launch', 'packages/cli/src/launcher.mjs', ' if (!launches) throw new Refusal("launches-disabled", "this host was started with --no-launch");\n', '', 'packages/cli/tests/launcher.test.mjs', None),
('K25 session launch request allowed under --no-launch', 'packages/cli/src/launcher.mjs', ' if (!launches) {\n await host.op({ op: "refuse", cap, code: "launches-disabled" })', ' if (false) {\n await host.op({ op: "refuse", cap, code: "launches-disabled" })', 'packages/cli/tests/launcher.test.mjs', None),
('K26 recover() ends sessions under --no-launch', 'packages/cli/src/launcher.mjs', ' if (!launches) {\n for (const s of leftover) log(', ' if (false) {\n for (const s of leftover) log(', 'packages/cli/tests/launcher.test.mjs', None),
('K27 ticker runs under --no-launch', 'packages/cli/src/launcher.mjs', 'if (b.launch && launches) ticker', 'if (b.launch) ticker', 'packages/cli/tests/launcher.test.mjs', None),
('K28 registry writes under --no-launch', 'packages/cli/src/launcher.mjs', 'new Registry(dataRoot, { readOnly: !launches })', 'new Registry(dataRoot)', 'packages/cli/tests/launcher.test.mjs', None),
('K29 Registry readOnly writes anyway', 'packages/seat/src/session.mjs', ' if (!readOnly) this.#write();', ' this.#write();', 'packages/seat/tests/session.test.mjs', None),
('K30 Registry readOnly add() allowed', 'packages/seat/src/session.mjs', ' if (this.#readOnly) throw new SeatError("this host keeps no sessions (--no-launch)", 2);\n', '', 'packages/seat/tests/session.test.mjs', None),
('K31 cli --no-launch not passed to the launcher', 'packages/cli/src/cli.mjs', 'tracker: Boolean(boot.trackers?.[businessId]), launches, ', 'tracker: Boolean(boot.trackers?.[businessId]), ', 'packages/cli/tests/host.test.mjs', None),
('K32 cli --pm with --no-launch allowed', 'packages/cli/src/cli.mjs', ' if (!launches && parsed.flags.has("--pm")) throw usage(', ' if (false) throw usage(', 'packages/cli/tests/host.test.mjs', None),
('K33 cli host-up line drops launches disabled', 'packages/cli/src/cli.mjs', '${launches ? "" : ", launches disabled"}', '', 'packages/cli/tests/host.test.mjs', None),
]
sha = lambda p: hashlib.sha256(open(p, 'rb').read()).hexdigest()
env = dict(os.environ, TMPDIR='/mnt/storage/scratch/sb163t')
results = []
ONLY = set(sys.argv[1:])
for name, f, old, new, test, pat in M:
if ONLY and name.split()[0] not in ONLY: continue
p = os.path.join(W, f); bak = os.path.join(OUT, os.path.basename(f) + '.orig')
shutil.copy2(p, bak)
if sha(bak) != sha(p): sys.exit(f'backup of {p} failed')
src = open(p).read()
if src.count(old) != 1: sys.exit(f'{name}: pattern count {src.count(old)} in {f}')
open(p, 'w').write(src.replace(old, new))
cmd = ['node', '--test'] + (['--test-name-pattern', pat] if pat else []) + [test]
log = os.path.join(OUT, name.split()[0] + '.log')
try:
with open(log, 'w') as lf:
pr = subprocess.Popen(cmd, cwd=W, env=env, stdout=lf, stderr=subprocess.STDOUT, start_new_session=True)
try: rc = pr.wait(timeout=600)
except subprocess.TimeoutExpired:
os.killpg(pr.pid, signal.SIGKILL); pr.wait(); rc = 'timeout'
finally:
shutil.copy2(bak, p)
if sha(bak) != sha(p): sys.exit(f'restore of {p} failed')
killed = rc != 0
results.append((name, killed, rc))
print(f'{"KILLED" if killed else "SURVIVED"} {name} (rc {rc})', flush=True)
print('ALL_KILLED' if all(k for _, k, _ in results) else 'SOME_SURVIVED')