# Graph Report - portalonsms2  (2026-07-23)

## Corpus Check
- 293 files · ~444,302 words
- Verdict: corpus is large enough that graph structure adds value.

## Summary
- 3160 nodes · 7538 edges · 189 communities (124 shown, 65 thin omitted)
- Extraction: 99% EXTRACTED · 1% INFERRED · 0% AMBIGUOUS · INFERRED: 66 edges (avg confidence: 0.78)
- Token cost: 0 input · 0 output

## Graph Freshness
- Built from commit: `5f1d906e`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).

## Community Hubs (Navigation)
- Storage Interface Methods
- Database Storage Implementation
- NPM Runtime Dependencies
- Badge and Card UI
- Roles and Permissions
- Schema Status Enums
- Accordion and Dialog UI
- Account Management Page
- Button and Alert Dialog UI
- Reporting and Monitoring Types
- AI Panel and Tabs UI
- App Routing and Auth Context
- Infobip API Integration
- Build Tooling Dependencies
- Template Utilities and Form UI
- Project Memory Notes
- Sender Profile and Notices UI
- Infobip Sender Storage
- Sidebar Layout UI
- Campaign Storage Methods
- CLAUDE.md Documentation
- Multi-BM Validated Templates UI
- WABA Template Storage
- Auth Middleware and Checknumber
- HubSpot Auth and Timeline
- AI Agent Orchestration
- admin-senders.tsx
- Server Bootstrap and Blocklist
- Campaign Chat UI
- Multi-BM Dispatch Logic
- DB Cleanup and Seed Scripts
- Bug: sistema de auto-registro de webhook nunca funcionou
- User and Sender Assignment Storage
- Multi-BM Submission Storage
- Admin Logs UI
- Media Storage Utilities
- RCS API Client
- TypeScript Configuration
- Menubar UI Component
- Shadcn UI Config
- Sidebar and Branding Context
- Toast and Notice System
- Chart UI Component
- HubSpot Action Sync
- Branding Storage Methods
- Button, Calendar, Pagination UI
- Multi-BM Template Storage
- Infobip Config Storage
- WABA Message Storage
- Carousel UI Component
- Chip Provisioning Clients
- Multi-BM Health Sync
- Business Manager Storage
- HubSpot Dispatch Queue Storage
- AI Conversation Storage
- WA Filter Batch Storage
- Multi-BM Dashboard UI
- Toast UI Component
- BM Sender Storage
- Chip Activation Storage
- HubSpot Connection Storage
- RCS Sender Storage
- API Token Storage
- Multi-BM Webhook Tests
- Error Boundary Component
- utils.ts
- Context Menu UI
- Dropdown Menu UI
- Knowledge Base Storage
- Multi-BM Message Storage
- RCS Config Storage
- RCS Message Storage
- Multi-BM Template Cluster Tests
- scripts
- dispatch
- Activity Log Storage
- Breadcrumb UI Component
- Drawer UI Component
- Navigation Menu UI
- AiConversationMessage
- Account Service Balance Storage
- HubSpot Execute Diagnostics
- Blocklist Term Storage
- Status Mapping Storage
- AI Client Settings Storage
- Vendor Mask Exposure Tests
- loadtest-multibm.ts
- File Upload Hook
- Multi-BM Validated Template Storage
- vendor-mask.ts
- Template Media Storage
- AI Agent Safeguards Tests
- Multi-BM Marketing Dispatch Tests
- OTP Input UI Component
- Column Keyword Storage
- toggle-group.tsx
- AI Agent Config Storage
- HubSpot Alert Config Storage
- Multi-BM Alert Config Storage
- Multi-BM Config Storage
- multibmDispatchResume.test.ts
- vite.ts
- whatsapp-template-preview.tsx
- AI Conversation Messages
- HubSpot Timeline Template Storage
- Object Uploader Component
- multibmDispatchPerContactParams.test.ts
- HubSpot Action Registration
- Sender Stats Queries
- dispatch
- fileSignatureValidation.test.ts
- User & Service Queries
- Template Preset Storage
- Build Script Allowlist
- Credit Transactions
- freeform-send-guard.md
- segmented-control.tsx
- Infobip Template Header Rule
- mailer.ts
- Production Deploy Script
- Dev Deploy Script
- Post-Merge Hook Script
- HubspotAlertState
- multibmCampaignCreationAtomic.test.ts
- multibmPauseResumeCancel.test.ts
- AccountServiceBalance
- TemplateGeneratorConfig
- TemplatePreset
- ProvidersTab
- urlSecurity.test.ts
- multibmRateLimitSharedAcrossCampaigns.test.ts
- drawer.tsx
- ClientBusinessProfile
- multibmValidateGuard.test.ts
- multibmDailyLimitByBm.test.ts
- multibmDistributionStrategy.test.ts
- multibmHealthSyncBanDetection.test.ts
- ApiToken
- moderationDispatchGuard.test.ts
- btnUrlSuffix.ts
- scheduledDispatchWorker.test.ts
- clientCallbackRetry.test.ts
- SenderProfile
- multibmDispatchMarketing.test.ts
- Service
- multibmDispatchResume.test.ts
- CompositorConfig
- multibmDistributionStrategy.test.ts
- scheduledCampaignCreationGuard.test.ts
- fmt
- senderProfiles.test.ts
- vendor-mask.ts
- ObjectUploader.tsx
- ClientBusinessProfile
- ClientBlacklistTrigger
- slider.tsx
- CreditTransaction
- vendor-mask.ts
- blocklist.ts
- app-sidebar.tsx
- normalizeBrPhone
- fileSignatureValidation.test.ts
- TemplatePreset
- .getCampaignWithContacts
- .getDefaultAccountTemplatePreset
- UpdateCampaign
- webhookTokenTimingSafe.test.ts
- AccountServiceBalance
- btnUrlSuffix.ts
- toast.tsx
- InsertCampaign
- Service
- multibmHideAndIgnore.test.ts
- UpdateCampaign
- sheet.tsx
- MultibmIgnoredWaba

## God Nodes (most connected - your core abstractions)
1. `DatabaseStorage` - 384 edges
2. `IStorage` - 369 edges
3. `registerRoutes()` - 146 edges
4. `useToast()` - 114 edges
5. `cn()` - 110 edges
6. `apiRequest()` - 94 edges
7. `Button` - 58 edges
8. `useAuth()` - 53 edges
9. `Card` - 51 edges
10. `CardContent` - 50 edges

## Surprising Connections (you probably didn't know these)
- `registerRoutes()` --indirect_call--> `sender()`  [INFERRED]
  server/routes.ts → tests/multibmTemplateCluster.test.ts
- `registerRoutes()` --indirect_call--> `displayName()`  [INFERRED]
  server/routes.ts → client/src/lib/accountUtils.ts
- `CampaignDetail()` --references--> `jspdf`  [EXTRACTED]
  client/src/pages/campaign-detail.tsx → package.json
- `Router()` --indirect_call--> `AdminLogs()`  [INFERRED]
  client/src/App.tsx → client/src/pages/admin-logs.tsx
- `Router()` --indirect_call--> `Termos()`  [INFERRED]
  client/src/App.tsx → client/src/pages/termos.tsx

## Import Cycles
- 3-file cycle: `client/src/hooks/use-auth.tsx -> client/src/lib/queryClient.ts -> client/src/lib/vendor-mask.ts -> client/src/hooks/use-auth.tsx`

## Communities (189 total, 65 thin omitted)

### Community 2 - "NPM Runtime Dependencies"
Cohesion: 0.02
Nodes (85): dependencies, archiver, bcrypt, class-variance-authority, clsx, cmdk, connect-pg-simple, date-fns (+77 more)

### Community 3 - "Badge and Card UI"
Cohesion: 0.09
Nodes (30): ACCEPTED_MIMES, profileFormSchema, ProfileFormValues, ProfileResponse, SenderProfileSheetProps, NoticeBanner(), FormControl, FormDescription (+22 more)

### Community 4 - "Roles and Permissions"
Cohesion: 0.03
Nodes (84): RFC-4180, listarTemplates(), CREATABLE_ROLES, hasPermission(), Permission, PERMISSIONS, REQUIRED_PARENT_ROLES, requirePermission() (+76 more)

### Community 5 - "Schema Status Enums"
Cohesion: 0.02
Nodes (83): bmClientAssignments, BmQuality, bmQualityEnum, BmStatus, bmStatusEnum, CampaignStatus, campaignStatusEnum, ChipActivationStatus (+75 more)

### Community 6 - "Accordion and Dialog UI"
Cohesion: 0.06
Nodes (57): AgentTab(), ConfigResponse, ConfigResponse, AgentConfigResponse, ApiKeyPresence, CompositorConfigResponse, GeneratorConfigResponse, messageForTestError() (+49 more)

### Community 7 - "Account Management Page"
Cohesion: 0.05
Nodes (57): AiProviderValue, ApiKeyPresence, IMAGE_MODELS, IMAGE_PROVIDERS, ProviderModelPicker(), ProviderModelPickerProps, TEXT_MODELS, TEXT_PROVIDERS (+49 more)

### Community 8 - "Button and Alert Dialog UI"
Cohesion: 0.22
Nodes (12): buildRcsBatchBody(), mapCard(), mapMessage(), mapSuggestions(), RcsBatchResult, RcsMailingParams, RcsOutBase, RcsOutMessage (+4 more)

### Community 9 - "Reporting and Monitoring Types"
Cohesion: 0.03
Nodes (60): AccountServiceRow, BmAssignmentClientRow, MultibmBmFailureStat, MultibmBmMetrics, MultibmClientMetrics, MultibmMonitoring, MultibmVolumePoint, PaginatedResult (+52 more)

### Community 10 - "AI Panel and Tabs UI"
Cohesion: 0.07
Nodes (28): columnTargetLabel(), ContactFilePreviewTable(), VariableMappingPanel(), RcsContentEditor(), RcsContentEditorProps, RcsContentType, RcsPreview(), renderRcsPreviewText() (+20 more)

### Community 11 - "App Routing and Auth Context"
Cohesion: 0.20
Nodes (6): db, dispatch(), sender(), sendMock, storageHandlers, Sub

### Community 12 - "Infobip API Integration"
Cohesion: 0.06
Nodes (59): buildAuthHeaders(), buildButtonsArray(), buildCarouselCard(), buildHeaderComponent(), buildHeaders(), buildSendButtonsPayload(), buscarRelatorio(), buscarSaldo() (+51 more)

### Community 13 - "Build Tooling Dependencies"
Cohesion: 0.09
Nodes (23): devDependencies, autoprefixer, drizzle-kit, esbuild, postcss, @replit/vite-plugin-cartographer, @replit/vite-plugin-dev-banner, @replit/vite-plugin-runtime-error-modal (+15 more)

### Community 15 - "Project Memory Notes"
Cohesion: 0.09
Nodes (8): The AI agent's prompt is composed from exactly two account-scoped sources, Tone of voice / extra instructions count as content on their own, Every automatic free-form send must pass the shared guard, Inbound API-service campaigns require a template, Multi-BM monitoring & alerts (Task #337), Templates Validados: validate on one BM, then rollout to the rest, Safe date formatting, SSRF guard for user-supplied URL fetches

### Community 16 - "Sender Profile and Notices UI"
Cohesion: 0.05
Nodes (60): activeRunCount(), activeRuns, dailyBudgetSnapshot(), pruneWebhookBuckets(), registerActiveRun(), registerBudgetSend(), _resetDailyBudgetForTests(), revertBudgetSend() (+52 more)

### Community 18 - "Sidebar Layout UI"
Cohesion: 0.11
Nodes (32): ResizableHandle(), ResizablePanelGroup(), SheetHeader(), Sidebar(), SidebarContent(), SidebarContext, SidebarContextProps, SidebarFooter() (+24 more)

### Community 20 - "CLAUDE.md Documentation"
Cohesion: 0.06
Nodes (33): Agendamento de Campanhas, Agente de IA (Respostas Automáticas a Mensagens Recebidas / MO), Ambiente atual (Claude Code / servidor dedicado), API Token por Serviço (API de entrada), Armazenamento de mídia, Arquitetura, Atribuição por sender (não por BM), Comandos úteis (+25 more)

### Community 21 - "Multi-BM Validated Templates UI"
Cohesion: 0.25
Nodes (14): sendRcsBatch(), ContactRenderCtx, dispatchRcsCampaign(), dispatchRcsCampaignInner(), finalizarCampanhaRcs(), inFlightCampaigns, parseContactParams(), RcsDispatchOptions (+6 more)

### Community 22 - "WABA Template Storage"
Cohesion: 0.08
Nodes (4): InsertTemplateAccountPreset, InsertWabaTemplate, TemplateAccountPreset, WabaTemplate

### Community 23 - "Auth Middleware and Checknumber"
Cohesion: 0.18
Nodes (8): buildApp(), createCalls, deleteCalls, infobipState, listCalls, sessionState, storageHandlers, storageState

### Community 24 - "HubSpot Auth and Timeline"
Cohesion: 0.11
Nodes (26): getHubspotOAuthConfig(), getValidAccessToken(), HubSpotAuthError, hubspotRefreshLocks, buildEventTemplateDefinition(), buildOnsmsLink(), getDeveloperConfig(), getPublicBaseUrl() (+18 more)

### Community 25 - "AI Agent Orchestration"
Cohesion: 0.07
Nodes (39): buildProfileSection(), buildSystemPrompt(), handleInboundMessage(), InboundMessage, normalizeForMatch(), selectKnowledge(), AiChatTurn, AiProviderError (+31 more)

### Community 26 - "admin-senders.tsx"
Cohesion: 0.21
Nodes (12): CampaignClickStats, DeactivateCampaignLinksParams, fetchCampaignClickStats(), generateCampaignLinks(), GenerateCampaignLinksParams, headers(), isWhatsappUrl(), lookupRevrSlugs() (+4 more)

### Community 27 - "Server Bootstrap and Blocklist"
Cohesion: 0.18
Nodes (9): app, http, httpServer, IncomingMessage, Issue, pgPool, PgStore, serveStatic() (+1 more)

### Community 28 - "Campaign Chat UI"
Cohesion: 0.20
Nodes (9): @esbuild-kit/esm-loader, license, name, optionalDependencies, bufferutil, overrides, drizzle-kit, type (+1 more)

### Community 29 - "Multi-BM Dispatch Logic"
Cohesion: 0.09
Nodes (27): ClientCallbackContact, ClientCallbackPayload, sendClientCallback(), dispatchHubspotMessageStandalone(), DispatchStandaloneResult, InfobipSendResult, ordenarSenders(), parseRetryAfterMs() (+19 more)

### Community 30 - "DB Cleanup and Seed Scripts"
Cohesion: 0.09
Nodes (23): main(), cleanupApiCampaignOrphanMedia(), CleanupReport, CleanupRow, MEDIA_DIR, safeUnlink(), db, pgPoolOptions (+15 more)

### Community 31 - "Bug: sistema de auto-registro de webhook nunca funcionou"
Cohesion: 0.18
Nodes (10): Achado relacionado (não bloqueante, sem ação necessária agora), Bug: sistema de auto-registro de webhook nunca funcionou, Causa raiz: endpoint e schema errados, Como retomar isso numa sessão nova, Comparação: código atual vs. API real, Contexto / como foi descoberto, Eventos disponíveis por canal, Onde o código precisa mudar (+2 more)

### Community 32 - "User and Sender Assignment Storage"
Cohesion: 0.10
Nodes (5): BmClientAssignment, InsertSenderAssignment, InsertUser, SenderAssignment, User

### Community 33 - "Multi-BM Submission Storage"
Cohesion: 0.09
Nodes (4): MultibmPhysicalSubmission, MultibmTemplateSubmissionWithBm, InsertMultibmTemplateSubmission, MultibmTemplateSubmission

### Community 34 - "Admin Logs UI"
Cohesion: 0.16
Nodes (6): ICON, NoticeBannerProps, VARIANT, useNotices(), InsertSystemNotice, SystemNotice

### Community 35 - "Media Storage Utilities"
Cohesion: 0.15
Nodes (21): assertPublicHost(), deleteMediaObject(), DownloadedMedia, downloadMediaBuffer(), downloadMediaFromUrl(), ensureMediaDir(), extFromMime(), getUploadDir() (+13 more)

### Community 36 - "RCS API Client"
Cohesion: 0.25
Nodes (11): apiGet(), getNumber(), GetNumberError, GetNumberResult, getStatus(), GetStatusResult, setStatus(), apiGet() (+3 more)

### Community 37 - "TypeScript Configuration"
Cohesion: 0.10
Nodes (19): compilerOptions, allowImportingTsExtensions, baseUrl, esModuleInterop, incremental, jsx, lib, module (+11 more)

### Community 38 - "Menubar UI Component"
Cohesion: 0.12
Nodes (11): Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarRadioItem, MenubarSeparator, MenubarShortcut() (+3 more)

### Community 39 - "Shadcn UI Config"
Cohesion: 0.12
Nodes (16): aliases, components, hooks, lib, ui, utils, rsc, $schema (+8 more)

### Community 40 - "Sidebar and Branding Context"
Cohesion: 0.23
Nodes (12): applyPalette(), applyPrimaryColor(), BrandingConfig, BrandingContext, BrandingContextValue, BrandingProvider(), DEFAULT_BRANDING, hexToHsl() (+4 more)

### Community 41 - "Toast and Notice System"
Cohesion: 0.16
Nodes (12): ButtonProps, buttonVariants, Calendar(), CalendarProps, Pagination(), PaginationContent, PaginationEllipsis(), PaginationItem (+4 more)

### Community 42 - "Chart UI Component"
Cohesion: 0.12
Nodes (13): useCarousel(), ChartConfig, ChartContainer, ChartContext, ChartContextProps, ChartLegendContent, ChartTooltipContent, THEMES (+5 more)

### Community 43 - "HubSpot Action Sync"
Cohesion: 0.19
Nodes (13): checkHubspotActionSync(), currentHash, HubspotActionSyncState, HubspotActionSyncStatus, state, buildExpectedCanonicalShape(), CanonicalActionShape, CanonicalDependency (+5 more)

### Community 45 - "Button, Calendar, Pagination UI"
Cohesion: 0.08
Nodes (30): Avatar, AvatarFallback, AvatarImage, DropdownMenuContent, DropdownMenuItem, MultibmSender, qualityColor(), qualityLabel() (+22 more)

### Community 46 - "Multi-BM Template Storage"
Cohesion: 0.27
Nodes (3): MultibmTemplateWithSubmissions, InsertMultibmTemplate, MultibmTemplate

### Community 49 - "Carousel UI Component"
Cohesion: 0.15
Nodes (12): Carousel, CarouselApi, CarouselContent, CarouselContext, CarouselContextProps, CarouselItem, CarouselNext, CarouselOptions (+4 more)

### Community 50 - "Chip Provisioning Clients"
Cohesion: 0.31
Nodes (8): applyBlocklist(), applySync(), CachedTerm, escapeRegex(), refreshCacheIfNeeded(), shouldSkipKey(), SKIP_KEYS, syncCache

### Community 51 - "Multi-BM Health Sync"
Cohesion: 0.17
Nodes (17): InfobipSenderFromApi, listarSendersFromApi(), diagnoseMultibmForService(), effectiveBmDailyLimit(), mapConnectionStatusToBanRestriction(), MultibmDiagnosticItem, MultibmDiagnosticKind, MultibmDiagnosticsResult (+9 more)

### Community 52 - "Business Manager Storage"
Cohesion: 0.19
Nodes (3): BusinessManagerWithStats, BusinessManager, InsertBusinessManager

### Community 53 - "HubSpot Dispatch Queue Storage"
Cohesion: 0.17
Nodes (5): aiState, buildApp(), forwardCalls, storageHandlers, storageState

### Community 56 - "Multi-BM Dashboard UI"
Cohesion: 0.22
Nodes (12): buildMappedContacts(), BuildMappedContactsResult, ColumnMapping, ContactMappingError, MappedContact, BTN_URL_SUFFIX_ERROR_LABELS, BtnUrlSuffixResult, canonicalizeForCompare() (+4 more)

### Community 57 - "Toast UI Component"
Cohesion: 0.25
Nodes (8): scripts, build, check, db:push, dev, start, test, test:watch

### Community 62 - "API Token Storage"
Cohesion: 0.20
Nodes (7): buildApp(), criarTemplateMock, listarSendersFromApiMock, listarTemplatesPorWabaMock, sessionState, state, storageHandlers

### Community 63 - "Multi-BM Webhook Tests"
Cohesion: 0.19
Nodes (10): CampaignComposer(), CampaignComposerProps, composerErrorMessage(), ComposeResponse, DEFAULT_PERSONAS, GenerateResponse, Persona, PersonaOption (+2 more)

### Community 64 - "Error Boundary Component"
Cohesion: 0.20
Nodes (3): ErrorBoundary, ErrorBoundaryProps, ErrorBoundaryState

### Community 65 - "utils.ts"
Cohesion: 0.10
Nodes (30): SelectLabel, groupByMetaBm(), metaBmGroupLabel(), BusinessManager, CATEGORIA_LABELS, ClusterSignature, countVars(), emptyForm (+22 more)

### Community 66 - "Context Menu UI"
Cohesion: 0.20
Nodes (9): ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut(), ContextMenuSubContent (+1 more)

### Community 67 - "Dropdown Menu UI"
Cohesion: 0.25
Nodes (7): DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut(), DropdownMenuSubContent, DropdownMenuSubTrigger

### Community 69 - "Multi-BM Message Storage"
Cohesion: 0.06
Nodes (51): CampaignChatProps, ConversationPane(), ConversationRow, MessageBubble(), STATUS_LABEL, DialogContent, DialogDescription, DialogFooter() (+43 more)

### Community 72 - "Multi-BM Template Cluster Tests"
Cohesion: 0.18
Nodes (11): Como retomar isto numa sessão nova, ⚠️ CONFLITOS/LACUNAS mapeados no código atual (resolver na implementação), Contexto e decisão do dono (redesenho — substitui uma proposta anterior de, Guardrails, Modelo definido pelo dono, Multi-BM sidebar (CANCELADA) + HubSpot compatibility (pendente), Ordem recomendada de execução, PARTE A — UX: Multi-BM na barra lateral com sub-itens (+3 more)

### Community 73 - "scripts"
Cohesion: 0.33
Nodes (4): BuildInfo, cached, { commit: _commit, source: _source }, getBuildInfo()

### Community 74 - "dispatch"
Cohesion: 0.20
Nodes (5): TermsCurrentResponse, TermsCurrentResponse, TermsCurrentResponse, InsertTermsDocument, TermsDocument

### Community 75 - "Activity Log Storage"
Cohesion: 0.28
Nodes (4): inferActivityLogOrigin(), ActivityLog, ActivityLogOrigin, InsertActivityLog

### Community 76 - "Breadcrumb UI Component"
Cohesion: 0.28
Nodes (3): EnrichedAcceptance, InsertTermsAcceptance, TermsAcceptance

### Community 77 - "Drawer UI Component"
Cohesion: 0.25
Nodes (7): Breadcrumb, BreadcrumbEllipsis(), BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator()

### Community 78 - "Navigation Menu UI"
Cohesion: 0.25
Nodes (7): NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuViewport

### Community 80 - "Account Service Balance Storage"
Cohesion: 0.18
Nodes (10): Achados da análise (já verificados no código — corrigir nesta ordem), ALTO, Como retomar isto numa sessão nova, Contexto, CRÍTICO, Entregável, Guardrails, MÉDIO (+2 more)

### Community 85 - "Vendor Mask Exposure Tests"
Cohesion: 0.25
Nodes (5): buildApp(), EnviarFn, fetchCalls, HubSpotAuthError, storageState

### Community 87 - "File Upload Hook"
Cohesion: 0.38
Nodes (6): IMPORTANT: This function receives the UppyFile object from Uppy., IMPORTANT: Send JSON metadata, NOT the file itself., UploadMetadata, UploadResponse, useUpload(), UseUploadOptions

### Community 88 - "Multi-BM Validated Template Storage"
Cohesion: 0.29
Nodes (6): AI inbound (MO) attribution depends on dispatch-time ownership, MO attribution must cover BOTH dispatch tracks (WA OFICIAL + Multi-BM), MO dedupe must be DB-atomic, and empty ids must be null, Per-dispatch reply cap: conversation lookup must include LIMIT_REACHED, Persist the inbound BEFORE any no-send gate; exclude it from prompt history by row id, Window is measured from the DISPATCH (REVERSED 2026-07-14 — post-billing model)

### Community 89 - "vendor-mask.ts"
Cohesion: 0.06
Nodes (47): xlsx, express-session, hashPassword(), requireAdmin(), requireAdminOrOperator(), requireAuth(), requireModerationAccess(), requireTermsAccepted() (+39 more)

### Community 90 - "Template Media Storage"
Cohesion: 0.06
Nodes (59): AiProvider, assembleTemplate(), buildComposeSystemPrompt(), buildGenerateSystemPrompt(), ComposerComposeInput, ComposerComposeResult, ComposerGenerateInput, ComposerGenerateResult (+51 more)

### Community 93 - "OTP Input UI Component"
Cohesion: 0.33
Nodes (5): InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, input-otp

### Community 95 - "toggle-group.tsx"
Cohesion: 0.33
Nodes (5): ToggleGroup, ToggleGroupContext, ToggleGroupItem, Toggle, toggleVariants

### Community 101 - "vite.ts"
Cohesion: 0.10
Nodes (25): Progress, Action, ActionType, actionTypes, addToRemoveQueue(), dispatch(), genId(), listeners (+17 more)

### Community 103 - "AI Conversation Messages"
Cohesion: 0.20
Nodes (7): buildApp(), db, infobipState, sessionState, storageHandlers, Sub, Tpl

### Community 105 - "Object Uploader Component"
Cohesion: 0.35
Nodes (13): ClusterSignature, computeSignature(), countQuickReplies(), countTemplateVars(), extractButtonUrlPrefix(), extractUrlButtonDynamic(), findUrlButton(), normalizeHeaderMarker() (+5 more)

### Community 106 - "multibmDispatchPerContactParams.test.ts"
Cohesion: 0.25
Nodes (5): db, dispatch(), enviarMensagemTemplateMock, SendCall, storageHandlers

### Community 107 - "HubSpot Action Registration"
Cohesion: 0.50
Nodes (3): baseTrimmed, definition, isUpdate

### Community 109 - "dispatch"
Cohesion: 0.40
Nodes (4): A regra (comprovada ao vivo, 2026-07-14), Armadilha conhecida (custou uma tarde), Infobip: uma assinatura só — produção encaminha pro dev, O modelo vigente

### Community 110 - "fileSignatureValidation.test.ts"
Cohesion: 0.07
Nodes (79): Router(), ClientsTab(), ServicesTab(), CompositorTab(), GeneratorTab(), SenderProfileSheet(), TermsGateModal(), canDoOperational() (+71 more)

### Community 111 - "User & Service Queries"
Cohesion: 0.40
Nodes (4): Multi-BM template fallback (T09) & per-second throttle (T01), Per-second throttle, Retry is intentionally absent, Template fallback resolution

### Community 112 - "Template Preset Storage"
Cohesion: 0.50
Nodes (3): Do NOT migrate to `exceljs` as a drop-in replacement, Remediating the `xlsx` (SheetJS) npm advisory, The fix

### Community 115 - "freeform-send-guard.md"
Cohesion: 0.04
Nodes (60): StatusBadge(), StatusBadgeProps, StatusTone, TONE_CLASSES, Badge(), BadgeProps, badgeVariants, ScrollArea (+52 more)

### Community 116 - "segmented-control.tsx"
Cohesion: 0.24
Nodes (10): RCS_ALIGNMENTS, RCS_CARD_WIDTHS, RCS_MEDIA_HEIGHTS, RCS_ORIENTATIONS, RcsCardsPayload, RcsContentInput, RcsMediaHeight, RcsSuggestionType (+2 more)

### Community 118 - "mailer.ts"
Cohesion: 0.07
Nodes (78): ConfigResponse, EMPTY_TERM_FORM, PERSONA_FIELDS, TermFormState, FilterPill(), FilterPillProps, LegacyWebhookMode(), PageHeader() (+70 more)

### Community 122 - "HubspotAlertState"
Cohesion: 0.20
Nodes (8): Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut()

### Community 123 - "multibmCampaignCreationAtomic.test.ts"
Cohesion: 0.29
Nodes (4): atomicState, buildApp(), sessionState, storageHandlers

### Community 124 - "multibmPauseResumeCancel.test.ts"
Cohesion: 0.29
Nodes (5): buildApp(), enviarMensagemTemplateMockRef, sessionState, state, storageHandlers

### Community 130 - "AccountServiceBalance"
Cohesion: 0.10
Nodes (20): 1. Fluxograma do ciclo de vida, 2. Âncoras de código por etapa, 3. Walkthrough do exemplo: lote de 1.000 números · 1 BM · 10 senders · 100/dia cada, 4. Achados da auditoria, 5. Simulação executável (12/07/2026) — `tests/multibmDispatchSimulation.test.ts`, 6. Confirmação em dados reais (banco dev, 12/07/2026, somente SELECT), 7. Barragens — tabela consolidada e priorização, 8. Reforma implementada (12/07/2026) — R1/R2/R3 (+12 more)

### Community 132 - "TemplatePreset"
Cohesion: 0.18
Nodes (7): db, enviarMensagemTemplateMock, loadDispatch(), Msg, seedWabas(), storageHandlers, submissionFor()

### Community 133 - "ProvidersTab"
Cohesion: 0.50
Nodes (3): SegmentedControl(), SegmentedControlProps, SegmentedOption

### Community 135 - "multibmRateLimitSharedAcrossCampaigns.test.ts"
Cohesion: 0.25
Nodes (4): callTimestamps, db, enviarMensagemTemplateMock, storageHandlers

### Community 136 - "drawer.tsx"
Cohesion: 0.25
Nodes (6): DrawerContent, DrawerDescription, DrawerFooter(), DrawerHeader(), DrawerOverlay, DrawerTitle

### Community 138 - "multibmValidateGuard.test.ts"
Cohesion: 0.29
Nodes (5): buildApp(), criarTemplateMock, sessionState, state, storageHandlers

### Community 139 - "multibmDailyLimitByBm.test.ts"
Cohesion: 0.83
Nodes (3): RESTRICTED_ROLES, scrubVendor(), scrubVendorForRole()

### Community 140 - "multibmDistributionStrategy.test.ts"
Cohesion: 0.33
Nodes (4): buildApp(), enviarCalls, EnviarMensagemArgs, storageState

### Community 141 - "multibmHealthSyncBanDetection.test.ts"
Cohesion: 0.40
Nodes (3): db, listarSendersFromApiMock, storageHandlers

### Community 143 - "moderationDispatchGuard.test.ts"
Cohesion: 0.40
Nodes (3): db, enviarMensagemTemplateMock, storageHandlers

### Community 148 - "multibmDispatchMarketing.test.ts"
Cohesion: 0.29
Nodes (4): db, dispatch(), storageHandlers, Sub

### Community 149 - "Service"
Cohesion: 0.22
Nodes (7): buildApp(), criarCalls, handlers, infobipState, sessionState, St, validBody

### Community 150 - "multibmDispatchResume.test.ts"
Cohesion: 0.29
Nodes (4): db, dispatch(), enviarMensagemTemplateMock, storageHandlers

### Community 153 - "scheduledCampaignCreationGuard.test.ts"
Cohesion: 0.29
Nodes (4): buildApp(), dispatchInfobipCampaignMock, sessionState, storageHandlers

### Community 155 - "fmt"
Cohesion: 0.60
Nodes (6): fmt(), HubspotTab(), InfobipTab(), periodToFrom(), SistemaTab(), useLiveStream()

### Community 156 - "senderProfiles.test.ts"
Cohesion: 0.40
Nodes (3): sessionState, state, storageHandlers

### Community 160 - "ClientBusinessProfile"
Cohesion: 0.33
Nodes (3): ProfileResponse, ClientBusinessProfile, UpsertClientBusinessProfileInput

### Community 161 - "ClientBlacklistTrigger"
Cohesion: 0.43
Nodes (7): AppSidebar(), ROLE_ICON, useBranding(), canBranding(), canManageAccounts(), canManageUsers(), canSeeOperationalAdmin()

### Community 167 - "vendor-mask.ts"
Cohesion: 0.14
Nodes (12): ProtectedRoute(), ThemeToggle(), AuthContext, AuthContextType, AuthProvider(), AuthUser, UserRole, setCurrentUserRole() (+4 more)

### Community 170 - "normalizeBrPhone"
Cohesion: 0.33
Nodes (4): express, vite, setupVite(), viteLogger

### Community 173 - ".getCampaignWithContacts"
Cohesion: 0.47
Nodes (5): AnyButton, buttonLabel(), WhatsappTemplatePreview(), WhatsappTemplatePreviewProps, applyPreset()

### Community 175 - "UpdateCampaign"
Cohesion: 0.33
Nodes (4): buildApp(), sessionState, state, storageHandlers

### Community 184 - "toast.tsx"
Cohesion: 0.24
Nodes (10): Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastTitle, toastVariants (+2 more)

### Community 185 - "InsertCampaign"
Cohesion: 0.22
Nodes (3): InsertCampaign, InsertTwoStageConfig, TwoStageConfig

### Community 186 - "Service"
Cohesion: 0.24
Nodes (3): UserWithServices, InsertService, Service

### Community 190 - "sheet.tsx"
Cohesion: 0.25
Nodes (7): SheetContent, SheetContentProps, SheetDescription, SheetFooter(), SheetOverlay, SheetTitle, sheetVariants

## Knowledge Gaps
- **1004 isolated node(s):** `ObjectUploaderProps`, `ConfigResponse`, `ConfigResponse`, `PERSONA_FIELDS`, `TermFormState` (+999 more)
  These have ≤1 connection - possible missing edges or undocumented components.
- **65 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.

## Suggested Questions
_Questions this graph is uniquely positioned to answer:_

- **Why does `registerRoutes()` connect `vendor-mask.ts` to `Roles and Permissions`, `Schema Status Enums`, `App Routing and Auth Context`, `Infobip API Integration`, `Sender Profile and Notices UI`, `Multi-BM Validated Templates UI`, `HubSpot Auth and Timeline`, `AI Agent Orchestration`, `admin-senders.tsx`, `Server Bootstrap and Blocklist`, `Multi-BM Dispatch Logic`, `DB Cleanup and Seed Scripts`, `Media Storage Utilities`, `RCS API Client`, `Sidebar and Branding Context`, `normalizeBrPhone`, `HubSpot Action Sync`, `Chip Provisioning Clients`, `Multi-BM Health Sync`, `Multi-BM Dashboard UI`, `scripts`, `Template Media Storage`, `Object Uploader Component`, `fileSignatureValidation.test.ts`, `segmented-control.tsx`?**
  _High betweenness centrality (0.099) - this node is a cross-community bridge._
- **Why does `IStorage` connect `Storage Interface Methods` to `Database Storage Implementation`, `TemplateGeneratorConfig`, `Reporting and Monitoring Types`, `ClientBusinessProfile`, `Template Utilities and Form UI`, `ApiToken`, `Infobip Sender Storage`, `scheduledDispatchWorker.test.ts`, `Campaign Storage Methods`, `SenderProfile`, `WABA Template Storage`, `CompositorConfig`, `User and Sender Assignment Storage`, `ClientBusinessProfile`, `Admin Logs UI`, `Multi-BM Submission Storage`, `CreditTransaction`, `blocklist.ts`, `app-sidebar.tsx`, `fileSignatureValidation.test.ts`, `Branding Storage Methods`, `TemplatePreset`, `.getDefaultAccountTemplatePreset`, `Infobip Config Storage`, `Multi-BM Template Storage`, `WABA Message Storage`, `Business Manager Storage`, `AccountServiceBalance`, `AI Conversation Storage`, `btnUrlSuffix.ts`, `WA Filter Batch Storage`, `InsertCampaign`, `BM Sender Storage`, `Chip Activation Storage`, `HubSpot Connection Storage`, `RCS Sender Storage`, `Service`, `MultibmIgnoredWaba`, `UpdateCampaign`, `Knowledge Base Storage`, `RCS Config Storage`, `RCS Message Storage`, `dispatch`, `Activity Log Storage`, `Breadcrumb UI Component`, `AiConversationMessage`, `HubSpot Execute Diagnostics`, `Blocklist Term Storage`, `Status Mapping Storage`, `AI Client Settings Storage`, `Multi-BM Marketing Dispatch Tests`, `Column Keyword Storage`, `AI Agent Config Storage`, `HubSpot Alert Config Storage`, `Multi-BM Alert Config Storage`, `Multi-BM Config Storage`, `whatsapp-template-preview.tsx`, `HubSpot Timeline Template Storage`, `Sender Stats Queries`, `Credit Transactions`?**
  _High betweenness centrality (0.088) - this node is a cross-community bridge._
- **Why does `DatabaseStorage` connect `Database Storage Implementation` to `Storage Interface Methods`, `TemplateGeneratorConfig`, `Reporting and Monitoring Types`, `ClientBusinessProfile`, `Template Utilities and Form UI`, `ApiToken`, `.getServices`, `Infobip Sender Storage`, `scheduledDispatchWorker.test.ts`, `Campaign Storage Methods`, `SenderProfile`, `WABA Template Storage`, `CompositorConfig`, `Multi-BM Dispatch Logic`, `mailer.ts`, `User and Sender Assignment Storage`, `ClientBusinessProfile`, `slider.tsx`, `Admin Logs UI`, `.attachSubmissions`, `CreditTransaction`, `.listAllSendersWithStats`, `.getUserById`, `blocklist.ts`, `app-sidebar.tsx`, `Multi-BM Submission Storage`, `fileSignatureValidation.test.ts`, `Branding Storage Methods`, `TemplatePreset`, `.getDefaultAccountTemplatePreset`, `Infobip Config Storage`, `Multi-BM Template Storage`, `WABA Message Storage`, `.getBusinessManagers`, `.getCampaigns`, `AccountServiceBalance`, `Business Manager Storage`, `AI Conversation Storage`, `btnUrlSuffix.ts`, `WA Filter Batch Storage`, `InsertCampaign`, `BM Sender Storage`, `Chip Activation Storage`, `HubSpot Connection Storage`, `RCS Sender Storage`, `Service`, `.getCampaignWithContacts`, `MultibmIgnoredWaba`, `UpdateCampaign`, `Knowledge Base Storage`, `RCS Config Storage`, `RCS Message Storage`, `dispatch`, `Activity Log Storage`, `Breadcrumb UI Component`, `AiConversationMessage`, `HubSpot Execute Diagnostics`, `Blocklist Term Storage`, `Status Mapping Storage`, `AI Client Settings Storage`, `Multi-BM Marketing Dispatch Tests`, `Column Keyword Storage`, `AI Agent Config Storage`, `HubSpot Alert Config Storage`, `Multi-BM Alert Config Storage`, `Multi-BM Config Storage`, `whatsapp-template-preview.tsx`, `HubSpot Timeline Template Storage`, `Sender Stats Queries`, `Credit Transactions`?**
  _High betweenness centrality (0.079) - this node is a cross-community bridge._
- **Are the 10 inferred relationships involving `registerRoutes()` (e.g. with `displayName()` and `requireAdmin()`) actually correct?**
  _`registerRoutes()` has 10 INFERRED edges - model-reasoned connections that need verification._
- **What connects `ObjectUploaderProps`, `IMPORTANT: This receives the file object - use file.name, file.size, file.type`, `ConfigResponse` to the rest of the system?**
  _1008 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Storage Interface Methods` be split into smaller, more focused modules?**
  _Cohesion score 0.014925373134328358 - nodes in this community are weakly interconnected._
- **Should `Database Storage Implementation` be split into smaller, more focused modules?**
  _Cohesion score 0.018018018018018018 - nodes in this community are weakly interconnected._