fix/resource-watchdog-ulimit-bypass #73

Merged
clawdie merged 2 commits from fix/resource-watchdog-ulimit-bypass into main 2026-11-19 14:01:27 +01:00
Owner
No description provided.
- Remove the silent command.includes('ulimit -v ') skip in
  wrapBashWithChildEnvelope() so comments, quoted strings, or trailing
  ulimit calls cannot bypass child virtual-memory wrapping.
- Replace fail-open 'ulimit -v <kb> 2>/dev/null || true' with an
  explicit fail-closed check (exit 126 + truthful stderr noting
  RLIMIT_AS, not host RSS) so protected bash calls never run uncapped
  when ulimit -v fails.
- Extend the existing 1,536 MiB virtual-memory arena floor
  (V8_VMEM_CAGE_MB + 323) to Go binaries (go, zot, colibri, bherdr)
  alongside V8 runtimes without altering any tier profile values.
- Clarify header/inline comments that this is a per-child Pi tool_call
  hygiene guard (not host-wide RSS enforcement or an unbypassable OS
  boundary), preserving RESOURCE_WATCHDOG_DRY_RUN=1 semantics.
- Add focused unit + POSIX /bin/sh tests in hooks/tests/test_resource_watchdog.py.
fix(hooks): anchor Go/V8 vmem floor to argv[0], clarify tier reconciliation, test prelude splitter
All checks were successful
format-check / gates (pull_request) Successful in 8s
40085a9f8e
- Replace unanchored HIGH_VMEM_BINARY_RE with argv[0]-positioned clause
  matching (skipping env assignments and common command wrappers) so
  filenames like 'cat go.mod', 'docs.go', 'go.tar.gz', or 'echo zot'
  keep the tier's childVmemMb instead of triggering the 1,536 MiB floor.
- Clarify in comments that the 1,536 MiB floor is an RLIMIT_AS virtual
  arena floor (not a physical RSS grant), Gate 3 still checks physical
  availableMb vs childToolRssMb, and this hook runs only inside Pi's
  tool_call lifecycle (standalone Zot has no watchdog here).
- Add negative false-positive assertions, prelude-vs-splitter clause
  preservation test, and real /bin/sh trailing 'ulimit -v unlimited'
  hard-limit check.
clawdie deleted branch fix/resource-watchdog-ulimit-bypass 2026-11-19 14:01:27 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/agent-skills!73
No description provided.