refactor(console): de-mock Notificações/Conexões + migra specs (limpeza de mocks 5.5) - #109
Merged
Merged
Conversation
…za de mocks 5.5)
Sexta fatia (strangler). Remove as branches de mock de PRODUÇÃO de 2 telas e migra
notifications/notifications_pairs/connections specs para o fixture. Diff 100% em
docs/design/pages/, zero backend.
Telas de-mockadas: screen_notifications (2 leituras de mock), screen_connections (3).
De-mock MECÂNICO — ZERO vazamentos CT.* (todas as leituras estavam em mock ? … :
null: channels/rules/connections/platformKeys). CT_PREFS.timezone() é helper real,
preservado.
Gating de demo — confirmado OCULTO (não disabled): não há gating in-screen nessas
telas; o gate é route-level (app.jsx ROUTE_PERMS: notifications→edit_settings,
connections→manage_keys; shell.jsx filtra o nav por perm). Demo/operador → "Sem
permissão" + nav oculto. Intacto (fora das telas) — só saíram os if(mock).
Fixture (e2e/fixtures/) — datasets net-new, SECRETS SEMPRE MASCARADOS:
- NOTIF_CHANNELS (destination_masked "…token •••4821"), NOTIF_RULES (r1 circuit_
breaker/critical→ch1,ch2; r2 */high→ch1 pairs:['BTC/USDT']), NOTIF_SETTINGS.
- CONNECTIONS (api_key_masked "•••b3f1"; cx2 error "Invalid API-key…"), PLATFORM_KEYS
(key_prefix "ctk_a1b2c3d4"), EGRESS_IP {ip:"203.0.113.42"}.
- Nenhum token em claro — o notifications.spec test 1 afirma que o HTML NÃO contém
"AAAbbb" (guarda de raw-secret atendida por construção). Verificado verde.
- 1 write canned: POST /v1/api-keys → {label, key:"ctk_…"} (a chave é exibida uma
vez na criação; a tabela pós-fecho afirma o key_prefix do pk1 → stub simples, sem
stateful).
Specs migrados via installMockApi (cenários authMode/role, não mais MOCK_ROLE/AUTH):
notifications (5), notifications_pairs (2), connections (5).
Acoplamento: ZERO. Nenhum spec não-migrado navega para #notifications/#connections;
console afirma só labels de nav (perm-gated, preservado). Sem fix de system.spec.
Auditoria de mocks: 2 telas sem USE_MOCK_DATA/CT.* (grep limpo). Restam: core+shell+
landing (5.7), Agentes + Conta/Segurança/Auditoria/Onboarding (5.6).
Validação: 12 specs migrados verdes; suíte completa 75 verdes (retries=1); build OK.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UZ3vLNTHKekjQVtjFVRi5D
danzeroum
force-pushed
the
claude/criptotrade-onboarding-06pd5p
branch
from
July 20, 2026 17:05
363944f to
c79b181
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Limpeza de mocks — Fatia 5.5 (Notificações · Conexões & Chaves)
Remove as branches de mock de produção de 2 telas e migra
notifications+notifications_pairs+connectionsspecs para o fixture. Diff 100% emdocs/design/pages/, zero backend.Telas de-mockadas
screen_notifications(2 leituras demock) ·screen_connections(3). De-mock mecânico — ZERO vazamentosCT.*(todas as leituras estavam emmock ? … : null).CT_PREFS.timezone()é helper real (preservado).Gating de demo — confirmado OCULTO (não disabled)
Não há gating in-screen nessas telas; o gate é route-level (
app.jsx ROUTE_PERMS: notifications→edit_settings, connections→manage_keys;shell.jsxfiltra o nav por perm). Demo/operador → "Sem permissão" + nav oculto (o padrão certo p/ telas com secrets). Intacto (fora das telas) — só saíram osif(mock).Fixture (
e2e/fixtures/) — datasets net-new, secrets SEMPRE mascaradosNOTIF_CHANNELS(destination_masked "…token •••4821"),NOTIF_RULES(r1 circuit_breaker/critical→ch1,ch2; r2*/high→ch1pairs:['BTC/USDT']),NOTIF_SETTINGS.CONNECTIONS(api_key_masked "•••b3f1"; cx2error "Invalid API-key…"),PLATFORM_KEYS(key_prefix "ctk_a1b2c3d4"),EGRESS_IP {ip:"203.0.113.42"}.notifications.spectest 1 afirma que o HTML não contém "AAAbbb" (guarda de raw-secret atendida por construção; verificado verde).POST /v1/api-keys→{label, key:"ctk_…"}(a chave é exibida uma vez na criação; a tabela pós-fecho afirma okey_prefixdo pk1 → stub simples, sem stateful).Specs migrados
notifications(5) ·notifications_pairs(2) ·connections(5) →installMockApi(cenáriosauthMode/role, não maisMOCK_ROLE/MOCK_AUTH).Acoplamento: ZERO
Nenhum spec não-migrado navega para
#notifications/#connections;consoleafirma só labels de nav (perm-gated, preservado). Sem fix desystem.specnesta fatia.Auditoria de mocks
2 telas sem
USE_MOCK_DATA/CT.*(grep limpo). Restam: core+shell+landing (5.7), Agentes + Conta/Segurança/Auditoria/Onboarding (5.6).Validação local
--retries=1).node build.mjsOK.🤖 Generated with Claude Code
Generated by Claude Code