Runs
NWT-214Completed Demo data

Add a clamp(n, min, max) helper

Repo Triage

Add and export clamp(n, min, max) constraining n to [min, max]. clamp(5,0,10)=5, clamp(-3,0,10)=0, clamp(99,0,10)=10.

Verification gate

Baseline
5/7 passing
After the change
7/7 passing
Confidence
high
Risk:lowsmall, self-contained change

Verdict: Adds and exports a correct, minimal clamp using Math.min/Math.max that satisfies every specified case.

Timeline

  1. Picked up NWT-214
  2. Planned the fix

    Add clamp to src/utils.js; verify against the failing test.

  3. read_reporead420ms

    src/utils.js, test/utils.test.js

  4. Baseline: 5/7 passing

    clamp tests fail as expected (function missing).

  5. write_patchwrite1.5s

    Added export function clamp(n,min,max).

  6. Verification gate: 7/7 passing

    Previously-failing tests pass; no regressions.

  7. Shipped

    Gate passed. Opened PR on branch minion/nwt-214.

  8. Pull request + diff

Artifacts

src/utils.js
@@ -25,4 +25,6 @@ export function parseQueryString(qs) {
return out;
}
-// NWT-214: a clamp(n, min, max) helper is requested but doesn't exist yet.
+export function clamp(n, min, max) {
+ return Math.min(Math.max(n, min), max);
+}

Details

Model
claude-fable-5
Started
Aug 9
Steps
7
Tool calls
7
Duration
29.3s
Cost
$0.38
NWT-214 · Add a clamp(n, min, max) helper · Agent Forge