← Back to Pull requests

chore(ci): gestão de workflows fase 1 — 106 → 92 (12 updaters em 1, 3 obsoletos, 3 duplicados ajustados) #3055

Merged
adm01-debug merged 24 files (2530 lines) on Nov 03, 2026 10:55 UTC
View on GitHub
adm01-debug adm01-debug commented on Nov 02, 2026 20:58 UTC
Author

Por quê

Inventário completo dos 106 workflows (relatório versionado em docs/ci/INVENTARIO_WORKFLOWS_2026-11-02.md) mostrou: 12 workflows de regeneração de snapshot visual com o mesmo fluxo copiado (um por spec), 3 arquivos obsoletos sem referência/run, e 3 workflows duplicando checks que já são required no deploy-gates.yml.

O que muda (Fase 1 — mecânico e seguro)

Fusão (12 → 1): .github/workflows/update-snapshots.yml ganha os inputs que cobrem todas as variações dos updaters apagados:

  • spec (1..N), project (chromium-public | chromium-authed | all-public = chromium+firefox+webkit), safe_mode (dry-run + classificação visual/real, portado de e2e-update-calendar-snapshots.yml), mode (pr | push, push bloqueado em main), dev_server (sobe Vite antes; usa npm run dev em vez de bun run dev — mesmo Vite, sem action extra).

  • Checagem de auth state antes de regenerar baseline autenticada (portada de e2e-update-quote-missing-fields-snapshots.yml).

  • git add restrito a <spec>-snapshots/ por spec — antes era e2e/ inteiro.

  • Apagados: e2e-update-{alert-dialog,calendar,confirm-dialog,dialog,editor-sheet,magazine-ring,quote-conditions,quote-freight,quote-missing-fields,quote-no-pres}-snapshots.yml, update-quote-reset-snapshots.yml. O editor-sheet tinha actions/setup-node@v7 sem SHA (violava R15) — some junto.
  • Obsoletos apagados: python-package-conda.yml (template Python num repo TS, 0 runs), _template.yml (template didático, 0 runs; secrets.EXAMPLE_API_KEY removido da allowlist em scripts/check-secrets-inventory.mjs), magazine-typed-queries.yml (branch-only de PR antiga já mergeada).

    Duplicados ajustados:

  • policies-baseline.yml: removidos triggers pull_request/push — o mesmo script roda em toda PR/push como Gate 1.13 do deploy-gates.yml. Fica schedule semanal + dispatch de seed.

  • security.yml: removido job gitleaks — duplicava o required check "Gate E23 - Secret Scan (gitleaks)" (mesma action, mesmo escopo). Job headers-mirror mantido.

  • ci-security-drift.yml: npm run lint:check → npm run lint:baseline — estava vermelho 3× seguidas em push/main porque lint:check usa --max-warnings=0 enquanto o Gate 1 usa o baseline.
  • Guards: 3 entradas mortas removidas de scripts/check-workflow-contracts.allowlist.json (ci-quotes-wizard.yml:362, e2e-focused.yml C17 e C25 — nenhuma dispara mais no gate). Referências em README.md, scripts/qa-price-readonly-regression.mjs e scripts/qa/validate-quote-conditions-workflows.mjs apontadas para o workflow unificado.

    Required checks (.github/required-checks.json) não são tocados.

    Verificado de verdade (local, neste commit)

  • node scripts/check-workflow-contracts.mjs --gate → 0 violações novas (só o aviso C27 de bulk-edit).

  • node scripts/check-secrets-inventory.mjs --gate, check-required-checks.mjs, check-gates-table.mjs (23/23), check-visual-preview-suite.mjs, check-visual-tests-specs.mjs (20/20) → todos verdes.

  • actionlint -shellcheck=shellcheck (v1.7.7) nos 4 workflows alterados → exit 0.

  • npx vitest run tests/scripts/check-workflow-contracts.test.mjs tests/scripts/deploy-gates-live-audit.test.mjs → 28/28.

  • update-snapshots.yml não foi executado (workflow_dispatch; aviso C27 pede execução antes do merge — ver próximo passo).
  • Fase 2 — proposta (não está nesta PR; decisão do dono)

    C2 matriz e2e-modules.yml (fundir os workflows E2E por módulo), C3 unit-modules.yml (vitest por módulo), C4 steps extras no deploy-gates.yml, C5 nightly-full consolidado. Detalhes e trade-offs na seção (C) do relatório. Também pendentes de doc: docs/ci/PADRAO_WORKFLOW.md:570-607 e nomes antigos em docs/ci/SEGREDOS.md.

    Regra 8

    PR toca .github/workflows/** → fica aberta para o dono; não mergeio.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01N1ArYQYUMHo9B9k67vpvBo

    Diff: 2530 lines (+849 / -1681) across 24 files Reviewer: adm01-debug Review duration: 837m
    All Vouch review confidence checks passed
    Residual risk 0.13 = Change Risk (0.91) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.91 · 2530 lines diff across 24 files
    0.91
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.94 · 5 substantive comment(s)
    0.94
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    85%
    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.400
    Self Review self_review
    0.140
    Mass File Touch mass_file_touch
    0.080
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    36 items
    vercel[bot] vercel[bot] commented on Nov 02, 2026 20:58 UTC
    Bot

    [vc]: #WA0PjCVRo3GEIpWu4UmHtpZCWU+rGGOovmX3hjxUvyw=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJwcm9tby1naWZ0cy12NCIsInByb2plY3RJZCI6InByal85VWZ1Z05ZQ3Vib0gyUjBYQjA0SnY4UHBqRHBaIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6IiJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vanVjYTEvcHJvbW8tZ2lmdHMtdjQvQzU0WDZidkt0V0R2dkN3RjN4eG1MZUxVYWpQYyIsIm5leHRDb21taXRTdGF0dXMiOiJGQUlMRUQiLCJyb290RGlyZWN0b3J5IjpudWxsLCJwcmV2aWV3VXJsIjoiIn1dfQ==
    The latest updates on your projects. Learn more about Vercel for GitHub.

    | Project | Deployment | Actions | Updated |
    | :--- | :----- | :------ | :------ |
    | <a href="https://vercel.com/juca1/promo-gifts-v4"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_9UfugNYCuboH2R0XB04Jv8PpjDpZ&teamId=team_QyN41X0q8hrqhW80AwokbFLv&s=32" width="16" height="16" align="middle" alt="" /></sup></a> promo-gifts-v4 | !Error Error | | <relative-time datetime="2026-11-02T22:12:33.657Z">Nov 2, 2026 10:12pm UTC</relative-time> |

    supabase[bot] supabase[bot] commented on Nov 02, 2026 20:58 UTC
    Bot

    [supa]:doufsxqlfjyuvxuezpln
    This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.

    <hr/>

    Preview Branches by Supabase.
    Learn more about Supabase Branching ↗︎.

    github-actions[bot] github-actions[bot] commented on Nov 02, 2026 20:59 UTC
    Bot

    <!-- ssot-report-comment -->

    SSOT Report — 🟢 PASS

    Overall: PASS · Gates: 3/3 OK · Falhas: 0 · Linhas de erro detectadas: 0

    Resumo

    | Campo | Valor |
    |---|---|
    | schemaVersion | 2.0.0 |
    | timestamp | 2026-11-02T22:09:45.666Z |
    | canonical | doufsxqlfjyuvxuezpln |
    | forbidden | pqpdolkaeqlyzpdpbizo |
    | overallOk | true |
    | Duração total | 1295ms |

    Gates

    | # | Gate | Status | Exit | Duração | Linhas de erro |
    |---:|---|:---:|---:|---:|---:|
    | 1 | validate-supabase-config | 🟢 PASS | 0 | 899ms | 0 |
    | 2 | guard-canonical-project | 🟢 PASS | 0 | 167ms | 0 |
    | 3 | check-docs-supabase-hosts | 🟢 PASS | 0 | 229ms | 0 |

    Contagens

    | Métrica | Valor |
    |---|---:|
    | Gates totais | 3 |
    | Gates OK | 3 |
    | Gates com falha | 0 |
    | Linhas de erro (stdout+stderr) | 0 |
    | Duração acumulada | 1295ms |

    Detalhes por gate

    <details>
    <summary>🟢 PASS <code>validate-supabase-config</code> — exit <code>0</code>, <code>899ms</code>, erros: 0</summary>

    Comando: node scripts/validate-supabase-config.mjs

    stdout

    🚀 Validating Supabase Project Connection Configuration...
    ✅ Supabase connection is correctly pointing to the current project.
    ✅ E064: 3043 arquivo(s) de migration sem referência executável ao project-ref proibido.
    

    </details>

    <details>
    <summary>🟢 PASS <code>guard-canonical-project</code> — exit <code>0</code>, <code>167ms</code>, erros: 0</summary>

    Comando: node scripts/guard-canonical-project.mjs

    stdout

    [CI Guard] Fase 1/3 — Runtime code (pqpdolkaeqlyzpdpbizo)…
    [OK] Runtime code limpo.
    [CI Guard] Fase 2/3 — Arquivos críticos contêm ID canônico…
    [OK] Arquivos críticos ancorados no canônico.
    [CI Guard] Fase 3/3 — Docs .md operacionais…
    [OK] Nenhuma menção operacional ao ID legado em docs.
    [CI Guard] Fase 4/4 — Config files (.yml/.yaml/.toml/.env*/.json)…
    [OK] Nenhuma menção ao ID legado em configs.
    [OK] Guard canônico aprovado.
    

    </details>

    <details>
    <summary>🟢 PASS <code>check-docs-supabase-hosts</code> — exit <code>0</code>, <code>229ms</code>, erros: 0</summary>

    Comando: node scripts/check-docs-supabase-hosts.mjs

    stdout

    🔗 Supabase hosts em .md — canônico esperado: doufsxqlfjyuvxuezpln.supabase.co
       arquivos varridos: 892
    [OK] Todos os hosts operacionais apontam para o canônico.
    

    </details>

    ---

    _Gerado a partir de ssot-report.json (schema v2.0.0) em 2026-11-02T22:09:45.666Z._

    ---
    <sub>🤖 SSOT Supabase Guard · status: success · run #41534739794</sub>

    adm01-debug adm01-debug commented on Nov 02, 2026 21:01 UTC
    Author

    Status Vercel (preview) em falha — não é desta PR. O diff só toca .github/workflows/*, scripts/check-, README.md, docs/ci/ e 2 scripts de QA; nada que entre no build da Vercel. O mesmo status falha em todas as PRs recentes, inclusive as só-de-docs (#3039, #3052, #3054), e não é required check. Não consegui ler o log do deploy pela API (404 no dpl_29fY9S5RnAcQ1ZB7RgE3usXzRFa5); sem fix a portar daqui. Sigo acompanhando os 5 required.

    ---
    _Generated by Claude Code_

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 02, 2026 21:57 UTC
    Bot

    <!-- codex-pull-request-review-summary -->
    <!-- codex-review-state:v1 {"code_review":{"commit_sha":"6a3c118c191665f5a75e442b359c9dd944e98adc","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->

    Codex Review Summary

    This comment shows the latest Codex review activity on this pull request.

    | Review | Status | Commit | Review trigger |
    | --- | --- | --- | --- |
    | 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-02T22:10:21.467370Z">2026-11-02T22:10:21.467370Z</relative-time> | 6a3c118 | New commits |

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review" or "@codex security review".
  • Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    </details>

    qodo-code-review[bot] qodo-code-review[bot] commented on Nov 02, 2026 21:58 UTC
    Bot

    <h3>PR Summary by Qodo</h3>

    Consolidar workflows de snapshots e reduzir duplicações no CI

    <code>⚙️ Configuration changes</code> <code>📝 Documentation</code> <code>🕐 40+ Minutes</code>

    <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">

    <details>
    <summary>AI Description</summary>

    <dl>
    <dd>
    <br/>

    ><pre>
    >• Consolida updaters visuais em um workflow, preservando disparos automáticos para seis suítes e

    oferecendo regeneração manual segura.

    >• Remove workflows obsoletos e checks duplicados, reduzindo o inventário de 106 para 92 workflows.
    >• Documenta o inventário e ajusta referências e allowlists sem alterar os required checks.
    ></pre>

    </dd>
    </dl>

    </details>

    <details>
    <summary>Diagram</summary>

    <dl>
    <dd>

    <br/>

    graph TD
      Push["Push em main"] --> Prep["Matriz de specs"] --> Test["Dry-run Playwright"] --> Diff{"Diferença visual?"} -->|Sim| Regen["Regenerar baselines"] --> PR["Abrir PR"]
      Dispatch["Dispatch manual"] --> Prep
      Regen -->|Modo push| Branch["Branch destino"]
    

    </dd>
    </dl>

    </details>

    <details>
    <summary>High-Level Assessment</summary>

    <dl>
    <dd>

    <br/>

    >Centralizar a regeneração no workflow já existente é a opção mais simples para eliminar cópias sem introduzir outra camada de Actions. A matriz preserva disparos por suíte e o padrão de abrir PR evita voltar aos pushes automáticos diretos; extrair um workflow reutilizável acrescentaria manutenção sem uma segunda implementação que precisasse compartilhá-lo.

    </dd>
    </dl>

    </details>

    <details>
    <summary> Files changed (10) <code> +835 / -80 </code> </summary>

    <dl>
    <dd>

    <br/>

    <details>
    <summary>Refactor (1) <code> +318 / -34 </code></summary>

    <dl>
    <dd>

    <details>
    <summary>update-snapshots.yml<code>Unifica a regeneração de snapshots visuais</code> <code>+318/-34</code></summary>

    <br/>

    >Unifica a regeneração de snapshots visuais

    ><pre>

    >• Aceita múltiplos specs, projetos públicos ou autenticados, safe mode, servidor Vite e publicação por PR ou push permitido. Adiciona detecção de mudanças e execução em matriz para seis suítes em push/main, além de restringir o staging aos diretórios de snapshots solicitados.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-4b6fce1c311539adb4f9a4a32423b3bba8a271508a4aeaf13b6db0dc26f828dc'>.github/workflows/update-snapshots.yml</a>

    </details>

    </dd>
    </dl>

    </details>

    <details>
    <summary>Documentation (3) <code> +508 / -7 </code></summary>

    <dl>
    <dd>

    <details>
    <summary>README.md<code>Atualiza instruções de regeneração visual</code> <code>+6/-5</code></summary>

    <br/>

    >Atualiza instruções de regeneração visual

    ><pre>

    >• Substitui comandos dos workflows removidos por exemplos de dispatch do updater unificado para calendário e snapshots de quote.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5'>README.md</a>

    </details>

    <details>
    <summary>INVENTARIO_WORKFLOWS_2026-11-02.md<code>Versiona inventário e plano de gestão dos workflows</code> <code>+500/-0</code></summary>

    <br/>

    >Versiona inventário e plano de gestão dos workflows

    ><pre>

    >• Registra os 106 workflows de origem, evidências de cobertura e execução, decisões aplicadas na Fase 1 e propostas separadas para fases posteriores.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-3c12a810febe9fa95eda55e38590eea9cfbe996309a456016c8aabfbd6d4ba38'>docs/ci/INVENTARIO_WORKFLOWS_2026-11-02.md</a>

    </details>

    <details>
    <summary>qa-price-readonly-regression.mjs<code>Aponta a orientação de QA para o updater unificado</code> <code>+2/-2</code></summary>

    <br/>

    >Aponta a orientação de QA para o updater unificado

    ><pre>

    >• Troca o nome do antigo workflow de quote reset nas instruções de regeneração visual.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-36fe03b7fb1601edfde9795ad294a173886c5187a01054d51e7bd4f88eda1daf'>scripts/qa-price-readonly-regression.mjs</a>

    </details>

    </dd>
    </dl>

    </details>

    <details>
    <summary>Other (6) <code> +9 / -39 </code></summary>

    <dl>
    <dd>

    <details>
    <summary>ci-security-drift.yml<code>Alinha o lint de security drift ao Gate 1</code> <code>+2/-2</code></summary>

    <br/>

    >Alinha o lint de security drift ao Gate 1

    ><pre>

    >• Substitui lint:check por lint:baseline para usar o mesmo critério do gate principal e evitar falhas causadas apenas pela diferença de política de warnings.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-076614c50e635a6de8a764c6886e7624ede1b65741eb2026057acb3d3e4c38fa'>.github/workflows/ci-security-drift.yml</a>

    </details>

    <details>
    <summary>policies-baseline.yml<code>Reserva a auditoria de policies para cron e dispatch</code> <code>+3/-9</code></summary>

    <br/>

    >Reserva a auditoria de policies para cron e dispatch

    ><pre>

    >• Remove os disparos de PR e push, já cobertos pelo Gate 1.13. Preserva a auditoria semanal e a geração manual do baseline.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-d2c3cd45e353afea9c2372f3976b2b5195d04099e1b76d0c7181fb781cf942f2'>.github/workflows/policies-baseline.yml</a>

    </details>

    <details>
    <summary>security.yml<code>Remove o scan de segredos duplicado</code> <code>+2/-18</code></summary>

    <br/>

    >Remove o scan de segredos duplicado

    ><pre>

    >• Elimina o job gitleaks deste workflow, mantendo a verificação de headers. O scan de segredos permanece no Gate E23.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-6102d4f2cddb56c446459bde9bf8e8044b87ce3f98a24c2bba99debfd62461dc'>.github/workflows/security.yml</a>

    </details>

    <details>
    <summary>check-secrets-inventory.mjs<code>Remove exceção para segredo do template excluído</code> <code>+0/-2</code></summary>

    <br/>

    >Remove exceção para segredo do template excluído

    ><pre>

    >• Retira EXAMPLE_API_KEY da allowlist após a exclusão do workflow didático que a referenciava.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-e3f44cc6fcb15ffbda35270ceaf159bd67fc04d5fb270230033686fc9b991f84'>scripts/check-secrets-inventory.mjs</a>

    </details>

    <details>
    <summary>check-workflow-contracts.allowlist.json<code>Limpa exceções de contratos sem correspondência</code> <code>+1/-7</code></summary>

    <br/>

    >Limpa exceções de contratos sem correspondência

    ><pre>

    >• Remove três violações e justificativas obsoletas associadas a ci-quotes-wizard e e2e-focused.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-4fd5dced8e5c2ed2feb427a34e825cdea9c46c87178ab37ae476525e2b8512c6'>scripts/check-workflow-contracts.allowlist.json</a>

    </details>

    <details>
    <summary>validate-quote-conditions-workflows.mjs<code>Redireciona a referência ao updater de condições</code> <code>+1/-1</code></summary>

    <br/>

    >Redireciona a referência ao updater de condições

    ><pre>

    >• Passa a procurar update-snapshots.yml em vez do workflow específico removido.
    ></pre>
    ><a href='https://github.com/adm01-debug/Promo_Gifts_V4/pull/3055/files#diff-721c3707439d3ff01d63a5d2e2171a7684a17a1d2f49838486d5bb988b3454a9'>scripts/qa/validate-quote-conditions-workflows.mjs</a>

    </details>

    </dd>
    </dl>

    </details>

    </dd>
    </dl>

    </details>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Nov 02, 2026 21:59 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,
    +              }];
    +            } else {
    +              // push — um item por grupo afetado, sempre mode=pr/safe_mode=true (mais
    +              // seguro que o push direto que os workflows originais faziam).
    +              const changed = JSON.parse(process.env.CHANGED || "[]");
    +              const table = {
    +                "alert-dialog":   { spec: "e2e/ui/alert-dialog-visual.spec.ts", project: "chromium-public" },
    +                "confirm-dialog": { spec: "e2e/ui/confirm-dialog-visual.spec.ts", project: "chromium-public" },
    +                "dialog":         { spec: "e2e/ui/dialog-visual.spec.ts", project: "chromium-public" },
    +                "magazine-ring":  { spec: "e2e/ui/magazine-ring-visual.spec.ts", project: "chromium-public" },
    +                "editor-sheet":   { spec: "e2e/quotes/quote-item-editor-sheet-header.spec.ts", project: "all-public" },
    +                "calendar":       { spec: "e2e/ui/calendar-visual.spec.ts", project: "chromium-public", dev_server: true },
    +              };
    +              include = changed.filter((name) => table[name]).map((name) => {
    +                const t = table[name];
    +                return {
    +                  suite: name,
    +                  spec: t.spec,
    +                  project: t.project,
    +                  safe_mode: true,
    +                  mode: "pr",
    +                  dev_server: !!t.dev_server,
    +                  branch: "",
    +                  commit_message: "chore(e2e): update visual snapshots (" + name + ")",
    +                };
    +              });
    +            }
    +            const fs = require("fs");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "matrix=" + JSON.stringify(include) + "\n");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "count=" + include.length + "\n");
    +            console.log("Evento:", ev, "- itens na matriz:", include.length);
    +            console.log(JSON.stringify(include, null, 2));
    +          '
    +
       update:
    -    name: Regenerar baselines
    +    name: Regenerar baselines · ${{ matrix.suite }}
    +    needs: [prep]
    +    if: needs.prep.outputs.count != '0'
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        include: ${{ fromJSON(needs.prep.outputs.matrix) }}

    <sub><sub>!P2 Badge</sub></sub> Gere uma branch distinta para cada item da matriz

    Quando um push altera mais de uma suíte visual e duas regenerações chegam ao commit no mesmo minuto, os jobs paralelos usam o mesmo nome de branch: chore/e2e-snapshots-${TS} (linhas 421–422). Cada job contém snapshots diferentes, mas ambos tentam publicar na mesma referência, comprometendo a criação das PRs independentes. A concorrência no nível do workflow não serializa os itens desta matriz. Inclua a suíte e um identificador da execução no nome da branch para evitar a colisão introduzida pela execução em paralelo.

    Useful? React with 👍 / 👎.

    <!-- codex-code-review-finding:v1 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Nov 02, 2026 21:59 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');

    <sub><sub>!P2 Badge</sub></sub> Valide os nomes das entradas do localStorage autenticado

    Ao regenerar os snapshots autenticados antes atendidos por update-quote-reset-snapshots.yml, o novo modo seguro executa o login no dry-run e depois passa por esta validação. O storageState() salvo em e2e/fixtures/auth.setup.ts:65 representa localStorage como um array de objetos {name, value}; portanto, Object.keys(o.localStorage) retorna índices, não nomes de tokens. Para uma sessão Supabase válida armazenada em localStorage e sem cookies, a checagem retorna empty e aborta antes da regeneração. Inspecione o campo name de cada entrada para não bloquear essas atualizações com credenciais válidas.

    Useful? React with 👍 / 👎.

    <!-- codex-code-review-finding:v1 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 02, 2026 21:59 UTC
    Reviewer

    <!-- codex-review-receipt:v1 -->

    💡 Codex Review

    Here are some automated review suggestions for this pull request.

    Reviewed commit: 2e57102ca3

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review".
  • If Codex has suggestions, it will comment; otherwise it will react with 👍.

    Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    </details>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Nov 02, 2026 21:59 UTC
    Code Review
    .github/workflows/security.yml:1
    @@ -27,24 +27,8 @@ defaults:
         shell: bash
     
     jobs:
    -  gitleaks:
    -    name: Gitleaks — Secret Scan
    -    runs-on: ubuntu-24.04
    -    timeout-minutes: 10
    -    steps:
    -      - name: Checkout
    -        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    -        with:
    -          persist-credentials: false  # E32
    -          fetch-depth: 0
    -
    -      - name: Run Gitleaks
    -        uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
    -        env:
    -          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    -          # GITLEAKS_LICENSE: necessário apenas para organizações
    -          # Para usuário pessoal, não precisa de licença
    -
    +  # Job `gitleaks` removido 2026-11-02 — duplicava o required check
    +  # "Gate E23 - Secret Scan (gitleaks)" do deploy-gates.yml (mesma action, mesmo escopo).

    <sub><sub>!P1 Badge</sub></sub> Preserve a varredura dos commits antes do merge

    Se uma PR adiciona um segredo em um commit e o remove em outro, a remoção deste job deixa de detectar o vazamento antes do merge. O substituto em deploy-gates.yml:815–817 usa --no-git, cuja descrição oficial é “treat git repo as a regular directory and scan those files” (Gitleaks 8.21.2); portanto, examina os arquivos finais, não os commits intermediários. Já a action removida percorre o intervalo de commits da PR (implementação da action). Conferi também gitleaks-history-audit.yml:9–15: ele só executa por agendamento, dispatch ou push em main, quando o segredo já pode ter sido incorporado ao histórico. Preserve a análise do intervalo da PR, neste workflow ou no gate consolidado.

    Useful? React with 👍 / 👎.

    <!-- codex-code-review-finding:v1 -->

    qodo-code-review[bot] qodo-code-review[bot] commented on Nov 02, 2026 22:01 UTC
    Bot

    <h3>Code Review by Qodo</h3>

    <br/>

    <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">

    <details>
    <summary> 1. Manual snapshot updates cannot be committed <code>🐞</code></summary>

    <br/>

    <details>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    >The dispatch matrix reads <b><i>inputs.commit_message</i></b>, but the workflow declares no such input, leaving
    ><b><i>matrix.commit_message</i></b> empty. When a manual run changes snapshots, <b><i>git commit -m</i></b> receives an
    >empty message and fails before the workflow can open a pull request.
    ></pre>
    ></details>

    <details>

    ><summary>Agent prompt</summary>
    ><br/>
    >
    >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
    >
    >## Issue description
    >Manual dispatch leaves the commit message empty, so snapshot-changing runs cannot commit.
    >
    >## Fix Focus Areas
    >- .github/workflows/update-snapshots.yml[55-93]
    >- .github/workflows/update-snapshots.yml[164-179]
    >
    >## Recommended Fix
    >Declare a `commit_message` dispatch input with a nonempty default, or supply a nonempty fallback while building the dispatch matrix. Preserve the message when committing and naming the pull request.
    >

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>

    ></details>

    Dismiss ↗ | View ↗

    </details>

    <br/>

    <details><summary><ins><strong>View low (1)</strong></ins></summary><br/>
    <img src="https://img.shields.io/badge/Low-634FD1?style=flat-square" height="20px" alt="Informational">

    <details>
    <summary> 2. Feature-branch pushes stop updating images <code>🐞</code></summary>

    <br/>

    <details>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    >The replacement updater restricts its automatic <b><i>push</i></b> trigger to <b><i>main</i></b>, whereas several deleted
    >visual updaters triggered when their spec or harness changed on any branch. Developers pushing those
    >changes to feature branches therefore no longer start the previously automatic baseline update.
    ></pre>
    ></details>

    <details>

    ><summary>Agent prompt</summary>
    ><br/>
    >
    >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
    >
    >## Issue description
    >Restricting automatic updates to main removes the former feature-branch push behavior.
    >
    >## Fix Focus Areas
    >- .github/workflows/update-snapshots.yml[37-53]
    >- .github/workflows/update-snapshots.yml[181-205]
    >
    >## Recommended Fix
    >Restore automatic handling of matching feature-branch pushes, with an explicit branch-specific update policy and target. Verify that pushes changing an affected spec or harness outside main start the intended updater.
    >

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>

    ></details>

    Dismiss ↗ | View ↗

    </details>

    </details>

    <br/>

    <!-- qodo-self-review-slot -->
    <!-- https://github.com/adm01-debug/Promo_Gifts_V4/commit/6a3c118c191665f5a75e442b359c9dd944e98adc -->

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');
    +                });
    +              });
    +              hasCookies || hasSupabaseToken ? 'valid' : 'empty'

    <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">

    <s>1\. Empty auth states can pass ci</s> <code>📘 Rule violation</code> <code>☼ Reliability</code>

    <pre><s>
    The auth-state guard treats a Supabase token in local storage as valid even when <b><i>storageState.json</i></b>
    contains zero cookies. When login produces local-storage-only state, the workflow proceeds to
    regenerate authenticated snapshots instead of failing the job as required.
    </s></pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    The authenticated snapshot workflow accepts `storageState.json` when it has a Supabase local-storage token but zero cookies, so an empty-cookie login state can proceed to authenticated baseline regeneration.
    
    ## Fix Focus Areas
    - .github/workflows/update-snapshots.yml[353-368]
    
    ## Recommended Fix
    Parse `storageState.json`, count `s.cookies`, and exit non-zero with a clear error whenever the cookie count is zero before authenticated snapshot regeneration. Do not treat a local-storage token as a substitute for the required cookie-count validation.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,

    <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">

    2\. Manual snapshot updates cannot be committed <code>🐞 Bug</code> <code>≡ Correctness</code>

    <pre>
    The dispatch matrix reads <b><i>inputs.commit_message</i></b>, but the workflow declares no such input, leaving
    <b><i>matrix.commit_message</i></b> empty. When a manual run changes snapshots, <b><i>git commit -m</i></b> receives an
    empty message and fails before the workflow can open a pull request.
    </pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    Manual dispatch leaves the commit message empty, so snapshot-changing runs cannot commit.
    
    ## Fix Focus Areas
    - .github/workflows/update-snapshots.yml[55-93]
    - .github/workflows/update-snapshots.yml[164-179]
    
    ## Recommended Fix
    Declare a `commit_message` dispatch input with a nonempty default, or supply a nonempty fallback while building the dispatch matrix. Preserve the message when committing and naming the pull request.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    Dismiss ↗ | View ↗

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,
    +              }];
    +            } else {
    +              // push — um item por grupo afetado, sempre mode=pr/safe_mode=true (mais
    +              // seguro que o push direto que os workflows originais faziam).
    +              const changed = JSON.parse(process.env.CHANGED || "[]");
    +              const table = {
    +                "alert-dialog":   { spec: "e2e/ui/alert-dialog-visual.spec.ts", project: "chromium-public" },
    +                "confirm-dialog": { spec: "e2e/ui/confirm-dialog-visual.spec.ts", project: "chromium-public" },
    +                "dialog":         { spec: "e2e/ui/dialog-visual.spec.ts", project: "chromium-public" },
    +                "magazine-ring":  { spec: "e2e/ui/magazine-ring-visual.spec.ts", project: "chromium-public" },
    +                "editor-sheet":   { spec: "e2e/quotes/quote-item-editor-sheet-header.spec.ts", project: "all-public" },
    +                "calendar":       { spec: "e2e/ui/calendar-visual.spec.ts", project: "chromium-public", dev_server: true },
    +              };
    +              include = changed.filter((name) => table[name]).map((name) => {
    +                const t = table[name];
    +                return {
    +                  suite: name,
    +                  spec: t.spec,
    +                  project: t.project,
    +                  safe_mode: true,
    +                  mode: "pr",
    +                  dev_server: !!t.dev_server,
    +                  branch: "",
    +                  commit_message: "chore(e2e): update visual snapshots (" + name + ")",
    +                };
    +              });
    +            }
    +            const fs = require("fs");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "matrix=" + JSON.stringify(include) + "\n");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "count=" + include.length + "\n");
    +            console.log("Evento:", ev, "- itens na matriz:", include.length);
    +            console.log(JSON.stringify(include, null, 2));
    +          '
    +
       update:
    -    name: Regenerar baselines
    +    name: Regenerar baselines · ${{ matrix.suite }}
    +    needs: [prep]
    +    if: needs.prep.outputs.count != '0'
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        include: ${{ fromJSON(needs.prep.outputs.matrix) }}

    <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">

    6\. Multi-suite pushes lose snapshot updates <code>🐞 Bug</code> <code>☼ Reliability</code>

    <pre>
    The new matrix runs one update job per affected suite, but each job creates its pull-request branch
    using only the current UTC minute. If one push affects multiple suites, jobs starting in that minute
    push different commits to the same branch, so later pushes are rejected and their pull requests are
    not created.
    </pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    Parallel snapshot jobs collide on a minute-based pull-request branch name.
    
    ## Fix Focus Areas
    - .github/workflows/update-snapshots.yml[193-205]
    - .github/workflows/update-snapshots.yml[421-429]
    
    ## Recommended Fix
    Include the run ID and matrix suite in each generated branch name. Ensure independently triggered runs and suites cannot push different commits to the same branch.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    Dismiss ↗ | View ↗

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -65,13 +229,25 @@ jobs:
           FORCE_COLOR: "0"
           VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL || 'https://doufsxqlfjyuvxuezpln.supabase.co' }}
           VITE_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY || 'sb_publishable_tjH5qAbZ0e5HTTd872NijQ_s9m6JvYU' }}
    +      INPUT_SPEC: ${{ matrix.spec }}
    +      INPUT_PROJECT: ${{ matrix.project }}
         steps:
           - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
             with:
               persist-credentials: false  # E32
    -          ref: ${{ github.event.inputs.branch || github.ref }}
    +          ref: ${{ matrix.branch || github.ref }}
               fetch-depth: 0
     
    +      - name: Bloquear push direto em main
    +        if: ${{ matrix.mode == 'push' }}
    +        env:
    +          TARGET_BRANCH: ${{ matrix.branch || github.ref_name }}
    +        run: |
    +          if [ "$TARGET_BRANCH" = "main" ]; then

    <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">

    3\. The direct-push guard allows main pushes <code>🐞 Bug</code> <code>⛨ Security</code>

    <pre>
    The <b><i>mode=push</i></b> guard compares the supplied target only with the literal <b><i>main</i></b>, rather than
    resolving its Git ref. A dispatch using <b><i>branch=refs/heads/main</i></b> passes that guard and later pushes
    <b><i>HEAD:refs/heads/main</i></b> with a write-capable token, unless branch protection independently rejects
    it.
    </pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    A fully qualified branch ref bypasses the direct-push prohibition for main.
    
    ## Fix Focus Areas
    - .github/workflows/update-snapshots.yml[241-249]
    - .github/workflows/update-snapshots.yml[415-417]
    
    ## Recommended Fix
    Resolve and validate the target as a branch ref before checkout or push. Reject both `main` and `refs/heads/main` as direct-push destinations, and use the validated destination for the push.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    Dismiss ↗ | View ↗

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/policies-baseline.yml:1
    @@ -23,16 +23,10 @@ name: Policies Baseline
     # Sem credenciais (ex.: PR de fork): o script degrada para static-pass.
     # =============================================================================
     
    +# 2026-11-02 (gestão de workflows, Fase 1): triggers pull_request/push removidos —
    +# o mesmo check roda em toda PR e push pelo Gate 1.13 do deploy-gates.yml
    +# (scripts/check-policies-baseline.mjs). Aqui fica só a auditoria semanal + seed manual.
     on:
    -  pull_request:
    -    branches: [main]
    -    paths:
    -      - 'supabase/migrations/**'
    -      - '.security/policies-baseline.json'

    <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">

    4\. Policy-only pull requests lose validation <code>🐞 Bug</code> <code>⛨ Security</code>

    <pre>
    Removing the policy workflow’s pull-request trigger delegates validation to a deploy gate that skips
    its policy check when <b><i>docs_only</i></b> is true. A pull request changing only
    <b><i>.security/policies-baseline.json</i></b> is not classified as code by that gate, so it loses the check
    that the removed trigger explicitly ran for that file.
    </pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    Policy-baseline-only pull requests bypass the replacement policy check.
    
    ## Fix Focus Areas
    - .github/workflows/policies-baseline.yml[26-32]
    - .github/workflows/deploy-gates.yml[75-101]
    
    ## Recommended Fix
    Add `.security/policies-baseline.json` to the deploy gate’s code-change filter, or retain a pull-request trigger for that file in the policy workflow. Verify a pull request changing only the baseline executes the policy check.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    Dismiss ↗ | View ↗

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,
    +              }];
    +            } else {
    +              // push — um item por grupo afetado, sempre mode=pr/safe_mode=true (mais
    +              // seguro que o push direto que os workflows originais faziam).
    +              const changed = JSON.parse(process.env.CHANGED || "[]");
    +              const table = {
    +                "alert-dialog":   { spec: "e2e/ui/alert-dialog-visual.spec.ts", project: "chromium-public" },
    +                "confirm-dialog": { spec: "e2e/ui/confirm-dialog-visual.spec.ts", project: "chromium-public" },
    +                "dialog":         { spec: "e2e/ui/dialog-visual.spec.ts", project: "chromium-public" },
    +                "magazine-ring":  { spec: "e2e/ui/magazine-ring-visual.spec.ts", project: "chromium-public" },
    +                "editor-sheet":   { spec: "e2e/quotes/quote-item-editor-sheet-header.spec.ts", project: "all-public" },
    +                "calendar":       { spec: "e2e/ui/calendar-visual.spec.ts", project: "chromium-public", dev_server: true },
    +              };
    +              include = changed.filter((name) => table[name]).map((name) => {
    +                const t = table[name];
    +                return {
    +                  suite: name,
    +                  spec: t.spec,
    +                  project: t.project,
    +                  safe_mode: true,
    +                  mode: "pr",

    <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">

    <s>5\. Generated snapshot prs lack ci runs</s> <code>🐞 Bug</code> <code>☼ Reliability</code>

    <pre><s>
    The new automatic matrix selects pull-request mode, but its branch push and <b><i>gh pr create</i></b> use the
    default Actions token. When those operations succeed, pull-request workflows are not triggered by
    that token’s events, leaving the generated snapshot pull request without the CI runs needed for
    required checks.
    </s></pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    The new automatic pull-request flow uses a token whose generated events do not start pull-request CI.
    
    ## Fix Focus Areas
    - .github/workflows/update-snapshots.yml[193-205]
    - .github/workflows/update-snapshots.yml[393-431]
    
    ## Recommended Fix
    Authenticate the generated branch push and pull-request creation with an appropriately scoped GitHub App token or another approved credential that triggers CI. Verify a generated snapshot pull request receives its required checks.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');
    +                });
    +              });
    +              hasCookies || hasSupabaseToken ? 'valid' : 'empty'
    +            " 2>/dev/null || echo "error")
    +            if [ "$AUTH_VALID" != "valid" ]; then
    +              echo "::error title=Empty auth state::storageState.json não contém cookies nem token Supabase em localStorage (sb-*-auth-token) — autenticação E2E produziu estado vazio. Regenerar baselines agora capturaria páginas não-autenticadas como baseline aprovado. Verifique E2E_USER_EMAIL e E2E_USER_PASSWORD."
    +              exit 1
    +            fi
    +            echo "✅ Auth state válido — prosseguindo com regeneração."
    +          else
    +            echo "ℹ️  storageState ainda não existe (será criado pelo auth setup do Playwright na etapa seguinte)."
    +          fi
     
           - name: Regenerar snapshots
    +        id: regen
    +        if: ${{ !matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual') }}
             env:
               E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
               E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    -          INPUT_SPEC: ${{ github.event.inputs.spec }}
    -          INPUT_PROJECT: ${{ github.event.inputs.project }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
             run: |
    -          read -ra SPECS <<< "$INPUT_SPEC"
    -          npx playwright test "${SPECS[@]}" \
    -            --project="$INPUT_PROJECT" \
    -            --update-snapshots \
    -            --reporter=list
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          npx playwright test $SPECS $PROJECTS --update-snapshots --reporter=list
     
           - name: Credencial de push sem token em disco (E32)
    +        if: ${{ steps.regen.outcome == 'success' }}
             run: |
               # persist-credentials:false nao grava token; o helper le GIT_PUSH_TOKEN so no passo de push.
               # shellcheck disable=SC2016 # aspas simples intencionais: $1 e GIT_PUSH_TOKEN expandem quando o git chama o helper
               git config --local credential.helper '!f() { test "$1" = get || exit 0; echo username=x-access-token; echo "password=${GIT_PUSH_TOKEN}"; }; f'
     
    -      - name: Comitar baselines e abrir PR
    +      - name: Comitar baselines (PR ou push)
    +        if: ${{ steps.regen.outcome == 'success' }}
             env:
               GIT_PUSH_TOKEN: ${{ github.token }}
               GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    -          INPUT_COMMIT_MESSAGE: ${{ github.event.inputs.commit_message }}
    -          TARGET_BRANCH: ${{ github.event.inputs.branch || github.ref_name }}
    +          INPUT_COMMIT_MESSAGE: ${{ matrix.commit_message }}
    +          INPUT_MODE: ${{ matrix.mode }}
    +          TARGET_BRANCH: ${{ matrix.branch || github.ref_name }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +          RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
               HUSKY: "0"
             run: |
               git config user.name  "github-actions[bot]"
               git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
    -          git add e2e/ || true
    +          read -ra SPEC_LIST <<< "$SPECS"
    +          for s in "${SPEC_LIST[@]}"; do
    +            git add -A "${s}-snapshots" 2>/dev/null || true  # ok: spec sem diretório de snapshots ainda
    +          done

    <img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">

    <s>7\. Snapshot-only prs miss a required check</s> <code>🐞 Bug</code> <code>≡ Correctness</code>

    <pre><s>
    The consolidated commit step stages only spec snapshot directories, producing pull requests whose
    changes can be confined to <b><i>e2e/**</i></b>. CodeQL excludes those paths from its pull-request trigger even
    though its analysis job is required on <b><i>main</i></b>, so such a generated pull request cannot obtain that
    required check even after pull-request CI is made to trigger.
    </s></pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    A generated snapshot-only pull request cannot satisfy the required CodeQL check because its paths do not trigger that workflow.
    
    ## Fix Focus Areas
    - .github/workflows/update-snapshots.yml[407-410]
    - .github/workflows/codeql.yml[6-13]
    - .github/required-checks.json[18-23]
    
    ## Recommended Fix
    Align the required check with its trigger: run CodeQL for these generated pull requests, or change the required-check policy so a path-excluded check is not required of them. Verify a snapshot-only pull request can satisfy branch protection.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:01 UTC
    Code Review
    .github/workflows/security.yml:1
    @@ -27,24 +27,8 @@ defaults:
         shell: bash
     
     jobs:
    -  gitleaks:
    -    name: Gitleaks — Secret Scan
    -    runs-on: ubuntu-24.04
    -    timeout-minutes: 10
    -    steps:
    -      - name: Checkout
    -        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    -        with:
    -          persist-credentials: false  # E32
    -          fetch-depth: 0
    -
    -      - name: Run Gitleaks
    -        uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
    -        env:
    -          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    -          # GITLEAKS_LICENSE: necessário apenas para organizações
    -          # Para usuário pessoal, não precisa de licença
    -
    +  # Job `gitleaks` removido 2026-11-02 — duplicava o required check
    +  # "Gate E23 - Secret Scan (gitleaks)" do deploy-gates.yml (mesma action, mesmo escopo).

    <img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">

    8\. Secrets committed then removed in a pr slip past <code>🐞 Bug</code> <code>⛨ Security</code>

    <pre>
    The removed <b><i>gitleaks</i></b> job ran <b><i>gitleaks/gitleaks-action</i></b> with <b><i>fetch-depth: 0</i></b>, which scans the
    commit range of a PR or push. The remaining &#x27;Gate E23&#x27; runs <b><i>gitleaks detect ... --no-git</i></b>, which
    scans only the final working tree. So the claim that it has the same action and scope is wrong: a
    credential added in one PR commit and deleted in a later one passes every PR check, and a history
    scan only finds it after it is already in main&#x27;s history.
    </pre>

    <details>
    <summary><strong>Agent Prompt</strong></summary>

    ## Issue description
    Removing the `gitleaks` job from security.yml drops the only PR-time scan of commit history. Gate E23 uses `--no-git` and only scans the working tree.
    
    ## Fix Focus Areas
    - .github/workflows/security.yml[29-32]
    - .github/workflows/deploy-gates.yml[811-819]
    
    ## Recommended Fix
    Either restore the gitleaks-action job in security.yml, or change Gate E23 to scan the PR commit range, for example `gitleaks detect --source . --log-opts="${{ github.event.pull_request.base.sha || github.event.before }}..HEAD" --exit-code 1` (fetch-depth: 0 is already set). Then update the comment so it describes the scope accurately.
    

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
    </details>

    Dismiss ↗ | View ↗

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:02 UTC
    Code Review
    .github/workflows/security.yml:1
    @@ -27,24 +27,8 @@ defaults:
         shell: bash
     
     jobs:
    -  gitleaks:
    -    name: Gitleaks — Secret Scan
    -    runs-on: ubuntu-24.04
    -    timeout-minutes: 10
    -    steps:
    -      - name: Checkout
    -        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    -        with:
    -          persist-credentials: false  # E32
    -          fetch-depth: 0
    -
    -      - name: Run Gitleaks
    -        uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
    -        env:
    -          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    -          # GITLEAKS_LICENSE: necessário apenas para organizações
    -          # Para usuário pessoal, não precisa de licença
    -
    +  # Job `gitleaks` removido 2026-11-02 — duplicava o required check
    +  # "Gate E23 - Secret Scan (gitleaks)" do deploy-gates.yml (mesma action, mesmo escopo).

    Confirmado — minha premissa de "duplicata" estava errada. gitleaks-action varre o range de commits da PR por padrão; o Gate E23 usa --no-git e vê só o estado final da árvore, então um segredo commitado e removido na mesma PR passaria. Job gitleaks restaurado em security.yml.

    ---
    _Generated by Claude Code_

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:02 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,
    +              }];
    +            } else {
    +              // push — um item por grupo afetado, sempre mode=pr/safe_mode=true (mais
    +              // seguro que o push direto que os workflows originais faziam).
    +              const changed = JSON.parse(process.env.CHANGED || "[]");
    +              const table = {
    +                "alert-dialog":   { spec: "e2e/ui/alert-dialog-visual.spec.ts", project: "chromium-public" },
    +                "confirm-dialog": { spec: "e2e/ui/confirm-dialog-visual.spec.ts", project: "chromium-public" },
    +                "dialog":         { spec: "e2e/ui/dialog-visual.spec.ts", project: "chromium-public" },
    +                "magazine-ring":  { spec: "e2e/ui/magazine-ring-visual.spec.ts", project: "chromium-public" },
    +                "editor-sheet":   { spec: "e2e/quotes/quote-item-editor-sheet-header.spec.ts", project: "all-public" },
    +                "calendar":       { spec: "e2e/ui/calendar-visual.spec.ts", project: "chromium-public", dev_server: true },
    +              };
    +              include = changed.filter((name) => table[name]).map((name) => {
    +                const t = table[name];
    +                return {
    +                  suite: name,
    +                  spec: t.spec,
    +                  project: t.project,
    +                  safe_mode: true,
    +                  mode: "pr",
    +                  dev_server: !!t.dev_server,
    +                  branch: "",
    +                  commit_message: "chore(e2e): update visual snapshots (" + name + ")",
    +                };
    +              });
    +            }
    +            const fs = require("fs");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "matrix=" + JSON.stringify(include) + "\n");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "count=" + include.length + "\n");
    +            console.log("Evento:", ev, "- itens na matriz:", include.length);
    +            console.log(JSON.stringify(include, null, 2));
    +          '
    +
       update:
    -    name: Regenerar baselines
    +    name: Regenerar baselines · ${{ matrix.suite }}
    +    needs: [prep]
    +    if: needs.prep.outputs.count != '0'
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        include: ${{ fromJSON(needs.prep.outputs.matrix) }}

    Confirmado — real. Branch agora inclui matrix.suite e timestamp com segundos (chore/e2e-snapshots-${{ matrix.suite }}-${TS}), elimina a colisão entre jobs paralelos da matriz.

    ---
    _Generated by Claude Code_

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:02 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');

    Confirmado — real. storageState().localStorage é array de {name, value}, não objeto; Object.keys() retornava índices numéricos, nunca batendo com sb-*-auth-token. Corrigido para iterar o array e checar .name. Testado com storageState real (array) válido e vazio — classifica corretamente os dois casos agora.

    ---
    _Generated by Claude Code_

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -65,13 +229,25 @@ jobs:
           FORCE_COLOR: "0"
           VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL || 'https://doufsxqlfjyuvxuezpln.supabase.co' }}
           VITE_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY || 'sb_publishable_tjH5qAbZ0e5HTTd872NijQ_s9m6JvYU' }}
    +      INPUT_SPEC: ${{ matrix.spec }}
    +      INPUT_PROJECT: ${{ matrix.project }}
         steps:
           - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
             with:
               persist-credentials: false  # E32
    -          ref: ${{ github.event.inputs.branch || github.ref }}
    +          ref: ${{ matrix.branch || github.ref }}
               fetch-depth: 0
     
    +      - name: Bloquear push direto em main
    +        if: ${{ matrix.mode == 'push' }}
    +        env:
    +          TARGET_BRANCH: ${{ matrix.branch || github.ref_name }}
    +        run: |
    +          if [ "$TARGET_BRANCH" = "main" ]; then

    Confirmado — real. branch=refs/heads/main passava o guard que comparava só com o literal main. Normalizado (${TARGET_BRANCH#refs/heads/}) antes de comparar; testado com main, refs/heads/main (bloqueados) e branches normais (permitidos).

    ---
    _Generated by Claude Code_

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/policies-baseline.yml:1
    @@ -23,16 +23,10 @@ name: Policies Baseline
     # Sem credenciais (ex.: PR de fork): o script degrada para static-pass.
     # =============================================================================
     
    +# 2026-11-02 (gestão de workflows, Fase 1): triggers pull_request/push removidos —
    +# o mesmo check roda em toda PR e push pelo Gate 1.13 do deploy-gates.yml
    +# (scripts/check-policies-baseline.mjs). Aqui fica só a auditoria semanal + seed manual.
     on:
    -  pull_request:
    -    branches: [main]
    -    paths:
    -      - 'supabase/migrations/**'
    -      - '.security/policies-baseline.json'

    Confirmado — real. O filtro code de deploy-gates.yml (job changes) não inclui .security/**; uma PR só-de-policies-baseline.json cairia em docs_only=true e o Gate 1.13 nunca rodaria. Trigger pull_request/push restaurado em policies-baseline.yml.

    ---
    _Generated by Claude Code

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,
    +              }];
    +            } else {
    +              // push — um item por grupo afetado, sempre mode=pr/safe_mode=true (mais
    +              // seguro que o push direto que os workflows originais faziam).
    +              const changed = JSON.parse(process.env.CHANGED || "[]");
    +              const table = {
    +                "alert-dialog":   { spec: "e2e/ui/alert-dialog-visual.spec.ts", project: "chromium-public" },
    +                "confirm-dialog": { spec: "e2e/ui/confirm-dialog-visual.spec.ts", project: "chromium-public" },
    +                "dialog":         { spec: "e2e/ui/dialog-visual.spec.ts", project: "chromium-public" },
    +                "magazine-ring":  { spec: "e2e/ui/magazine-ring-visual.spec.ts", project: "chromium-public" },
    +                "editor-sheet":   { spec: "e2e/quotes/quote-item-editor-sheet-header.spec.ts", project: "all-public" },
    +                "calendar":       { spec: "e2e/ui/calendar-visual.spec.ts", project: "chromium-public", dev_server: true },
    +              };
    +              include = changed.filter((name) => table[name]).map((name) => {
    +                const t = table[name];
    +                return {
    +                  suite: name,
    +                  spec: t.spec,
    +                  project: t.project,
    +                  safe_mode: true,
    +                  mode: "pr",

    Real, mas pré-existente (não introduzido por esta PR) — os 12 workflows originais já usavam github.token/GITHUB_TOKEN padrão para o mesmo push/gh pr create (confirmado no commit-pai 8bc5078dbc). É a limitação conhecida do GitHub (token padrão não dispara pull_request CI, para evitar loop recursivo). Corrigir exige um PAT ou GitHub App token — mudança de segredo/arquitetura, decisão do dono. Sinalizado para "Próximos passos", não corrigido nesta PR.

    ---
    _Generated by Claude Code

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');
    +                });
    +              });
    +              hasCookies || hasSupabaseToken ? 'valid' : 'empty'

    Verificado e é falso-positivo para este repo. O app usa sessão Supabase só em localStorage (persistSession com storage padrão em src/integrations/supabase/client.ts; o próprio auth.setup.ts grava {cookies: [], origins: []} em sessão válida no fallback de timeout). Exigir contagem de cookies > 0, como sugerido, faria o gate rejeitar toda regeneração autenticada real — isso quebraria o fluxo, não o protegeria. Mantendo a checagem por token em localStorage (já corrigida nesta PR para ler o array {name,value} corretamente, achado separado do Codex).

    ---
    _Generated by Claude Code

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,

    Verificado e é falso-positivo. commit_message está declarado em on.workflow_dispatch.inputs.commit_message com default: "chore(e2e): update visual snapshots" — confirmei no próprio commit (2e57102) que esta review auditou. Nada a corrigir aqui.

    ---
    _Generated by Claude Code

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,
    +              }];
    +            } else {
    +              // push — um item por grupo afetado, sempre mode=pr/safe_mode=true (mais
    +              // seguro que o push direto que os workflows originais faziam).
    +              const changed = JSON.parse(process.env.CHANGED || "[]");
    +              const table = {
    +                "alert-dialog":   { spec: "e2e/ui/alert-dialog-visual.spec.ts", project: "chromium-public" },
    +                "confirm-dialog": { spec: "e2e/ui/confirm-dialog-visual.spec.ts", project: "chromium-public" },
    +                "dialog":         { spec: "e2e/ui/dialog-visual.spec.ts", project: "chromium-public" },
    +                "magazine-ring":  { spec: "e2e/ui/magazine-ring-visual.spec.ts", project: "chromium-public" },
    +                "editor-sheet":   { spec: "e2e/quotes/quote-item-editor-sheet-header.spec.ts", project: "all-public" },
    +                "calendar":       { spec: "e2e/ui/calendar-visual.spec.ts", project: "chromium-public", dev_server: true },
    +              };
    +              include = changed.filter((name) => table[name]).map((name) => {
    +                const t = table[name];
    +                return {
    +                  suite: name,
    +                  spec: t.spec,
    +                  project: t.project,
    +                  safe_mode: true,
    +                  mode: "pr",
    +                  dev_server: !!t.dev_server,
    +                  branch: "",
    +                  commit_message: "chore(e2e): update visual snapshots (" + name + ")",
    +                };
    +              });
    +            }
    +            const fs = require("fs");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "matrix=" + JSON.stringify(include) + "\n");
    +            fs.appendFileSync(process.env.GITHUB_OUTPUT, "count=" + include.length + "\n");
    +            console.log("Evento:", ev, "- itens na matriz:", include.length);
    +            console.log(JSON.stringify(include, null, 2));
    +          '
    +
       update:
    -    name: Regenerar baselines
    +    name: Regenerar baselines · ${{ matrix.suite }}
    +    needs: [prep]
    +    if: needs.prep.outputs.count != '0'
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        include: ${{ fromJSON(needs.prep.outputs.matrix) }}

    Já corrigido (achado equivalente do Codex, respondido acima): branch agora inclui matrix.suite + timestamp com segundos. Sobre incluir também o run id: o concurrency: do workflow serializa runs diferentes no mesmo ref (cancel-in-progress: false), então só colisão dentro do MESMO run (múltiplas suítes em paralelo) era possível — e isso já fica resolvido com matrix.suite no nome. Não deveria precisar do run id também, mas fico de olho se aparecer caso real.

    ---
    _Generated by Claude Code

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');
    +                });
    +              });
    +              hasCookies || hasSupabaseToken ? 'valid' : 'empty'
    +            " 2>/dev/null || echo "error")
    +            if [ "$AUTH_VALID" != "valid" ]; then
    +              echo "::error title=Empty auth state::storageState.json não contém cookies nem token Supabase em localStorage (sb-*-auth-token) — autenticação E2E produziu estado vazio. Regenerar baselines agora capturaria páginas não-autenticadas como baseline aprovado. Verifique E2E_USER_EMAIL e E2E_USER_PASSWORD."
    +              exit 1
    +            fi
    +            echo "✅ Auth state válido — prosseguindo com regeneração."
    +          else
    +            echo "ℹ️  storageState ainda não existe (será criado pelo auth setup do Playwright na etapa seguinte)."
    +          fi
     
           - name: Regenerar snapshots
    +        id: regen
    +        if: ${{ !matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual') }}
             env:
               E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
               E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    -          INPUT_SPEC: ${{ github.event.inputs.spec }}
    -          INPUT_PROJECT: ${{ github.event.inputs.project }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
             run: |
    -          read -ra SPECS <<< "$INPUT_SPEC"
    -          npx playwright test "${SPECS[@]}" \
    -            --project="$INPUT_PROJECT" \
    -            --update-snapshots \
    -            --reporter=list
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          npx playwright test $SPECS $PROJECTS --update-snapshots --reporter=list
     
           - name: Credencial de push sem token em disco (E32)
    +        if: ${{ steps.regen.outcome == 'success' }}
             run: |
               # persist-credentials:false nao grava token; o helper le GIT_PUSH_TOKEN so no passo de push.
               # shellcheck disable=SC2016 # aspas simples intencionais: $1 e GIT_PUSH_TOKEN expandem quando o git chama o helper
               git config --local credential.helper '!f() { test "$1" = get || exit 0; echo username=x-access-token; echo "password=${GIT_PUSH_TOKEN}"; }; f'
     
    -      - name: Comitar baselines e abrir PR
    +      - name: Comitar baselines (PR ou push)
    +        if: ${{ steps.regen.outcome == 'success' }}
             env:
               GIT_PUSH_TOKEN: ${{ github.token }}
               GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    -          INPUT_COMMIT_MESSAGE: ${{ github.event.inputs.commit_message }}
    -          TARGET_BRANCH: ${{ github.event.inputs.branch || github.ref_name }}
    +          INPUT_COMMIT_MESSAGE: ${{ matrix.commit_message }}
    +          INPUT_MODE: ${{ matrix.mode }}
    +          TARGET_BRANCH: ${{ matrix.branch || github.ref_name }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +          RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
               HUSKY: "0"
             run: |
               git config user.name  "github-actions[bot]"
               git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
    -          git add e2e/ || true
    +          read -ra SPEC_LIST <<< "$SPECS"
    +          for s in "${SPEC_LIST[@]}"; do
    +            git add -A "${s}-snapshots" 2>/dev/null || true  # ok: spec sem diretório de snapshots ainda
    +          done

    Real, mas pré-existente e mais amplo que esta PR — o mesmo gap (CodeQL só dispara em src//supabase/functions/) já afeta qualquer PR só-de-e2e/**, incluindo as que os 12 workflows originais já geravam. Confirmei empiricamente ao mergear #3054 (PR só-de-doc) que a API de merge não bloqueia nesse caso — nenhum dos 2 rulesets do repo exige o check "Analyze (javascript-typescript)" de fato (achado de uma auditoria separada nesta sessão). Mudar isso é decisão de política de CI (required-checks.json ou trigger do codeql.yml), não algo para resolver via diff aqui. Sinalizado para "Próximos passos".

    ---
    _Generated by Claude Code

    adm01-debug adm01-debug commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/security.yml:1
    @@ -27,24 +27,8 @@ defaults:
         shell: bash
     
     jobs:
    -  gitleaks:
    -    name: Gitleaks — Secret Scan
    -    runs-on: ubuntu-24.04
    -    timeout-minutes: 10
    -    steps:
    -      - name: Checkout
    -        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    -        with:
    -          persist-credentials: false  # E32
    -          fetch-depth: 0
    -
    -      - name: Run Gitleaks
    -        uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
    -        env:
    -          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    -          # GITLEAKS_LICENSE: necessário apenas para organizações
    -          # Para usuário pessoal, não precisa de licença
    -
    +  # Job `gitleaks` removido 2026-11-02 — duplicava o required check
    +  # "Gate E23 - Secret Scan (gitleaks)" do deploy-gates.yml (mesma action, mesmo escopo).

    Já corrigido (mesmo achado do Codex acima, com mais detalhe aqui sobre o --log-opts): job gitleaks restaurado em security.yml, não removido mais. Obrigado pela sugestão alternativa de ajustar o Gate E23 com --log-opts — optei por restaurar o job original (menor diff, não toca deploy-gates.yml, arquivo protegido).

    ---
    _Generated by Claude Code

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:07 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -45,18 +103,124 @@ permissions:
     
     # R2 — dispatch-only nunca cancelado (E19)
     concurrency:
    -  group: update-snapshots-${{ github.event.inputs.branch || github.ref_name }}
    +  group: update-snapshots-${{ inputs.branch || github.ref_name }}
       cancel-in-progress: false
     
     defaults:
       run:
         shell: bash
     
     jobs:
    +  prep:
    +    name: Preparar matriz (dispatch=1 item · push=N specs afetados)
    +    runs-on: ubuntu-24.04
    +    timeout-minutes: 3
    +    outputs:
    +      matrix: ${{ steps.build.outputs.matrix }}
    +      count: ${{ steps.build.outputs.count }}
    +    steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        if: github.event_name == 'push'
    +        with:
    +          persist-credentials: false  # E32
    +
    +      - name: Detectar specs afetados (push)
    +        id: filter
    +        if: github.event_name == 'push'
    +        uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
    +        with:
    +          filters: |
    +            alert-dialog:
    +              - 'e2e/ui/alert-dialog-visual.spec.ts'
    +              - 'src/pages/dev/AlertDialogHarness.tsx'
    +            confirm-dialog:
    +              - 'e2e/ui/confirm-dialog-visual.spec.ts'
    +              - 'src/pages/dev/ConfirmDialogHarness.tsx'
    +            dialog:
    +              - 'e2e/ui/dialog-visual.spec.ts'
    +              - 'src/pages/dev/DialogHarness.tsx'
    +            magazine-ring:
    +              - 'e2e/ui/magazine-ring-visual.spec.ts'
    +              - 'src/pages/dev/MagazineRingHarness.tsx'
    +            editor-sheet:
    +              - 'e2e/quotes/quote-item-editor-sheet-header.spec.ts'
    +              - 'src/pages/__visual/QuoteItemEditorSheetHarness.tsx'
    +            calendar:
    +              - 'src/components/ui/calendar.tsx'
    +              - 'src/pages/__visual/CalendarHarness.tsx'
    +              - 'e2e/ui/calendar-visual.spec.ts'
    +
    +      - name: Montar matriz
    +        id: build
    +        env:
    +          EVENT_NAME: ${{ github.event_name }}
    +          CHANGED: ${{ steps.filter.outputs.changes || '[]' }}
    +          IN_SPEC: ${{ inputs.spec }}
    +          IN_PROJECT: ${{ inputs.project }}
    +          IN_SAFE_MODE: ${{ inputs.safe_mode }}
    +          IN_MODE: ${{ inputs.mode }}
    +          IN_DEV_SERVER: ${{ inputs.dev_server }}
    +          IN_BRANCH: ${{ inputs.branch }}
    +          IN_COMMIT_MESSAGE: ${{ inputs.commit_message }}
    +        run: |
    +          set -euo pipefail
    +          node -e '
    +            const ev = process.env.EVENT_NAME;
    +            let include;
    +            if (ev === "workflow_dispatch") {
    +              include = [{
    +                suite: "dispatch",
    +                spec: process.env.IN_SPEC,
    +                project: process.env.IN_PROJECT,
    +                safe_mode: process.env.IN_SAFE_MODE === "true",
    +                mode: process.env.IN_MODE,
    +                dev_server: process.env.IN_DEV_SERVER === "true",
    +                branch: process.env.IN_BRANCH || "",
    +                commit_message: process.env.IN_COMMIT_MESSAGE,
    +              }];
    +            } else {
    +              // push — um item por grupo afetado, sempre mode=pr/safe_mode=true (mais
    +              // seguro que o push direto que os workflows originais faziam).
    +              const changed = JSON.parse(process.env.CHANGED || "[]");
    +              const table = {
    +                "alert-dialog":   { spec: "e2e/ui/alert-dialog-visual.spec.ts", project: "chromium-public" },
    +                "confirm-dialog": { spec: "e2e/ui/confirm-dialog-visual.spec.ts", project: "chromium-public" },
    +                "dialog":         { spec: "e2e/ui/dialog-visual.spec.ts", project: "chromium-public" },
    +                "magazine-ring":  { spec: "e2e/ui/magazine-ring-visual.spec.ts", project: "chromium-public" },
    +                "editor-sheet":   { spec: "e2e/quotes/quote-item-editor-sheet-header.spec.ts", project: "all-public" },
    +                "calendar":       { spec: "e2e/ui/calendar-visual.spec.ts", project: "chromium-public", dev_server: true },
    +              };
    +              include = changed.filter((name) => table[name]).map((name) => {
    +                const t = table[name];
    +                return {
    +                  suite: name,
    +                  spec: t.spec,
    +                  project: t.project,
    +                  safe_mode: true,
    +                  mode: "pr",

    Dismissed — deferred.

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:08 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');
    +                });
    +              });
    +              hasCookies || hasSupabaseToken ? 'valid' : 'empty'
    +            " 2>/dev/null || echo "error")
    +            if [ "$AUTH_VALID" != "valid" ]; then
    +              echo "::error title=Empty auth state::storageState.json não contém cookies nem token Supabase em localStorage (sb-*-auth-token) — autenticação E2E produziu estado vazio. Regenerar baselines agora capturaria páginas não-autenticadas como baseline aprovado. Verifique E2E_USER_EMAIL e E2E_USER_PASSWORD."
    +              exit 1
    +            fi
    +            echo "✅ Auth state válido — prosseguindo com regeneração."
    +          else
    +            echo "ℹ️  storageState ainda não existe (será criado pelo auth setup do Playwright na etapa seguinte)."
    +          fi
     
           - name: Regenerar snapshots
    +        id: regen
    +        if: ${{ !matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual') }}
             env:
               E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
               E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    -          INPUT_SPEC: ${{ github.event.inputs.spec }}
    -          INPUT_PROJECT: ${{ github.event.inputs.project }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
             run: |
    -          read -ra SPECS <<< "$INPUT_SPEC"
    -          npx playwright test "${SPECS[@]}" \
    -            --project="$INPUT_PROJECT" \
    -            --update-snapshots \
    -            --reporter=list
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          npx playwright test $SPECS $PROJECTS --update-snapshots --reporter=list
     
           - name: Credencial de push sem token em disco (E32)
    +        if: ${{ steps.regen.outcome == 'success' }}
             run: |
               # persist-credentials:false nao grava token; o helper le GIT_PUSH_TOKEN so no passo de push.
               # shellcheck disable=SC2016 # aspas simples intencionais: $1 e GIT_PUSH_TOKEN expandem quando o git chama o helper
               git config --local credential.helper '!f() { test "$1" = get || exit 0; echo username=x-access-token; echo "password=${GIT_PUSH_TOKEN}"; }; f'
     
    -      - name: Comitar baselines e abrir PR
    +      - name: Comitar baselines (PR ou push)
    +        if: ${{ steps.regen.outcome == 'success' }}
             env:
               GIT_PUSH_TOKEN: ${{ github.token }}
               GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    -          INPUT_COMMIT_MESSAGE: ${{ github.event.inputs.commit_message }}
    -          TARGET_BRANCH: ${{ github.event.inputs.branch || github.ref_name }}
    +          INPUT_COMMIT_MESSAGE: ${{ matrix.commit_message }}
    +          INPUT_MODE: ${{ matrix.mode }}
    +          TARGET_BRANCH: ${{ matrix.branch || github.ref_name }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +          RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
               HUSKY: "0"
             run: |
               git config user.name  "github-actions[bot]"
               git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
    -          git add e2e/ || true
    +          read -ra SPEC_LIST <<< "$SPECS"
    +          for s in "${SPEC_LIST[@]}"; do
    +            git add -A "${s}-snapshots" 2>/dev/null || true  # ok: spec sem diretório de snapshots ainda
    +          done

    Dismissed — deferred.

    qodo-code-review[bot] qodo-code-review[bot] commented on code on Nov 02, 2026 22:08 UTC
    Code Review
    .github/workflows/update-snapshots.yml:1
    @@ -94,52 +270,160 @@ jobs:
             uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
             with:
               path: ~/.cache/ms-playwright
    -          key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    -          restore-keys: playwright-${{ runner.os }}-
    +          key: playwright-${{ runner.os }}-${{ matrix.project }}-${{ hashFiles('package-lock.json') }}
    +          restore-keys: playwright-${{ runner.os }}-${{ matrix.project }}-
     
    -      - name: Install Playwright Chromium
    -        run: npx playwright install --with-deps chromium
    +      - name: Install Playwright browsers
    +        run: |
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            npm run e2e:install:all-browsers
    +          else
    +            npx playwright install --with-deps chromium
    +          fi
    +
    +      - name: Resolver projects e specs
    +        id: resolve
    +        run: |
    +          read -ra SPECS <<< "$INPUT_SPEC"
    +          for s in "${SPECS[@]}"; do
    +            [ -f "$s" ] || { echo "::error::spec não encontrado: $s"; exit 1; }
    +          done
    +          if [ "$INPUT_PROJECT" = "all-public" ]; then
    +            PROJECTS="--project=chromium-public --project=firefox-public --project=webkit-public"
    +          else
    +            PROJECTS="--project=$INPUT_PROJECT"
    +          fi
    +          echo "projects=$PROJECTS" >> "$GITHUB_OUTPUT"
    +          echo "specs=${SPECS[*]}" >> "$GITHUB_OUTPUT"
    +
    +      - name: Subir Vite (dev_server)
    +        if: ${{ matrix.dev_server }}
    +        run: |
    +          nohup npm run dev -- --port 8080 --strictPort > /tmp/vite.log 2>&1 &
    +          for _ in $(seq 1 90); do
    +            if curl -sf http://localhost:8080 >/dev/null; then exit 0; fi
    +            sleep 1
    +          done
    +          tail -n 100 /tmp/vite.log >&2; exit 1
    +
    +      - name: Dry-run (safe mode)
    +        if: ${{ matrix.safe_mode }}
    +        id: dryrun
    +        continue-on-error: true
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +          E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
    +          PROJECTS: ${{ steps.resolve.outputs.projects }}
    +          SPECS: ${{ steps.resolve.outputs.specs }}
    +        run: |
    +          # shellcheck disable=SC2086 # expansão intencional em argumentos
    +          PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/results.json \
    +          npx playwright test $SPECS $PROJECTS --reporter=list,json
    +
    +      - name: Classificar falha (visual vs real)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' }}
    +        id: classify
    +        run: |
    +          if find test-results -type f \( -name "*-diff.png" -o -name "*-actual.png" \) 2>/dev/null | grep -q .; then
    +            echo "kind=visual" >> "$GITHUB_OUTPUT"
    +          else
    +            echo "kind=real" >> "$GITHUB_OUTPUT"
    +          fi
    +
    +      - name: Abortar (falha não-visual)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'real' }}
    +        run: |
    +          echo "::error::Falha não é diferença visual — abortando rewrite de baselines. Corrija o erro real antes de atualizar snapshots."
    +          exit 1
    +
    +      - name: Nada a atualizar (safe mode passou)
    +        if: ${{ matrix.safe_mode && steps.dryrun.outcome == 'success' }}
    +        run: |
    +          echo "✅ Spec(s) já passam contra baselines atuais — nenhuma atualização necessária."
    +
    +      - name: Verificar auth state antes de regenerar baselines autenticados
    +        if: ${{ matrix.project == 'chromium-authed' && (!matrix.safe_mode || (steps.dryrun.outcome == 'failure' && steps.classify.outputs.kind == 'visual')) }}
    +        env:
    +          E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
    +        run: |
    +          if [ -z "$E2E_USER_EMAIL" ]; then
    +            echo "::error title=Auth credentials missing::E2E_USER_EMAIL não está configurado — regenerar baselines autenticados com estado de login vazio capturaria páginas não-autenticadas como baseline aprovado. Configure E2E_USER_EMAIL e E2E_USER_PASSWORD nos secrets do repositório."
    +            exit 1
    +          fi
    +          STORAGE="e2e/.auth/storageState.json"
    +          if [ -f "$STORAGE" ]; then
    +            AUTH_VALID=$(node -pe "
    +              const s = JSON.parse(require('fs').readFileSync('$STORAGE','utf8'));
    +              const hasCookies = s.cookies && s.cookies.length > 0;
    +              const hasSupabaseToken = (s.origins || []).some(function(o) {
    +                return Object.keys(o.localStorage || {}).some(function(k) {
    +                  return k.startsWith('sb-') && k.endsWith('-auth-token');
    +                });
    +              });
    +              hasCookies || hasSupabaseToken ? 'valid' : 'empty'

    Dismissed — false positive. If the rule is incorrect or no longer relevant, you can update the rule or its scope, or disable it in the Qodo portal: View rule.

    adm01-debug adm01-debug commented on Nov 02, 2026 22:10 UTC
    Author

    Último achado do Qodo (baixo/informativo): o trigger push que restaurei só dispara em branches: [main]; 5 dos 6 workflows originais (todos exceto calendar) disparavam em qualquer branch, com commit direto (sem PR). Isso é decisão deliberada, não lacuna: ao restaurar o auto-trigger optei por sempre abrir PR (mais seguro que o commit direto original — achado separado desta mesma review), e abrir PR automática em todo push de branch de feature seria ruído durante desenvolvimento ativo, não ganho. Restrito a main de propósito. Não vou expandir de novo para "qualquer branch" sem pedido explícito — ficaria perseguindo sugestão de severidade baixa sem fim.

    Resumo das 4 rodadas de review (Codex + Qodo) nesta PR: 4 bugs reais corrigidos (push-trigger perdido, colisão de branch na matriz, guarda de push-direto bypassável, trigger de policy removido sem cobertura, fetch-depth faltante), 2 falsos-positivos rejeitados com evidência, 2 limitações pré-existentes sinalizadas para decisão do dono (token de CI, gap do CodeQL).

    ---
    _Generated by Claude Code_

    adm01-debug adm01-debug commented on Nov 02, 2026 22:18 UTC
    Author

    Falha em "Edge Functions · Integration All" (SHA 6a3c118c) — não é desta PR.

    Timeout de 30s em 6 testes (intelligence-substitute-applied, magic-up-score — casos "input inválido") na suíte LIVE (tests/edge-functions/live/*), que chama as edge functions reais em produção. Esta PR não toca supabase/functions/ nem tests/edge-functions/ — o workflow edge-integration-all.yml também não foi alterado.

    Confirmado que é instabilidade pré-existente da suíte live, não regressão: o mesmo workflow já falhou em main antes desta PR (run 41524218467, SHA 09d7cdd3f8, merge da #3039) — lá foi health-check retornando 503 com latências de 15–24s em várias chamadas. Latências desse tamanho contra funções reais (cold start / rate limit do lado do Supabase) batem com o padrão dos dois runs.

    Sem fix a portar — não é um bug de código, é flakiness de infra da suíte live. Re-executei o job uma vez (rerun_failed_jobs); seguindo a PR até ficar verde ou até o dono decidir.

    Reviewers
    Assignees
    adm01-debug adm01-debug
    Labels
    risk: low confidence: 85.1% 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: 90.5% (HIGH) · Higher = larger blast radius
    90.5%
    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: 85.1% · Lower = rushed or shallow review
    85.1%
    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: 13.5% · Safe to merge
    13.5%