Skip to content

fix(runtime): validate max loop limit - #72

Merged
ralyodio merged 1 commit into
moshcoder:mainfrom
aiirvizionz:clientkit/runtime-max-guard
Jul 30, 2026
Merged

fix(runtime): validate max loop limit#72
ralyodio merged 1 commit into
moshcoder:mainfrom
aiirvizionz:clientkit/runtime-max-guard

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • Validate programmatic runScript({ max }) values before creating the loop governor
  • Reject zero, negative, and fractional max values with a clear error
  • Add regression coverage for invalid max values while keeping existing runtime behavior intact

Why

The CLI validates --max, but direct runScript() callers could pass invalid values. max: 0 stops scripts before any alive loop iteration, while fractional values produce surprising loop counts. The runtime should enforce the same positive-integer contract as the CLI.

Validation

  • node --test test\runtime.test.mjs

@ralyodio
ralyodio merged commit 29700dc into moshcoder:main Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants