docs: close architecture cleanup backlog with verified results

This commit is contained in:
Boki 2026-10-28 16:11:14 -04:00
parent 8c54eb7e12
commit f8ca9b529b
6 changed files with 156 additions and 40 deletions

View file

@ -1,6 +1,8 @@
# Revised development roadmap
Current status — October 28, 2026: **99/99 selected tasks complete**, with five optional extensions deferred and four merged redirects in the [manifest](backlog/manifest.json). The owner explicitly resumed performance and authorized judgment on all seven remaining conditions. P08's measured local strategy-state optimization and O02's truthful diagnostics are implemented in `70d173a9` and `8c858b9d`. No task remains active or ready.
Current status — October 28, 2026: **113/113 selected tasks complete**, with five optional extensions deferred and four merged redirects in the [manifest](backlog/manifest.json). All 14 whole-application cleanup tasks (CL22–CL35) are committed and verified; see the [execution record](architecture-cleanup-execution.md). No selected task remains active or ready.
The cleanup establishes explicit shared API/orchestrator modules, a public strategy authoring contract, shared validated HTTP responses, one research-service composition point, isolated historical writers, container-owned ingestion initialization and correct queue draining. It preserves the authoritative Rust financial engine and durable execution behavior.
The [conditional review](conditional-review.md) records raw measurements, preserved invariants, verification and all seven dispositions. D04/P03/P05/P06/CL21 are not selected now: caching, residency, paging and DSL work need representative bottleneck evidence; replay extraction needs a concrete upcoming change. They remain unimplemented, not silently cancelled or counted as done. Performance is no longer paused. Research/paper readiness stays distinct, native execution is explicitly unverified until run start, and real paper/live activation and multi-asset financial-policy gates remain unchanged.

View file

@ -1,41 +1,44 @@
# Whole-application architecture cleanup
Baseline `1a9f07b2`. Owner authorized all October 28 audit recommendations and a commit after each validated task. Manifest owns status; CL22–CL35 task files own scope. Five speculative extensions remain deferred.
**Complete: 14/14 cleanup tasks; 113/113 selected backlog tasks.** Baseline `1a9f07b2`. The owner authorized all October 28 audit recommendations and a commit after each validated task. Five optional extensions remain deferred; four merged IDs are redirects.
Agents use root-reserved disjoint files in the integration worktree. Root alone stages, commits and builds shared outputs. Each task receives review and focused verification; final combined gates validate the integrated source. No isolated native agent-build claim is made.
Agents worked on root-reserved, disjoint files in the integration worktree. Root reviewed and committed each task and built shared outputs. Independent reviews checked shared custody, composition, transactions, analytics startup and queue/handler lifecycle. No isolated native agent-build claim is made.
## Completed changes
## Changes and commits
| Task | Result | Commits |
| --- | --- | --- |
| [CL22](backlog/tasks/CL22.md) | Own queue transports without deleting pending payloads | `3fc0a272`, `1aa35d2d` |
| [CL23](backlog/tasks/CL23.md) | Reject retired backtest creation before persistence | `cd1aa614` |
| [CL24](backlog/tasks/CL24.md) | Remove prototype dashboard from normal navigation | `5400dba4` |
| [CL25](backlog/tasks/CL25.md) | Share validated product response contracts | `366a6054`, `2a9382a2`, `ed7429cf` |
| [CL26](backlog/tasks/CL26.md) | Replace private application imports with explicit shared modules | `b4589d5a`, `33e22404` |
| [CL27](backlog/tasks/CL27.md) | Initialize enabled ingestion handlers once per container | `5c9e32d0`, `dac49ac1` |
| [CL28](backlog/tasks/CL28.md) | Compose research services with explicit collaborators | `24487d35` |
| [CL29](backlog/tasks/CL29.md) | Share transactional experiment run and dispatch insertion | `731acc41` |
| [CL30](backlog/tasks/CL30.md) | Separate research UI workflow state from rendering | `a411f9a6` |
| [CL31](backlog/tasks/CL31.md) | Publish a stable strategy authoring contract | `3a63b203` |
| [CL32](backlog/tasks/CL32.md) | Separate paper safety enforcement from readiness projection | `2165a2ef` |
| [CL33](backlog/tasks/CL33.md) | Isolate legacy repository writers from production capabilities | `ec582bd5` |
| [CL34](backlog/tasks/CL34.md) | Normalize provider symbols and remove unused scaffolding | `e2292e48` |
| [CL35](backlog/tasks/CL35.md) | Make optional Python analytics composition honest and testable | `7ae6ac21` |
The API and orchestrator now share server-side historical storage, admission and lazy artifact inspection through `libs/trading-runtime`. Browser-safe contracts remain in `stock-config`, and strategy authors use the type-only `@stock-bot/research/strategy-api`. Rust remains authoritative for financial semantics. Existing compatibility paths preserve historical readers and tests.
- **CL24:** Root reviewed route compatibility, removed demo-only consumers and real App rendering. Focused home/navigation tests passed; scoped lint/format passed. Final browser gate pending combined source.
Independent review caught the queue's previous worker timeout of two seconds and manager timeout of five seconds falsely completing shutdown. Follow-up commits retain the actual drain promise; the regression runs beyond both former deadlines and proves transports stay usable until the worker completes. A real Redis fixture verifies pending payload survival and later consumption.
- **CL22:** Queue library tsc build passed; independent root queue-lifecycle and cache-ownership suites passed (see /tmp/stock-bot-cl22-root.log). Scoped lint/format passed. Pending payload ownership, drain behavior, and connection cleanup covered without service mutation.
## Final verification
- **CL23:** Independent root retired-backtest-api, catalog-backtest-contract and backtest-result-mapping suites: 16 passed, 125 assertions. Scoped lint/format passed. Regression verifies no writes on retired V1/implicit autostart, explicit save-only behavior and preserved historical read/cancellation.
- `CARGO_BUILD_JOBS=2 bun run check`: all gates passed — build, source/contract types, secret audit, lint, 179 tooling, 43 utility, 44 calculation, 1,609 integration and 150 Rust tests.
- `bun run test:postgres`: **287 passed**, 2949 assertions, 0 conditional skips; disposable PostgreSQL/Redis only. Covers transaction rollback, duplicate submissions, numbering, holdout boundaries, leases, recovery, paper safety, provider mapping and queue shutdown.
- `bun run test:e2e`: **27 Chromium workflows passed**, 971 assertions, against the same disposable stores and a fresh production web build.
- `bun run test:analytics-api`: **11 passed**, including actual FastAPI app import/lifespan with missing optional dependencies, structured unavailable responses and successful runtime stubs.
- Additional new-test lint, scoped formatting and whitespace checks passed. Native addon SHA256: `df0ecbd5c3772d7e8aeb0226b40ae290cfaddf9d87fb3a7375f2a31c2acf05e5`.
- **CL27:** Root rebuilt DI and independently ran ingestion-handler-initialization: 6 passed, 27 assertions. Enabled-instance identity, two-container isolation, failure propagation, operations waiting for init, unchanged schedules and duplicate registration covered. Scoped lint/format passed.
The first combined check exposed Bun bundling descriptor interference and two old web fixtures using incomplete records/wrong success statuses. Bundling probes now use isolated processes, fixtures match actual 202 run and 201 review responses, and the complete repository gate passed on rerun. Chromium also caught valid historical SQL-null configuration rejected by the new response schema; nullable read contracts and guarded UI access now preserve those records, with regression coverage. Browser error assertions now follow the actual server and transport diagnostics.
- **CL34:** Independent provider normalization suite: 6 passed, 10 assertions. Disposable PostgreSQL pipeline safety: 8 passed, 28 assertions, including verified mapping preservation, unverified update and replay identity. Scoped lint/format passed; active QM session manager preserved.
The subprocess replay regression now has a 30-second deadline (`8c54eb7e`); its financial and hash assertions are unchanged. Its previous five-second deadline timed out during concurrent browser verification. The final repository check ran sequentially and passed.
- **CL25:** Shared response wire schemas and server type aliases; root mapping/date/invalid-response/run-control tests 59 passed (388 assertions), agent complete focused UI/transport/reproduction set 358 passed. Scoped lint/format passed. Preserves historical optional records and submission receipt/idempotency guards.
Four manual Rust cases remain ignored, and 14 opt-in real OS-isolated candidate integration tests were not enabled. Python successful scientific and multipart paths use stubs; heavy optional runtimes were not installed. This cleanup does not claim new market-data coverage, faster backtests, or live-trading readiness.
- **CL32:** Independent pure projection/runtime suite 4 passed, 22 assertions; disposable PostgreSQL paper-runtime suite 22 passed, 143 assertions. Verified atomic expiry latch, rollback on storage failure, no implicit reactivation, stale generation and restart recovery. Scoped lint/format passed.
- **CL26:** Moved existing shared server helpers to explicit trading-runtime subpaths, shared financial wire contracts to config, split metadata verifier from executable loader, and made artifact paths lazy. Config/runtime/API/orchestrator builds and full source typecheck passed. Architecture/Turbo/browser gates: 30 passed (7363 assertions); shared admission/storage/feed tests passed; isolated retained worker final15 passed after preserving rejection diagnostics. Native finance unchanged.
- **CL35:** Actual FastAPI app/lifespan and optional capability tests: 11 passed. Missing scientific/multipart dependencies do not prevent unrelated routes; unavailable initialization returns503, health observes state. Successful optimizer/model paths tested with stubs; load-to-list output shape corrected and covered. No heavy scientific packages installed.
- **CL30:** Independent workspace/finding UI suites: 203 passed, 1306 assertions; agent full relevant UI set344 passed, 2143 assertions. Full source typecheck and scoped lint/format passed. Extracted feature-owned read/draft/write hooks; neutral styles and unsaved warning imports replace cross-feature dependencies; custody and uncertainty behavior preserved.
- **CL31:** Independent public-author/runtime suite:25 passed,363 assertions; standalone compilation uses no repository aliases or orchestrator/native implementation types. Source and packaged strategies produce identical native traces/checkpoints; contract compilation and scoped lint/format passed. Old contract path is a type-only compatibility export.
- **CL28:** One application composition graph with narrow collaborators and caller-owned transactions; independent review no blockers. Focused API45 passed547 assertions; root combined composition/capability5 passed1091 assertions. Disposable PG research/validation/walk-forward/paper/durable gates69 passed602 assertions plus catalog/durable-validation17 passed186 assertions. Scoped lint/format passed.
- **CL33:** Canonical concrete/unavailable repositories expose supported writes only; legacy adapter reuses exact fencing helpers and unchanged method bodies. Root capability/composition5 passed1091 assertions. Disposable PG durable/canonical/retention/catalog tests passed in69+17-test gates; source and contract typechecks pass. Historical readers and supported runtime behavior preserved.
- **CL22:** Independent review reproduced premature worker drain at2s. Follow-up removes false-success2s/5s queue deadlines; actual Queue.close is idempotent and retains workers/transports until completion. Deferred-worker regression crosses both old deadlines; real Redis DB15 smoke preserves queued payloads through observer/producer shutdown and subsequent consumption. Root queue build and focused tests passed; service-level exit deadline remains authoritative.
- **CL29:** Shared insertion helper preserves exact run/outbox SQL payload and order under caller-owned transaction; UUIDs, numbering, locks, quotas, receipts and holdout choice stay with callers. Focused26 tests351 assertions passed; independent SQL review no blockers. Complete repository check passed; full disposable PostgreSQL/Redis287 tests2949 assertions passed, including duplicate keys, second-dispatch rollback and heldout admission.
- **CL25:** Chromium caught a valid historical SQL-null configuration rejected by the new schema. Read contracts now preserve null and canonical setup/detail access is guarded; no stored records rewritten. Source typecheck and108 focused tests835 assertions passed; final Chromium27 workflows971 assertions passed, including historical unavailable-results and run-error recovery. Error assertions follow real server/transport responses.
Full command logs for this session are `/tmp/stock-bot-architecture-cleanup-check-final.log`, `/tmp/stock-bot-architecture-cleanup-postgres.log`, `/tmp/stock-bot-architecture-cleanup-browser.log` and `/tmp/stock-bot-cl35-root.log`. Task files retain focused acceptance evidence; [manifest.json](backlog/manifest.json) remains the canonical status record.

View file

@ -1,8 +1,8 @@
# Canonical development backlog
**Active: E13 architecture cleanup, CL22–CL35 (14/14 complete).** Owner authorized all October 28 audit recommendations and a commit per validated task. Earlier completion counts below are historical. [Execution record](../architecture-cleanup-execution.md).
**E13 architecture cleanup: CL22–CL35 (14/14 complete).** Each task is committed and the combined repository, database and browser gates passed. [Execution record](../architecture-cleanup-execution.md). Earlier milestone counts below are historical.
**Current scheduled backlog: 99/99 complete.** The owner resumed performance and authorized review of all seven conditions. P08 and O02 are implemented; five optional extensions remain deliberately deferred, and four merged IDs are redirects. This is not a claim that all 108 retained IDs were implemented. [Decisions, measurements and validation](../conditional-review.md).
**Current scheduled backlog: 113/113 complete (100%).** The October 28 whole-application cleanup adds 14 completed tasks to the earlier 99. Five optional extensions remain deliberately deferred, and four merged IDs remain redirects. [Conditional decisions](../conditional-review.md).
**The original 45/45 scheduled tasks are complete.** The canonical Rust engine, TypeScript research/workbench, bounded worker pool, isolated candidates, AI evidence workflow and human-reviewed paper promotion are validated. Implementation commits: `bbf0dd4`, `26b9726`, `25b5cbf` (R07 measurement `ab08db8`). Six conditional tasks remain deferred; four merged IDs remain redirects. This is scheduled-backlog completion, not live-trading activation.
@ -12,7 +12,7 @@
[manifest.json](manifest.json) owns scheduling metadata: status, priorities, dependencies, ADR approvals, assignments and write locks. Task Markdown owns implementation scope/evidence/acceptance. This index and the [graph](dependencies.mmd) are derived views. Only the planning/integration owner updates scheduling state.
**Current total: 108 retained IDs — 99 done, 5 deferred, 4 merged.** No task is ready or active. P08/O02 source commits are `70d173a9` / `8c858b9d`. Deferred tasks retain concrete reopen conditions; the earlier blanket performance pause is superseded by the October 28 owner instruction. The manifest owns scheduling and completion evidence.
**Current total: 122 retained IDs — 113 done, 5 deferred, 4 merged.** No selected task is ready or active. D04/P03/P05/P06/CL21 retain their documented reopen conditions. The manifest owns scheduling and verification evidence.
States: ready, claimed, in_progress, review, done, blocked, deferred, merged. “Ready” means no code/ADR prerequisite, not execution authority. Implementation dependencies require accepted integration. `release_gates` govern enabling an end-to-end feature, not component coding or integration; conditional gates apply only to the named capability. F05 may integrate before F06, but its replay behavior is not released until F06 proves it.

View file

@ -365,3 +365,24 @@ flowchart TD
R04 --> RP32
RP30 --> RP32
subgraph E13["E13: Whole-application architecture cleanup"]
CL22["CL22: Own queue transports without deleting pending payloads"]
CL23["CL23: Reject retired backtest creation before persistence"]
CL24["CL24: Remove prototype dashboard from normal navigation"]
CL25["CL25: Share validated product response contracts"]
CL26["CL26: Replace private application imports with explicit shared modules"]
CL27["CL27: Initialize enabled ingestion handlers once per container"]
CL28["CL28: Compose research services with explicit collaborators"]
CL29["CL29: Share transactional experiment run and dispatch insertion"]
CL30["CL30: Separate research UI workflow state from rendering"]
CL31["CL31: Publish a stable strategy authoring contract"]
CL32["CL32: Separate paper safety enforcement from readiness projection"]
CL33["CL33: Isolate legacy repository writers from production capabilities"]
CL34["CL34: Normalize provider symbols and remove unused scaffolding"]
CL35["CL35: Make optional Python analytics composition honest and testable"]
end
CL26 --> CL28
CL28 --> CL29
CL25 --> CL30
CL26 --> CL31

View file

@ -1,6 +1,6 @@
{
"schema_version": 1,
"plan_revision": "2026-10-28.143",
"plan_revision": "2026-10-28.144",
"repository_base": "b7aeca4",
"plan_status": "architecture_cleanup_complete",
"execution_authorized": true,
@ -30,6 +30,27 @@
"implemented": ["P08", "O02"],
"reviewed_not_selected": ["D04", "P03", "P05", "P06", "CL21"],
"record": "conditional_review"
},
"architecture_cleanup": {
"authorized_by": "Owner: do it all till 100% commit after each",
"tasks": [
"CL22",
"CL23",
"CL24",
"CL25",
"CL26",
"CL27",
"CL28",
"CL29",
"CL30",
"CL31",
"CL32",
"CL33",
"CL34",
"CL35"
],
"status": "complete",
"record": "architecture-cleanup-execution.md"
}
},
"cleanup_scope": {
@ -3817,7 +3838,7 @@
"complexity": "M",
"assignment": null,
"write_locks": ["CL25"],
"completed_commit": "2a9382a201477590c93b76ed7c82caec405cd8af",
"completed_commit": "ed7429cfbc0d792249c13d92328f6fd1ae0a6ac2",
"blocker": null,
"release_gates": [],
"completion_evidence": "architecture-cleanup-execution.md",
@ -10214,17 +10235,31 @@
},
"completion_summary": {
"date": "2026-10-28",
"scheduled_complete": 99,
"scheduled_total": 99,
"scheduled_complete": 113,
"scheduled_total": 113,
"scheduled_percent": 100,
"deferred_conditional": 5,
"merged_redirects": 4,
"retained_total": 108,
"retained_total": 122,
"implementation_commits": {
"P08": "70d173a908eadac53941cc931b1f6cd3ca4070af",
"O02": "8c858b9d5ca4675d064c4a853b0e9575a84872cb"
"O02": "8c858b9d5ca4675d064c4a853b0e9575a84872cb",
"CL22": "1aa35d2db330179c4b19a6dadaacdb0b23761d3b",
"CL23": "cd1aa6148119ea364de52bcfb4cfa1bac8259ca9",
"CL24": "5400dba47ee4fbd0f1aa0f12a358864df6bb7a38",
"CL25": "ed7429cfbc0d792249c13d92328f6fd1ae0a6ac2",
"CL26": "33e224048ff326e482ad452f48ad5590a753373b",
"CL27": "dac49ac1b89414afd980dfb6b57f0fb153ca981e",
"CL28": "24487d35daef7bd09af09905a7dfca3955aec5a7",
"CL29": "731acc41db221887e3e527fe0cc139f739273975",
"CL30": "a411f9a6659014a3a2f1cedd7f3d4ed5f23dbe54",
"CL31": "3a63b2039e8f6b874d5cb1e1748c688a10f98c11",
"CL32": "2165a2efa845b601ce478d59d31bce5ea5cfbaa4",
"CL33": "ec582bd5e8d3cad13e03486e345a0f383e5a087e",
"CL34": "e2292e4883516cf2e4cb5d19d3dff003f60567b7",
"CL35": "7ae6ac21c471f8841ba1985b5ce0d42c04401704"
},
"scope": "All selected work complete. All seven conditions reviewed; five optional extensions intentionally remain deferred. Performance pause superseded by explicit resumption. Financial policy and paper/live activation gates unchanged."
"scope": "All113 selected tasks complete, including E13 CL22\u2013CL35. Five optional extensions remain deliberately deferred. This is not live-trading activation or a claim that every retained ID was implemented."
},
"completion_review": {
"date": "2026-10-28",
@ -10410,6 +10445,57 @@
"work_policy": "Root integrates/commits reviewed tasks; agents own disjoint explicit files in the root integration worktree. Only root builds shared outputs and runs combined gates. No isolated native agent build claim.",
"first_wave": ["CL22", "CL23", "CL24"],
"completed": 14,
"last_verification": "Chromium caught a valid historical SQL-null configuration rejected by the new schema. Read contracts now preserve null and canonical setup/detail access is guarded; no stored records rewritten. Source typecheck and108 focused tests835 assertions passed; final Chromium27 workflows971 assertions passed, including historical unavailable-results and run-error recovery. Error assertions follow real server/transport responses."
"last_verification": "Chromium caught a valid historical SQL-null configuration rejected by the new schema. Read contracts now preserve null and canonical setup/detail access is guarded; no stored records rewritten. Source typecheck and108 focused tests835 assertions passed; final Chromium27 workflows971 assertions passed, including historical unavailable-results and run-error recovery. Error assertions follow real server/transport responses.",
"verification": {
"repository_check": {
"command": "CARGO_BUILD_JOBS=2 bun run check",
"status": "passed",
"log": "/tmp/stock-bot-architecture-cleanup-check-final.log",
"tooling": 179,
"utilities": 43,
"calculations": 44,
"integration": {
"passed": 1609,
"skipped": 14
},
"rust": {
"passed": 150,
"ignored": 4
},
"build_types_contracts_lint_secrets": "passed"
},
"postgres": {
"passed": 287,
"skipped": 0,
"assertions": 2949,
"failed": 0,
"log": "/tmp/stock-bot-architecture-cleanup-postgres.log"
},
"browser": {
"passed": 27,
"skipped": 0,
"assertions": 971,
"failed": 0,
"log": "/tmp/stock-bot-architecture-cleanup-browser.log"
},
"analytics_api": {
"passed": 11,
"log": "/tmp/stock-bot-cl35-root.log",
"successful_scientific_runtimes": "stubbed"
},
"native_binary_sha256": "df0ecbd5c3772d7e8aeb0226b40ae290cfaddf9d87fb3a7375f2a31c2acf05e5",
"limitations": [
"14 opt-in real OS-isolated candidate tests were not enabled.",
"Four manual Rust cases remain ignored.",
"Python scientific and multipart success paths use stubs; heavy optional runtimes were not installed."
],
"independent_reviews": [
"CL26 shared custody/build boundaries: no blockers.",
"CL28 composition and transactions: no blockers.",
"CL29 SQL ordering and caller ownership: no blockers.",
"CL35 lazy optional capabilities: no blockers.",
"CL22/CL27 review found premature worker drain; corrected and verified beyond both former deadlines and with Redis."
]
}
}
}

View file

@ -8,6 +8,10 @@ Frontend run observation/submission, strategy cloning/version inspection and exp
submission each have focused hooks/components beside their existing pages. These moves
preserve the Rust financial engine and saved-run contracts described below.
The API and orchestrator share server helpers through [`libs/trading-runtime`](../../libs/trading-runtime/package.json): historical storage, retained-package verification, paper admission and lazy build identity inspection. These modules do not run strategies or simulate money. Browser-safe wire schemas live under [`stock-config/contracts`](../../apps/stock/config/src/contracts), and strategy authors import only types from `@stock-bot/research/strategy-api`.
[`createResearchServices()`](../../apps/stock/web-api/src/services/research-services.ts) is the API composition point: it shares experiment, validation, evidence and result readers explicitly. The production run repository exposes canonical operations; historical write fixtures use the private compatibility adapter. On the web side, research read/edit/save lifecycles live in [feature hooks](../../apps/stock/web-app/src/features/research/hooks/useResearchEntry.ts), while components render their state.
[Guide home](README.md) · [System map](system-map.md) · [Backtest walkthrough](backtest-walkthrough.md) · [Strategy authoring](strategy-development.md)