Runs
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
- Picked up NWT-214
- Planned the fix
Add clamp to src/utils.js; verify against the failing test.
- read_reporead420ms
src/utils.js, test/utils.test.js
- Baseline: 5/7 passing
clamp tests fail as expected (function missing).
- write_patchwrite1.5s
Added export function clamp(n,min,max).
- Verification gate: 7/7 passing
Previously-failing tests pass; no regressions.
- Shipped
Gate passed. Opened PR on branch minion/nwt-214.
- 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