interpretthis 0.3.0

Sandboxed Python AST interpreter for untrusted and LLM-generated code
Documentation
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.0] — 2026-07-09

Post-0.2 hardening: true generator frames, eval stack, security/docs, and
parity polish. Closes the post-0.2 ticket epic.

### Added

- True generator suspend/resume (`Value::Generator`) for for-based bodies;
  `next` / `send` / `throw` / `close`; `yield from`; while-based gens stay eager
- `ExceptionGroup.subgroup` / `.split` with nested flatten
- `decimal.localcontext` (save/restore `prec`); per-interpreter decimal prec
  (no process-global atomics)
- `InterpreterConfig::max_int_bits` resource gate on large shifts
- Class `__slots__` inheritance across bases
- Metaclass `__prepare__(name, bases)` namespace seed; method tables restored
  after `type()` rebuild
- Non-data descriptor precedence (instance dict shadows `__get__`-only)
- BigInt-aware `<<` / `>>` with shift-size caps
- `copy.deepcopy` cycle memo (Arc identity)
- `cargo deny` config + CI job (advisories/licenses)
- Table-driven builtin method handlers in `method_dispatch`
- `ClassValue::new` defaults for synthetic classes
- Host-facing crate docs for int / ExceptionGroup / async / tool timeouts

### Changed

- `eval_stmt` / `eval_expr` box each match arm separately (~8-deep recursion on
  default test stacks vs ~3 before)
- ExceptionType construction unified (direct + indirect calls)
- State export round-trips BigInt and ExceptionGroup.exceptions
- CONFORMANCE / STATUS truth pass for 0.2+ surface
- Dependency-update process documented for PR-disabled workflow

### Notes

- Generator bodies that use `while` still use the eager Lazy buffer path
- True async/await remains unsupported

## [0.2.0] — 2026-07-09

Language-surface and stdlib parity expansion after the 0.1.0 extract.

### Added

- Arbitrary-precision ints (`Value::BigInt`) with i64 fast path and promotion
- `NotImplemented` singleton and reflected-op fallthrough for user dunders
- User data descriptors (`__get__` / `__set__` / `__delete__`) beyond `@property`
- PEP 487: `__init_subclass__`, `__set_name__`
- PEP 654: `ExceptionGroup` / `BaseExceptionGroup` and `try`/`except*`
- Class-body `__slots__` and `@dataclass(slots=True)` field allowlists
- `metaclass=` with `__new__` and three-arg `type(name, bases, dict)`
- Computed class bases; nested `del` attribute paths; slice augmented assignment
- Bounded builtins `getattr` / `setattr` / `delattr` with shared instance fields
- Generator protocol surface (`next` / `send` / `throw` / `close` on Lazy buffers)
- Method kwargs (CPython 3.12 keyword surface) across dispatch tables
- `decimal.getcontext` / `setcontext` with mutable `prec`
- `Decimal.from_float`; `Fraction` float construct and arith
- `functools.cmp_to_key`, `lru_cache` / `cache`
- `contextlib.nullcontext` and `suppress`
- `datetime.strptime`; namedtuple iteration/len
- `copy.copy` vs `copy.deepcopy` (shared vs independent nested storage)
- Unicode-aware `str.casefold`; `str.encode` latin-1 + strict ascii
- Tool wall-clock timeout from remaining `max_execution_time`
- Tool errors catchable as `Exception`
- List `@` matrix multiply (intentional extension; see CONFORMANCE)
- TypeObject `has_methods_table` wiring for method-bearing builtins

### Changed

- Crate-root re-export trim (deeper types under `interpretthis::value`)
- Integer power keeps exact `BigInt` results instead of OverflowError past i64
- Recursion smoke tests use shallower depths after per-frame stack growth

### Notes

- `async`/`await` remains unsupported (clear runtime error + CONFORMANCE)
- Full coroutine frames and true async I/O remain backlog

## [0.1.0] — 2026-07-09

Initial public release of `interpretthis`: a sandboxed Python AST interpreter
for untrusted and LLM-generated code.

### Added

- Sandboxed evaluator over `rustpython-parser` ASTs with host tool injection
- Resource limits (operations, memory, recursion, cooperative wall-clock)
- Allowlisted stdlib modules and blocked dangerous names/attributes
- Versioned interpreter state export/import (`STATE_FORMAT_VERSION`)
- Differential parity corpus against host Python 3.12
- Dual license: MIT OR Apache-2.0
- Conformance and threat-model documentation

### Notes

- Not an embedded CPython; language surface is intentional — see
  [`CONFORMANCE.md`]./CONFORMANCE.md and [`THREAT_MODEL.md`]./THREAT_MODEL.md.

[0.3.0]: https://github.com/moderately-ai/interpretthis/releases/tag/v0.3.0
[0.2.0]: https://github.com/moderately-ai/interpretthis/releases/tag/v0.2.0
[0.1.0]: https://github.com/moderately-ai/interpretthis/releases/tag/v0.1.0