Sutura Case Lab

JavaScript repair

Recorded live result Fixed

Passed the required checks

The repair reproduced the failure, fixed it, and held the behavior the checks require.

Historical recorded result · A real off-by-one bug fails one test. Sutura must repair the code, not the test. · subject e724f3b22de79d6ab3f40cffa96de7776c256ce9 · 2026-09-17T14:08:32.715Z

Review the diff and the behavior tested before merging.

This result is a recorded live benchmark evaluation of the released Sutura version, not a run started from this page.

Outcome matches the expected outcome.

Failed commit and CI evidence

Nano diagnosis and confidence

Failure class
test-assertion
Confidence
97%
Signals
  • AssertionError
  • expected 3 to be 2
  • Object.is equality
  • mechanical:test-assertion
  • signature:\bexpected\b[^\n]*\b(?:to|but)\b[^\n]*\b(?:received|be|equal|match)\b

Diagnosis recovery

Clean audit branch and Ultra verdict

Verdict: approved · policy default at local

CheckResultEvidence
deleted-testpassed
skipped-testpassed
pass-with-no-testspassed
weakened-assertionpassed
loosened-typepassed
relaxed-configpassed
module-syntaxpassed
llm-adjudicationpassedThe patch corrects the pageCount function from `Math.floor(items / size) + 1` to `Math.floor((items - 1) / size) + 1`, which fixes the off-by-one error causing the test to expect 2 but receive 3. The test 'keeps an exact final page' now passes without any modifications to the test suite, no skipped tests, no weakened assertions, and no changes to linting or type safety. The after log confirms the single test passes, indicating the diagnosed assertion failure is resolved.
second-opinionpassedgpt-6-astra: skipped: Not configured: OPENAI_API_KEY absent
typesafe-auditpassedjev-latest: skipped: Not configured: TYPESAFE_API_KEY absent
policy-required-commandpassedPassed 0 repository policy commands

The patch corrects the pageCount function from `Math.floor(items / size) + 1` to `Math.floor((items - 1) / size) + 1`, which fixes the off-by-one error causing the test to expect 2 but receive 3. The test 'keeps an exact final page' now passes without any modifications to the test suite, no skipped tests, no weakened assertions, and no changes to linting or type safety. The after log confirms the single test passes, indicating the diagnosed assertion failure is resolved.

Final outcome

Fixed Recorded live result

Sutura never merges a generated repair. A fixed result still needs human review.

Check a patch this page did not produce

This run did not record an exact failing commit and policy commit, so both are shown as placeholders. Verification is always tied to exact commits. A patch cannot ask for a more permissive policy by carrying one, and no green log is accepted in place of execution.

sutura verify \
  --case-dir <checkout> \
  --source-sha <failing commit> \
  --policy-base-sha <trusted policy commit> \
  --candidate-diff <patch file> \
  --failing-command diagnosed \
  --format json

The same route runs as a GitHub Action and needs no repository write access. Uploading a patch stays a command-line and Action route; this page never runs one.

Execution and cost detail
Release
v0.3.1 · Action e724f3b22de79d6ab3f40cffa96de7776c256ce9
Controller
e724f3b22de79d6ab3f40cffa96de7776c256ce9
Request
recorded-javascript-repair · 2026-09-17T14:30:57.361Z

ConTree search tree and branch status

Triage: real · reproduced 4/4 · stop reason failure-boundary · method sprt-p20-p80-a05-b05-v1

NodeParentDepthTerminal reasonTest exitPolicyChanged filesDiff bytes
search-001root1passed0valid1293
search-002root1passed0valid1300
search-003root1open1valid1293

Super proposals and candidate patches

Candidate repair-8e0798eb6849 · selected

Replace the controller-selected source excerpt.

Test exit 0 · held its result · node search-001 · Adaptive search passed at depth 1

diff --git a/page-count.js b/page-count.js
index 28f73e0..65f9eef 100644
--- a/page-count.js
+++ b/page-count.js
@@ -1 +1 @@
-export function pageCount(items, size) { return Math.floor(items / size) + 1; }
+export function pageCount(items, size) { return Math.floor((items - 1) / size) + 1; }

Candidate repair-9b12d1fedabe

Replace the controller-selected source excerpt.

Test exit 0 · held its result · node search-002 · Adaptive search passed at depth 1

diff --git a/page-count.js b/page-count.js
index 28f73e0..22b843b 100644
--- a/page-count.js
+++ b/page-count.js
@@ -1 +1 @@
-export function pageCount(items, size) { return Math.floor(items / size) + 1; }
+export function pageCount(items, size) { return items === 0 ? 0 : Math.ceil(items / size); }

Rejected patches and rejection reasons

CandidateResultTest exitNote
repair-9b12d1fedabeheld0Adaptive search passed at depth 1

Token cost, provider cost, latency, and sandbox operations

Inference cost
USD 0.008736
Sandbox cost
USD 0.084121
Elapsed
112.4 s
CPU time
7.65 s
Peak memory
240 MiB
Sandbox stages
22 (12 with an operation id)
RoleCallsInput tokensOutput tokensCost
nano11742403USD 0.000201
super31503100USD 0.000541
ultra24646257USD 0.007994

Recorded from docs/demo/placebo-v0.3.1-live-2026-09-17.json (result hash 4ff3693ba6bb…) at 2026-09-17T14:08:32.715Z, subject e724f3b22de79d6ab3f40cffa96de7776c256ce9.

Result hash 092ee0e2071fc8d80785ccf89a92dfbb7091551578552a04b937501a7645163f