fix(compression): rank codex-responses in adaptive-ladder maps (#8381)

#8010 registered the codex-responses engine in the compression catalog
(engineCatalog.ts, stackPriority 12 between rtk's 10 and headroom's 15)
but never added it to adaptiveCompression/ladder.ts's AGGRESSIVENESS and
REDUCTION_FACTOR maps. Those maps' own header documents that they must
cover every real catalog/registry engine, not just the 7 in
DEFAULT_LADDER, so an operator adding codex-responses via ladderOverride
silently fell back to aggressivenessOf() === 0 (same as "off") and
expectedReductionFactor() === 0.9 (the generic default), breaking
floor-mode escalation ranking for any ladder that includes it.

Add "codex-responses" to both maps between rtk and ionizer, matching
its stackPriority (12) sitting between rtk's (10) and ionizer's (13):
- AGGRESSIVENESS: 22 (between rtk's 20 and ionizer's 25)
- REDUCTION_FACTOR: 0.84 (between rtk's 0.85 and ionizer's 0.83),
  reflecting its "lossless-first, bounded diagnostic" guidance in
  engineCatalog.ts

Validation: tests/unit/ladder-engine-maps-6533.test.ts red -> green
(2 of 3 tests were failing on the missing engine; all 3 pass after the
fix). Sanity-checked neighbors compression-exclusions.test.ts and
compression/adaptive-resolve-plan.test.ts still pass.

Refs #8010
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-24 09:57:12 -03:00
committed by GitHub
parent bb4cb86be2
commit 0ba68ce482

View File

@@ -25,8 +25,8 @@ export const DEFAULT_LADDER: LadderStage[] = [
* engines that ship in `open-sse/services/compression/engines/index.ts` but are not part
* of DEFAULT_LADDER: `ccr` and `llmlingua` are intentionally excluded from the AUTOMATIC
* ladder (see DEFAULT_LADDER doc comment) yet must still rank correctly when an operator
* adds them via `ladderOverride` — same for `ionizer`, `relevance`, `llm`, and
* `read-lifecycle`. Placement follows each engine's documented `stackPriority` in
* adds them via `ladderOverride` — same for `ionizer`, `relevance`, `llm`, `read-lifecycle`,
* and `codex-responses`. Placement follows each engine's documented `stackPriority` in
* `engineCatalog.ts` / its own module header, interpolated onto the existing 7-tier scale
* (the `lite` exception — ranked after `headroom` despite a lower stackPriority — is a
* pre-existing, deliberate design call and is left untouched).
@@ -36,6 +36,7 @@ const AGGRESSIVENESS: Record<string, number> = {
"session-dedup": 10, // stackPriority 3 — lossless cross-turn dedup
ccr: 15, // stackPriority 4 — reversible retrieval marker, only if it shrinks
rtk: 20, // stackPriority 10 — command-output filtering
"codex-responses": 22, // stackPriority 12 (#8010) — conservative Responses tool-output compression
ionizer: 25, // stackPriority 13 — tabular row sampling (lighter than headroom)
headroom: 30, // stackPriority 15 — tabular JSON compaction
lite: 40, // pri 5, but cheap prose pass (pre-existing reorder, kept as-is)
@@ -64,6 +65,7 @@ const REDUCTION_FACTOR: Record<string, number> = {
"session-dedup": 0.95,
ccr: 0.9, // conservative: only replaces a block when the marker is shorter than it
rtk: 0.85,
"codex-responses": 0.84, // stackPriority 12 (#8010) — lossless-first, bounded diagnostic trims
ionizer: 0.83, // row sampling, lighter than headroom's full tabular compaction
headroom: 0.8,
lite: 0.92,