JavaScript repair bench
The patch passed.
Would you ship it?
Challenge a plausible fix with real inputs. See what the function returns, catch changes it makes to its arguments, and keep the failing case as a regression test.
Checking function execution support…
- Initial checks
- 4/4
- With one new case
- 4/5
An unsafe price slipped through the passing patch.
- Expected return
null- Observed return
"too-high"
How the bench checks a repair
Analyze a failure, review a replacement, then run it against the same examples. Add a case if there is a requirement the examples miss.
- ON-DEVICE · OPTIONAL
Diagnose in Chrome
Ask Nano to inspect the source and a failing example. Requires a supported browser and on-device model.
- CLOUD · YOUR CHOICE
Approve the cloud request
Inspect the exact request before asking Gemini for a patch. Its draft still needs your diff review and Apply.
- INDEPENDENT CHECKS
Run the new counterexample
Check actual returns and input changes. Challenge a passing repair with another example, then verify afresh.
Try the example without a model or account. On-device advice needs a supported model; Firebase setup may contact Google. Passing your examples leaves untested behavior unknown.
See the recorded Firebase run
Why did valid tags disappear?
The demo’s original function passed three of five checks. It returned an empty list when the expected result was ["constructor", "__proto__"].
-
On-device · SDK reported
on_deviceThe hint found the filter
Chrome pointed to
if (!key || seen[key]) return false. Its explanation left the cause unresolved. -
Cloud · SDK reported
in_cloudGemini challenged the diagnosis
After approval to share the hint, Gemini identified inherited properties on
seen. The filter treated valid tags as duplicates. -
Browser verifier · 5/5
The reviewed correction passed
An authored correction used a
Setand handled non-string inputs. The verifier reran the same five examples.
Saved demo results. Comparing the two versions runs fresh checks in this tab and makes zero model calls.
Bring your own function · JSON counterexamples
One synchronous CommonJS export, up to eight examples. Compare its return value and check that inputs stayed unchanged. No imports, async functions or repository access. Source stays in this run unless you explicitly send a cloud request.
Checking function execution support…
Reopen a saved replay case
Choose a saved replay file or paste its JSON. Load the replay to replace the intake draft. Then open it as a new run and verify it.
Validation checks both file hashes. Open and verify the function separately.
Compare a function revision
Checkout patch audit
Gemini received four examples. These eight additional examples were set aside before the request. The unsafe-price failure informed the one-line correction. This reruns the recorded draft and the reviewed fix against those same eight examples, with zero model calls.
Find a price the first checks missed
These four examples were the ones Gemini saw. Both versions pass them. Choose Probe boundary inputs to look for a disagreement inside the quote data.
Find a new test
Try up to eight inputs. Replace nested nonnegative integers with the first unsafe integer, then try boundary values for top-level arguments.
Add a regression test
Use the required behavior to decide the expected outcome. Loading replaces the repair form and keeps the active run open.
Load replaces the repair form with this candidate and its fixed examples. The active run stays open. The download contains the candidate code and all example values.
Run a saved replay twice to see whether its observed results change. Add a candidate JavaScript file or replay to compare versions against the same examples.
Compare local JavaScript files with a CI contract
Use the same test contract as CI with an earlier and a proposed version of the function. Both files run in this tab. The contract contains example values and expected results.
Each example includes label, args, and either expected for a JSON return or throws for an error code such as "INVALID_SLUG".
Examples define your contract. Passing them does not prove behavior for other inputs.
Save or reopen an intake draft
The draft file contains these form values, including source and examples. Loading a file replaces only the form.
Practice with guided repair drills
OPTIONAL / LEARN THE WORKFLOW
Inspect failure opens the selected authored drill, runs its baseline checks and reads the source. Choose model advice separately.
Inspect the evidence for the current run.
Three isolated examples of bugs that quietly hurt real software.
NO ACTIVE RUN- 01 Establish the failure
- 02 Inspect the evidence
- 03 Review the change
- 04 Verify & finish
Opening the repair bench…
First failing example
The job
Open a drill to see the original task.
Read a file to add its current contents to the evidence.
Runtime & setup
Checking available adapters…
Check readiness without sending a repair prompt. Chrome controls model downloads, which can use several GB. A readiness check may trigger background setup in some browser configurations.
Reopen the bench offline on this browser. Download a replay to keep your source and tests.
The change
AWAITING PATCHInspect the failure, then load an example correction or generate a local patch.
Request a cloud patch
Google can propose a replacement from your function and fixed examples. Inspect the request before sending; the returned draft still needs diff review, Apply and local checks.
Destination: Google via Firebase AI Logic · gemini-3.5-flash-lite.
View complete cloud prompt
View model draft
This walkthrough replays a draft returned by Gemini in an earlier checkout test. The replay itself makes no model call.
Review prepares a diff. Apply changes only the function; your JSON contract stays read-only.
Optional challenge: try a plausible cursor patch, then compare every check before loading the correction. Authored example; no AI call.
Your checked function
View checked source
Keep the source and fixed examples together. This replay file contains your code and expected values; the default evidence record excludes them.
View replay JSON
Run these examples in CI
In the Local Pit Crew source checkout with Node.js 24+, install the runner once.
npm ci --ignore-scripts --prefix local-pit-crew/runner
The contract contains example inputs and expected returns. Review them before committing the file. Replace src/my-function.js with the function in your checkout.
The saved examples check the current file without a model call. Append --junit NEW_REPORT.xml to write a new report for CI.
Challenge with another example
A passing example set can still miss a bug. Supply one more input and the return you expect. Every existing example is kept in a new contract; the current contract is not edited.
Repeat a passing input
Run the same input again after the current examples. Review the copied expected return before starting the extended check.
Try an integer boundary
Set one number from a passing example to 9007199254740992, just above the safe integer range in JavaScript. Then enter the return your function should give.
Use an array of call arguments. For a function receiving one array, wrap that array in another array.
Source evidence
A second set of eyes
FIREBASE + NANOA failed check and the source give Nano something specific to reason about. Its hint stays separate from the patch.
Run the baseline and read a file to build a diagnosis.
Challenge the diagnosis
OPTIONAL CLOUDAsk Gemini for a counterexample or a next check. Review what leaves your device first. Works without the on-device model.
Review what Gemini will receive
Destination: Google via Firebase AI Logic · gemini-3.5-flash-lite. This sends the complete prompt shown below. Provider quota and terms apply.
View complete review prompt
Optional: review the exact source snippets and failed check IDs before sending them to Google.
The checks
Public fixture checks. Held-out correctness is measured separately.
Keep a reproducible bug report
The replay includes the tested function, its requirements and its fixed examples. Share it only with someone who should see those contents. It reruns the checks when opened.
View failure replay JSON
Run these examples in CI
In the Local Pit Crew source checkout with Node.js 24+, install the runner once.
npm ci --ignore-scripts --prefix local-pit-crew/runner
The contract contains example inputs and expected returns. Review them before committing the file. Replace src/my-function.js with the function in your checkout.
The saved examples check the current file without a model call. Append --junit NEW_REPORT.xml to write a new report for CI.
The run record
- Your run starts here.