25 KiB
Real-data research workflow
Authorized follow-up to cleanup on October 26, 2026. Baseline bd9332b2. The manifest owns scheduling. RP01 adds read-only source inspection; RP02 exercises existing research paths with actual stored data. Performance, conditional CL21 and paper/live activation remain deferred.
Independent cleanup reviews
- CL01/CL04: foundation reviewer accepted; CL02/CL03 required owned-cache corrections before acceptance. Real adapter probes reproduced transport leakage, cross-container endpoint reuse and ignored options. The correction owns DI/queue cache transports, preserves shared callers and namespaces, wires supported retries/TTL and diagnoses obsolete controls. Foundation reviewer accepted the fix; root scoped tests passed 38/190 assertions and application types. Expanded implementer gates passed 75/280. Three historical queue-utils expectations independently fail on the old baseline; no claim those passed.
- CL05/CL08/CL12: backend reviewer accepted; 154 domain/admission cases, 15 retained-worker cases, and 55 disposable PostgreSQL cases passed. Dataset/report moves preserve algorithms and transaction/receipt boundaries.
- CL06/CL07/CL09/CL10/CL11/CL13: frontend reviewer accepted; 390 UI/transport and 41 dataset/architecture cases passed. A pre-existing body-read abort diagnostic limitation remains nonblocking because cancelled generations are fenced.
Reviewers: /root/review_cleanup_foundations, /root/review_cleanup_backend, /root/review_cleanup_frontend. Exact logs under /tmp/stock-bot-*-review*.log and /tmp/stock-bot-research-next-20261026/. Combined integration evidence follows.
Rechecked source
Read-only Mongo query reproduced the previous AAPL October 2024 snapshot exactly: 1,816 five-minute rows, 22 null volumes at 20:00 UTC, no duplicate timestamps; raw query JSON hash a8772d01d388b8fc9bca0d2790ad0d37146570fd09d057fcf1f1fcb5e6113bde. PostgreSQL initially contained zero retained datasets/strategy versions and no experiments; existing runs are not evidence of this pilot. The development API responds on port 2003.
RP01 — Accepted scoped source inspection
The stored-EOD preparation panel now accepts an instrument and timeframe, explicitly loads that series' coverage, and diagnoses a selected half-open UTC window. It reports field errors, null volume and duplicate timestamps without changing rows or granting dataset eligibility. Editing these controls does not dirty or submit the enclosing backtest setup; cancellation and changed drafts fence late replies. An already dispatched Mongo query is not interrupted by the current database wrapper.
The first proposal grouped every archived row. Actual Mongo estimates were 3,402,612,960 one-minute, 1,075,367,880 five-minute and 110,450,096 hourly records, so that proposal was rejected during integration. The final query requires one instrument/timeframe and starts with an exact match. Actual Mongo explain selected eodSearchCode_1_timestamp_1; no index migration, cache or input cap was introduced. Coverage does not establish complete calendar sessions. Window queries cannot diagnose timestamps that cannot be located in that query; coverage counts invalid timestamps separately.
Independent backend and frontend reviewers accepted the final implementation. Corrections included BSON Decimal128 timestamp consistency, strict zero-warning lint, and preventing inspector Enter/change events from submitting or dirtying the parent setup.
Validation on the combined checkout:
CARGO_BUILD_JOBS=2 bun run check: passed — 134 tooling, 43 utility, 44 calculation, 1,251 integration and 150 Rust tests; 14 conditional integration skips and 4 ignored Rust measurement tests remain.- Disposable PostgreSQL/Redis suite: 274 passed, 2,630 assertions. The first invocation crashed inside Bun 1.2.17 after 83 seconds; the complete retry passed. This is not reported as a successful initial invocation.
- Chromium: all 18 existing scenarios passed in the full run. The new scenario initially used a draft-only navigation button on an already-configured template; after correcting that test navigation, its focused rerun passed with 20 assertions. Together these cover all 19 scenarios; no application change followed the full suite.
- Real Mongo BSON aggregation: passed, including Decimal128 rejection, supported numeric representations and missing selection. Selected AAPL coverage and inspection succeeded; the session has 78 rows with zero invalid or duplicate rows. Source history was read only.
- Implementer focused regressions: 106 tests / 521 assertions. Independent frontend: 91 / 319; backend: 6 / 46. Production frontend build, authored-test types, strict lint and diff checks passed.
Logs: /tmp/stock-bot-research-next-20261026/combined-check-scoped.log, combined-postgres-retry.log, combined-browser.log, source-browser-focused.log, source-mongo-explain.log. Tests used disposable stores; the development research records below were not test fixtures.
RP02 — Completed after explicit strategy approval
The following inputs were created and reopened through existing research APIs. The owner then explicitly approved the exact SMA artifact for this bounded pilot; nine runs completed:
| Record | Identity |
|---|---|
| Frozen dataset | 6b72d7fc3ebf87a52aefb5683d1bdaea344546daea1a988533c66871e56ed687 |
| Raw selected-query file SHA256 | 343a025b15ffe695479f940ca7eaa6511dd4270deaeaf9bc49b4e28961c1b15c |
| SMA strategy version | a67fb31d-7d13-4337-91fb-b49745983160 — explicitly approved for the research pilot |
| Strategy artifact SHA256 | 008a42dc373168ba17d5e73a1cc769de6b0bc24b7e487f07a422ceaa3618aa71 |
| Clean strategy source commit | b4ac6460efd40734f55d12bc94f1969583fd8587 |
| Draft backtest | 373e1046-64fc-409e-b414-da46fb20bea3 |
| Research project | 59027da7-4e84-4c71-ac3e-10cab219f0c4 |
| Hypothesis | a0fb1cb7-6202-470e-aa9d-8f2f22918c6a |
| Preparation note | 9c077001-3309-4a29-ae95-0891ec8488c5 — AI-origin, unvalidated, no performance evidence |
Local durable input package: .data/research-pilots/aapl-20241001/. It contains raw query bytes, complete metadata, source evidence, retained package/lock, API receipts, reopened dataset/draft, preparation scripts and execution-plan.json. PostgreSQL retains the canonical dataset and immutable strategy artifact. Local raw files are ignored runtime data, not Git documentation.
The declared session is October 1, 2024, 13:30–20:00 UTC. All 78 consecutive five-minute bars remain unchanged. The explicitly half-open query excludes after-hours rows; no filtering within the query, interpolation or null-volume coercion occurred. Evaluation begins at 14:30 after sufficient SMA warmup.
Evidence and limits:
- Nasdaq's 2024 calendar and regular hours support the declared ordinary session. The normalizer validates the declaration; it does not certify exchange evidence.
- EOD intraday documentation defines UTC Unix-second bar starts. Availability at interval end is an explicit zero-delay assumption; actual historical arrival times are unavailable.
- Action-free coverage for this one session is an inference from Apple's dividend/split history, not a certified complete action feed.
- Apple's August 2024 release establishes common shares before the session. The fixed AAPL universe uses that historical membership, but the asset/window were selected retrospectively for a workflow proof. This is not a point-in-time universe-selection study; the stored vendor vintage was captured in 2026.
The predeclared plan has at most nine runs: baseline SMA 3/8, its exact reproduction, two training candidates (fast 2/4, slow 8), two held-out phases for the server-selected training winner, and three cost scenarios including the automatic baseline. Capital is $10,000 with a $1,000 strategy budget and explicit native limits. Fees, spread and slippage are scenario assumptions. Training evaluates 14:30–16:00, validation 16:00–18:00 and test 18:00–20:00; each phase resets capital and has one hour of prior warmup. These tiny partial-session partitions cannot establish alpha, regime robustness or statistically meaningful out-of-sample performance. Do not interpret annualized CAGR or unavailable daily-period statistics as such evidence.
The original capability check correctly rejected execution pending human approval. The owner subsequently answered “Approve this research pilot” for the exact version/artifact above. That approval was recorded through the existing review endpoint before any submission; owner-approval.json and approved-version.json retain the scope and response. No paper/live deployment was activated.
All nine runs used the existing durable BacktestRunner / RustBacktestAdapter, invoked only for their newly admitted IDs; no generic queue was drained. The runner claimed attempts and stored canonical native results through the existing repository. All six submission operations were replayed with their original bodies, principals and idempotency keys; the pilot still has exactly nine completed runs. Results, the sealed chronological report and the cost experiment were reopened through normal APIs.
| Completed evidence | Identity / result |
|---|---|
| Baseline run | 3f87ca4c-b61c-4eba-996a-94fdb525369d; 8 fills, terminal cash/equity 9994.54250007, fees 7.20654989 |
| Reproduction run | 41ace77c-4c13-44e6-915f-593e3d914147; exact match |
| Economic hash, both runs and cost baseline | f1d0111dad1d33d6d53225b598ede56ecb9c31c9264436fbcf065d72f2982daa |
| Chronological validation | 0e4a8a73-e25f-4256-82a1-905cc5d57bab; training selected SMA 2/8, both holdouts preserved that choice |
| Sealed report | 96dff56c-1840-4925-b2b2-9edd738c694c; hash 20ab18f465c46bbf141dee53f35c2db1652f67e8c831be2c5c11a49df770136c |
| Cost experiment | 2a8d767f-0770-47b1-8377-2dd18d038a08; three comparable completed trials |
| Finding | 9942626c-0684-40d3-a15b-45fb1d00579b; 19 retained scalar references, AI-authored, unvalidated research conclusion |
| Native engine binary SHA256 | df0ecbd5c3772d7e8aeb0226b40ae290cfaddf9d87fb3a7375f2a31c2acf05e5 |
Baseline total return was approximately -0.054575%. The fixed SMA 3/8 cost scenarios ended at 10002.46970496 with zero fees/slippage but spread retained, and 9984.45333211 with stressed fees/slippage. These are observed scenario results, not calibrated execution estimates or a general monotonicity claim. Annualized CAGR was deliberately excluded from the finding; there are zero complete daily reporting periods.
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 and the project finding. 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.
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.
RP05 / RP06 — Retained dataset reuse and settings custody
Owner continuation authorized two independently verified workflow corrections, recorded in planning commit 5319bd1b. RP05 (6d549542) fixes the canonical picker's first-page-only limitation; RP06 (c838e3d0) fixes loss of settings and preparation on same-backtest tab changes. The backend, database schema and Rust financial behavior are unchanged. Workbench usage.
RP05 uses existing paginated catalog and exact-hash endpoints. Load-more preserves prior choices and retries a failed page at the same offset; refresh and retention fence stale requests. The deliberate hash action verifies identity/availability before saving. Catalog/detail parsing now rejects malformed successful responses while preserving valid unavailable entries and converted v2 manifests with parent hashes. Browsing and typing a lookup do not save a template or submit a run.
RP06 first reproduced the baseline defect: an edited name reverted after Settings → Runs → Settings. Settings now mount only after the first visit and stay hidden across tabs and index/run routes for that backtest. Captured source input and ambiguous-retention retry remain owned by the editor; changing backtest ID disposes it and fences old completions. Explicit discard and saved-definition replacement retain their behavior. Hidden controls are excluded from accessible role queries. This is in-memory same-backtest preservation, not persistent draft recovery or a general navigation guard.
Independent reviewer /root/review_cleanup_backend accepted both changes: RP05 29 workbench tests / 245 assertions plus eight independent transport probes; RP06 45 lifecycle tests / 279 assertions. Implementer focused suites passed 119 / 570 and 198 / 967 respectively. Reviewer /root/review_cleanup_frontend independently checked root's browser fixtures and usage documentation. That review caught a fixture timestamp UPDATE forbidden by the evidence-immutability trigger; the fixture now sets ordering on initial INSERT and verifies custody through the normal retention helper, without altering the trigger.
Combined validation:
CARGO_BUILD_JOBS=2 bun run check: passed — 134 tooling, 43 utility, 44 calculation, 1,279 integration and 150 Rust tests; existing 14 conditional integration skips / 4 ignored Rust measurements remain. Build, types, contract checks, strict lint and secret audit passed.- Chromium full workbench run: 20 scenarios passed. The new dataset-reuse scenario correctly remained unable to save because its test omitted the existing explicit strategy-parameter validation step. After adding that step to the test, its focused rerun passed with 13 assertions. Together these cover all 21 scenarios; no application change followed the full browser run. The initial full invocation is not reported as an all-pass run.
- The new browser scenario inserts 52 distinct valid older snapshots in its disposable schema, selects a hash absent from the first page, loads the older page, saves the verified dataset and reopens it. It asserts zero runs and dispatch records.
- The retention browser scenario commits through the actual HTTP/database route, deliberately loses the response, changes tabs and retries the identical input/hash after removing the fixture source rows. Exactly two original session reads remain; the saved template and run/dispatch counts do not change. The actual-native smoke preserves an unsaved name across index-to-run navigation while the persisted definition remains unchanged.
- Application and authored-test types, focused lint, formatting/diff checks and production frontend build passed. The browser used isolated PostgreSQL/Redis fixtures, removed after validation. No development dataset, research execution or paper/live state was changed.
Logs: /tmp/stock-bot-rp05-root-check.log, /tmp/stock-bot-rp05-browser.log, /tmp/stock-bot-rp05-browser-focused.log, /tmp/stock-bot-rp05-root-test-types.log, and /tmp/stock-bot-rp06-baseline-regression.log. Current manifest: 71 accepted scheduled tasks, seven deferred conditional tasks and four merged redirects, 82 IDs total. No conditional performance or monitoring work was activated.
RP07 — Retained dataset export for local research
Owner continuation on October 27 authorized this follow-up; planning commit 43ea2cc9 records the frozen API/UI contract. Existing catalog endpoints returned descriptors without bars, forcing local exploration to reach into the database. The new GET /api/v2/datasets/canonical/:hash/export reuses readCanonicalDataset once to return the validated full v2 {manifest,bars} snapshot. It preserves canonical identity, converted parent hashes, timestamps, availability delays, source ordinals and null VWAP. JSON formatting and downloaded-file byte hashes are not dataset identity guarantees.
The loader's typed rejection extends its existing request-error base, preserving admission/catalog catches and messages. Invalid, missing, corrupt/mismatched and unsupported datasets return 400, 404, 409 and 422 respectively; unexpected errors are sanitized. Route-handled responses are no-store/nosniff, and only validated success receives an attachment filename. Cancellation fences delivery. Existing authentication is unchanged; tests use the real research-credential resolver to prove dataset routes remain unavailable to research-agent tokens.
A shared download action appears for a verified setup selection and full canonical results. Result downloads use the original immutable request hash, independently of the editable template. The browser checks the response envelope/identity, preserves the received text, supports retry, prevents duplicate clicks and fences pending bodies on hash change/unmount. Full content/hash validation stays on the server; there is no browser financial engine or new export format. Usage covers VS Code/notebook inspection and the existing CLI importer.
Independent backend review accepted both implementation halves: 66 focused tests / 591 assertions and 25 additional transport/authentication probes passed. The reviewer also accepted root's PostgreSQL/browser fixtures; independent frontend review accepted the usage documentation. Implementer checks passed application/authored-test types, strict lint and production builds.
Root validation:
CARGO_BUILD_JOBS=2 bun run check: passed — 134 tooling, 43 utility, 44 calculation, 1,316 integration and 150 Rust tests. Existing 14 conditional integration skips and 4 ignored Rust measurements remain. Build, types, contract checks, strict lint and secret audit passed.- Disposable PostgreSQL: 14 tests / 183 assertions across dataset-source preparation, stored-source preparation and canonical research. The actual export performs one payload read; its received JSON validates, is imported through the real CLI twice, and leaves every fixture table unchanged. Unsupported/corrupt retained rows return no attachment.
- Root-authored browser/PostgreSQL test typecheck and formatting/diff checks passed.
- Chromium: all 21 workbench scenarios passed with 721 assertions. Actual downloaded files from a verified selection and a reopened native result validate in full. The latter's template is deliberately changed to a distinct retained dataset first; export still delivers the original run dataset and leaves the replacement settings, one run and one dispatch unchanged. The fills-only view exposes no download action.
Logs: /tmp/stock-bot-rp07-root-check.log, /tmp/stock-bot-rp07-postgres.log, /tmp/stock-bot-rp07-browser.log, /tmp/stock-bot-rp07-root-test-types.log, /tmp/stock-bot-rp07-api-independent.log and /tmp/stock-bot-rp07-ui-independent.log. Tests use disposable PostgreSQL/Redis fixtures; no development research runs or paper/live operations were performed. Export retains the existing eligible single-asset/single-series gate. Performance, monitoring and conditional replay extraction remain deferred.