Skip to content

feat(compression): persist RTK grouping config (unlock R5 enableGrouping) - #4207

Merged
diegosouzapw merged 1 commit into
release/v3.8.29from
fix/compression-rtk-config
Jun 18, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.29from
fix/compression-rtk-config

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Contexto

Programa compressão 100% funcional (follow-up da auditoria). Item: desbloquear o RTK grouping R5.

Gap

A estratégia R5 (colapsar linhas consecutivas quase-equivalentes em <linha> [rtk:grouped ×N]) é lida pelo engine (rtk/index.ts:330 config.enableGrouping / :332 groupingThreshold), mas era inalcançável em produção:

  • rtkConfigSchema (.strict()) rejeitava os 2 campos na escrita.
  • normalizeRtkConfig os dropava na leitura do DB.

→ enableGrouping nunca podia ser nada além de undefined (sempre OFF).

Fix

Adicionar enableGrouping (bool) + groupingThreshold (int, 2..100, default 3) a DEFAULT_RTK_CONFIG, normalizeRtkConfig e rtkConfigSchema → a feature agora é configurável e sobrevive ao round-trip do DB. Default continua OFF — zero mudança para configs existentes.

Validação

  • TDD: 2 testes novos RED→GREEN — (a) schema aceita os campos + rejeita groupingThreshold:1; (b) round-trip de DB (updateCompressionSettings→getCompressionSettings) preserva enableGrouping:true/groupingThreshold:7.
  • Suíte completa de compressão: 673/673 ✅ — o teste existente "RTK grouping strategy (R5)" (engine aplica/não-aplica) segue passando; nenhuma regressão do shape de DEFAULT_RTK_CONFIG.
  • typecheck:core ✅ · eslint ✅.

🤖 Generated with Claude Code

…ing)

The RTK R5 grouping strategy (collapse near-equivalent consecutive lines) is read by the
engine (config.enableGrouping / groupingThreshold) but was unreachable in production: the
rtkConfigSchema (.strict()) rejected the two fields on write and normalizeRtkConfig dropped
them on read, so they could never be anything but undefined.

Add enableGrouping (bool) + groupingThreshold (int, 2..100, default 3) to DEFAULT_RTK_CONFIG,
normalizeRtkConfig, and rtkConfigSchema so the feature is actually settable and survives the
DB round-trip. Default stays OFF — no behavior change for existing configs.

Part of the compression "100% functional" program (audit follow-up).
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@diegosouzapw
diegosouzapw merged commit aed2a50 into release/v3.8.29 Jun 18, 2026
4 checks passed
@diegosouzapw
diegosouzapw deleted the fix/compression-rtk-config branch June 19, 2026 12:07
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…ing) (cheaper-inference#4207)

The RTK R5 grouping strategy (collapse near-equivalent consecutive lines) is read by the
engine (config.enableGrouping / groupingThreshold) but was unreachable in production: the
rtkConfigSchema (.strict()) rejected the two fields on write and normalizeRtkConfig dropped
them on read, so they could never be anything but undefined.

Add enableGrouping (bool) + groupingThreshold (int, 2..100, default 3) to DEFAULT_RTK_CONFIG,
normalizeRtkConfig, and rtkConfigSchema so the feature is actually settable and survives the
DB round-trip. Default stays OFF — no behavior change for existing configs.

Part of the compression "100% functional" program (audit follow-up).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant