From 535a5b673488273166a5dee6381a677fcba6e299 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Fri, 19 Jun 2026 02:57:35 -0300 Subject: [PATCH] chore(db): allowlist accessTokens in check:db-rules (Rule #2 direct-import) The new src/lib/db/accessTokens.ts is consumed by direct "@/lib/db/accessTokens" imports (4 /api/cli/* routes + server/authz/accessTokenAuth.ts), never barrel-imported from localDb.ts (Hard Rule #2). Add it to INTENTIONALLY_INTERNAL so the db-rules gate (Fast Quality Gates) passes without re-exporting it (which would incentivize the forbidden barrel-import anti-pattern). --- scripts/check/check-db-rules.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/check/check-db-rules.mjs b/scripts/check/check-db-rules.mjs index 43b89c41e0..93a3371f5f 100644 --- a/scripts/check/check-db-rules.mjs +++ b/scripts/check/check-db-rules.mjs @@ -39,6 +39,7 @@ const HANDLERS_DIR = path.join(cwd, "open-sse/handlers"); // sem investigação — pode ser reserva de schema ou F2 pendente export const INTENTIONALLY_INTERNAL = new Set([ "_rowTypes", // type-only: 5 importers internos em db/ (AgentBridge/Inspector row types) + "accessTokens", // intentionally-internal: 4 rotas /api/cli/* (connect, whoami, tokens, tokens/[id]) + server/authz/accessTokenAuth.ts via import direto "@/lib/db/accessTokens" (Rule #2) "cleanup", // intentionally-internal: 3 API routes (purge-quota-snapshots, purge-call-logs, purge-detailed-logs) "cliToolState", // intentionally-internal: 14+ API routes em /api/cli-tools/*-settings "comboForecast", // intentionally-internal: src/lib/usage/comboForecast.ts