Repository navigation
fix(engine): omit review-derived metrics when the reviews read fails - #284
Merged
Merged
Conversation
With the reviews pass failed, every PR carries no reviews, so review coverage can only read 0% and the single-pass rate 100%, and the narrative stated both as fact. Like merge strategy under degraded enrichment, the review-derived fields are now omitted instead: the top-level review metrics, time to first review, and the review keys of the acceptance groups. The report and the trend comparison handle their absence, and METRICS.md says when they are omitted. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Flow Efficiency anchors its phases on the first review, and open PR staleness is measured from the last review or commit. With the reviews read failed every PR carries no reviews, so flow put the whole open-to-merge window into "awaiting first review" (the narrative then stated "wait time dominates" as fact) and staleness read older than it is. Absent beats fabricated, as for the other review-derived fields. Omitted when `reviews` degraded: the whole Flow Efficiency block (flow_efficiency_median, time_in_phase_median_hours, flow_pr_count, the by-intent and by-origin splits, median_time_to_first_review_hours) and stale_open_pr_pct, very_stale_open_pr_pct, abandonment_risk_pct and stale_open_pr_pct_by_origin. Kept: open_pr_count and the open PR ages, which depend only on the creation time. The narrative readers already tolerate absence. Clean runs are unchanged. The shared test fixture now carries commit refs, so the clean twin really produces the review, flow and staleness fields it asserts. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 5, 2026
cpenaforte-clickbus
marked this pull request as ready for review
October 5, 2026 19:17
cpenaforte-clickbus
requested review from
clickmatos,
lucastribioliclickbus and
rafaeldearaujop
October 5, 2026 19:30
clickmatos
changed the base branch from
fix/pr-read-degradation-report
to
main
October 8, 2026 13:37
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexto e Motivação
Quando a passada de reviews da leitura de PRs falha, todo PR chega sem review. As métricas derivadas de review não ficam só incompletas — ficam fabricadas: a cobertura de review humana só pode dar 0%, o single-pass só pode dar 100%, as fases de flow viram uma única espera "aguardando primeira review", e PR aberto parece mais parado do que está. A narrativa do relatório afirma isso como fato: "nenhum PR teve revisão humana", "wait time dominates".
Resolver agora pela mesma razão da merge strategy em #281: campo ausente é melhor que número fabricado (decisão D3 do autor, análoga à D1). E essa passada é justamente a que o próprio código documenta como sujeita a 504.
Refs #236
Mudanças
reviewsdegradado, oaggregate()não emite:pr_review_rounds_median,pr_single_pass_rate,median_time_to_first_review_hours,human_review_coverage_pct,human_approval_coverage_pct,human_review_coverage_by_intent,human_review_coverage_by_origin_of_pr; o bloco de flow inteiro (flow_efficiency_median,time_in_phase_median_hours,flow_pr_count,flow_efficiency_by_*); as métricas de PR aberto parado (stale_open_pr_pct,very_stale_open_pr_pct,abandonment_risk_pct,stale_open_pr_pct_by_origin); e as chavessingle_pass_rate/median_review_roundsdos grupos deacceptance_by_*.pr_ratedos grupos de acceptance.—, o delta não é calculado.docs/METRICS.md§15, §25 e a seção de PR aberto dizem quando cada campo é omitido.Plano de Teste
pytest tests/test_pr_fetch_degradation.py -v— comreviewsdegradado, todos os campos acima ausentes e os de PR aberto por idade presentes; num run limpo com os mesmos PRs, todos presentes; relatório renderizando sem as métricas de review; tendência sem o delta de single-pass quando um lado não tem o valor; narrativa sem quebrar — rodado em52ded1f: 26 passedpytest tests/ -q— a suíte inteira, com o portão de determinismo da [FEAT] Comparador de paridade do metrics.json, campo a campo #214 — rodado em52ded1f: local: 376 passed; a única falha é atest_status_reflects_state([BUG] test_agent_settings_hook lê o spool real — falha em máquina com registros pendentes #146), que só ocorre fora do CI, e otest_hook_binders.pyficou de fora por depender de rede; no CI o comando literal passapython scripts/check_analysis_chain.py— rodado em52ded1f: Analysis chain OKA verificação roda fora da máquina de quem construiu: o job
clido CI (RFC 0029, PM-4).Impacto e Risco
docs/METRICS.md.reviewsdegradado geram o mesmometrics.jsone o mesmo relatório. Runs comreviewsdegradado passam a não trazer os campos listados. Ordem de deploy: a plataforma multiplicasingle_pass_ratedos grupos de acceptance; sem a tolerância do feat(platform): mark incomplete PR data on compare and dashboard #283, um payload deste engine virariaNaN%no dashboard. O feat(platform): mark incomplete PR data on compare and dashboard #283 entra e é publicado antes deste, e nenhuma release do CLI com esta mudança sai antes disso.Sobre o tamanho (RFC 0028 §2.4): 362 linhas, faixa 251–500. A omissão e a tolerância dos leitores formam uma mudança só: omitir sem ajustar relatório, narrativa e tendência quebraria o run degradado.
Plano de Rollback
git revertdo merge. Os campos voltam a ser emitidos — distorcidos sobreviewsdegradado, como antes; nada a migrar.Referências
docs/METRICS.md§15 e §25Autoria Assistida
🤖 Generated with Claude Code