← Back to Pull requests

fix: rollback do PERF005 restaura o COMMENT do idx_spr_images_pending #4158

Open
unknown opened this pull request with 265 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 26, 2026 03:25 UTC
Author

Causa

O supabase/rollbacks/20261126030000_rollback.sql (PERF-005, aplicado em produção em 26/11) recria os 48 índices dropados, mas omitia o único metadado de índice existente no dump vivo: o COMMENT ON INDEX "public"."idx_spr_images_pending". Um rollback devolveria os 48 índices e perderia essa documentação do catálogo — divergência de byte a byte em relação ao estado anterior à migration.

O que muda

supabase/rollbacks/20261126030000_rollback.sql, 3 linhas:

  • COMMENT ON INDEX "public"."idx_spr_images_pending" IS 'Fila do worker de imagens. Espelha idx_spr_unprocessed mas para images_status.'; logo após o CREATE INDEX correspondente;

  • 2 linhas de cabeçalho registrando que 1 dos 48 índices tinha COMMENT.
  • A migration aplicada (20261126030000_…, sha256 d9286013e417e512ce32b59b460f53f184f4f71721d1e00c72adf095c5e62e34) não é tocada — só o artefato de reversão.

    Verificação (o que foi realmente rodado)

    1. Inventário exaustivo: para cada um dos 48 índices, todas as linhas da baseline anterior (supabase/baseline/20261125180000_baseline_schema.sql) que citam o nome e não são CREATE INDEX → 1 linha, exatamente o COMMENT do idx_spr_images_pending. Nenhum ALTER INDEX, SET STATISTICS ou opção de storage ficou de fora.
    2. grep -c 'COMMENT ON INDEX' supabase/rollbacks/20261126030000_rollback.sql → 0 (antes) / 1 (depois).
    3. npx vitest run tests/scripts/preflight-migration-apply.test.mjs → 52 passed (o preflight lê supabase/rollbacks/; nenhuma regressão de nomenclatura/existência).
    4. git diff --stat → 1 file changed, 3 insertions(+); CRLF ausente (arquivo íntegro em LF).

    Não houve mudança de schema em produção nem reaplicação de migration.
    <!-- devin-review-badge-begin -->

    ---

    <a href="https://app.devin.ai/review/adm01-debug/promo_gifts_v4/pull/4158" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
    <!-- devin-review-badge-end -->

    Diff: 265 lines (+198 / -67) across 3 files Reviewer: devin-ai-integration[bot] Review duration: 2m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.39) × (1 − Review Confidence (0.22)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 265 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 33% · Reviewer familiarity: 35%
    21%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.334
    Real PR Conversation Timeline
    1 comments
    "Review active on #4158"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 21.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.3% (MEDIUM) · Higher = larger blast radius
    39.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 21.9% · Lower = rushed or shallow review
    21.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.7% · Safe to merge
    30.7%