docs(research): plan saved revision download (RP26)

This commit is contained in:
Boki 2026-10-27 22:59:42 -04:00
parent 84d2a67d74
commit 6ce3b68b3d
4 changed files with 58 additions and 3 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: 101 retained IDs — 90 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: 102 retained IDs — 90 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.
@ -202,3 +202,5 @@ Owner authorized planning and per-task implementation commits. [Execution plan a
- [RP24: Single-run finding acknowledgements](tasks/RP24.md) — done, `f80ae2f3`; verify every returned source/citation and preserve uncertain drafts, including canonical and historical single-run findings.
- [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) — in progress; export the displayed immutable narrative and citations for local analysis.

View file

@ -339,3 +339,7 @@ flowchart TD
A03 --> RP25
RP23 --> RP25
R04 --> RP26
RP08 --> RP26
RP25 --> RP26

View file

@ -1,8 +1,8 @@
{
"schema_version": 1,
"plan_revision": "2026-10-27.123",
"plan_revision": "2026-10-27.124",
"repository_base": "b7aeca4",
"plan_status": "typed_artifact_reads_complete",
"plan_status": "research_revision_download_in_progress",
"execution_authorized": true,
"execution_scope": {
"authorized_by": "Owner: commit and continue with the rest of the tasks till 100%",
@ -3813,6 +3813,34 @@
"reviewer": "/root",
"planning_commit": "f9b97c30",
"review_notes": "Root reviewed two authenticated GET methods and distinct retained-read versus strict creation contracts. Exact immutable revisions, ownership/authorship, units, source, canonical/legacy evidence and history identities preserved. Client/cycle 40 tests / 399 assertions; tooling 155 / 14,355; final actual PostgreSQL/native workflow 4 / 236 with sealed sources, human revisions, service notes, revoked credentials and unchanged run counts. Authored/application types, contracts, scoped lint/format, secrets and diff passed. No independent review/build/browser/full integration rerun claimed. Disposable store stopped; no real research edits or deferred work."
},
{
"id": "RP26",
"title": "Download the displayed saved research revision",
"epic": "E12",
"priority": "P2",
"severity": "Medium",
"status": "in_progress",
"dependencies": [
"R04",
"RP08",
"RP25"
],
"decision_dependencies": [],
"task_file": "backlog/tasks/RP26.md",
"complexity": "S",
"assignment": "/root",
"write_locks": [
"research-revision-download"
],
"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. Local export of loaded saved research revisions using existing download behavior; no real research execution or deferred work.",
"integration_base": "84d2a67d"
}
],
"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

@ -0,0 +1,21 @@
# RP26 — Download the displayed saved research revision
Parent E12. Priority P2 / Medium product gap. Complexity S. Dependencies R04, RP08, RP25. Owner continuation authorizes implementation and commits. All seven conditional tasks remain deferred.
Verified baseline: the web app exports retained datasets and complete run results, and the typed AI client now reopens artifact history. `ResearchEntry` displays saved hypotheses, notes/findings and exact historical revisions but provides no local download. Its loaded revision already contains authorship, source and server-resolved citations; no additional endpoint is necessary.
Scope: add **Download saved revision** to the loaded research entry. Export inert JSON `{ kind: 'research-revision-export/v1', projectId, entry, revision }`. `entry` contains its ID and kind (`hypothesis`, `note`, `finding`), plus the exact linked hypothesis-revision ID for artifacts. `revision` is the complete saved revision displayed, preserving IDs/ordinal, narrative, authorship, source, evidence values, units, availability, dataset hashes and limitations. Filename: `research-<entryId>-<revisionId>.json`. Unsaved edits are excluded and the UI says so while editing.
Reuse the existing pure JSON download helper by moving it from the backtest feature into `src/utils/`, updating its two consumers. No new download framework, financial calculation, endpoint, schema migration, automatic research job, archive bundle or import format. Run results/datasets remain separate downloads. Moving this helper must preserve object-URL cleanup and error behavior.
Affected modules: `ResearchEntry.tsx`; the shared download helper and its existing canonical-result/dataset consumers; workspace UI and browser tests; existing walkthrough documentation. Backend and financial engine are excluded.
Acceptance and tests:
- Latest and explicitly selected historical revisions export exactly the displayed saved object; an older revision never acquires the latest narrative/source. Hypotheses, notes, findings and archived entries work. Null metrics, raw precision, authorship and evidence metadata are unchanged.
- Download issues no API call, write, run or revision. Editing a draft exports the saved version and keeps the draft untouched. Pending save disables download. Loading, missing revision and load failure expose no download action.
- Browser URL/click failures show a local retry; retry exports the same revision. Temporary anchors/URLs are cleaned up, and changing the selected revision resets the local error. Existing result/dataset downloads remain green.
- Add an actual Chromium download/readback in the existing research workflow, covering the old finding revision after a newer edit and an exact hypothesis revision. Verify file bytes against API-retained revisions and no added API requests or research rows from download.
- Run workspace/finding/source and existing canonical-download UI tests, application/authored types, contracts, scoped lint/formatting, web build and the browser workbench. Record actual gates and limitations; preserve all existing financial semantics.
Definition of done: demonstrate the missing action, implement this local export with the shared helper, review selected-revision/draft custody, pass checks, document the analysis-file scope, update task state and commit. No new architecture decision is needed.