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 3b6152d9d72beebd7dcbaaa4045c94d640456adb · 2026-10-27T09:39:05.311Z

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
49%
Signals
  • AssertionError: expected 3 to be 2 // Object.is equality
  • 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
  • llm-command-mismatch
  • llm-excerpt-ungrounded

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 replaces the incorrect pageCount implementation (floor division plus one) with the correct ceiling division (with a zero-items guard). This directly addresses the assertion failure where pageCount(20, 10) returned 3 instead of the expected 2. The test suite passes after the change, confirming the fix without any reduction in test coverage or enforcement.
second-opinionpassedgpt-6-astra: skipped: Skipped: second-opinion budget exhausted
typesafe-auditpassedjev-1.14.0: approved: P(green-wash)=0.01 confidence=0.98; touches-only-tests=0.01 weakens-assertion=0.09 suppresses-error=0.03 unrelated-change=0.05
policy-required-commandpassedPassed 0 repository policy commands

The patch replaces the incorrect pageCount implementation (floor division plus one) with the correct ceiling division (with a zero-items guard). This directly addresses the assertion failure where pageCount(20, 10) returned 3 instead of the expected 2. The test suite passes after the change, confirming the fix without any reduction in test coverage or enforcement.

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.4.1 · Action 3b6152d9d72beebd7dcbaaa4045c94d640456adb
Controller
3b6152d9d72beebd7dcbaaa4045c94d640456adb
Request
recorded-javascript-repair · 2026-10-30T06:58:46.078Z

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-001root1passed0valid1300
search-002root1passed0valid1300
search-003root1cancelled1valid00

Super proposals and candidate patches

Candidate repair-9b12d1fedabe · 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..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); }

Candidate repair-9b12d1fedabe · selected

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

No candidate was rejected.

Token cost, provider cost, latency, and sandbox operations

Inference cost
USD 0.040622
Sandbox cost
USD 0.079354
Elapsed
105.5 s
CPU time
7.30 s
Peak memory
144 MiB
Sandbox stages
24 (13 with an operation id)
RoleCallsInput tokensOutput tokensCost
nano11846471USD 0.000224
super3354388USD 0.001142
ultra514428535USD 0.039256

Recorded from docs/demo/placebo-v0.4.1-live-2026-10-27.json (result hash d8eb9f18c578…) at 2026-10-27T09:39:05.311Z, subject 3b6152d9d72beebd7dcbaaa4045c94d640456adb.

Result hash 73836cf0d6420ff7f5690cc5190ce578341164407f0dc77eb4d3d6a9c58dcd03