Skip to content

feat(ci): wire the F2.4 compression budget-gate ratchet - #4232

Merged
diegosouzapw merged 1 commit into
release/v3.8.29from
feat/compression-budget-gate
Jun 19, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.29from
feat/compression-budget-gate

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Contexto

Programa compressão 100% funcional — cauda longa, item de maior valor. O budgetGate.ts (tokensPerTask/checkTokensPerTaskGate) existia mas sem baseline, sem runner, sem CI — um "ratchet só no nome" (achado da auditoria). Este PR o torna um gate real.

O que muda

  • scripts/check/check-compression-budget.ts: roda os engines determinísticos sobre o BENCHMARK_CORPUS e falha se o tokens-per-task médio de qualquer engine subir > 2% vs a baseline congelada (melhor compressão sempre passa; refresh com --update). Determinístico + API-free → portável local↔CI.
  • compression-budget-baseline.json: baseline commitada (por engine × por task: prose/tool-output/json).
  • npm run check:compression-budget + step "Compression budget ratchet" no job quality-gate do ci.yml.

Saída real

✓ compression budget gate: no regressions (tolerance 2%)

Validação

  • TDD: 2 testes RED→GREEN — (a) a baseline commitada bate com o benchmark atual (não-stale + sem regressão; vira guarda permanente), (b) uma baseline apertada é flagada como regressão.
  • Check script roda local ✓ · typecheck:core ✅ · eslint ✅ · YAML do ci.yml válido (step presente).
  • ⭐ Determinismo: o harness é chars/4 sobre corpus fixo (o teste de reprodutibilidade do benchmark já garante) → baseline portável.

Agora uma mudança futura que piora a compressão é pega na suíte de testes E na CI.

🤖 Generated with Claude Code

budgetGate.ts (tokensPerTask / checkTokensPerTaskGate) existed but had no baseline, no runner
and no CI job — a "ratchet in name only" (audit finding). This makes it a real gate.

- check-compression-budget.ts: runs the deterministic engines over BENCHMARK_CORPUS and fails if
  any engine's mean compressed-tokens-per-task RISES beyond 2% vs the frozen baseline (better
  compression always passes; refresh with --update). Deterministic + API-free → portable to CI.
- compression-budget-baseline.json: the committed per-engine per-task baseline.
- npm run check:compression-budget + a "Compression budget ratchet" step in the quality-gate job.

A unit test asserts the committed baseline is not stale (matches the current benchmark) and that
a tightened baseline is flagged as a regression — so a future change that worsens compression is
caught both in the test suite and in CI.

Part of the compression "100% functional" program (audit long-tail).
@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 5847610 into release/v3.8.29 Jun 19, 2026
4 checks passed
@diegosouzapw
diegosouzapw deleted the feat/compression-budget-gate branch June 19, 2026 12:06
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
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