docs(research): close frozen dataset read task

This commit is contained in:
Boki 2026-10-28 00:05:05 -04:00
parent 4b9c642817
commit aa7201d4fa
4 changed files with 156 additions and 467 deletions

View file

@ -8,7 +8,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: 104 retained IDs — 92 done, 1 in progress, 7 deferred, 4 merged.** RP18 completes the bounded October multi-session pilot; RP01–RP17 add the authorized real-data workflow and its dataset reuse, export and workflow recovery follow-ups. The earlier 68 IDs retain their state. E11 adds seven authorized cleanup tasks and one conditional replay extraction; see the manifest for current scheduling. The original backlog accounted for 55 IDs. F09/P07 added projection/profiling work; the owner deferred P08's TypeScript optimization. Merged records preserve traceability; never execute them separately. Deferred work requires its stated trigger and explicit activation.
**Current total: 104 retained IDs — 93 done, 7 deferred, 4 merged.** RP18 completes the bounded October multi-session pilot; RP01–RP17 add the authorized real-data workflow and its dataset reuse, export and workflow recovery follow-ups. The earlier 68 IDs retain their state. E11 adds seven authorized cleanup tasks and one conditional replay extraction; see the manifest for current scheduling. The original backlog accounted for 55 IDs. F09/P07 added projection/profiling work; the owner deferred P08's TypeScript optimization. Merged records preserve traceability; never execute them separately. Deferred work requires its stated trigger and explicit activation.
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.
@ -207,4 +207,4 @@ Owner authorized planning and per-task implementation commits. [Execution plan a
- [RP27: Complete canonical run reads](tasks/RP27.md) — done, `66af201d`; research credentials inspect full native results through shared validation while the backend preserves trusted SQL binding.
- [RP28: Frozen data reads for research](tasks/RP28.md) — in progress; allow exact retained exports and verify their complete content/hash in the typed client.
- [RP28: Frozen data reads for research](tasks/RP28.md) — done (`4b9c6428`); exact retained exports with complete content/hash verification in the typed client.

File diff suppressed because it is too large Load diff

View file

@ -18,3 +18,5 @@ Acceptance/tests:
- Run client/cycle and focused credential/security suites, complete tooling/integration, actual PostgreSQL AI/agent tests, application/authored types, contracts, strict lint/formatting and secrets. Build the web app to verify the permission description; no engine rebuild or browser-flow change is necessary.
Definition of done: reproduce the missing typed/read permission capability, add the narrow existing endpoint access and typed read, review shared research-read versus privileged data-write scope, pass gates, document usage/holdout discipline, update task state and commit. This fits ADR-007 research/data isolation; no new architecture approval is required.
Accepted after root review: plan `04892a59`, implementation `4b9c6428`. Missing client capability and permission regressions failed before implementation. Final focused client/cycle/security/export checks passed 58 tests / 716 assertions. Full integration passed 1,404 with 14 existing conditional skips / 10,605 assertions; tooling passed 161 / 14,435; actual PostgreSQL AI/agent suites passed 18 / 417. Application/authored types, contracts, strict scoped lint, formatting, secrets, web production build and diff checks passed. Actual issued/revoked credentials, exact retained content, malformed/tampered/missing snapshots, unchanged run counts and original hash independence from template edits were verified. The disposable database was stopped. [Execution evidence](../../real-data-research.md#rp28--frozen-market-data-reads-for-research).

View file

@ -491,3 +491,18 @@ Verification:
- Application/authored-test types, contracts, strict scoped lint, formatting, secret audit and diff checks passed. Authored assertions were corrected for branded decimal types and nullable result narrowing. Root reviewed embedded-versus-SQL binding and unchanged financial/statistical authority. No independent review, engine build, browser or full repository `check` rerun is claimed; no UI or Rust source changed.
Logs: `/tmp/stock-bot-rp27-red.log`, `rp27-focused.log`, `rp27-focused-permitted.log`, `rp27-integration.log`, `rp27-tooling.log`, `rp27-postgres.log`, `rp27-typecheck.log`, `rp27-authored-types.log`, `rp27-contracts.log`, `rp27-lint.log`, `rp27-format.log` and `rp27-secrets.log`, all under `/tmp/stock-bot-`. The disposable PostgreSQL container was stopped after verification. No real study was changed or executed. All seven conditional tasks remain deferred.
## RP28 — Frozen market data reads for research
Plan `04892a59`, implementation `4b9c6428`. Research credentials now permit only the existing exact GET/HEAD canonical dataset export path with a lowercase 64-character hash. This deliberately extends the shared research catalog/result read model to known frozen snapshots. Listing, provider inspection/preparation/retention, other dataset paths and all data writes remain denied. It adds no per-dataset grant model or new endpoint. The operator page describes the expanded read permission.
`ResearchClient.canonicalDataset(hash, signal?)` reuses `validateDatasetV2` to verify all retained content, derived policies and the requested hash, returning detached, deeply frozen bars and metadata. Callers can use a saved canonical result's `request.datasetHash`. Reads do not query providers, create runs, retry failures or substitute an editable template's current dataset. README documents predeclared training inputs and untouched holdouts; isolated candidate callbacks retain their existing prefix-only context and have no network or research credentials. No financial semantics, storage, simulation or execution policy changed.
Verification:
- Two baseline capability/permission regressions failed before implementation. Final focused client/cycle/security/export suites passed **58 tests / 716 assertions**. Cases cover immutable original bars/metadata, mismatched valid hashes, content/availability/policy tampering, invalid paths/hashes, aborts, HTTP failures and no retries or writes.
- Full integration: **1,404 passed / 14 existing conditional skips**, 10,605 assertions. The initial sole failure was the old export test's intentional research-denial expectation; it now verifies the new read permission and continued revocation/data-write denials. Complete tooling: **161 passed / 14,435 assertions**. Focused counts overlap those suites.
- Actual PostgreSQL AI/agent suites: **18 passed / 417 assertions**. Issued credentials retrieve exact retained snapshots and HEAD attachment headers; revoked credentials return 401. Missing/corrupt snapshots return 404/409. Reads leave dataset/experiment/run counts unchanged. After a template selects another retained snapshot, the original result and its original dataset hash reopen unchanged. The first fixture changed only the template hash and correctly failed existing bounds validation; updating its matching dates/assets/frequency fixed the fixture without relaxing application validation.
- Application/authored-test types, contracts, strict scoped lint, formatting, secrets, web production build and diff checks passed. Authored adversarial fixtures were corrected to construct malformed wire copies without assigning to readonly typed fields. The build retains the existing nonblocking Vite chunk warning. Root reviewed exact-path permission and strict content/hash validation; no independent review, native rebuild, browser rerun or full repository `check` is claimed.
Logs: `/tmp/stock-bot-rp28-red.log`, `rp28-focused-final.log`, `rp28-integration-final.log`, `rp28-tooling.log`, `rp28-postgres-final.log`, `rp28-typecheck.log`, `rp28-authored-types.log`, `rp28-contracts.log`, `rp28-lint.log`, `rp28-format.log`, `rp28-secrets.log` and `rp28-web-build.log`, all under `/tmp/stock-bot-`. The disposable PostgreSQL container was stopped after verification. No real study was changed or executed. All seven conditional tasks remain deferred.