Skip to content

chore(cleanup): remover refs órfãs a quote-public-view (Onda 3)#190

Merged
adm01-debug merged 3 commits into
mainfrom
cleanup/onda-3-remove-orphan-refs
May 14, 2026
Merged

chore(cleanup): remover refs órfãs a quote-public-view (Onda 3)#190
adm01-debug merged 3 commits into
mainfrom
cleanup/onda-3-remove-orphan-refs

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented May 14, 2026

Onda 3 do hardening pré-prod. Limpa loose ends pós-deleção das edges
quote-public-view (B-9) e useFavoriteReactions (B-5) — esses arquivos
já estavam deletados em sessões anteriores, mas referências mortas
permaneciam em 4 arquivos do repo.

Mudanças:

  • supabase/config.toml: bloco [functions.quote-public-view] removido
  • supabase/functions/_shared/edge-authz-manifest.ts: entrada removida
  • supabase/functions/_shared/cors-snapshot.json: entrada removida
  • supabase/functions/_shared/credentials.ts: comentário atualizado

Validações:

  • Edge function já era HTTP 404 no Supabase prod
  • Hook useFavoriteReactions não é importado em nenhum lugar
  • JSON do cors-snapshot continua parseável

Risco: baixo. Tempo: ~20min.

Detalhes: docs/hardening/ONDA-3-REMOVE-ORPHANS.md


Summary by cubic

Remove referências órfãs à edge quote-public-view e ao hook useFavoriteReactions para concluir a Onda 3 de hardening pré-prod. Cobre B-9 e B-5 (parcial — refs), sem impacto de runtime.

  • Refactors
    • Remove quote-public-view de supabase/config.toml, edge-authz-manifest.ts e cors-snapshot.json.
    • Atualiza comentário em credentials.ts (remove menção).
    • Adiciona docs/hardening/ONDA-3-REMOVE-ORPHANS.md.

Written for commit b5cd1ab. Summary will update on new commits.

Summary by CodeRabbit

Release Notes

  • Documentation

    • Documentação completa da Onda 3 com registro de validações e impacto das mudanças.
  • Refactor

    • Remoção de referências órfãs em configurações de autorização.
    • Limpeza de entradas desnecessárias em snapshots de configuração.
  • Chores

    • Ajustes nas configurações do Supabase.
    • Atualização de comentários em documentação técnica interna.

Review Change Stack

Onda 3 do plano de hardening pré-prod. Limpa loose ends pós-deleção
das edges quote-public-view (B-9) e useFavoriteReactions (B-5).

Refs mortas removidas:
- supabase/config.toml: bloco [functions.quote-public-view]
- supabase/functions/_shared/edge-authz-manifest.ts: entrada do manifest
- supabase/functions/_shared/cors-snapshot.json: entrada do snapshot CORS
- supabase/functions/_shared/credentials.ts: comentário documentação

Validações:
- Edge function quote-public-view já era HTTP 404 no Supabase prod
- Hook useFavoriteReactions não é importado em nenhum lugar
- JSON do cors-snapshot continua parseável
- Estrutura TOML do config.toml válida

Tempo: ~20min. Risco: baixo (apenas refs mortas).
Bloqueadores: B-5 e B-9 (parcial — refs).

Detalhes: docs/hardening/ONDA-3-REMOVE-ORPHANS.md
Part of Onda 3 — completing the push that github_push_files truncated.
…comment

Part of Onda 3 — completing the push that github_push_files truncated.
Copilot AI review requested due to automatic review settings May 14, 2026 13:36
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
promo-gifts Ready Ready Preview, Comment May 14, 2026 1:36pm

@supabase
Copy link
Copy Markdown

supabase Bot commented May 14, 2026

This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Walkthrough

PR realiza limpeza de referências órfãs à edge function quote-public-view removendo-a de configuração Supabase, manifests de autorização e snapshots CORS; documenta a onda com mudanças, validações e impacto; e adiciona comparisons-public-react ao manifest.

Changes

Onda 3 — Remoção de Referências Órfãs

Layer / File(s) Summary
Documentação da Onda 3
docs/hardening/ONDA-3-REMOVE-ORPHANS.md
Cabeçalho, contexto dos bloqueadores resolvidos, enumeração das mudanças executadas (remoção em config.toml, cors-snapshot.json, edge-authz-manifest.ts, credentials.ts), validações de parse e ausência de referências remanescentes, tabela de impacto (redução de edges e refs mortas).
Remoção de configuração e manifests
supabase/config.toml, supabase/functions/_shared/cors-snapshot.json, supabase/functions/_shared/edge-authz-manifest.ts, supabase/functions/_shared/credentials.ts
Remove seção [functions.quote-public-view] e ajusta enable_anonymous_sign_ins = false em config.toml; remove entrada CORS de quote-public-view em cors-snapshot.json; remove entrada quote-public-view e adiciona comparisons-public-react como "public" no EDGE_AUTHZ_MANIFEST; atualiza comentário de documentação em credentials.ts refletindo edge functions futuras menores.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • adm01-debug/Promo_Gifts#131: Complementa a limpeza removendo o stub da edge function supabase/functions/quote-public-view/index.ts.
  • adm01-debug/Promo_Gifts#134: Adiciona suporte no workflow "delete-orphan-edges" para deletar edges adicionais via extraEdges, incluindo quote-public-view.
  • adm01-debug/Promo_Gifts#118: Atualiza scripts/gen-edges-readme.mjs para ler EDGE_AUTHZ_MANIFEST diretamente e regenerar info de orfandade/categorização.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed O título descreve claramente a mudança principal: remover referências órfãs a uma edge function (quote-public-view) como parte da Onda 3 de hardening pré-prod.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup/onda-3-remove-orphan-refs

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review


P2 Badge Keep the CORS snapshot totals in sync

After removing this snapshot entry, the metadata at the top of the same JSON still says total: 83 and counts.shared: 83, while the functions array now contains only 82 entries. Consumers such as cors-audit will report incorrect totals, and the generated snapshot check (node scripts/build-cors-snapshot.mjs --check) now catches this internal mismatch; please regenerate the snapshot or update the counts together with the deletion.

ℹ️ About Codex in GitHub

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".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Limpa referências órfãs a quote-public-view após a remoção da edge function, mantendo manifest, config, snapshot CORS e documentação de hardening alinhados ao estado atual.

Changes:

  • Remove quote-public-view do config.toml, manifest de autorização e snapshot CORS.
  • Atualiza comentário em credentials.ts.
  • Adiciona documentação da Onda 3 de limpeza/hardening.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
supabase/functions/_shared/edge-authz-manifest.ts Remove a entrada de autorização da edge removida.
supabase/functions/_shared/credentials.ts Remove menção obsoleta a quote-public-view em comentário.
supabase/functions/_shared/cors-snapshot.json Remove a entrada CORS da edge removida.
supabase/config.toml Remove o bloco de configuração da edge removida.
docs/hardening/ONDA-3-REMOVE-ORPHANS.md Documenta escopo, validações e impacto da limpeza.
Comments suppressed due to low confidence (3)

docs/hardening/ONDA-3-REMOVE-ORPHANS.md:39

  • This says .tmp-write-probe.md was deleted, but the file is still present at the repository root and is not part of this diff. Either include the deletion in this PR or update this section/impact table so the hardening record does not claim a cleanup that did not happen.
### 5. `.tmp-write-probe.md`
Deletado (artefato do diagnóstico de permissões GitHub PAT durante Onda 1).

docs/hardening/ONDA-3-REMOVE-ORPHANS.md:55

  • The impact row overstates the cleanup as 0 dead quote-public-view refs. The current tree still has active, non-historical docs that list this edge as available/credential-dependent (for example docs/EDGE_FUNCTIONS.md:48 and docs/RUNBOOK_CONNECTIONS.md:177), so either those refs should be cleaned up too or this row should scope the claim to src/ and supabase/functions/.
| Refs mortas a quote-public-view | 4 | 0 |

docs/hardening/ONDA-3-REMOVE-ORPHANS.md:53

  • These manifest counts do not match the actual EDGE_AUTHZ_MANIFEST: after this deletion the Públicas por design section still contains 19 entries (and had 20 before), not 15/16. Please update the numbers or clarify a different counting scope.
| Edges públicas no manifest | 16 | 15 |

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 498 to 499
{
"name": "quote-sync",
- **B-5:** `src/hooks/useFavoriteReactions.ts` chamava edge function `favorites-public-react` que não existe
- **B-9:** `supabase/functions/quote-public-view/` era stub que retornava 501 com `verify_jwt=false`, expondo metadata pra reconnaissance de bots

Em sessões anteriores, dois trabalhos parciais já tinham sido feitos:
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@supabase/config.toml`:
- Line 32: A mudança do flag enable_anonymous_sign_ins = false altera
comportamento global de autenticação; reverta essa alteração neste PR ou, se a
intenção for mantê-la, adicione validação e documentação explícita dos fluxos
que dependem de sessões anônimas (testes de login anônimo, listas de endpoints
afetados) antes do merge; localize a chave enable_anonymous_sign_ins no arquivo
supabase/config.toml e restaure o valor anterior ou adicione um comentário e
checklist de validação dos fluxos anônimos conforme necessário.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 09f67622-0402-41d1-9221-a0e95429404b

📥 Commits

Reviewing files that changed from the base of the PR and between bc080b6 and b5cd1ab.

📒 Files selected for processing (5)
  • docs/hardening/ONDA-3-REMOVE-ORPHANS.md
  • supabase/config.toml
  • supabase/functions/_shared/cors-snapshot.json
  • supabase/functions/_shared/credentials.ts
  • supabase/functions/_shared/edge-authz-manifest.ts

Comment thread supabase/config.toml
[auth]
enable_signup = false
enable_anonymous_sign_ins = false
enable_anonymous_sign_ins = false No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Mudança de política global de auth fora do escopo deste PR.

A alteração da Line 32 (enable_anonymous_sign_ins = false) muda comportamento de autenticação em produção e pode quebrar fluxos que dependem de sessão anônima. Como o objetivo aqui é cleanup de referências órfãs, recomendo reverter este ponto neste PR ou documentar/validar explicitamente os fluxos anônimos afetados antes do merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/config.toml` at line 32, A mudança do flag enable_anonymous_sign_ins
= false altera comportamento global de autenticação; reverta essa alteração
neste PR ou, se a intenção for mantê-la, adicione validação e documentação
explícita dos fluxos que dependem de sessões anônimas (testes de login anônimo,
listas de endpoints afetados) antes do merge; localize a chave
enable_anonymous_sign_ins no arquivo supabase/config.toml e restaure o valor
anterior ou adicione um comentário e checklist de validação dos fluxos anônimos
conforme necessário.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="supabase/functions/_shared/cors-snapshot.json">

<violation number="1" location="supabase/functions/_shared/cors-snapshot.json:667">
P2: Removing the `quote-public-view` entry from the `functions` array without updating the top-level `total` and `counts.shared` fields leaves the snapshot metadata inconsistent. If `scripts/build-cors-snapshot.mjs --check` validates these counts in CI, this will break the build. Either regenerate the snapshot via the build script or manually decrement the stale counters.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

@@ -495,14 +495,6 @@
"allowMethods": null,
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Removing the quote-public-view entry from the functions array without updating the top-level total and counts.shared fields leaves the snapshot metadata inconsistent. If scripts/build-cors-snapshot.mjs --check validates these counts in CI, this will break the build. Either regenerate the snapshot via the build script or manually decrement the stale counters.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At supabase/functions/_shared/cors-snapshot.json, line 667:

<comment>Removing the `quote-public-view` entry from the `functions` array without updating the top-level `total` and `counts.shared` fields leaves the snapshot metadata inconsistent. If `scripts/build-cors-snapshot.mjs --check` validates these counts in CI, this will break the build. Either regenerate the snapshot via the build script or manually decrement the stale counters.</comment>

<file context>
@@ -672,4 +664,4 @@
     }
   ]
-}
+}
\ No newline at end of file
</file context>
Fix with Cubic

@adm01-debug adm01-debug merged commit ffe454d into main May 14, 2026
25 of 29 checks passed
@adm01-debug adm01-debug deleted the cleanup/onda-3-remove-orphan-refs branch May 14, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants