docs: plan cleanup and maintainability backlog
This commit is contained in:
parent
fbf2eb9e0c
commit
4ddffa6b67
19 changed files with 1743 additions and 7 deletions
|
|
@ -1,5 +1,7 @@
|
|||
# Revalidated audit findings
|
||||
|
||||
The original findings below describe their stated historical baseline. For the current cleanup extension, see [Cleanup audit 2026-10-26](#cleanup-audit-2026-10-26); completed financial migration findings must not be mistaken for newly reopened defects.
|
||||
|
||||
Baseline: `b7aeca4`, inspected 2026-10-22. No standalone structured audit/backlog was found in existing docs; this matrix reconciles the supplied audit concerns against current code. Existing informal docs remain historical context, not a second task tracker.
|
||||
|
||||
**Verified** means the cited implementation establishes the behavior or gap. **Likely** would mean an inference not yet reproduced; none is promoted to a confirmed defect here. **Needs Investigation** marks runtime/coverage questions that source alone cannot certify. No full application test suite or new performance benchmark was run during this planning-only task. Numeric acceptance examples are new test requirements, not fabricated passing tests.
|
||||
|
|
@ -222,3 +224,67 @@ Disposition: [S04](tasks/S04.md), [A04](tasks/A04.md), [O02](tasks/O02.md).
|
|||
- No runtime evidence here establishes real broker reliability. Live-disabled guards remain intact.
|
||||
- Exact hardware throughput, storage hot spots, memory limits and sandbox availability require P01/A02 measurements, not architectural confidence.
|
||||
- Preservation rules in [cleanup audit](../../cleanup-audit.md) remain: reviewed calculations, restored helpers and useful research prototypes are not disposable dead code.
|
||||
|
||||
## Cleanup audit 2026-10-26
|
||||
|
||||
Baseline: `fbf2eb9e`. The read-only audit passed `bun run typecheck`, `bun run lint:check`, and 39 focused tests / 384 assertions across canonical SMA, strategy-runtime, canonical-durable-runner, QuestDB configuration and chart lifecycle suites. It did not rerun the complete PostgreSQL/browser suites or performance measurements. The planning stories below do not claim additional implementation or test completion.
|
||||
|
||||
### CL-F01 — High / Verified — Configuration precedence and field loss
|
||||
|
||||
A no-connection probe supplied enabled PostgreSQL/MongoDB/cache configuration and explicitly disabled those services through builder options. The resolved configurations stayed enabled; QuestDB's disable option behaved differently. PostgreSQL SSL/pool/timeout fields also exist in the core schema but are omitted by the DI schema/registration path.
|
||||
|
||||
Evidence: [builder precedence](../../../libs/core/di/src/container/builder.ts#L88), [core PostgreSQL schema](../../../libs/core/config/src/schemas/database.schema.ts#L4), [DI PostgreSQL schema](../../../libs/core/di/src/config/schemas/postgres.schema.ts#L3), [registration](../../../libs/core/di/src/registrations/database.registration.ts#L43). Story: [CL02](tasks/CL02.md).
|
||||
|
||||
### CL-F02 — High / Verified — Partial shared startup retains resources
|
||||
|
||||
An isolated cache-success/mongo-failure probe recorded cache connection and startup rejection without cache disconnection. Shared initialization uses Promise.all without rollback; timeout timers are not cleared on settled initialization. This differs from C04's completed ModeManager-specific recovery scope.
|
||||
|
||||
Evidence: [shared lifecycle](../../../libs/core/di/src/utils/lifecycle.ts#L24), [timeout creation](../../../libs/core/di/src/utils/lifecycle.ts#L97), [builder startup](../../../libs/core/di/src/container/builder.ts#L74). Story: [CL03](tasks/CL03.md).
|
||||
|
||||
### CL-F03 — High / Verified — Older infrastructure tests can pass without proving production behavior
|
||||
|
||||
DI success tests accept any exception as a passing result and replace production normalization with a module-local implementation. The older QuestDB client suite exercises a SimpleQuestDBClient defined in the test file; it is not production client transport coverage. Existing newer real-path tests remain valuable.
|
||||
|
||||
Evidence: [permissive assertions](../../../libs/core/di/test/container-builder.test.ts#L114), [test client](../../../libs/data/questdb/test/questdb.test.ts#L9), [instantiation](../../../libs/data/questdb/test/questdb.test.ts#L121). Story: [CL01](tasks/CL01.md). CL02 extends real wire-configuration coverage; this finding is not authority for an unrelated test-suite rewrite.
|
||||
|
||||
### CL-F04 — High / Verified — Shared research logic is imported from application internals
|
||||
|
||||
The web API imports orchestrator dataset validation, reporting and host build/sandbox helpers through source-relative paths. Reusable pure domain code and runtime integration are mixed in the import boundary. Only the pure subset should move; runtime adapters retain their process responsibilities.
|
||||
|
||||
Evidence: [admission imports](../../../apps/stock/web-api/src/services/canonical-research.service.ts#L31), [report import](../../../apps/stock/web-api/src/services/backtest-v2.service.ts#L37), [dataset implementation](../../../apps/stock/orchestrator/src/data/historical-dataset-v2.ts#L1). Story: [CL05](tasks/CL05.md).
|
||||
|
||||
### CL-F05 — Medium / Verified — Dataset response structures are maintained independently
|
||||
|
||||
The browser backtest client contains a large manifest/preparation schema overlapping backend dataset structures and workbench eligibility checks. Shared structures can be consolidated while full content/hash verification remains server-owned.
|
||||
|
||||
Evidence: [browser manifest](../../../apps/stock/web-app/src/features/backtest/services/backtestApiV2.ts#L113), [dataset metadata](../../../apps/stock/orchestrator/src/data/historical-dataset-v2.ts#L34), [eligibility](../../../apps/stock/web-api/src/services/canonical-research.service.ts#L51). Story: [CL06](tasks/CL06.md).
|
||||
|
||||
### CL-F06 — Medium / Verified — Repeated experiment-client transport plumbing
|
||||
|
||||
Experiment and durable validation clients separately implement fetch, abort handling, JSON parsing, expected-status checks and domain-error wrapping. A small common transport layer can remove repetition while domain parsers and uncertain-acceptance rules remain explicit.
|
||||
|
||||
Evidence: [experiments](../../../apps/stock/web-app/src/features/experiments/services/experimentApi.ts#L44), [validation](../../../apps/stock/web-app/src/features/experiments/services/chronologicalValidationDurableApi.ts#L29). Story: [CL07](tasks/CL07.md).
|
||||
|
||||
### CL-F07 — Medium / Verified — Application modules combine independent lifetimes
|
||||
|
||||
At this baseline BacktestServiceV2 is 1,071 lines, StrategyDetailPage 796, ExperimentEditor 623, BacktestDetailPageV2 645 and useBacktestV2 571. The finding is mixed responsibility/state ownership, not a line-count rule: template operations, run admission, reproduction, version publication, preview ownership and selected-run monitoring have different lifetimes.
|
||||
|
||||
Evidence: [backtest service](../../../apps/stock/web-api/src/services/backtest-v2.service.ts#L167), [strategy detail](../../../apps/stock/web-app/src/features/strategies/StrategyDetailPage.tsx#L20), [experiment editor](../../../apps/stock/web-app/src/features/experiments/components/ExperimentEditor.tsx#L49), [backtest hook](../../../apps/stock/web-app/src/features/backtest/hooks/useBacktestV2.ts#L34). Stories: [CL08](tasks/CL08.md), [CL09](tasks/CL09.md), [CL10](tasks/CL10.md), [CL11](tasks/CL11.md).
|
||||
|
||||
### CL-F08 — Medium / Verified — Developer commands are inconsistent or stale
|
||||
|
||||
Root db:setup-ib, db:init and proxy commands point at absent files. docker:start omits MongoDB while infra:up includes it. These are command/configuration defects, not evidence that missing setup capabilities should be reimplemented from scratch.
|
||||
|
||||
Evidence: [root commands](../../../package.json#L55), [Docker helper](../../../scripts/docker.sh#L93). Story: [CL04](tasks/CL04.md).
|
||||
|
||||
### CL-F09 — Medium / Verified — Retired execution seams remain in current control flow
|
||||
|
||||
Current admission rejects non-catalog execution, but later retains a legacy snapshot fallback. The runner retains an explicit retired entrypoint, and the native wrapper exposes old and canonical exports together. Their presence is verified; unused/deletable status is not inferred. Historical readers, artifacts and useful old algorithms must survive.
|
||||
|
||||
Evidence: [canonical guard](../../../apps/stock/web-api/src/services/backtest-v2.service.ts#L461), [fallback](../../../apps/stock/web-api/src/services/backtest-v2.service.ts#L486), [retired entry](../../../apps/stock/orchestrator/src/backtest/BacktestRunner.ts#L70), [native exports](../../../apps/stock/engine/index.mjs#L28). Story: [CL12](tasks/CL12.md), limited to proven control-flow cleanup and boundary checks.
|
||||
|
||||
### CL-F10 — Low / Verified — Primary navigation advertises placeholder pages
|
||||
|
||||
Portfolio, Analytics and Settings appear in navigation while their routes only render Coming Soon. Existing run/experiment analytics are separate working capabilities and must remain accessible.
|
||||
|
||||
Evidence: [navigation](../../../apps/stock/web-app/src/lib/constants.ts#L32), [placeholder routes](../../../apps/stock/web-app/src/app/App.tsx#L34). Story: [CL13](tasks/CL13.md).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue