refactor: share research domain and simplify application workflows
This commit is contained in:
parent
805a9f8fd4
commit
8c39ccf7ea
58 changed files with 3805 additions and 3081 deletions
|
|
@ -31,3 +31,77 @@ intentionally owns DB1 and its service/global namespace; core `db`/`keyPrefix` d
|
|||
that isolation policy. Core `ttl`, retry hints and QuestDB buffer/flush metadata are not
|
||||
claims that the shared DI client supports writer/cache tuning; those adapter APIs remain
|
||||
unchanged. Financial inputs, hashes and accounting were not modified.
|
||||
|
||||
## CL05–CL13 — Shared domain and application cleanup
|
||||
|
||||
- CL05 adds one `@stock-bot/research` workspace with browser-safe contracts, server
|
||||
normalization/hashing and statistical reports. Orchestrator paths re-export the one
|
||||
implementation. Legacy V1 adaptation stays application-owned and calls an explicit
|
||||
parent-hash factory; existing pure stock-config contracts are reused.
|
||||
- CL06 reuses shared manifest structures and structural eligibility policy in API/browser
|
||||
admission. Preparation-specific parent-hash/null and response refinements remain explicit;
|
||||
server content validation and client expected-identity checks remain separate.
|
||||
- CL07 shares cookie JSON transport for experiment, chronological and walk-forward clients.
|
||||
Domain parsing, uncertain acceptance, receipt identities and endpoint errors remain local.
|
||||
No automatic retry or research-token/browser credential mixing is introduced.
|
||||
- CL08 retains BacktestServiceV2 as a compatible facade over template, run/control,
|
||||
reproduction and result operations. Row mapping and contracts are shared locally. SQL
|
||||
transactions retain their original ordering and pass the same connection into result reads.
|
||||
- CL09 separates metadata presentation, version/artifact comparison and clone-receipt state
|
||||
from the strategy route. Publication continues using the existing CandidatePublication.
|
||||
- CL10 separates saved-template loading and the preview/submission coordinator. One phase
|
||||
replaces coupled ordinary-submission flags; the immediate submission lock/ref and exact
|
||||
frozen receipt remain necessary across ordinary/chronological/walk-forward modes.
|
||||
- CL11 separates run selection/polling/results/cancellation and submission receipt lifetime
|
||||
from editable-template state. The useBacktestV2 public return contract is preserved.
|
||||
- CL12 removes the impossible legacy snapshot fallback after canonical admission. Current
|
||||
run writes use the admitted canonical request/hash. Legacy template adapters, saved result
|
||||
readers, historical provenance parsing, retired REST/runner rejection and native exports
|
||||
remain. No algorithms, calculation library or retained executable artifacts were deleted.
|
||||
- CL13 hides only the three verified placeholder menu items; their URLs show explicit
|
||||
availability messages and links to existing backtest/experiment analytics. AuthGate and
|
||||
all working route identities remain unchanged.
|
||||
|
||||
Review focused on receipt lifetime and navigation races, original request/result identity,
|
||||
transaction ordering, single-connection reads, hash/property-order preservation, client
|
||||
bundle boundaries, and avoiding additional framework layers. The public facade re-exports
|
||||
its original contracts; internal helper/container types are not new public API.
|
||||
|
||||
Intermediate verification:
|
||||
|
||||
- Workspace build — 28/28 tasks pass.
|
||||
- Domain/native/UI group — 174 pass; one initial architecture allowlist failed on the
|
||||
newly shared **pure** report subpath. Added the narrow allowlist plus tests verifying the
|
||||
new package has no application/service imports and browser contracts bundle successfully.
|
||||
- Strategy/publication/experiment/transport group — 218 pass / 931 assertions.
|
||||
- Run-control/workbench/reproduction UI group — 83 pass / 472 assertions.
|
||||
- Backend/reproduction/result/navigation group — 28 pass / 184 assertions.
|
||||
- First full check found the missing-config disabled MongoDB URI regression; corrected
|
||||
the schema-valid default instead of weakening validation. Store/offline/paper-composition
|
||||
focused group then passed 22 tests / 129 assertions.
|
||||
- Final `CARGO_BUILD_JOBS=2 bun run check` — pass: 132 tooling, 43 utility, 44 calculation,
|
||||
1,221 integration tests (14 explicitly skipped), 150 Rust tests (4 ignored), plus build,
|
||||
type/contract checks, secret audit and lint. Conditional OS-isolation tests remain skipped
|
||||
under their existing explicit runtime gate; this cleanup does not certify live trading.
|
||||
- DI builder/general/lifecycle focused group — 32 pass; root integration separately covers
|
||||
startup rollback and store configuration.
|
||||
|
||||
The first disposable PostgreSQL suite ran concurrently with the first repository check,
|
||||
encountered the same pre-fix disabled-Mongo default, then Bun 1.2.17 segfaulted. That attempt
|
||||
is not a pass. A fresh full suite runs after the successful repository check on the corrected
|
||||
build; final PostgreSQL/browser outcomes are recorded below. Sandbox-restricted native
|
||||
worker spawning also failed initially; its rerun outside the sandbox used the assigned
|
||||
checkout and correctly built addon rather than weakening worker checks.
|
||||
|
||||
Final integration evidence:
|
||||
|
||||
- `PIPELINE_TEST_DATABASE_URL=<disposable PostgreSQL>/stock_bot_safety BACKTEST_TEST_REDIS_URL=<disposable Redis>/15 bun run test:postgres` — **273 pass, 0 fail, 2,617 assertions, 34 files**. Fresh run completed after the runtime crash noted above; it includes single-connection reproduction, concurrent receipts/outbox transactions, recovery, ownership and unchanged native economics.
|
||||
- The same fixture URLs with `bun run test:e2e` — **18 pass, 0 fail, 655 assertions** using installed Chromium and a freshly built frontend. Includes native smoke, version clone, archived history, experiments/validation and research evidence workflows.
|
||||
- Final review added an explicit unknown-VWAP guard to `createDatasetV2FromLegacy`: the former private application adapter guaranteed this invariant before normalization. Its shared entrypoint now rejects contradictory provenance before returning a prepared dataset. Dataset/report focused suites passed **25 tests / 515 assertions**, including detached validation, golden hashes and malformed parent hashes. Typecheck/lint passed again.
|
||||
- Temporary PostgreSQL and Redis fixture containers were removed after both suites. Existing development stores and environment files were preserved.
|
||||
- After the final boundary guard, `CARGO_BUILD_JOBS=2 bun run check` passed again on the final application tree: **1,222 integration tests** (14 existing skips), **150 Rust tests** (4 ignored), plus all build/type/contract/tooling/utility/calculation/secret/lint gates. No application edits followed that pass.
|
||||
|
||||
All 13 implementations are validated. Their manifest status is `review`, because these
|
||||
stories define independent review as part of done and this execution used one agent.
|
||||
The earlier first-four `done` entries were corrected to `review` for consistency; this is
|
||||
an outstanding reviewer sign-off, not unfinished implementation or a failing test gate.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue