From f6dd552cabb6bcdcc6defd2953e9641083827284 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Mon, 19 Oct 2026 07:48:02 +0700 Subject: [PATCH] test(claw): kill the real check_latest.t27 mutation survivors (#10739) Three tests: run ids of 0 and 20 digits, the 1024-row cap in both readers, and a blank line before a re-run at the cap. 41 -> 46 of 51 mutants; the 5 left are equivalent. Reseals CheckLatest and RequiredRed, which still cited check_state.t27 from before #10726. Co-Authored-By: Claude Opus 5.5 --- .trinity/seals/claw_ClawCheckLatest.json | 18 ++++---- .trinity/seals/claw_ClawRequiredRed.json | 6 +-- specs/claw/check_latest.t27 | 55 ++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 12 deletions(-) diff --git a/.trinity/seals/claw_ClawCheckLatest.json b/.trinity/seals/claw_ClawCheckLatest.json index fb0b79831f..46017790b5 100644 --- a/.trinity/seals/claw_ClawCheckLatest.json +++ b/.trinity/seals/claw_ClawCheckLatest.json @@ -3,7 +3,7 @@ "closure": [ { "spec": "specs/claw/check_state.t27", - "spec_hash": "sha256:f5f05cce0d40d19693618461a81702761d27917cc6d1a3dfb53d8c06ba8b4ab4" + "spec_hash": "sha256:0a036f9c3e48e9c91b1cdadc806d63db91d5f7638157d26b355bd4db42014d83" }, { "spec": "specs/claw/queue_cost.t27", @@ -15,23 +15,23 @@ } ], "config": "gen=c,rust,verilog,zig;tests=zig", - "gen_hash_c": "sha256:28730ddb411cdbd8dab71a359b3198c5d9a604f801292681d99923aa29d83472", - "gen_hash_rust": "sha256:4859d66eed907385076ba205174f57e990c975f8cc5806db5b7ad4abfed807e0", - "gen_hash_verilog": "sha256:f9f5fd676b30d5ae414b77ed7139622591110b63f8bd819dc7381b6cd449ce8e", - "gen_hash_zig": "sha256:449674e0eaa92835b542ae7fe033667a048de932b3f260948fa9b52c93cd6679", + "gen_hash_c": "sha256:c0d1d710a7c1a9acdb6a5abb3ce953cdd6bcf61f76bea744de5d7afa76724327", + "gen_hash_rust": "sha256:7703ef78ced73ae5248a3e376e05f1c4caeaa7061cc4f53a47fd9e9ae8f9f547", + "gen_hash_verilog": "sha256:2b9974288e94433fe04a162f2bb606a627c4dd943c781aab973b96b747bd1f41", + "gen_hash_zig": "sha256:30ff2f1d40d12413152d4e233885bc59f0145102aa4e0ef95fba4909b4296f69", "module": "ClawCheckLatest", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-19T00:13:49Z", + "sealed_at": "2026-10-19T00:46:35Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:3195aefb8a0d3dc6cc0f2ba9e1ae064b5678446611cccf1bb80a8d8066c668b4", + "spec_hash": "sha256:2de14a373379d1a5acc19fffeb4123c951dc6f36caffb883fb5a8a406be65d58", "spec_path": "specs/claw/check_latest.t27", "tests": { "failed": 0, "failing": [], "forced": false, - "passed": 11, - "total": 11, + "passed": 14, + "total": 14, "vacuous": 0 }, "toolchain": { diff --git a/.trinity/seals/claw_ClawRequiredRed.json b/.trinity/seals/claw_ClawRequiredRed.json index 3903bd8513..f2ba99afa1 100644 --- a/.trinity/seals/claw_ClawRequiredRed.json +++ b/.trinity/seals/claw_ClawRequiredRed.json @@ -3,11 +3,11 @@ "closure": [ { "spec": "specs/claw/check_latest.t27", - "spec_hash": "sha256:3195aefb8a0d3dc6cc0f2ba9e1ae064b5678446611cccf1bb80a8d8066c668b4" + "spec_hash": "sha256:2de14a373379d1a5acc19fffeb4123c951dc6f36caffb883fb5a8a406be65d58" }, { "spec": "specs/claw/check_state.t27", - "spec_hash": "sha256:f5f05cce0d40d19693618461a81702761d27917cc6d1a3dfb53d8c06ba8b4ab4" + "spec_hash": "sha256:0a036f9c3e48e9c91b1cdadc806d63db91d5f7638157d26b355bd4db42014d83" }, { "spec": "specs/claw/queue_cost.t27", @@ -26,7 +26,7 @@ "module": "ClawRequiredRed", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-19T00:13:57Z", + "sealed_at": "2026-10-19T00:47:30Z", "sealed_by": "t27c-bootstrap@0.5.2", "spec_hash": "sha256:ad8660400d420444a1a3c8858866b4cf7447f60027e27e1bb333a9463e1decea", "spec_path": "specs/claw/required_red.t27", diff --git a/specs/claw/check_latest.t27 b/specs/claw/check_latest.t27 index 597c1f7eab..4a4696239f 100644 --- a/specs/claw/check_latest.t27 +++ b/specs/claw/check_latest.t27 @@ -196,6 +196,22 @@ fn t_bad(row : str, row_len : usize) -> bool { return rows == 1 and st[K_BAD] == 1 and st[K_PASS] == 0; } +/// CHECK_MAX_ROWS rows: an old failure, a blank line when asked, 1022 passing commit statuses +/// (never superseded, so cheap to scan), the re-run that supersedes the failure, and one more +/// re-run past the cap when asked. +fn t_cap(dst : []u8, cap : usize, blank : bool, extra : bool) -> usize { + var x : usize = put_str(dst, cap, 0, "g\t8\tCOMPLETED\tFAILURE\n", 22); + if (blank) { x = put_str(dst, cap, x, "\n", 1); } + var i : u32 = 0; + while (i < 1022) { + x = put_str(dst, cap, x, "p\t-\tCONTEXT\tSUCCESS\n", 20); + i += 1; + } + x = put_str(dst, cap, x, "g\t9\tCOMPLETED\tSUCCESS\n", 22); + if (extra) { x = put_str(dst, cap, x, "g\t10\tCOMPLETED\tSUCCESS\n", 23); } + return x; +} + // ---- tests ---- test the_10563_rollup_is_pending_here_and_red_to_check_state { @@ -276,3 +292,42 @@ test a_clipped_plan_still_advances_the_cursor { var out : [160]u8 = undefined; assert latest_plan(&raw, n, &out, 50) == 104; } + +// ---- mutation sweep of this file (#10739): each test below kills a survivor ---- + +test a_run_id_is_one_to_twenty_digits { + assert t_bad("x\t\tCOMPLETED\tSUCCESS\n", 21) == true; + assert t_bad("x\t12345678901234567890\tCOMPLETED\tSUCCESS\n", 41) == false; + assert t_bad("x\t1\tCOMPLETED\tSUCCESS\n", 22) == false; +} + +test the_row_cap_reads_1024_rows_and_refuses_the_next { + var raw : [20608]u8 = undefined; + var st : [5]u32 = undefined; + var n : usize = t_cap(&raw, 20608, false, false); + assert n == 20484; + assert latest_counts(&raw, n, &st) == 1024; + assert st[K_SUPERSEDED] == 1; + assert st[K_PASS] == 1023; + assert st[K_FAIL] == 0; + assert st[K_BAD] == 0; + assert latest_verdict(&raw, n) == V_GREEN; + n = t_cap(&raw, 20608, false, true); + assert n == 20507; + assert latest_counts(&raw, n, &st) == 1025; + assert st[K_SUPERSEDED] == 1; + assert st[K_PASS] == 1023; + assert st[K_BAD] == 1; +} + +test a_blank_line_does_not_push_a_rerun_past_the_cap { + var raw : [20608]u8 = undefined; + var st : [5]u32 = undefined; + const n : usize = t_cap(&raw, 20608, true, false); + assert n == 20485; + assert raw[22] == 10; + assert latest_counts(&raw, n, &st) == 1024; + assert st[K_SUPERSEDED] == 1; + assert st[K_FAIL] == 0; + assert latest_verdict(&raw, n) == V_GREEN; +}