Skip to content

[CLOSED] Claude/faxina rebased 2026-05-22 — superseded, deletes regenerated audit/internal-schema.tsv#160

Merged
adm01-debug merged 11 commits into
mainfrom
claude/faxina-rebased-2026-05-22
May 23, 2026
Merged

[CLOSED] Claude/faxina rebased 2026-05-22 — superseded, deletes regenerated audit/internal-schema.tsv#160
adm01-debug merged 11 commits into
mainfrom
claude/faxina-rebased-2026-05-22

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

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

Fechado — branch obsoleto e destrutivo

Este PR de faxina (−21.877 linhas, 65 arquivos removidos) inclui a deleção de audit/internal-schema.tsv, que foi regenerado no commit 8e527e31 (PR #158, merged) com 278 tabelas atualizadas do banco vivo (vs 139 tabelas do snapshot antigo).

Motivos do fechamento:

  1. status=removed em audit/internal-schema.tsv — reverteria o entregável MELHORIAS #158 (278→0 tabelas)
  2. Branch diverged (ahead 11, behind 13 do main) — conflito irreconciliável sem rebase manual
  3. draft=true, sem aprovação humana, sem reviewers atribuídos
  4. Deleções incluem testes e2e e artefatos de auditoria que podem ser necessários

Se a faxina for necessária, reabrir com branch rebased no main atual e excluindo audit/internal-schema.tsv e scripts/gen-internal-schema.mjs do diff.

claude added 9 commits May 22, 2026 09:53
- AUDITORIA_REDEPLOY_PROMO_GIFTS_2026-05-13_15-32 (1).md was a stale
  browser-download duplicate (note the " (1)" suffix); no consumers.
- src/test/setup.ts was orphan — vitest.config.ts uses tests/setup.ts.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
audit/db-frontend-coverage.json (9.7k lines) and audit/internal-schema.tsv
(1.5k lines) are local audit outputs. .gitignore already declared the
intent — "Outputs de auditoria/triage — gerados localmente, não devem
versionar" — but these two slipped through. Adds explicit patterns and
removes them from the index (filesystem copies retained for local devs).

The hand-authored audit/ANALISE_BACKEND_SENIOR_2026-05-22.md stays tracked.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
build:dev was running "node scripts/generate-health.mjs && vite build", but
the script does not exist anywhere in git history reachable from this
branch — so npm run build:dev failed immediately. No code reads the
public/api/health.json the script was meant to emit, so removing the
reference is safe. Also drops the orphan .gitignore entry that paired
with the missing script.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
tests/e2e/ contained 40+ test files plus committed runtime artifacts that
were never executing:
- 9 specs use @playwright/test but playwright.config.ts uses testDir:'./e2e'
  (not tests/e2e) — never picked up.
- 31 are vitest files but vitest.config.ts explicitly excluded
  'tests/e2e/**' to avoid a worker deadlock from accidentally loading the
  Playwright files alongside them — so these never ran either.
- artifacts/ subtree was generated HTML/JSON snapshots checked in by past
  test runs.

Nothing outside tests/e2e/ referenced anything inside it (only vitest's
own exclude pattern + its explanatory comment). Baselines have zero
entries for this path, so no baseline churn.

Drops the now-unnecessary exclude entry from vitest.config.ts.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
- scripts/generate-theme-report.ts — superseded duplicate of
  scripts/generate-theme-report.mjs (the .mjs is what
  e2e/theme-validation.spec.ts and package.json:test:theme-validation
  actually invoke).
- scripts/test-external-db.ts — strict subset of
  scripts/verify-external.ts (same purpose, smaller assertion set).

Both files were unreferenced by package.json, scripts, configs, CI, or
docs. Other unreferenced dev utilities (CORS codemods, list-users) are
intentionally kept as ad-hoc manual tools.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
src/hooks/stock/index.ts contained only a single-line comment with no
exports. Zero importers across src/ and tests/. Removing the dead barrel
file keeps the directory clean (stockAlerts.ts and stockFetcher.ts
import each other and from src/hooks/products/ directly, not via the
barrel).

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
generateKitOgImage was only referenced by .lovable/memory feature notes
pointing at a PublicKitViewPage that does not exist in this codebase.
Verified zero imports (static or dynamic) anywhere in src/, tests/, e2e/,
and supabase/. Safe to remove.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
Zero importers (static or dynamic) anywhere in src/, tests/, e2e/, or
supabase/. The active kit PDF export logic — if any — lives elsewhere;
this file was dead.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
The eslint baseline gate (.eslint-baseline.json, 2026-05-14) is unaware
of two lint errors introduced into main by later commits, so any new
push triggers them as "new":

- src/contexts/AuthContext.test.tsx:38 — @typescript-eslint/
  consistent-type-imports flagged \`typeof import('@/services/authService')\`
  inside a vi.mock importOriginal call. Hoisted the module type as a
  type-only \`import type * as AuthServiceModule\` and used
  \`typeof AuthServiceModule\`.

- src/tests/AdminLayout.test.tsx:58 — @typescript-eslint/no-explicit-any
  flagged \`cb?: any\` inside a then() supabase-client mock. Replaced
  with the concrete callback signature \`(value: { data: never[]; error: null }) => void\`.

Neither file was touched semantically; both were blocking pre-push only
because the baseline predates the upstream churn.

https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
Copilot AI review requested due to automatic review settings May 23, 2026 16:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6e98517c-1de5-4eb8-a5a9-53ddaecec84b

📥 Commits

Reviewing files that changed from the base of the PR and between 4c633c5 and 19aec16.

⛔ Files ignored due to path filters (1)
  • audit/internal-schema.tsv is excluded by !**/*.tsv
📒 Files selected for processing (64)
  • .gitignore
  • audit/db-frontend-coverage.json
  • docs/historico/AUDITORIA_REDEPLOY_PROMO_GIFTS_2026-05-13_15-32.md
  • scripts/generate-theme-report.ts
  • scripts/test-external-db.ts
  • src/contexts/AuthContext.test.tsx
  • src/lib/kit-og-image.ts
  • src/test/setup.ts
  • src/utils/kitPdfGenerator.ts
  • tests/e2e/admin-module.test.ts
  • tests/e2e/analytics-bi.test.ts
  • tests/e2e/artifacts/compare/viewer/audit-snapshot.html
  • tests/e2e/artifacts/compare/viewer/initial-comparison-view-styles.json
  • tests/e2e/artifacts/compare/viewer/initial-comparison-view.html
  • tests/e2e/artifacts/compare/viewer/initial-view.html
  • tests/e2e/artifacts/quotes/audit-report/builder-full.html
  • tests/e2e/artifacts/quotes/ci-final-resilient/builder-snapshot.html
  • tests/e2e/artifacts/quotes/ci-final/step-items.html
  • tests/e2e/artifacts/quotes/ci-report/identificacao/current.html
  • tests/e2e/artifacts/quotes/ci-report/itens/current.html
  • tests/e2e/artifacts/quotes/ci-visual/builder-layout.html
  • tests/e2e/artifacts/quotes/full-cycle/audit-snapshot-conditions.html
  • tests/e2e/artifacts/quotes/full-cycle/resilience-layout-stability.html
  • tests/e2e/artifacts/quotes/visual/quote-builder-initial.html
  • tests/e2e/artifacts/quotes/visual/step-identification.html
  • tests/e2e/auth-flow.test.tsx
  • tests/e2e/carts-excellence.spec.ts
  • tests/e2e/catalog-price-freshness-badge.test.tsx
  • tests/e2e/compare-exhaustive.test.ts
  • tests/e2e/compare-exhaustive.test.tsx
  • tests/e2e/compare-module.test.ts
  • tests/e2e/compare-module.test.tsx
  • tests/e2e/compare-ultra.test.ts
  • tests/e2e/compare-ultra.test.tsx
  • tests/e2e/compare-viewer-a11y.test.tsx
  • tests/e2e/compare-visual.test.ts
  • tests/e2e/compare-visual.test.tsx
  • tests/e2e/cross-cutting-regression.test.ts
  • tests/e2e/favorites-module.test.ts
  • tests/e2e/favorites-ui.test.tsx
  • tests/e2e/infra-banners-prod.test.tsx
  • tests/e2e/kit-builder-flow.test.ts
  • tests/e2e/mockup-regressions.spec.ts
  • tests/e2e/navigation-layout.test.tsx
  • tests/e2e/new-quote-advanced.test.tsx
  • tests/e2e/new-quote-cycle.test.tsx
  • tests/e2e/new-quote-exhaustive.test.ts
  • tests/e2e/new-quote-exhaustive.test.tsx
  • tests/e2e/new-quote-full-audit.test.tsx
  • tests/e2e/new-quote-resilience.test.tsx
  • tests/e2e/performance.test.ts
  • tests/e2e/phase1-foundation-types.test.ts
  • tests/e2e/phase2-filters-catalog.test.ts
  • tests/e2e/phase3-detail-experience.test.ts
  • tests/e2e/phase4-admin-grid.test.ts
  • tests/e2e/phase5-propagation.test.ts
  • tests/e2e/products-catalog.test.ts
  • tests/e2e/profile-user.test.ts
  • tests/e2e/quote-resilience.test.ts
  • tests/e2e/quotes-flow.test.ts
  • tests/e2e/seller-carts.test.ts
  • tests/e2e/tools-simulator.test.ts
  • tests/e2e/ui-components.test.tsx
  • vitest.config.ts

Walkthrough

PR remove sistematicamente testes E2E, utilitários de geração (PDF/OG-image), scripts de validação, setup de teste e documentação de auditoria. Reajusta .gitignore e vitest.config.ts para refletir mudança de estratégia de testes.

Changes

Limpeza de testes e utilitários

Layer / File(s) Summary
Configuração de build e auditoria
.gitignore, vitest.config.ts
.gitignore adiciona ignorância de audit/db-frontend-coverage.json e audit/internal-schema.tsv, remove regra para public/api/health.json. vitest.config.ts remove exclusão explícita de tests/e2e/**, permitindo que testes E2E sejam descobertos.
Remoção de testes E2E
tests/e2e/products-catalog.test.ts, src/contexts/AuthContext.test.tsx
Remoção completa de products-catalog.test.ts (suites de filtro, ordenação, favoritos, comparação e paginação). Ajuste menor de ordem de imports de tipos em AuthContext.test.tsx.

Nota sobre removals em massa (sem ranges capturados em detalhe):

O diff remove integralmente estes arquivos conforme raw_summary:

  • Scripts: scripts/generate-theme-report.ts, scripts/test-external-db.ts
  • Utilitários: src/lib/kit-og-image.ts (gerador de OG images via Canvas), src/utils/kitPdfGenerator.ts (gerador de PDF com jspdf), src/test/setup.ts (mock de window.matchMedia)
  • Testes E2E (40+ arquivos): admin-module.test.ts, analytics-bi.test.ts, auth-flow.test.tsx, carts-excellence.spec.ts, compare-*.test.*, favorites-*.test.*, kit-builder-flow.test.ts, new-quote-*.test.*, performance.test.ts, phase[1-5]-*.test.ts, quote-resilience.test.ts, quotes-flow.test.ts, tools-simulator.test.ts, ui-components.test.tsx e todos correlatos
  • Artefatos de teste (snapshots HTML/JSON): tests/e2e/artifacts/**/*.html e tests/e2e/artifacts/**/*.json
  • Documentação: docs/historico/AUDITORIA_REDEPLOY_PROMO_GIFTS_2026-05-13_15-32.md (auditoria técnica completa com bloqueadores, secrets e rollback)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Justificativa: Embora o volume de linhas removidas seja alto (~5700 linhas), a natureza é predominantemente remoção homogênea (testes e artefatos). A lógica essencial mudou pouco: reconfiguração de vitest.config e .gitignore. Impacto: verifica-se se remoções são intencionais (depreciação de E2E?), se há dependências quebradas e se secrets/dados sensíveis não ficaram em branches de release.

✨ 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 claude/faxina-rebased-2026-05-22

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

@adm01-debug
Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

@adm01-debug adm01-debug marked this pull request as draft May 23, 2026 16:12
Copy link
Copy Markdown
Contributor

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

No issues found across 68 files

Re-trigger cubic

Copy link
Copy Markdown
Contributor

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

This PR primarily cleans up legacy/orphaned “E2E” test files (previously living under tests/e2e/**), removes a few unused utilities/scripts, and simplifies local/dev build/test configuration after the rebase.

Changes:

  • Removed the tests/e2e/** tree (Vitest-based “E2E” suites and some Playwright leftovers) and updated Vitest config accordingly.
  • Deleted unused kit PDF/OG image helpers and a couple of obsolete scripts/artifacts.
  • Simplified build:dev and updated .gitignore for new audit outputs.

Reviewed changes

Copilot reviewed 66 out of 68 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vitest.config.ts Drops the tests/e2e/** exclusion now that the folder is removed.
src/tests/AdminLayout.test.tsx Formatting/typing tweaks for mocks and test strings.
src/contexts/AuthContext.test.tsx Refactors mock typing for importOriginal (currently introduces a TS type issue).
package.json Removes scripts/generate-health.mjs from build:dev.
.gitignore Stops ignoring the old health output path; adds audit output ignores.
tests/e2e/** (deleted) Removes legacy “E2E” test suites (Vitest + some Playwright) and artifacts under tests/e2e.
src/utils/kitPdfGenerator.ts (deleted) Removes unused kit PDF generator utility.
src/lib/kit-og-image.ts (deleted) Removes unused OG image generator utility.
scripts/test-external-db.ts (deleted) Removes obsolete external DB connectivity test script.
scripts/generate-theme-report.ts (deleted) Removes old TS version of theme report generator (repo uses .mjs).

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

Comment on lines 38 to 40
vi.mock('@/services/authService', async (importOriginal) => {
const actual = await importOriginal<typeof import('@/services/authService')>();
const actual = await importOriginal<typeof AuthServiceModule>();
return {
Copilot AI added 2 commits May 23, 2026 16:22
…-2026-05-22

# Conflicts:
#	audit/internal-schema.tsv
#	docs/historico/AUDITORIA_REDEPLOY_PROMO_GIFTS_2026-05-13_15-32.md
#	src/tests/AdminLayout.test.tsx
#	tests/e2e/compare-exhaustive.test.tsx
#	tests/e2e/compare-module.test.tsx
#	tests/e2e/compare-ultra.test.tsx
#	tests/e2e/compare-viewer-a11y.test.tsx
#	tests/e2e/compare-visual.test.tsx
#	tests/e2e/new-quote-advanced.test.tsx
#	tests/e2e/new-quote-cycle.test.tsx
#	tests/e2e/new-quote-exhaustive.test.tsx
#	tests/e2e/new-quote-full-audit.test.tsx
#	tests/e2e/new-quote-resilience.test.tsx
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
we-dream-big Ready Ready Preview, Comment May 23, 2026 4:25pm

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

@copilot resolve the merge conflicts in this pull request

Conflitos resolvidos e branch atualizada com origin/main no commit 01d0caa; também corrigi um ajuste de lint pós-merge no commit 19aec16 para destravar o push.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.ipify.org
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/promo-gifts-v4/promo-gifts-v4/node_modules/.bin/vitest run (dns block)
  • doufsxqlfjyuvxuezpln.supabase.co
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/promo-gifts-v4/promo-gifts-v4/node_modules/.bin/vitest run (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@adm01-debug adm01-debug marked this pull request as ready for review May 23, 2026 20:42
@adm01-debug adm01-debug merged commit 104de66 into main May 23, 2026
5 of 6 checks passed
Copy link
Copy Markdown
Contributor

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

No issues found across 65 files

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Re-trigger cubic

adm01-debug added a commit that referenced this pull request May 23, 2026
Gate check:toast-leaks estava VERMELHO no main (78 "novas" ocorrências).
Causa: keyOf = ${file}::${line}; baseline de 2026-05-18 ficou desalinhado
após a faxina #160 (2026-05-23, -21.877 linhas) deslocar os números de
linha. Das 78: 13 drift puro de linha + restantes de 27 arquivos de
features pós-18/05 (kit-builder, intelligence, permissions, CRM, etc.).
Nenhuma introduzida pelas Etapas 9-13.

Regenera via UPDATE_BASELINE=1 (procedimento documentado no script).
176->173 entries: a #160 removeu mais toasts técnicos (código morto)
do que features novas adicionaram. check:toast-leaks volta a VERDE.

Validado contra main 80da684 (pós #176/#177): gate VERDE, 0 novas.

Divida registrada: os 173 toasts usam error.message cru — limpeza
retroativa fica como backlog dedicado.
adm01-debug added a commit that referenced this pull request May 23, 2026
Gate check:toast-leaks estava VERMELHO no main (78 "novas" ocorrências).
Causa: keyOf = ${file}::${line}; baseline de 2026-05-18 ficou desalinhado
após a faxina #160 (2026-05-23, -21.877 linhas) deslocar os números de
linha. Das 78: 13 drift puro de linha + restantes de 27 arquivos de
features pós-18/05 (kit-builder, intelligence, permissions, CRM, etc.).
Nenhuma introduzida pelas Etapas 9-13.

Regenera via UPDATE_BASELINE=1 (procedimento documentado no script).
176->173 entries: a #160 removeu mais toasts técnicos (código morto)
do que features novas adicionaram. check:toast-leaks volta a VERDE.

Validado contra main 80da684 (pós #176/#177): gate VERDE, 0 novas.

Divida registrada: os 173 toasts usam error.message cru — limpeza
retroativa fica como backlog dedicado.
@adm01-debug adm01-debug changed the title Claude/faxina rebased 2026 05 22 [CLOSED] Claude/faxina rebased 2026-05-22 — superseded, deletes regenerated audit/internal-schema.tsv May 24, 2026
adm01-debug added a commit that referenced this pull request May 24, 2026
Restores the canonical 278-table TSV (md5 84b87a12316947c9c0f070a6c5dd2a01)
originally committed in 8e527e3 and deleted when PR #160 was merged.
Generated via scripts/gen-internal-schema.mjs from live DB doufsxqlfjyuvxuezpln.
@adm01-debug adm01-debug deleted the claude/faxina-rebased-2026-05-22 branch May 24, 2026 19:02
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.

4 participants