headroom/crates
chopratejas 6617c43b72 fix(rust): PyO3 bridge for Rust ICM — PR-C
Expose the Rust IntelligentContextManager (PR-B) to Python as
headroom._core.IntelligentContextManager + IcmConfig + ApplyResult.

Pattern mirrors SmartCrusher exactly: one #[pyclass] per process,
GIL released across apply() so concurrent Python threads keep
running through the score-and-drop work. Messages cross the FFI
boundary as JSON strings — same wire shape the proxy already has,
keeps the binding surface narrow.

PR-D will reshim headroom/transforms/intelligent_context.py to
delegate to this; this PR ships only the binding + 8 Python smoke
tests covering construction, getters, should_apply, apply with
drops + CCR markers, frozen prefix protection, and bad-JSON
behaviour.

Quirks worth noting:
- Bad JSON panics (raised as PanicException), matching the
  SmartCrusher convention. pyo3 0.22's #[pymethods] macro hits a
  clippy::useless_conversion false positive on PyResult<MyPyclass>
  return types; panic-on-bad-input dodges it without an allow attr
  and matches existing bridge methods.
- An InMemoryCcrStore is owned per-manager. Sharing the proxy's
  existing CCR store is a follow-up; PR-C ships the simplest
  correct contract.
2026-05-01 14:51:45 -07:00
..
headroom-core fix(rust): IntelligentContextManager port (simplified, OSS) — PR-B 2026-05-01 14:40:47 -07:00
headroom-parity fix(rust): port MessageScorer to Rust + parity harness (PR-A) 2026-05-01 10:06:56 -07:00
headroom-proxy ci: fix cargo fmt + maturin action invocation 2026-04-25 12:52:55 -07:00
headroom-py fix(rust): PyO3 bridge for Rust ICM — PR-C 2026-05-01 14:51:45 -07:00