docs(research): close RP03 and RP04 with validation evidence

This commit is contained in:
Boki 2026-10-27 01:09:27 -04:00
parent d2b78eacdf
commit 7f7c07e35f
4 changed files with 58 additions and 15 deletions

View file

@ -81,3 +81,35 @@ Baseline total return was approximately -0.054575%. The fixed SMA 3/8 cost scena
Independent reviewer `/root/review_cleanup_backend` accepted 2,374 file-only assertions across the nine results and finding: fixed-eight cash/fee/quantity/P&L/owner reconciliation, no negative cash or position quantity in the observed fills, exact artifact/lock and sliced-dataset identities, reproduction hashes, sealed report/selection hashes, training-only winner, unchanged non-cost policy and all 19 evidence references. This audit does not claim to cover every possible risk path or independently prove unrelated database state was untouched. Full failure-oriented repository/PostgreSQL tests provide the broader regression gate.
Actual development Chromium signed in and reopened the [saved baseline and trades](http://localhost:5173/backtests/373e1046-64fc-409e-b414-da46fb20bea3/run/3f87ca4c-b61c-4eba-996a-94fdb525369d) and the [project finding](http://localhost:5173/research/59027da7-4e84-4c71-ac3e-10cab219f0c4). That browser context blocked every non-read API operation except authentication. Local `browser-reopened.json`, `execution-summary.json`, `execution-status.json`, `independent-audit.json` and `independent-review.mts` retain the completion evidence. The original execution plan and pending capability snapshots remain historical records; they were not rewritten to conceal the approval sequence.
## RP03 / RP04 — Session preparation and result interpretation
Owner continuation on October 27 authorized these two follow-ups; planning commit `76eb1b12` records their scope. RP03 (`d2b78eac`) adds an explicit declared-session choice to the existing stored-EOD preparation panel and API. RP04 (`302ba60e`) shows retained UTC evaluation bounds and exact elapsed calendar duration beside canonical metrics, explains CAGR's 365-calendar-day extrapolation, and distinguishes periodic-statistics annualization. No financial calculations, dataset hash format, risk policy or native execution semantics changed.
Session selection intersects the chosen series' declared calendar with its bounds, reads each window sequentially through the existing strict reader, snapshots returned values before another read and assigns global deterministic ordinals. The default continuous query and response remain compatible. Missing sessions, invalid selected rows and partial bars fail; no rows are coerced or post-filtered. The web client checks the echoed selection, fences stale responses and retains/retries the captured input and hash without source rereads. [Usage and limitations](../backtest-datasets.md#stored-eod-preparation-across-declared-sessions-v2).
Independent backend and frontend reviews accepted RP03. The backend's 44 focused tests / 361 assertions plus eight adversarial probes covered selected-calendar identity, invalid/empty windows, cancellation and mutation isolation. Independent frontend review passed 96 tests / 361 assertions covering selection echo, stale replies and retention locking. RP04's independent review passed 21 UI tests / 157 assertions; the duration formatter uses retained reporting facts and preserves all stored metrics/null reasons and the fills-only view. Root-authored PostgreSQL/browser tests were also independently reviewed.
Actual read-only AAPL five-minute source validation used explicitly declared October 1 and 2 windows, each 13:30–20:00 UTC:
| Evidence | Result |
| --- | --- |
| Continuous source query | 157 rows; preparation rejects the interior October 1 20:00 null-volume marker |
| Declared-session preview | Exactly two strict-reader queries; 156 unchanged bars, 78 per session |
| Repeated preview | Exact input rows, global ordinals and v2 hash reproduced |
| Raw selected capture SHA256 | `7e2925c8c97bcbb01406efdb5a5a8557c2135c0a1f28aa557c7ccf0e6f8dd067` |
| Prepared dataset hash | `3b2411cecc4014e7090f04d4220732968aec1a58041fce82b7149765d9ba00a3` |
| Independent actual-source validation | 2,366 assertions passed; no retention, database writes or research runs |
Ignored local evidence and the reproducible validator are under `.data/research-pilots/aapl-20241001-02-preparation/`. The calendar/action metadata explicitly declares engineering validation scope; eligibility means contract validity, not certified market coverage. Sequential reads are not an atomic database snapshot. Captured values define the eventual dataset; cancellation fences later reads/results but does not interrupt an already dispatched Mongo query. This two-session check is not evidence of strategy performance, market-data vintage or general completeness.
Combined checkout gates:
- `CARGO_BUILD_JOBS=2 bun run check`: passed — 134 tooling, 43 utility, 44 calculation, 1,266 integration and 150 Rust tests; 14 conditional integration skips and 4 ignored Rust measurement tests remain. Build, application/contract types, lint and secret audit passed.
- Relevant disposable PostgreSQL suites (`stored-dataset-preparation`, `dataset-source-preparation`, `canonical-research`): 14 passed / 169 assertions. Preview writes nothing; retention after source changes and retries save one exact dataset, with unrelated tables unchanged.
- Full Chromium workbench: 20 passed / 685 assertions. New coverage checks both displayed UTC windows, exact source queries, captured-input retention after source removal, unchanged template/no runs or dispatch, and the actual-native result horizon/CAGR explanation.
- Authored application/test types, focused zero-warning lint, production frontend build, formatting and diff checks passed. No development data was used as a mutable test fixture.
The initial sandbox checks could not reach fixture ports/launch Chromium or complete native workers. Authorized reruns passed. One browser attempt also overlapped the general frontend build and picked up the wrong API target; it was stopped, then the complete browser suite passed after serializing builds. Those interrupted attempts are not counted as successful validation. Logs: `/tmp/stock-bot-rp03-root-check-escalated.log`, `stock-bot-rp03-postgres.log`, `stock-bot-rp03-browser-final.log`, `stock-bot-rp03-root-test-types.log` and independent `stock-bot-rp03-*-review*.log` / `stock-bot-rp04-independent-review.log`.
Both stories are accepted. All 69 scheduled tasks are complete; seven conditional tasks and four merged redirects remain in the 80-ID manifest. Performance work, CL21 and paper/live activation remain deferred.