chore(quality): tighten the coverage ratchet to the CI's real numbers (#7326)

The Quality Ratchet has been red on main, and not for a regression — the report
says 'OK (57 métricas, 11 melhoraram)'. It fails the --require-tighten step:

  ✗ coverage.branches: melhorou de 73 para 78.1 (delta 5.1000 > slack 5)
    — rode 'npm run quality:ratchet -- --update' e commite o baseline apertado

The gate was asking for this in plain text. The baseline's own note names the
same trigger: 'Apertar via quality:ratchet -- --update a partir do 1o run de
coverage mergeada do CI que popule essas chaves.'

Values are the CI's, not a local run. The baseline warns that a local
test:coverage measures ~68% against the CI's ~76.5% — tightening to local
numbers would write the wrong floor. So this reproduces the CI's exact inputs:
eslint-results + coverage-report artifacts downloaded from the merged-coverage
run on main (29387411665), re-rooted from the runner's paths to the local cwd so
extractModuleCoverage can match CRITICAL_MODULE_PATHS, then quality:collect +
quality:ratchet --update. Collected output matches the CI's report line for
line (branches 78.1, statements/lines 80.8, functions 86.44, chatCore 72.98,
combo 85.42, accountFallback 96.78, auth 92.55).

Verified: no baseline key added or removed (56 before, 56 after) — only the 12
coverage values moved. The 57-vs-56 metric count between the CI's run and a
local one is --allow-missing skipping the metrics only CI collects (mutation
scores, CodeQL, bundle size).

Worth recording why the improvement appeared now: it is real, but it surfaced
because Coverage had been SKIPPED whenever unit shards went red — so the ratchet
was passing trivially over ABSENT data. Fixing the shards on #7300 made coverage
run and the ratchet finally had something to compare.
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-15 23:49:16 -03:00
committed by GitHub
parent b83fe6f7dc
commit 635db36de0
2 changed files with 13 additions and 12 deletions

View File

@@ -0,0 +1 @@
- **chore(quality):** tighten the coverage ratchet to the CI's real numbers (branches 73→78.1, statements/lines 76.5→80.8, functions 82→86.44, plus 7 per-module floors). The gate had been asking for this in plain text; the values come from the merged-coverage run on `main`, not a local run (local measures ~68% vs CI's ~80% — the baseline's own note warns about that gap).

View File

@@ -27,22 +27,22 @@
"eps": 0
},
"coverage.statements": {
"value": 76.5,
"value": 80.8,
"direction": "up",
"tightenSlack": 5
},
"coverage.lines": {
"value": 76.5,
"value": 80.8,
"direction": "up",
"tightenSlack": 5
},
"coverage.functions": {
"value": 82,
"value": 86.44,
"direction": "up",
"tightenSlack": 5
},
"coverage.branches": {
"value": 73,
"value": 78.1,
"direction": "up",
"eps": 1.5,
"tightenSlack": 5
@@ -54,49 +54,49 @@
"tightenSlack": 10
},
"coverage.combo.lines": {
"value": 80,
"value": 85.42,
"direction": "up",
"eps": 1.5,
"tightenSlack": 10
},
"coverage.accountFallback.lines": {
"value": 88,
"value": 96.78,
"direction": "up",
"eps": 1.5,
"tightenSlack": 10
},
"coverage.auth.lines": {
"value": 90,
"value": 92.55,
"direction": "up",
"eps": 1.5,
"tightenSlack": 10
},
"coverage.routeGuard.lines": {
"value": 94,
"value": 98.73,
"direction": "up",
"eps": 1.5,
"tightenSlack": 10
},
"coverage.error.lines": {
"value": 88,
"value": 92.13,
"direction": "up",
"eps": 1.5,
"tightenSlack": 10
},
"coverage.publicCreds.lines": {
"value": 92,
"value": 99.07,
"direction": "up",
"eps": 1.5,
"tightenSlack": 10
},
"coverage.circuitBreaker.lines": {
"value": 92,
"value": 95.09,
"direction": "up",
"eps": 1.5,
"tightenSlack": 10
},
"openapiCoverage.pct": {
"value": 38.0,
"value": 38,
"direction": "up",
"eps": 0.5,
"_tighten_2026_07_04_v3844_release": "36.9 -> 39.3 (aperto exigido pelo --require-tighten no PR de release #5925). A cobertura OpenAPI melhorou no ciclo (9 rotas documentadas em 8fb020676 + as rotas novas de #5939/#5817/#6034/#5998 documentadas junto das features). 39.3 = valor medido pelo CI Quality Ratchet no run 28708141003 (tip 00c55afcb).",