- **Version:** 1.108.129 — **Keystone-protected structural compression for `get_ranked_context` (opt-in `compress=True`; clean-room F-15, competitor unnamed in shipped artifacts).** Renovates an entropy/relevance-guided context-selection idea into jcm's read-only/local/model-free idiom: an oversized symbol body is pruned toward a per-item soft cap so MORE relevant symbols fit the same `token_budget`. New `retrieval/entropy_prune.py` — `prune_source(source, max_tokens, count_tokens)` ranks lines by `line_signal` (normalized Shannon token-entropy × length-weight), keeps the highest-signal lines, and ALWAYS keeps `is_keystone` lines (control-flow/return/raise/yield/assert, signatures `def`/`class`/`@`/`func`/etc., operators `!=`/`==`/`->`/`=>`, and NL constraint cues `must`/`only if`/`unless`/`never`/`require`); dropped runs collapse to an honest `… N low-signal line(s) elided …` marker. O(L) — one token-cost measurement per line; `max_tokens` is a SOFT cap (keystone protection + elision markers can exceed it slightly; the outer `_pack_budget` still enforces the hard total). Wired into BOTH the default and `fusion=True` paths via shared `_compressing_get_tokens(base_get_tokens, token_budget, registry)` (constants `_COMPRESS_TARGET_ITEMS=8`/`_COMPRESS_MIN_ITEM_TOKENS=120`) + `_prune_fields()`; pruned items carry `source_pruned`/`source_kept_lines`/`source_elided_lines`/`source_total_lines`/`source_is_pruned_view`. **Default `compress=False` is byte-identical**; param compact-stripped (`_COMPACT_STRIP_PARAMS["get_ranked_context"]`) so `core_compact` unchanged; NO new tool, NO tool-count change, NO INDEX_VERSION bump. Live-index smoke: 1500-tok budget delivered 12 symbols vs 9 default (3 pruned), same total. New `tests/test_v1_108_129.py` (13); ruff clean; ranked-context/negative-evidence/schema-budget/dispatch-parity/server suites green (150). Origin: a clean-room F-15 renovation of an Atelier-family runtime's entropy/perplexity context-compression stage (competitor unnamed in shipped artifacts, [[feedback_no_competitor_names_in_shipped_artifacts]]; intel kept in session memory); the versus.php warn-box conceded their selection stage was ahead — this closes it.
0 commit comments