chore(deps): hold monty at 0.0.19 — 0.0.21 silently disables the Python sandbox memory ceiling - #2300
Merged
Merged
Conversation
Monty 0.0.21 moves `max_memory` enforcement from host-side accounting in `LimitedTracker::on_grow` to a probe of the `LIVE_MEMORY`/`BASELINE_MEMORY` statics. Only the separate `monty-alloc` crate writes those, and only when installed as the process-wide global allocator; neither `monty` nor `monty-types` depends on it. Bashkit cannot supply that allocator — it is an embeddable library, and bashkit-python is a CPython extension module. With the statics at their initial values `probe_memory()` is `0.saturating_sub(usize::MAX)` == 0, so `check_allocation` never trips and the Python sandbox's memory ceiling is silently unenforced. Four threat-model regression tests fail on the bump (nested_list_bomb, successive_allocations_accumulate, tight_memory_blocks_many_small_objects, threat_python_pow_exhaustion) while the duration, recursion and print-cap tests still pass, localising the regression to allocator-backed memory. Adds dependabot ignores so the broken bump is not regenerated weekly, and documents the blocker — along with the `ResourceTracker`/`ResourceLimits` API migration and the `jiter` git-patch removal that become possible once the memory fix lands — in the Python builtin knowledge doc. Supersedes #2296 and #2297.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | c1768f3 | Commit Preview URL Branch Preview URL |
Aug 15 2026, 09:20 AM |
This was referenced Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Blocks the
monty/monty-types0.0.19 → 0.0.21 upgrade instead of taking it, and records why..github/dependabot.yml: ignoremontyandmonty-typesso the broken bump is not regenerated every week.crates/bashkit/Cargo.toml: document the hold at the dependency (the0.0.19requirement is already an exact pin — Cargo treats each0.0.zas its own compatibility range).knowledge/runtimes/python-builtin.md: new Upgrade blocker section covering the regression, the API migration the bump needs, and the supply-chain win that unlocks when it is safe.No product code changes.
Supersedes #2296 and #2297 — both should be closed.
Why
Dependabot split one upstream release across two PRs, each bumping half of a version-locked pair, so both fail every check. Fixing that split surfaced the real problem.
Monty 0.0.21 changes how
max_memoryis enforced:LimitedTracker::on_growaccounts VM heap growth in-processprobe_memory()reads theLIVE_MEMORY/BASELINE_MEMORYstaticsmonty-alloc, as the process-wide global allocatorNeither
montynormonty-typesdepends onmonty-alloc. With it absent the statics keep their initial values, soprobe_memory()is0.saturating_sub(usize::MAX)== 0 andcheck_allocation— backing bothmax_memoryandcheck_large_result— can never trip. The ceiling is not weakened, it is silently unenforced: no error, no warning.Bashkit cannot supply the missing allocator. It is an embeddable library, so the global allocator belongs to the downstream binary, and
bashkit-pythonis a CPython extension module where the allocator is CPython's.monty-allocis built for Monty's own out-of-process worker model, which bashkit does not use.Before / After
Verified locally by applying the full bump (both crates together, plus the
ResourceTracker/ResourceLimitsmigration needed to compile) and running the Python resource-limit suites.With monty 0.0.21 — a sandboxed script allocates without bound:
On this branch (monty 0.0.19):
The duration, recursion, string-bomb and print-collect-cap tests pass in both runs, which localises the regression to allocator-backed memory rather than resource limits generally.
Risk
Cargo.lockis untouched.[patch.crates-io]git pin ofjiterstays until the hold lifts. Both are recorded in the knowledge doc, including the two API changes (ResourceTrackerbecoming a concrete struct,ResourceLimits::new()→Default) and the fact that monty 0.0.21's move to the publishedjiter 0.16.0would remove the last git dependency from the release graph — a real supply-chain win, but not a reason to take a silent sandbox regression early.Checklist
Generated by Claude Code