core: split the compressor into a package
`navi/core/compressor.py` was 1355 lines covering three different jobs:
deciding what a pass summarizes, building and calling the summarizer, and
the retry/truncate/persist wrapper around it. Move each to its own module:

* `compression/partition.py` — pure partitioning and the single
  `_plan_compression` decision shared with `would_compress`;
* `compression/summarize.py` — prompt formatting, the KEYS line, the
  meta-summary and `compress_context`;
* `compression/compressor.py` — `ContextCompressor` and its fallbacks.

`navi/core/compressor.py` stays as a compatibility shim that re-exports the
public surface, so imports elsewhere are untouched. Because each module now
binds its own `settings`, the tests that override settings patch all of them
(and `_meta_summarize`/`compress_context` are patched where they are read,
not on the shim). Adds a regression test for the hard-truncate trim inside a
single oversized turn, which the moved `_split_turn_tail` import silently
broke (ruff F821, no test hit that branch).
1 parent 1c4462b commit 7287d91f6d1f6ddb23d150c1d7608918e620bf2b
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 19 hours ago
Showing 8 changed files
View
navi/core/compression/__init__.py 0 → 100644
View
navi/core/compression/compressor.py 0 → 100644
View
navi/core/compression/partition.py 0 → 100644
View
navi/core/compression/summarize.py 0 → 100644
View
navi/core/compressor.py
Too large (Show diff)
View
tests/unit/core/test_compression_breadcrumbs.py
View
tests/unit/core/test_compressor.py
View
tests/unit/workers/test_compression_worker.py