From 65c659487998f172e5e35cf8a417d135dcd1cad0 Mon Sep 17 00:00:00 2001 From: Boki Date: Tue, 27 Oct 2026 23:18:04 -0400 Subject: [PATCH] docs(research): plan canonical run inspection (RP27) --- docs/development/backlog/README.md | 4 ++- docs/development/backlog/dependencies.mmd | 4 +++ docs/development/backlog/manifest.json | 32 +++++++++++++++++++++-- docs/development/backlog/tasks/RP27.md | 18 +++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 docs/development/backlog/tasks/RP27.md diff --git a/docs/development/backlog/README.md b/docs/development/backlog/README.md index 722ffd55..d0b34511 100644 --- a/docs/development/backlog/README.md +++ b/docs/development/backlog/README.md @@ -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: 102 retained IDs — 91 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. +**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. 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. @@ -204,3 +204,5 @@ Owner authorized planning and per-task implementation commits. [Execution plan a - [RP25: Typed artifact reads](tasks/RP25.md) — done, `e39989c4`; authenticated reads preserve exact retained revisions, authorship, evidence and historical qualifications. - [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. diff --git a/docs/development/backlog/dependencies.mmd b/docs/development/backlog/dependencies.mmd index 41f2b8ce..1a0e063a 100644 --- a/docs/development/backlog/dependencies.mmd +++ b/docs/development/backlog/dependencies.mmd @@ -343,3 +343,7 @@ flowchart TD R04 --> RP26 RP08 --> RP26 RP25 --> RP26 + + A03 --> RP27 + F08 --> RP27 + RP25 --> RP27 diff --git a/docs/development/backlog/manifest.json b/docs/development/backlog/manifest.json index af7f5209..814ca0a4 100644 --- a/docs/development/backlog/manifest.json +++ b/docs/development/backlog/manifest.json @@ -1,8 +1,8 @@ { "schema_version": 1, - "plan_revision": "2026-10-27.125", + "plan_revision": "2026-10-27.126", "repository_base": "b7aeca4", - "plan_status": "research_revision_download_complete", + "plan_status": "canonical_run_client_read_in_progress", "execution_authorized": true, "execution_scope": { "authorized_by": "Owner: commit and continue with the rest of the tasks till 100%", @@ -3844,6 +3844,34 @@ "reviewer": "/root", "planning_commit": "6ce3b68b", "review_notes": "Root reviewed exact displayed revision export, draft custody and shared helper relocation. Six missing-action red cases; final UI 137 tests / 921 assertions; complete built Chromium workbench 23 / 862 with actual old finding/hypothesis file bytes, zero download API calls and unchanged research/run counts. App/authored types, contracts, scoped lint/formatting, secrets and diff passed; byte-identical helper move. No independent review/full repository check/full integration rerun claimed. Disposable stores stopped; no real study changes or deferred work." + }, + { + "id": "RP27", + "title": "Inspect complete canonical run results through the AI client", + "epic": "E12", + "priority": "P2", + "severity": "Medium", + "status": "in_progress", + "dependencies": [ + "A03", + "F08", + "RP25" + ], + "decision_dependencies": [], + "task_file": "backlog/tasks/RP27.md", + "complexity": "M", + "assignment": "/root", + "write_locks": [ + "canonical-result-read-contract" + ], + "blocker": null, + "integration_state": "in_progress", + "review_status": "pending", + "completed_commit": null, + "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" } ], "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.", diff --git a/docs/development/backlog/tasks/RP27.md b/docs/development/backlog/tasks/RP27.md new file mode 100644 index 00000000..8c844bd6 --- /dev/null +++ b/docs/development/backlog/tasks/RP27.md @@ -0,0 +1,18 @@ +# RP27 — Inspect complete canonical run results through the AI client + +Parent E12. Priority P2 / Medium workflow gap. Complexity M. Dependencies A03, F08, RP25. Owner continuation authorizes implementation and commits. All seven conditional tasks remain deferred. + +Verified baseline: `ResearchClient` reads experiment summaries and evidence-linked findings but exposes no full run-result read. The authenticated API already serves `GET /runs/:id/results`. `BacktestResults.getRunResults` validates canonical financial/reporting facts, analytics and the trusted SQL request inline; the AI workflow inspects full results through its privileged test service instead of the actual research credential. + +Scope: add `ResearchClient.canonicalRunResult(runId, signal?)`. Reuse one pure canonical-result decoder in `libs/research/src/results.ts`, extracted from the current backend validation. It checks result/request/run/backtest identities, execution kind, completion/time fields, the existing native report parser and existing statistical projection. Return the original validated payload without rounding or replacing financial strings. The backend retains its separate comparison against the trusted SQL request/backtest. Legacy reads remain supported by the current backend reader; the explicitly canonical client method rejects legacy/malformed results. + +Affected modules: shared research results, backend `services/backtests/results.ts`, research client/tests, a shared actual-native result fixture and contract tests, existing PostgreSQL AI/reproduction/canonical tests and README. No new endpoint, permission, schema, accounting/fill semantics, strategy execution, engine build, UI or generic client framework. + +Acceptance/tests: + +- An authorized AI client retrieves the complete saved request, native fills/positions/risk, analytics and provenance using GET only. Values/nulls/decimal strings and the input object are unchanged. Client reads never submit or retry jobs. +- Corrupt/mismatched run/backtest/request identity, execution kind, native identity/policy, analytics or metadata are rejected. Backend SQL snapshot binding remains mandatory, including missing/corrupt snapshots; no fallback to embedded request or legacy economics. +- Unit/contract tests use actual Rust-produced fixture finances. Existing AI workflow reads actual isolated-candidate results through the new authenticated method, compares them with retained records, and verifies unchanged run counts plus 401 after revocation. Missing/failed runs return existing read errors. Abort/deadline and invalid-ID behavior use the existing client transport. +- 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.