← Back to Pull requests

feat(db): coluna products.ships_separately — produto "não mistura" no frete (Bloco D — DDL) #3918

Closed
unknown closed this pull request without merging on Nov 20, 2026 02:21 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 02:05 UTC
Author

O que muda

Só DDL (etapa 31 do plano de frete): ALTER TABLE public.products ADD COLUMN IF NOT EXISTS ships_separately boolean NOT NULL DEFAULT false + COMMENT, com rollback e linha pendente no MIGRATIONS_SYNC_LOG.md.

Produto marcado vai sempre em caixa própria no cálculo de frete e vence a escolha "misturar" do vendedor.

Por que em PR separada

O db-apply-migration.yml só aplica o que já está na main. Se a tela que lê a coluna fosse junto, o merge publicaria o código antes de a coluna existir e editar qualquer produto quebraria (erro 42703). A tela (D-UI) vem em outra PR, mergeada só depois desta ser aplicada.

O que foi verificado

  • Produção (doufsxqlfjyuvxuezpln, SELECT somente leitura): a coluna ainda não existe; 96 views e views materializadas dependem de products e nenhuma é recriada (adicionar coluna não as afeta).

  • Verificador independente simulou a migration e o rollback em PostgreSQL 16 local com tabela products e view dependente.

  • check-soft-delete-policy verde; check-migration-filename-contract verde; evaluateSyncLogGate → {ok:true, missing:[], duplicates:[]}; sha256 do arquivo = o registrado no log (7d0ba2f1…9622).
  • Aprovação

    O dono autorizou previamente (20/11) mergear e aplicar as migrations do plano de frete. Depois do merge: db-apply-migration.yml com version=20261120013000, e conferência por SELECT.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_014nTibVGq4gR8HAmEaEQSE3
    <!-- devin-review-badge-begin -->

    ---

    <a href="https://app.devin.ai/review/adm01-debug/promo_gifts_v4/pull/3918" 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: 237 lines (+177 / -60) across 2 files Reviewer: adm01-debug Review duration: 16m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 237 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    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
    Diff Size diff_size
    0.327
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3918"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 16.1% · Safe to merge
    16.1%