Skip to content

feat: Add wall-clock, heap, and output size resource limits#4

Merged
ThomasHartDev merged 1 commit into
mainfrom
thomas/feat/resource-limits
Jul 23, 2026
Merged

feat: Add wall-clock, heap, and output size resource limits#4
ThomasHartDev merged 1 commit into
mainfrom
thomas/feat/resource-limits

Conversation

@ThomasHartDev

Copy link
Copy Markdown
Owner

Fills out the resource limit layer for every airlock tier. Timeout and heap already lived on the worker path; this PR makes them a shared ResourceLimits contract, hard-kills the isolate on both the deadline and a caller abort, and adds maxOutputBytes so a huge return never reaches the post-condition as a trusted value.

Output size is a budgeted walk over the value (UTF-8 string payload, typed arrays by byteLength, cycle-safe with WeakSet) so metering itself cannot hang the host. Oversize comes back as output-too-large without the payload attached. Tests cover empty/boundary/oversize, cyclic structures, invalid limit values, and terminate-on-abort timing for now.

Shared ResourceLimits validation, budgeted output metering with
output-too-large, and hard worker.terminate on deadline and abort.
@ThomasHartDev
ThomasHartDev merged commit ef7e2ad into main Jul 23, 2026
1 check passed
@ThomasHartDev
ThomasHartDev deleted the thomas/feat/resource-limits branch July 23, 2026 18:36
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.

1 participant