Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions scripts/check-edge-structured-logging.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ const FN_ROOT = "supabase/functions";
// ⚠️ Snapshot tirado em 2026-04-27. NÃO ADICIONAR novas entradas.
// Migrar uma edge para o logger SSOT remove-a daqui.
const LEGACY_ALLOWLIST = new Set([
"ai-recommendations","analyze-logo-colors","bi-copilot","bi-share-dossier",
"ai-recommendations","analyze-logo-colors","bi-copilot",
"bitrix-sync","block-ip-temporarily","categories-api","cleanup-notifications",
"cleanup-novelties","cnpj-lookup","collections-public-react","collections-watcher",
"cleanup-novelties","cnpj-lookup","collections-watcher",
"commemorative-dates","comparison-ai-advisor","comparison-price-watcher",
"comparisons-public-react","connection-tester","connections-auto-test",
"connection-tester","connections-auto-test",
"connections-health-check","connections-hub-audit","crm-db-bridge",
"detect-new-device","dropbox-list","e2e-cleanup","elevenlabs-scribe-token",
"elevenlabs-tts","expert-chat","external-db-bridge","external-db-inspect",
"favorites-watcher","force-global-logout",
"full-op-diagnostics","generate-ad-image","generate-ad-prompt","generate-mockup",
"generate-mockup-nanobanana","generate-product-seo","get-visitor-info",
"generate-product-seo","get-visitor-info",
"github-credentials-test","health-check","image-proxy",
"kit-ai-builder","kit-identity-suggest","kit-public-view","log-login-attempt",
"kit-ai-builder","kit-identity-suggest","log-login-attempt",
"magic-up-score","manage-users","market-intelligence-insights","materials-api",
"mcp-keys-issue","mcp-keys-revoke","mcp-keys-rotate","mcp-keys-update",
"mcp-server","ownership-audit","ownership-repair","process-queue",
"process-scheduled-reports","product-webhook","quote-followup-reminders",
"quote-public-view","quote-sync","rate-limit-check","rls-audit",
"quote-sync","rate-limit-check","rls-audit",
"rls-integration-tests","rls-matrix-export","secrets-manager","semantic-search",
"send-digest","send-notification","send-scheduled-reports",
"send-transactional-email","step-up-verify","sync-quote-bitrix","tests",
"trends-insights","validate-access","verify-email","visual-search",
"voice-agent","webhook-dispatcher","webhook-inbound",
]);

const SNAPSHOT_SIZE = 84;
const SNAPSHOT_SIZE = 78;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Set snapshot size to the actual allowlist length

After this removal the allowlist contains 76 entries, but the new ceiling is 78. Since the growth check only fails when LEGACY_ALLOWLIST.size - SNAPSHOT_SIZE > 0, the next two PRs could add functions back to LEGACY_ALLOWLIST and still pass this gate, contrary to the "NÃO ADICIONAR" invariant this script is meant to enforce. Set this to the current allowlist size so any growth is caught immediately.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

P2: Set SNAPSHOT_SIZE to the current allowlist size (76). Keeping it at 78 leaves room for two new legacy entries to be added without tripping the growth guard, which weakens the "NÃO ADICIONAR" enforcement.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/check-edge-structured-logging.mjs, line 54:

<comment>Set `SNAPSHOT_SIZE` to the current allowlist size (76). Keeping it at 78 leaves room for two new legacy entries to be added without tripping the growth guard, which weakens the "NÃO ADICIONAR" enforcement.</comment>

<file context>
@@ -26,32 +26,32 @@ const FN_ROOT = "supabase/functions";
 ]);
 
-const SNAPSHOT_SIZE = 84;
+const SNAPSHOT_SIZE = 78;
 
 function listEdgeFunctions() {
</file context>
Suggested change
const SNAPSHOT_SIZE = 78;
const SNAPSHOT_SIZE = 76;
Fix with Cubic


function listEdgeFunctions() {
return readdirSync(FN_ROOT)
Expand Down Expand Up @@ -126,4 +126,4 @@ function main() {
process.exit(exit);
}

main();
main();
Loading
Loading