Skip to content
CAI
Software that uses CAICheck a score

pydantic/monty

66.4

Adequate · 29 September 2026

194.5k

lines of production code

Rust

with Python

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Monty is a sandboxed Python runtime engine that executes untrusted code with strict resource limits and crash isolation. It provides a versioned wire protocol and elastic worker pools to manage subprocesses, supporting both local and remote WebSocket transports. The system offers client libraries for Python, JavaScript, and WebAssembly, enabling secure execution in diverse environments from Node.js to browsers. It includes comprehensive features for type checking, filesystem confinement, and telemetry to ensure safe and observable code execution.

Features

Add \`collections\` types and expand \`bytes\` methods

The \collections\ module now includes \deque\, \namedtuple\, \defaultdict\, and \Counter\, providing standard Python container types. The \bytes\ type has been significantly expanded with new methods for case transformation, searching, stripping, splitting, and padding, along with encoding/decoding support. Additionally, a new \CallableIterator\ type implements the two-argument \iter(callable, sentinel)\ pattern, handling re-entrant Python calls and garbage collection correctly.

crates/monty/src/types · high confidence

Add antigravity example running in a Monty sandbox

The antigravity example is now available in the browser, running the xkcd 353 comic inside a Monty WebAssembly sandbox. The Python script (\antigravity.py\) is restricted to only \random\ and \time\ imports, while DOM access is provided via host objects and functions defined in \main.ts\. The example uses a loop with \time.sleep()\ for animation instead of \set\_interval\ to comply with sandbox restrictions on passing functions to the host.

examples/antigravity · high confidence

Add collections module with deque, namedtuple, defaultdict, and Counter

The \collections\ module is now available, exposing \deque\, \namedtuple\, \defaultdict\, and \Counter\. \deque\ is implemented as a dedicated type, while \namedtuple\ is provided as a factory function that creates named tuple classes. \defaultdict\ and \Counter\ are implemented as specialized dict types that inherit standard dict behavior but add specific features: \defaultdict\ supports a default factory for missing keys, and \Counter\ provides counting operations, algebraic operators, and methods like \most\_common\.

crates/monty/src/modules/collections · high confidence

Add expense analysis example demonstrating custom budget handling

The \examples/expense\_analysis\ directory now contains a complete example that analyzes team travel expenses against both standard and per-user custom budgets. The example includes simulated data for five team members, where only one user (Bob) has a specific custom budget limit. The main script demonstrates how to use the \pydantic\_monty\ library to execute Python code that iterates through team members, sums their Q3 travel expenses, and identifies those exceeding their applicable budget (standard or custom), outputting a summary of over-budget details.

_examples/expense\analysis · high confidence

Add json module with loads and dumps functions

The \json\ module is now available, providing \json.loads()\ to parse JSON text into Monty values and \json.dumps()\ to serialize Monty values into JSON text. The implementation supports standard keyword arguments such as \indent\, \sort\_keys\, \ensure\_ascii\, \allow\_nan\, \separators\, and \skipkeys\, while intentionally omitting CPython kwargs like \cls\ and \default\. Parsing uses the \jiter\ library for performance and includes a per-run string cache to deduplicate repeated strings during \loads()\. The module also exposes \JSONDecodeError\ for handling syntax errors.

crates/monty/src/modules/json · high confidence

Added web scraper example demonstrating LLM-generated code extraction

A new example in the \examples/web\_scraper\ directory demonstrates how to use Pydantic AI to generate Python code that extracts pricing data from model lab websites. The entry includes a README explaining the approach and an \example\_code.py\ file showing the generated code structure, which uses BeautifulSoup to parse HTML tables and extract model information.

_examples/web\scraper · high confidence

Browser support via Web Workers

Monty now runs in the browser by executing the Python interpreter inside Web Workers. This change introduces a browser-specific worker factory, a dedicated entry point for the worker thread, and a shared channel layer that manages request-response lifecycles, hard per-turn timeouts, and worker termination. The pool infrastructure is unified so that both Node.js (using \worker\_threads\) and browsers (using \Web Worker\) present the same \Monty\ API, allowing users to run Monty directly in the browser without a Node.js backend.

crates/monty-js/ts/worker · high confidence

Expanded standard library coverage with new and extended modules

This update significantly broadens the Python standard library available in the sandbox. New modules include \asyncio\ (providing \run\, \gather\, and \sleep\), \copy\ (supporting \copy\ and \deepcopy\ for various heap types), \functools\ (adding \reduce\ and the \partial\ type), \gc\ (exposing \collect\, \enable\, and \disable\ for test hooks), and \itertools\ (implementing a wide range of iterators like \count\, \repeat\, \chain\, \accumulate\, \takewhile\, and more). Existing modules have also been extended: \base64\ now covers all codecs including ascii85 and MIME helpers, \binascii\ is fully implemented with checksums and encoding pairs, and \datetime\ exposes its core types (\date\, \datetime\, \time\, \timedelta\, \timezone\). A new \CLAUDE.md\ guide establishes strict CPython parity requirements for argument binding and error messages across all modules.

crates/monty/src/modules · high confidence

Initial devcontainer configuration for local development

Added a new devcontainer setup (devcontainer.json and setup.sh) to enable development within Codespaces or VS Code Remote Containers. This configuration provisions an Ubuntu 24.04 environment with Rust, Node.js, and SSH, and automates the installation of Python and JavaScript dependencies via uv and make. It specifically addresses pyo3 build requirements by configuring a shared libpython and updating system loader paths to ensure datatest and benchmark binaries run correctly.

.devcontainer · high confidence

Initial release of @pydantic/monty for JavaScript/TypeScript

This change introduces the \monty-js\ crate, enabling users to run Python code within Monty's sandbox from JavaScript and TypeScript environments. The package provides a public API for creating execution pools and sessions, allowing code to be fed and executed with support for inputs, print callbacks, and state retention across feeds. It supports both Node.js (using subprocess workers) and browser environments (using Web Workers via WASM). The release includes a build script that synchronizes the package version with the Cargo workspace, TypeScript type definitions for the native addon, and a test suite using Vitest to verify the public API contract.

crates/monty-js · high confidence

Introduce \`monty-types\` crate for sandbox boundary data structures

The \monty-types\ crate is added to define the core data types used at the sandbox boundary, including the \MontyObject\ arena-based graph for serializing Python values, \MontyException\ with CPython-matching traceback formatting, \FileMode\ for parsing \open()\ mode strings, and \PrintWriter\ for handling print output with memory caps. This establishes the foundational types for passing data between the host and the sandboxed environment.

crates/monty-types/src · high confidence

Introduce async/await support and versioned dump format

The interpreter now supports Python's async/await syntax, introducing coroutine objects, external futures, and task scheduling types in the new \asyncio\ module. To support session persistence with these new types, the dump serialization format has been updated to version 13, switching to CBOR encoding and embedding session metadata (script name, type-check state) directly in the dump header.

crates/monty/src · high confidence

Introduce elastic worker pool with subprocess and WebSocket transports

The \monty-pool\ crate now provides an elastic pool of sandboxed workers that can be reached either by spawning local subprocesses or by connecting to remote workers over WebSocket. The pool manages worker lifecycle, including pre-warming, on-demand spawning, and transparent replacement of crashed workers. Checkouts (REPL sessions) can be configured with resource limits, type checking, and custom print buffering. The WebSocket transport supports custom connect headers for authentication or tracing, and enables session persistence with automatic resume capabilities when connections drop.

crates/monty-pool/src · high confidence

Introduce in-memory overlay mount mode for sandboxed filesystems

The \monty-fs\ crate now supports an \OverlayMemory\ mount mode, allowing sandboxed code to perform copy-on-write filesystem operations where writes are captured in memory rather than persisted to the host. This mode provides a sandbox boundary that is enforced structurally via \cap\_std\ descriptors, preventing path escapes and symlink traversal, while maintaining a configurable memory budget to limit the size of retained overlay data. The implementation includes a new dispatch layer that routes filesystem requests to either direct or overlay backends, ensuring that read-only mounts and write limits are strictly enforced.

crates/monty-fs/src · high confidence

Introduce memory-limiting global allocator for workers

The \monty-alloc\ crate now provides a custom global allocator that enforces a hard memory ceiling on untrusted Python workers. By tracking live byte usage at the allocation level, the worker terminates itself (via exit code or abort) if it exceeds the configured budget, preventing resource exhaustion. This mechanism complements the interpreter's soft-limit checks by providing a hard safety net that catches all allocator-backed memory requests.

crates/monty-alloc · high confidence

Introduce native Rust bindings for the Monty JavaScript runtime

This change adds the \monty-js\ crate, providing the native Rust layer for the Monty TypeScript/JavaScript bindings. It implements bidirectional conversion between Monty sandbox values and JavaScript types (including \BigInt\, \Map\, \Set\, and \Buffer\), exposes a crash-isolated execution pool via \NativePool\ and \NativeSession\, and configures resource limits and OS policies (such as timezone, sleep, and datetime sources) for the sandboxed environment. Additionally, it bridges Monty's telemetry pipeline to the Node.js event loop and provides structured exception handling with detailed traceback support.

crates/monty-js/src · high confidence

Introduce pydantic-monty Python client package with sandboxing and OS access APIs

The \pydantic-monty\ package is now available as a Python client for the Monty sandboxing runtime. It exposes core execution classes (\Monty\, \AsyncMonty\, \MontySession\) and configuration types like \ResourceLimits\ and \OSPolicy\ for controlling sandbox behavior. The package includes \MountDir\ for mapping host directories into the sandbox with configurable modes (read-only, read-write, or overlay) and limits, as well as \CollectString\ and \CollectStreams\ for capturing print output with memory caps. It also provides \instrument\_telemetry\ for OpenTelemetry integration and a CLI shim (\python -m pydantic\_monty\) to invoke the underlying \monty\ binary.

crates/monty-python/python · high confidence

Introduce pydantic-monty-client package with sandboxing features

The \crates/monty-python\ location now contains the source for the \pydantic-monty-client\ package, a Python client for connecting to the Monty sandbox via websockets or local workers. This release adds support for setting a virtual working directory via the \cwd\ parameter, exposes snapshot source positions for debugging, and integrates OpenTelemetry tracing context into snapshots. It also introduces resource limits such as \max\_suspensions\ to abort feeds, configurable OS policies for time and random number generation, and a \max\_urandom\_bytes\ cap to prevent memory exhaustion from unseeded random requests.

crates/monty-python · high confidence

Introduce sandboxed Python execution with host integration and observability

This change adds the TypeScript client library for the Monty sandbox, enabling Node.js applications to spawn and manage isolated Python worker subprocesses. It introduces the \Monty\ class for managing a pool of crash-isolated workers and the \MontySession\ class for driving Python code via \feedRun\ and \feedStart\. The library provides a \MountDir\ API to safely expose host directories to the sandbox with configurable access modes (read-only, read-write, or overlay) and memory limits. It also includes a \ClassInstance\ wrapper to expose host JavaScript objects to Python with strict attribute and method policies, and integrates OpenTelemetry for tracing and telemetry across the host-sandbox boundary.

crates/monty-js/ts · high confidence

Introduce standalone CLI and protocol subprocess modes for the Monty sandbox

The \monty-runtime\ crate now provides a dual-mode execution entry point: a standalone CLI for interactive REPLs, file execution, and command-line scripts, and a \subprocess\ mode for protocol-driven child processes. The CLI exposes granular resource controls including memory limits, feed/turn durations, recursion depth, suspension caps, and sleep budgets, alongside features like host directory mounting, working directory configuration, and optional type checking. The subprocess mode implements a strict turn-based protocol over framed protobufs on stdin/stdout, handling crash isolation and memory limit enforcement per session to support parent orchestrators like \monty-pool\.

crates/monty-runtime/src · high confidence

Introduce vendored typeshed stubs for Monty's type checker

The new \monty-typeshed\ crate provides a trimmed, vendored subset of Python's typeshed stubs that powers Monty's static type checking. By shipping only the stubs for the stdlib modules Monty actually implements (such as \collections\, \math\, \json\, and \datetime\), the type checker now fails early on unsupported builtins or modules rather than passing type checking and failing at runtime. The crate includes a build script that zips these stubs into the binary, ensuring type checking works without external files, and exposes a \file\_system()\ API for the type-checking crate to resolve standard library modules.

crates/monty-typeshed · high confidence

Introduce versioned wire protocol for subprocess communication

The \monty-proto\ crate now defines the v1 wire protocol schema (\monty/v1/monty.proto\) used to drive a Python subprocess child process. This protocol establishes a strict request-response alternation where the parent sends \ParentRequest\ messages and the child replies with \ChildEvent\ streams, enabling features like timezone support, arbitrary-precision integers, and user-defined classes to cross the process boundary. The schema includes its own versioning mechanism, allowing the parent to declare a supported protocol version and the child to reject incompatible requests, ensuring safe evolution of the interface independent of the main package version.

crates/monty-proto/proto · high confidence

Introduces WebAssembly Component Model runtime for browser sessions

Adds a new \monty-wasm-runtime\ crate that implements the Monty worker as a WebAssembly Component Model guest, enabling persistent Python sessions in the browser via Web Workers. This runtime replaces the previous protobuf-based wire protocol with a flat, index-based arena for value serialization, ensuring that protobuf bytes never cross the component boundary into JavaScript. It enforces resource limits (memory, suspensions, sleep duration) via a custom allocator and provides a typed interface for handling requests, events, and OS calls within the sandboxed environment.

crates/monty-wasm-runtime · high confidence

Introduces memory-safe wire protocol with allocation budgets and versioning

The \monty-proto\ crate now enforces strict memory safety on the wire protocol by introducing a cumulative decode budget that charges allocations before they occur, preventing unbounded memory growth from malicious or corrupted payloads. This is implemented via a new \BudgetVec\ type for fallible vector growth, a \FrameReader\ with a 256 MiB frame length cap, and a 1 GiB per-frame decode budget. The wire schema version has been bumped to 5 (dropping support for versions 3 and 4), and the protocol now supports flat arena layouts for value serialization, replacing the previous recursive \MontyObject\ tree structure. Additionally, a new \generate.rs\ tool ensures generated protobuf code stays in sync with the schema, and a \validate\_requirement\ function guards against command-line injection in package requirements.

crates/monty-proto/src · high confidence

Introduction of a new bytecode-based virtual machine and compiler

Monty replaces its previous tree-walking interpreter with a new stack-based virtual machine and bytecode compiler. This change introduces a new \bytecode\ module containing the \Code\ object format, a \CodeBuilder\ for emitting instructions, and the \Compiler\ that transforms the AST into bytecode. The new system supports a comprehensive set of opcodes for stack manipulation, constants, variables, binary/unary/comparison operations, control flow (jumps, loops, try/except), and function calls, enabling more efficient execution and better integration with source location tracking for tracebacks.

crates/monty/src/bytecode · high confidence

Native dataclass support and host-sandbox object bridging

The sandbox now supports native Python \@dataclass\ definitions, including field-based construction, synthesized \\_\init\\\, \\\repr\\\, \\\eq\\\, and \\\hash\\_\ (with \eq\ and \frozen\ options), as well as \is\_dataclass\ and \ClassVar\ handling. Additionally, a new \pydantic\_monty\ module introduces \ClassInstance\ and \ClassType\ wrappers, allowing host-side objects and classes to be passed into the sandbox with explicit policies for attribute exposure and method calls, ensuring identity round-trips for returned instances.

monty-workspace · high confidence

Native in-sandbox @dataclass decorator support

Monty now implements Python's \@dataclass\ decorator natively within the sandbox, eliminating the need for \exec\ or generated bytecode. The \dataclasses\ module exposes \@dataclass\ (with \eq\ and \frozen\ options) and \is\dataclass()\, while decorated classes automatically receive synthesized \\\init\\\, \\\repr\\\, and equality methods based on their fields. The implementation introduces \DataclassField\ objects to represent \\\_dataclass\fields\\_\ and \DataclassParams\ to report decorator configuration, allowing users to define data-centric classes with standard Python semantics directly in the sandboxed environment.

crates/monty/src/modules/dataclasses · high confidence

New AI agent skills for code review and documentation parity

Added a suite of AI agent skills under \.agents/skills/\ to standardize pull request reviews and documentation maintenance. These include a \docs-parity-reviewer\ to ensure changes are reflected across all documentation surfaces (README, docs site, limitations, and crate READMEs), a \coverage\ skill to fetch Codecov diff data, and specialized review skills for general bugs, security risks, usability, and verbosity. The \fix-pr-comments\ skill and its \pr-threads.sh\ helper enable agents to automatically resolve review threads from known bots, while \writing-style\ and its \rewrap\_md.py\ utility enforce consistent, concise documentation prose.

.agents · high confidence

New Python sandbox runtime crate with async support and strict error handling

The \monty-python\ crate (now part of the \pydantic-monty\ package) introduces the core Python sandbox runtime, providing both synchronous (\PyMonty\) and asynchronous (\PyAsyncMonty\) execution modes. It adds comprehensive exception handling with a dedicated \MontyError\ hierarchy (including \MontySyntaxError\, \MontyRuntimeError\, and \MontyTypingError\) to ensure sandbox failures are properly surfaced to Python code. The runtime includes robust input validation, rejecting unknown resource limit keys and invalid UTF-8 in source code, and supports filesystem mounting via \MountDir\ with configurable access modes. Async execution is enabled through \async\_dispatch.rs\, allowing coroutines to be awaited or spawned as Tokio tasks, while \callback\_context.rs\ ensures proper OpenTelemetry context propagation during host callbacks.

crates/monty-python/src · high confidence

New SQL Playground example for cross-format sentiment analysis

Added a new example demonstrating how to combine SQL queries on CSV data with JSON processing and external sentiment analysis within a sandboxed environment. The example shows how to join customer purchase data with social media tweets, perform loop-based external calls for sentiment scoring, and use type checking to validate LLM-generated code before execution.

_examples/sql\playground · high confidence

New automated Rust API reference documentation generator

The \monty-apidoc\ crate now generates the Rust API reference pages for the documentation site. It runs the pinned nightly \rustdoc\ to produce JSON, then renders that data into Markdown files under \docs/api/rust/\. The generator handles signature reconstruction, converts rustdoc-style intra-doc links into resolved Markdown links, and demotes headings to fit the mkdocs/Starlight layout. It also configures specific reading orders and feature flags for each crate (such as \monty\, \monty-pool\, and \monty-types\) to ensure the generated pages reflect the correct public API surface.

crates/monty-apidoc · high confidence

New built-in functions: abs, all, any, bin, chr, divmod, enumerate, eval, exec, filter, format, getattr, hasattr, hash, hex, id, isinstance, len, locals, map, min, max

The \crates/monty/src/builtins\ module now includes implementations for a wide range of Python built-in functions. This adds support for \abs\ (handling \i64::MIN\ overflow by promoting to \LongInt\), \all\ and \any\ (short-circuiting iterable checks), \bin\, \hex\, and \oct\ (integer-to-string conversion), \chr\ and \ord\ (Unicode code point conversion), \divmod\, \enumerate\ (returning a list of tuples), \eval\ and \exec\ (compiling and running source snippets), \filter\ (returning a list), \format\ (using the runtime format spec mini-language), \getattr\ and \hasattr\ (attribute access with default handling), \hash\ (hashing objects), \id\ (object identity), \isinstance\ (type checking including tuples of classes and unions), \len\ (container length), \locals\ (local variable snapshot), \map\ (applying functions to iterables), and \min\/\max\ (finding extremes with optional \key\ and \default\ arguments).

crates/monty/src/builtins · high confidence

New bytecode VM implementation with async support and standard operations

The \crates/monty/src/bytecode/vm\ module has been replaced with a new bytecode interpreter implementation. This change introduces full async execution support, including coroutine awaiting, task scheduling, and gather future handling. It also adds comprehensive implementations for standard Python operations: attribute access (including lazy host-routed lookups for \getattr\/\hasattr\), binary and unary operators, function calls (builtins, defined functions, and external/OS calls), collection building (lists, dicts, sets, slices), comparison operations, context managers (\with\ statements), exception handling with traceback support, and f-string formatting.

crates/monty/src/bytecode/vm · high confidence

New class-instance examples across the sandbox boundary

Added a new set of Python and TypeScript examples in the \examples/classes\ directory that demonstrate how to expose host objects to the sandbox using \ClassInstance\ and \ClassType\. These examples cover identity round-trips, lazy attribute fetching, async method invocation, class member access, and sandbox-defined class proxies, providing runnable reference implementations for both languages.

examples/classes · high confidence

New data-driven test harness and PGO training tool

The \monty-datatest\ crate now provides a data-driven test harness that runs Python test cases against both the Monty runtime and CPython to detect behavioral divergences, and a separate \pgo-exercise\ binary that exercises the Monty binary with the test corpus to generate profile-guided optimization data. This includes support for test configuration directives (such as expected failures, timezone settings, and resource limits) and automatic handling of suspensions during test execution.

crates/monty-datatest · high confidence

New development and testing utility scripts

Added a suite of Python scripts to support development, testing, and performance analysis: \bench\_type\_checking.py\ benchmarks type-checking latency; \complete\_tests.py\ auto-fills test expectations using CPython; \cpython\_watchdog.py\ provides thread-interrupt support for test timeouts; \flamegraph\_to\_text.py\ converts flamegraph SVGs to LLM-readable text; \gen\_unicode\_type.py\ generates Rust Unicode property tables from CPython; \run\_nasty\_code.py\ and \run\_traceback.py\ execute code snippets and capture tracebacks for testing; \startup\_latency\_chart.py\ and \startup\_performance.py\ measure and visualize startup latency; and \websocket\_relay.py\ bridges WebSocket connections to local Monty subprocesses for remote worker testing.

scripts · high confidence

New itertools module with comprehensive iterator adaptors

The \itertools\ module is now available, providing a suite of iterator adaptors that mirror Python's standard library. This release adds support for \accumulate\, \batched\, \chain\, \combinations\, \compress\, \count\, \cycle\, \dropwhile\, \filterfalse\, \groupby\, \islice\, \pairwise\, \permutations\, \product\, \repeat\, \starmap\, \takewhile\, and \zip\_longest\. These functions allow users to perform complex iteration patterns, such as grouping, filtering, and combining sequences, directly within the runtime.

crates/monty/src/types/itertools · high confidence

New packaging scripts for platform-specific npm packages and WASM component bindings

Added three new build scripts in the \scripts\ directory to streamline the creation of platform-specific npm packages and WASM component bindings. \assemble-packages.mjs\ orchestrates the final packaging process, extracting the \monty\ CLI binary from Python wheels and bundling it alongside native addons for various platforms (macOS, Linux, Windows). \create-platform-packages.mjs\ patches the generated npm manifests to ensure the CLI binary is included and kept unpacked for subprocess execution. \build-component.mjs\ handles the generation of TypeScript bindings and WASM components from the Rust runtime using \@bytecodealliance/jco\, enabling the library to run in browser Web Workers and Node.js worker threads.

crates/monty-js/scripts · high confidence

New procedural macros for Python argument parsing and host calls

The \monty-macros\ crate now provides \\#\[derive(FromArgs)\]\ and \\#\[derive(ToArgs)\]\ procedural macros. \FromArgs\ generates code to parse Python function arguments (positional, keyword, varargs, and varkwargs) into typed Rust structs, supporting various CPython argument-parsing styles for accurate error reporting. \ToArgs\ performs the inverse, projecting Rust structs back into host call arguments. These macros streamline the implementation of Python builtins and methods by automating argument validation, type coercion, and refcount management.

crates/monty-macros/src · high confidence

New protocol conversion layer for Monty-to-protobuf serialization

This change introduces the \crates/monty-proto/src/convert\ module, which handles the serialization and deserialization of Monty runtime types to and from protobuf wire formats. It implements conversions for core execution data including \MontyObject\ graphs, \ResourceLimits\ (with safe saturation for 32-bit hosts), and \OsFunctionCall\ payloads (supporting file operations, timezone handling, and sleep durations). It also adds robust, validated conversion for \MontyException\ tracebacks and error data (JSON and Unicode), ensuring that untrusted child-process data is sanitized against size limits and malformed fields before reaching the host. Additionally, it covers conversion for \OsPolicy\ (sandbox configuration), resume payloads (call results, name lookups, futures), and type-checking configuration formats.

crates/monty-proto/src/convert · high confidence

New sandbox-to-host object serialization layer

The \monty-proto\ crate now includes a complete Python boundary implementation (\crates/monty-proto/src/python\) that handles bidirectional serialization of Python objects to and from the sandbox. This adds support for encoding and decoding complex types including containers, \datetime\ objects, file handles, and exceptions, while preserving object identity and sharing. It introduces a proxy system (\PyMontyClassProxy\, \PyMontyStdTypeProxy\) for objects that cannot be directly materialized on the host, ensuring that sandbox output remains safe and controlled.

crates/monty-proto/src/python · high confidence

New telemetry system for pool health and session tracing

The pool now records aggregate metrics (worker counts, checkout wait times, session and turn durations, suspension counts, and data volumes) and structured traces mirroring the protocol conversation. These are delivered via a new \TelemetryAdapter\ bridge for foreign-language hosts and directly to Logfire for Rust hosts, with W3C trace context propagation to link pool activity to upstream services.

crates/monty-pool/src/telemetry · high confidence

New type-checking crate with benchmarking and in-memory database

The \monty-type-checking\ crate introduces a new capability for validating Python source code via an in-memory type checker. It provides a \TypeChecker\ API that accepts source files and optional stubs, returning structured diagnostics. The implementation relies on a custom \MemoryDb\ built on Salsa and \ty\_python\_semantic\, handling file writes, revision bumping, and cleanup to ensure isolation between sessions. Additionally, the crate includes benchmarks (\benches/type\_check.rs\) to measure steady-state type-checking performance for trivial, builtin, and REPL-like sequences.

crates/monty-type-checking/src · high confidence

Behavioural changes

The \.claude\ directory is initialized with a new configuration file (\settings.json\) that enables the \codspeed@claude-plugins-official\ plugin and restricts the agent's ability to execute \git push\ commands, requiring user confirmation. Additionally, symbolic links are created to point the \agents\ and \skills\ directories to their respective locations in the parent \.agents\ directory, establishing the local agent configuration structure.

.claude · high confidence

Custom type stubs for Monty's standard library modules

The type checker now receives custom \.pyi\ stubs for \asyncio\, \base64\, \binascii\, \copy\, \functools\, \os\, \random\, \sys\, \time\, and \unicodedata\ that are trimmed to match Monty's actual runtime capabilities. By omitting features not implemented in Monty (such as \bytearray\/\memoryview\ in \base64\/\binascii\, file-object encoding in \base64\, or \lru\_cache\ in \functools\), type errors are caught at check time rather than causing \AttributeError\ at runtime. These stubs are generated from upstream typeshed and copied into the vendor directory by \update.py\ to keep type checking aligned with Monty's minimal standard library surface.

crates/monty-typeshed/vendor · high confidence

Introduce stable heap with trial-deletion cycle collection

The heap implementation now uses a paged arena (\StableHeap\) that guarantees address stability, allowing safe shared-reference allocation and efficient repeated access via \HeapReader\. It also integrates a trial-deletion cycle collector (Bacon–Rajan) to detect and collect reference cycles, and switches serialization of heap entries to use CBOR for snapshot stability.

crates/monty/src/heap · high confidence

New argument binding system for native and Python functions

The argument binding logic for both native (Rust-implemented) and user-defined Python functions has been restructured into dedicated modules (\bind\_native.rs\ and \bind\_python.rs\) with a shared \FromValue\ trait for type coercion. This change introduces a new \ArgValues\ enum in \mod.rs\ that optimizes for common call patterns (0-2 arguments) to reduce heap allocations, and implements CPython-compatible error ordering for arity checks, keyword conflicts, and type mismatches during function calls.

crates/monty/src/args · high confidence

Python parser switched from python-parser to rustpython-parser

The project has replaced the \python-parser\ crate with \rustpython-parser\ for parsing Python source code. This change updates the underlying AST generation logic, requiring adjustments to how parsed nodes are mapped to internal representations (such as the \Node\ and \Expr\ enums). Users will benefit from the improved compatibility and feature set provided by the RustPython parser, although specific behavioral differences in edge cases may arise due to the change in parsing engine.

src · high confidence

Rust quickstart documentation included in library crate

The \crates/monty-doctest\ library now includes the Rust quickstart guide as its primary documentation via \include\_str!\, enabling the examples to be treated as doctests. A specific Clippy lint expectation is added to allow four-space list indentation in the markdown content, ensuring the documentation compiles without warnings.

crates/monty-doctest · high confidence

Updated wire protocol definitions for datetime and timezone support

The generated Rust types for the \monty.v1\ wire protocol have been updated to include new message structures for \Date\, \Time\, \DateTime\, and \TimeZone\. This change enables the serialization and deserialization of Python datetime objects with timezone awareness (including UTC offsets and timezone names) and fold information for ambiguous times, aligning the protocol with the newly added \datetime.time\ and timezone support features.

crates/monty-proto/src/generated · high confidence

Test coverage

Add comprehensive test cases for argument validation, async behavior, and chained assignment; Added compile-fail tests for HeapReader API soundness; Added comprehensive test coverage for the Monty wire protocol; Added comprehensive type-checking test suite; Added end-to-end tests for pool metrics, worker lifecycle, and WebSocket transport; Added fuzz testing targets for interpreter stability; Added integration tests for CLI mounts and subprocess mode; Added integration tests for monty-fs mount confinement and security; Added smoke tests for Node and browser environments; Added test coverage for Monty types, graph, UUID, and virtual paths; Added test coverage for sandbox execution and runtime behavior; Added tests for wire protocol repeated field budgeting; Initial test suite for pydantic\_monty sandbox execution; New benchmark suite for decoding, interpreter execution, and subprocess pool overhead; New test suite for the JavaScript sandbox runtime.

Dependencies

Initial release of Monty 1.0.0 with full workspace structure

This change introduces the Monty 1.0.0 release, establishing the complete project workspace. It adds the \monty-js\ package (version 1.0.0) for Node.js/TypeScript bindings, including its \package.json\ and \package-lock.json\, and the \monty-python\ client package for Python integration. The Rust workspace is reorganized into multiple crates (e.g., \monty\, \monty-pool\, \monty-proto\, \monty-types\, \monty-fs\, \monty-alloc\, \monty-wasm-runtime\, \monty-runtime\, \monty-type-checking\, \monty-datatest\, \monty-bench\, \monty-doctest\, \monty-fuzz\, \monty-apidoc\, \monty-macros\, \monty-typeshed\) with their respective \Cargo.toml\ manifests. The \Cargo.lock\ is updated to version 4, reflecting the new dependency graph. The release also includes example projects (\antigravity\, \classes\) and a metapackage \pydantic-monty\ that combines the client and runtime components.

(dependencies) · high confidence

Housekeeping

Initial repository configuration and tooling setup

This change establishes the foundational development environment and project metadata for Monty. It introduces configuration files for code formatting and linting (\.rustfmt.toml\, \.python-version\, \clippy.toml\, \.yamlfmt.yaml\, \.mdformat.toml\), sets up pre-commit hooks for automated checks (\.pre-commit-config.yaml\), and defines the CI coverage reporting settings (\.codecov.yml\). It also adds the project license, a Makefile for managing build and test workflows, documentation scaffolding (\mkdocs.yml\, \README.md\, \CLAUDE.md\), and the Python dependency lockfile (\uv.lock\).

(repo-wide) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 67 → 66 (-0.4)
  • Rubric changed (rubric-2026.09.9 → rubric-2026.09.17) — scores are not directly comparable.

Lenses

  • Code Health 79 → 80 (+1.0)
  • Architecture 99 → 97 (-2.8)
  • Maturity 64 → 64 (+0.0)
  • Readiness 73 → 60 (-12.6)
  • Security 59 → 68 (+8.5)
  • Performance 100 (new)

Resolved (87)

  • Change coupling: builder.rs ↔ prepare.rs (crates/monty/src/bytecode/builder.rs)
  • Change coupling: object.rs ↔ py_trait.rs (crates/monty-types/src/object.rs)
  • Change-coupling hub: range.rs → bytes.rs, str.rs, tuple.rs (crates/monty/src/types/range.rs)
  • Child::drive (cognitive 25) (crates/monty-proto/src/worker.rs)
  • Child::handle_load (cognitive 19) (crates/monty-proto/src/worker.rs)
  • ClassTooLong: MontyObject (crates/monty-types/src/object.rs)
  • Compiler::compile_stmt (cognitive 18) (crates/monty/src/bytecode/compiler.rs)
  • Documentation: no architecture or design documentation (docs/server.md)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no installation or build instructions (crates/monty-proto/README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (10 lines × 2) (crates/monty/src/parse.rs)
  • Duplicated block (10 lines × 2) (crates/monty/src/repl.rs)
  • Duplicated block (11 lines × 2) (crates/monty-types/src/object.rs)
  • Duplicated block (12 lines × 2) (crates/monty/src/bytecode/vm/async_exec.rs)
  • Duplicated block (12 lines × 2) (crates/monty/src/object_bridge.rs)
  • Duplicated block (12–18 lines × 2) (crates/monty-pool/src/checkout.rs)
  • Duplicated block (18–19 lines × 2) (crates/monty-types/src/object.rs)
  • Duplicated block (26 lines × 2) (crates/monty/src/bytecode/vm/call.rs)
  • Duplicated block (32–33 lines × 2) (crates/monty/src/types/dict.rs)
  • …and 67 more

New (708)

  • ArenaEncoder.encode (cognitive 23) (crates/monty-js/ts/worker/value.ts)
  • ArenaEncoder.encode (cyclomatic 21) (crates/monty-js/ts/worker/value.ts)
  • Assertions commented out: assertion error (crates/monty-js/test/exceptions.spec.ts)
  • Assertions commented out: assertion error with introspected detail (crates/monty-js/test/exceptions.spec.ts)
  • Change coupling: parse.rs ↔ range.rs (crates/monty/src/parse.rs)
  • Change coupling: range.rs ↔ tuple.rs (crates/monty/src/types/range.rs)
  • ClassTooLong: Child (crates/monty-proto/src/worker.rs)
  • ClassTooLong: StaticStrings (crates/monty/src/intern.rs)
  • ClassTooLong: Type (crates/monty/src/types/type.rs)
  • Decoder::decode (cognitive 16) (crates/monty-proto/src/python/decode.rs)
  • Decoder::decode (cyclomatic 36) (crates/monty-proto/src/python/decode.rs)
  • Documentation: no installation or build instructions (docs/examples.md)
  • Documentation: no project overview (README.md)
  • Documentation: no project overview (docs/examples.md)
  • Duplicate domain models for REPL vs Run contexts. ReplProgress and RunProgress are structurally identical enums with identical into_* methods, but they yield different types (ReplFunctionCall vs FunctionCall, etc.). This duplication forces users to handle two parallel hierarchies for essentially the same concept (a suspended execution state). The types ReplFunctionCall and FunctionCall are nearly identical, as are ReplOsCall/OsCall, etc.
  • Duplicate ways to add mounts. mount constructs a Mount internally, while push_mount takes an existing Mount object. This is inconsistent with the Mount type which has its own constructor. Users can either build a Mount and push it, or use the convenience method. This is a minor API design flaw but creates redundancy.
  • Duplicated block (10 lines × 2) (crates/monty-js/src/convert.rs)
  • Duplicated block (10 lines × 2) (crates/monty-python/src/pool.rs)
  • Duplicated block (10 lines × 2) (crates/monty/src/modules/math.rs)
  • Duplicated block (10–11 lines × 2) (crates/monty/src/repl.rs)
  • …and 688 more

Changes since last survey

  • 66 commits — 56 feature/other, 10 fixes

By area

  • crates/monty — 35 commits
  • (root) — 6 commits
  • crates/monty-js — 6 commits
  • crates/monty-proto — 4 commits
  • crates/monty-python — 3 commits
  • crates/monty-fs — 2 commits
  • examples/antigravity — 2 commits
  • (repo) — 1 commit
  • .github/workflows — 1 commit
  • crates/monty-alloc — 1 commit
  • crates/monty-bench — 1 commit
  • crates/monty-pool — 1 commit
  • crates/monty-types — 1 commit
  • docs/index.md — 1 commit
  • docs/limitations — 1 commit

Notable commits

  • fix: Add a regression test for the trailing-slash symlink escape (#868)
  • fix: Comment and documentation fixes (#888)
  • fix: Docs fixes (#929)
  • fix: Fix async task scheduling for batched host failures (#875)
  • fix: Fix compile-time panic for lambda with nested comprehension (#925)
  • fix: Fix re-entrant source windows in chain, pairwise and accumulate (#843)
  • fix: Fix two container-reentrancy panics (#846)
  • fix: Revert itertools (#861)
  • fix: bump to b2, fix monty-proto's self dev-dependency (#908)
  • fix: fix merge conflict (#891)
  • change: Add time.time(), time.sleep() and asyncio.sleep() (#866)
  • change: Add session IDs, forking, ephemeral sessions and auto-resume (#933)
  • change: Add the copy module (#791)
  • change: Add the random module and an os.urandom host call (#867)
  • change: Add the antigravity example, running Monty in the browser (#864)
  • change: Add the remaining itertools callables bar tee (#860)
  • change: Announce v1.0.0 on the docs index page (#937)
  • change: Auto OS calls (#892)
  • change: Better casefold and other case methods compatibility (#857)
  • change: Build Linux npm addons against glibc 2.17 (#946)
  • …and 46 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pydantic/monty was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 29 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit e007685fbb06494c13b9a7b3fede9f8e6a54a2be — the exact code this score is about.
  • Scored under rubric-2026.09.17 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-705631bb727e.