docs(research): close canonical run inspection task

This commit is contained in:
Boki 2026-10-27 23:31:21 -04:00
parent 66af201dad
commit 2ac1ff6b1a
4 changed files with 30 additions and 9 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: 103 retained IDs — 91 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: 103 retained IDs — 92 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.
@ -205,4 +205,4 @@ Owner authorized planning and per-task implementation commits. [Execution plan a
- [RP26: Saved research revision download](tasks/RP26.md) — done, `54349502`; download exact current/historical hypotheses, notes and findings with retained citations and authorship.
- [RP27: Complete canonical run reads](tasks/RP27.md) — in progress; expose full results to research credentials using shared validation and retained SQL binding.
- [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.

View file

@ -1,8 +1,8 @@
{
"schema_version": 1,
"plan_revision": "2026-10-27.126",
"plan_revision": "2026-10-27.127",
"repository_base": "b7aeca4",
"plan_status": "canonical_run_client_read_in_progress",
"plan_status": "canonical_run_client_read_complete",
"execution_authorized": true,
"execution_scope": {
"authorized_by": "Owner: commit and continue with the rest of the tasks till 100%",
@ -3851,7 +3851,7 @@
"epic": "E12",
"priority": "P2",
"severity": "Medium",
"status": "in_progress",
"status": "done",
"dependencies": [
"A03",
"F08",
@ -3865,13 +3865,16 @@
"canonical-result-read-contract"
],
"blocker": null,
"integration_state": "in_progress",
"review_status": "pending",
"completed_commit": null,
"integration_state": "accepted",
"review_status": "accepted",
"completed_commit": "66af201dad792791800aa48483a10928d7ef86ac",
"completion_evidence": "real-data-research.md",
"release_gates": [],
"authorization": "Owner: commit and continue. Existing authenticated result read with shared validation; preserve trusted SQL binding and Rust finances. No real research execution or deferred work.",
"integration_base": "cd1eea83"
"integration_base": "cd1eea83",
"reviewer": "/root",
"planning_commit": "65c65948",
"review_notes": "Root reviewed shared canonical-result decoder and separate trusted SQL snapshot binding. Missing client method reproduced; permitted focused 47 tests / 494 assertions. Integration 1,403 passed with 14 existing conditional skips / 10,592 assertions; tooling 158 / 14,394; actual PostgreSQL AI/canonical/reproduction 20 / 409. Raw native payload, actual agent access/revocation, failed/missing reads, divergent/null SQL snapshots and unchanged run counts verified. App/authored types, contracts, scoped lint/formatting, secrets and diff passed. Initial sandbox worker timeout passed on permitted rerun. No independent review/engine build/browser/full check claimed. Disposable store stopped; no real study changes or deferred work."
}
],
"review_note": "Independent skeptical revision: four superseded tasks retain stable IDs; deferred work is not a dependency of scheduled tasks. Release gates are distinct from implementation prerequisites.",

View file

@ -16,3 +16,5 @@ Acceptance/tests:
- Run shared contract/native reporting, client/cycle and complete tooling tests; full integration; actual PostgreSQL AI/canonical/reproduction suites; application/authored types, contracts, scoped lint/formatting and secrets. No performance claim or optimization work.
Definition of done: demonstrate the missing client capability, extract existing validation without changing economics, review embedded versus trusted-SQL identity checks, pass relevant gates, document usage, update task state and commit. No new architecture decision is needed.
Accepted after root review: plan `65c65948`, implementation `66af201d`. The new client capability failed before implementation. Permitted focused contract/native-report/client/cycle checks passed 47 tests / 494 assertions. Full integration passed 1,403 with 14 existing conditional skips / 10,592 assertions; tooling passed 158 / 14,394; actual PostgreSQL AI/canonical/reproduction suites passed 20 / 409. Authored/application types, contracts, strict scoped lint, formatting, secrets and diff passed. Trusted SQL snapshot binding, actual research credential reads, revocation and unchanged run counts were verified. The disposable database was stopped. [Execution evidence](../../real-data-research.md#rp27--complete-canonical-run-inspection).

View file

@ -475,3 +475,19 @@ Verification:
- Web production build, application/authored-test types, contracts, explicit scoped lint, formatting, secret audit and diff checks passed. Initial test-style brace/format findings were corrected. The moved helper compares byte-for-byte with its original implementation; no old source import remains. Root reviewed selection/draft custody. No independent review, full repository check or full integration-suite rerun is claimed. The existing nonblocking Vite chunk warning remains.
Logs: `/tmp/stock-bot-rp26-red.log`, `rp26-ui.log`, `rp26-browser.log`, `rp26-typecheck.log`, `rp26-authored-types.log`, `rp26-contracts.log`, `rp26-lint.log`, `rp26-format.log` and `rp26-secrets.log`, all under `/tmp/stock-bot-`. The disposable PostgreSQL/Redis containers were stopped after verification. No real study was changed or run. All seven conditional tasks remain deferred.
## RP27 — Complete canonical run inspection
Plan `65c65948`, implementation `66af201d`. `ResearchClient.canonicalRunResult(runId, signal?)` now reads the existing authenticated result endpoint. AI callers can inspect complete retained requests, native fills/positions/risk, analytics and provenance. Legacy/malformed results and missing results remain read errors; no replacement run is created.
The backend's existing canonical validation is shared through `parseCanonicalRunResult` in the research library. It reuses the native report parser and existing statistical projection, checks completion/metadata, run/backtest/request identity and origin-derived execution kind, and returns the original payload with raw strings/nulls preserved. The database reader separately parses and compares its trusted SQL snapshot/backtest; the embedded request cannot replace a missing or different snapshot. Legacy backend reads and missing-canonical-result refusal remain intact. This adds no financial arithmetic, simulation path, permission or endpoint.
Verification:
- The capability regression failed at the missing method before implementation. Contract tests use actual Rust-produced SMA finances, including exact `9969.30000000` terminal equity and `0.70000000` fees. Negative cases cover foreign identities, execution kind, native policy/dataset/session, analytics and metadata. Fixture wall-time/package metadata is synthetic; real admission is covered separately below.
- The first sandboxed focused run timed out in an existing native-worker subprocess and reported its terminated child. The permitted rerun passed **47 tests / 494 assertions**, with no application change to address the timeout.
- Full integration: **1,403 passed / 14 existing conditional skips**, 10,592 assertions. Complete tooling: **158 passed / 14,394 assertions**. Focused cases overlap these totals.
- Actual PostgreSQL AI/canonical/reproduction suites: **20 passed / 409 assertions**. Research credentials read actual isolated-candidate results and match retained service results. Failed/missing runs return 404; revoked credentials return 401. Run counts remain unchanged. A valid but different SQL snapshot and a null snapshot both fail result reads, alongside existing malformed snapshot/analytics cases.
- 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.