docs+fix: plano de melhorias consolidado + onda 1 (backend/frontend/docs)#68
Merged
Merged
Conversation
…s wave Adds docs/plano-melhorias.md as a single, prioritized source of truth for the improvement backlog (unifying data-dictionary §8/§9, architecture R1–R8, the June audit and pendencias), plus a first wave of low-risk, verified fixes. Backend - ab_testing: write ab_tests.jsonl as valid JSON (json.dumps, not repr) - regime_detector: route mean_reversion in the sideways regime (was registered but never emitted by any regime); add registry↔routing consistency test - remove dead attributes: RiskAgent.max_daily_loss_pct (daily-loss lives in the orchestrator CircuitBreaker), UnifiedOrchestrator.sandbox/chain_manager, AgentMemorySystem.short_term - agent_memory: log vector-store failure at debug instead of silent pass Frontend (docs/design/pages) - surface mutation errors as toasts in hitl/journal/settings/backtest (were console.error only), using the existing addToast plumbing - two-step confirmation on HITL approve/reject (mirrors the market paper-order) - rename colliding STATUS_VARIANT/STATUS_LABEL to ORDER_*/AGENT_* (distinct maps) - dead cleanup: tst placeholders -> .gitkeep, drop unused flash keyframes, apply the .range class + aria-label to SliderField Docs - reconcile test count to 416 collected (408 pass + 8 Postgres-gated) in README/TESTING; document the ADR-004 gap and add ADR-005 to the index - mark stale snapshots (conformity audit, handoff-codex, validation-checklist) - rename docs/documentação -> docs/data (ASCII) Verification: 408 passed / 8 skipped, coverage 73.02% (>=72% gate), ruff clean, console esbuild build + Playwright e2e green, deploy-config validator OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QehSjYY6mpa1yBhqZxsY6X
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.
Contexto
Análise profunda do repositório partindo da documentação recém-adicionada (
docs/data/mapeamento-dados.md, C4/UML). Os sinais de melhoria já existiam mas estavam espalhados por 6+ documentos e, em vários casos, documentados sem correção (o dicionário de dados §8/§9 diz explicitamente "apenas documentados, nenhum código alterado").Verifiquei contra o código atual as 9 anomalias do §9 — todas continuavam verdadeiras. Este PR consolida tudo num plano único e entrega uma primeira onda de correções seguras.
Entregável 1 — plano consolidado
docs/plano-melhorias.md: fonte única de verdade do backlog, unificando mapeamento §8/§9, arquitetura R1–R8, a auditoria de junho e as pendências, com checkboxes earquivo:linha.Entregável 2 — Onda 1 (baixo risco, tudo com teste/build)
Backend
ab_testing: gravaab_tests.jsonlcomo JSON válido (json.dumps, nãorepr) — §9.4regime_detector:mean_reversionagora roteável no regimesideways(estava registrada mas nenhum regime a emitia) + teste de consistência registry↔roteamento — §9.3RiskAgent.max_daily_loss_pct(a perda-diária vive noCircuitBreaker, que tem o P&L que o agente não tem),UnifiedOrchestrator.sandbox/chain_manager,AgentMemorySystem.short_term— §8agent_memory: loga falha do vetor emdebugem vez deexcept: passsilenciosoFrontend (
docs/design/pages)console.error), via oaddToastjá existente — atende o briefing §6STATUS_VARIANT/STATUS_LABEL→ORDER_*/AGENT_*(eram mapas diferentes com o mesmo nome, hazard citado pelobuild.mjs)tst→.gitkeep,@keyframesmortos removidos, classe.range+aria-labelaplicados aoSliderFieldDocs
DATABASE_URL) em README/TESTING (antes divergia: 121/138/273/324/383/406)004-reserved.md) + índice passa a listar 004 e 005 (antes omitia 005)docs/documentação/→docs/data/(ASCII)Backlog estrutural (aberto, no plano)
R5 (módulo
src/risk/Kelly é código morto), R1/R2 (cluster "BuildToValue" + colisões de classe), R8 (responsividade + sidebar colapsável), unificar os 2 formatos demarket_data, e arquivos de projeto ausentes (CONTRIBUTING/CHANGELOG/SECURITY).Verificação
408 passed / 8 skipped; cobertura 73,02% (gate 72%)ruff(E4/E7/E9/F) limposcripts/validate_deploy_config.pyOKInvariante central preservado: paper-trading-first, HITL fail-closed, tudo auditável.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QehSjYY6mpa1yBhqZxsY6X
Generated by Claude Code