monty-updater
Purpose
dspy-monty-interpreter is a thin adapter that exposes Monty (a Rust-built sandboxed Python interpreter, distributed on PyPI as pydantic-monty) as a DSPy CodeInterpreter. When Monty ships a new release, this skill audits whether the adapter needs changes — bug fixes, version bumps, new features to surface, or breaking-change handling.
What the adapter actually does (so you can judge release impact)
Single class: MontyInterpreter in src/dspy_monty_interpreter/interpreter.py. Conforms to DSPy's CodeInterpreter protocol (tools, output_fields, _tools_registered, start, execute, shutdown).
Key Monty surface area it consumes (from pydantic_monty):
MontyRepl — persistent incremental REPL. Created in _new_repl(), replaced on shutdown() and whenever RLM resets _tools_registered = False.
MontyRepl.feed_run(code, inputs=, external_functions=, print_callback=, mount=, os=) — the one execution call. Any signature change here is a breaking change. (skip_type_check= also exists but adapter does not use it.)
MontyRuntimeError, MontySyntaxError — caught and re-raised as DSPy CodeInterpreterError / Python SyntaxError.
MountDir — passed through as mounts constructor arg. (Renamed from MountDirectory in 0.0.13.)
AbstractOS — passed through as os_access constructor arg, forwarded to feed_run(os=…). OSAccess is the concrete subclass users most often instantiate.
ResourceLimits — passed through as resource_limits constructor arg, forwarded to MontyRepl(limits=…).
Adapter responsibilities Monty does NOT provide:
- Strips markdown ```python fences before execution.
- Injects a
SUBMIT(...) external function that captures args into a box and returns None (so the VM continues past the call). Honored even if a runtime error fires after SUBMIT.
- Wraps every user tool with a callback shim that fires DSPy
on_tool_start / on_tool_end and threads ACTIVE_CALL_ID.
- Builds output: print buffer wins over expression value; both stringified.
Project goals (informs the recommendation):
- Stay a thin adapter — push capability into Monty, keep wrapping minimal.
- Track real Monty capability: as Monty grows (classes, more stdlib, match stmts) update README's "limitations" list.
- Maintain compatibility with
dspy>=3.0's CodeInterpreter protocol.
- Currently pinned:
pydantic-monty>=0.0.15 in pyproject.toml.
Workflow
- Read the current pin. Open
pyproject.toml, find the pydantic-monty>=X.Y.Z line. Record X.Y.Z.
- Fetch releases.
WebFetch https://github.com/pydantic/monty/releases. If that's noisy, also try the GitHub API: https://api.github.com/repos/pydantic/monty/releases (no auth needed for public reads, but rate-limited).
- Identify unreviewed releases. List every release with a tag
> X.Y.Z. If none, report "up to date" and stop.
- Pull each release's notes. For each new tag, read its body. Categorize each bullet as:
- Breaking — signature, exception, or behavior change in any symbol the adapter imports (see surface-area list above).
feed_run signature changes are the highest-risk class.
- Bug fix — may let us delete an adapter workaround, or fix a known issue in our test suite.
- New capability — new builtins, syntax support (classes, match), new stdlib modules, new
MontyRepl features, new ResourceLimits knobs, new mount options. These usually warrant README updates and sometimes new constructor params.
- Internal — Rust refactors, perf, no Python-visible change. Note but no action.
- Cross-check against the adapter. For each Breaking/New item, grep the relevant symbol in
src/dspy_monty_interpreter/ and tests/. State the exact file:line that would change.
- Recommend. Produce a punch list for the user with these sections (omit empty sections):
- Required changes (breaking-change fixes, version-pin bump)
- Suggested enhancements (surface a new Monty feature through the adapter)
- Docs/README updates (limitation list changes, version requirement bumps)
- No action (changes that don't affect us, with one-line reasons)
Include the proposed new pin (e.g.
pydantic-monty>=A.B.C) and whether this warrants a dspy-monty-interpreter patch/minor/major bump.
Do not edit code or bump versions in this skill. Stop at the recommendation. The user decides; release work runs through the release skill.
Quick reference
Common mistakes
- Skipping the surface-area check. A release note saying "added match statement support" sounds neutral but should trigger a README limitations-list edit.
- Treating any
MontyRepl change as breaking. Only changes to symbols listed in the surface-area section above affect us. Internal Monty changes are noise.
- Forgetting intermediate releases. If we're on 0.0.10 and latest is 0.0.13, review 0.0.11, 0.0.12, AND 0.0.13 — a feature added in .11 and removed in .13 still matters for our changelog narrative.
- Recommending a version bump without checking
requires-python. If Monty raises its Python floor, our pyproject.toml requires-python = ">=3.10" may need to follow.
Source: dbreunig/dspy-monty-interpreter — distributed by TomeVault.
1---2name: monty-updater3description: Use when checking whether a new pydantic-monty release affects dspy-monty-interpreter — fetches Monty's GitHub releases, compares to the pinned version in pyproject.toml, and recommends what (if anything) to update.4---56# monty-updater78## Purpose910`dspy-monty-interpreter` is a thin adapter that exposes [Monty](https://github.com/pydantic/monty) (a Rust-built sandboxed Python interpreter, distributed on PyPI as `pydantic-monty`) as a DSPy `CodeInterpreter`. When Monty ships a new release, this skill audits whether the adapter needs changes — bug fixes, version bumps, new features to surface, or breaking-change handling.1112## What the adapter actually does (so you can judge release impact)1314Single class: `MontyInterpreter` in `src/dspy_monty_interpreter/interpreter.py`. Conforms to DSPy's `CodeInterpreter` protocol (`tools`, `output_fields`, `_tools_registered`, `start`, `execute`, `shutdown`).1516Key Monty surface area it consumes (from `pydantic_monty`):1718- `MontyRepl` — persistent incremental REPL. Created in `_new_repl()`, replaced on `shutdown()` and whenever RLM resets `_tools_registered = False`.19- `MontyRepl.feed_run(code, inputs=, external_functions=, print_callback=, mount=, os=)` — the one execution call. Any signature change here is a breaking change. (`skip_type_check=` also exists but adapter does not use it.)20- `MontyRuntimeError`, `MontySyntaxError` — caught and re-raised as DSPy `CodeInterpreterError` / Python `SyntaxError`.21- `MountDir` — passed through as `mounts` constructor arg. (Renamed from `MountDirectory` in 0.0.13.)22- `AbstractOS` — passed through as `os_access` constructor arg, forwarded to `feed_run(os=…)`. `OSAccess` is the concrete subclass users most often instantiate.23- `ResourceLimits` — passed through as `resource_limits` constructor arg, forwarded to `MontyRepl(limits=…)`.2425Adapter responsibilities Monty does NOT provide:2627- Strips markdown ```python fences before execution.28- Injects a `SUBMIT(...)` external function that captures args into a box and returns `None` (so the VM continues past the call). Honored even if a runtime error fires after SUBMIT.29- Wraps every user tool with a callback shim that fires DSPy `on_tool_start` / `on_tool_end` and threads `ACTIVE_CALL_ID`.30- Builds output: print buffer wins over expression value; both stringified.3132Project goals (informs the recommendation):3334- Stay a **thin** adapter — push capability into Monty, keep wrapping minimal.35- Track real Monty capability: as Monty grows (classes, more stdlib, match stmts) update README's "limitations" list.36- Maintain compatibility with `dspy>=3.0`'s `CodeInterpreter` protocol.37- Currently pinned: `pydantic-monty>=0.0.15` in `pyproject.toml`.3839## Workflow40411. **Read the current pin.** Open `pyproject.toml`, find the `pydantic-monty>=X.Y.Z` line. Record `X.Y.Z`.422. **Fetch releases.** `WebFetch` https://github.com/pydantic/monty/releases. If that's noisy, also try the GitHub API: `https://api.github.com/repos/pydantic/monty/releases` (no auth needed for public reads, but rate-limited).433. **Identify unreviewed releases.** List every release with a tag `> X.Y.Z`. If none, report "up to date" and stop.444. **Pull each release's notes.** For each new tag, read its body. Categorize each bullet as:45 - **Breaking** — signature, exception, or behavior change in any symbol the adapter imports (see surface-area list above). `feed_run` signature changes are the highest-risk class.46 - **Bug fix** — may let us delete an adapter workaround, or fix a known issue in our test suite.47 - **New capability** — new builtins, syntax support (classes, match), new stdlib modules, new `MontyRepl` features, new `ResourceLimits` knobs, new mount options. These usually warrant README updates and sometimes new constructor params.48 - **Internal** — Rust refactors, perf, no Python-visible change. Note but no action.495. **Cross-check against the adapter.** For each Breaking/New item, grep the relevant symbol in `src/dspy_monty_interpreter/` and `tests/`. State the exact file:line that would change.506. **Recommend.** Produce a punch list for the user with these sections (omit empty sections):51 - **Required changes** (breaking-change fixes, version-pin bump)52 - **Suggested enhancements** (surface a new Monty feature through the adapter)53 - **Docs/README updates** (limitation list changes, version requirement bumps)54 - **No action** (changes that don't affect us, with one-line reasons)55 Include the proposed new pin (e.g. `pydantic-monty>=A.B.C`) and whether this warrants a `dspy-monty-interpreter` patch/minor/major bump.5657**Do not edit code or bump versions in this skill.** Stop at the recommendation. The user decides; release work runs through the `release` skill.5859## Quick reference6061| Thing to check | Where |62|---|---|63| Current pin | `pyproject.toml` line ~24 |64| Adapter surface area | `src/dspy_monty_interpreter/interpreter.py` |65| Stated limitations | `README.md` (top section) |66| Tests that exercise Monty behavior | `tests/test_interpreter.py` |67| Monty releases | https://github.com/pydantic/monty/releases |68| Monty PyPI metadata | https://pypi.org/pypi/pydantic-monty/json |6970## Common mistakes7172- **Skipping the surface-area check.** A release note saying "added match statement support" sounds neutral but should trigger a README limitations-list edit.73- **Treating any `MontyRepl` change as breaking.** Only changes to symbols listed in the surface-area section above affect us. Internal Monty changes are noise.74- **Forgetting intermediate releases.** If we're on 0.0.10 and latest is 0.0.13, review 0.0.11, 0.0.12, AND 0.0.13 — a feature added in .11 and removed in .13 still matters for our changelog narrative.75- **Recommending a version bump without checking `requires-python`.** If Monty raises its Python floor, our `pyproject.toml` `requires-python = ">=3.10"` may need to follow.7677---78> Source: [dbreunig/dspy-monty-interpreter](https://github.com/dbreunig/dspy-monty-interpreter) — distributed by [TomeVault](https://tomevault.io).79<!-- tomevault:4.0:skill_md:2026-06-17 -->