feat(surface,sdk,kernel): deterministic-step timeout option f.run with timeout (#343) - #350
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b9627be. Configure here.
…th timeout) (#343) Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
…sion + explicit variable naming (#354) Bugbot MED at compile.ts:68 flagged 'multiplies the captured coefficient by the wrong unit, rejecting valid timeouts like 5m or 300s'. Static analysis showed the code correctly used match[1] as coefficient and match[2] as unit — the flagged cases pass the existing tests. The real edge Bugbot circled is float precision: 1.1 * 1000 = 1100.0000000000002 which isSafeInteger rejects. Fix: - Math.round the coefficient * unit product so fractional-but-clean durations survive. - Rewrite the parse into explicit variables (coefficient, unit) instead of the chained ternary — a future edit cannot silently swap match[1] and match[2]. - Add regression tests for 1.1s / 2.2s / 1.1m / 0.5s / 14.999m, plus an explicit '5s' case whose expected value fails hard on any coefficient/unit swap. Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
b9627be to
eea6901
Compare
maintainability lens — FAILMaintainability review — PR #350 (per-invocation deterministic lease)Blockers1. Concerns2. Three names for one concept, no doc pointer. 3. 4. Ceiling enforced in SDK only. SURFACE.md declares 15 min a "hard ceiling," but 5. Two error surfaces for one code. 6. Redundant re-parsing. Notes
REVIEW_FAILED |
history lens — PASSBlockers: none. The supplied diff passes the HISTORY lens. Notes
Concerns
This verdict covers the supplied diff, matching REVIEW_PASSED |
structure lens — MISSING |
|
🎯 review-swarm: FAILED (M:fail H:pass S:missing) Lens transcripts posted as sibling comments above. |

Closes #343. Delivered via implement-slice.flow.ts (flows-driven dogfood, mixed codex/claude).
Note
Medium Risk
Changes deterministic execution timing, spec validation, and lease journaling across SDK and kernel; misaligned builds could refuse specs or behave differently on long-running commands.
Overview
Adds per-command timeouts for authored
f.run: optional{ timeout: string | number }(default 30s, hard cap 15 minutes), documented in SURFACE.md.The SDK parses durations (
ms/s/mor raw ms) viaparseStepTimeout, refuses bad values withtimeout_invalidand over-cap withlease_exceededbefore journal I/O, and lowers each call to a deterministic step carrying optionallease_ms. Journaltimeout/lease_expiredcompletions surface to authors aslease_exceeded.The kernel accepts
lease_msonly on deterministic steps (validated, fail-closed on llm/agent), journals the matchinglease_deadline_ms, and the deterministic executor waitsmin(lease_ms, timeout_ms)when both are set—then kills the process group and recordstimeouton expiry.Reviewed by Cursor Bugbot for commit eea6901. Bugbot is set up for automated code reviews on this repo. Configure here.