fix(research): verify revision acknowledgements before clearing drafts (RP30)

This commit is contained in:
Boki 2026-10-28 09:10:46 -04:00
parent dd8955ecbf
commit e4056c7d13
7 changed files with 434 additions and 21 deletions

View file

@ -358,4 +358,3 @@ flowchart TD
R04 --> RP30
RP24 --> RP30
RP29 --> RP30

View file

@ -3614,7 +3614,7 @@
"priority": "P1",
"severity": "High",
"status": "in_progress",
"dependencies": ["R04", "RP24", "RP29"],
"dependencies": ["R04", "RP24"],
"decision_dependencies": [],
"task_file": "backlog/tasks/RP30.md",
"complexity": "M",

View file

@ -1,6 +1,6 @@
# RP30 — Verify saved research revisions before clearing drafts
Parent E12. Priority P1 / High draft-custody defect. Complexity M. Dependencies R04, RP24, RP29. Owner continuation authorizes implementation and commits. All seven conditional tasks remain deferred.
Parent E12. Priority P1 / High draft-custody defect. Complexity M. Dependencies R04, RP24. Owner continuation authorizes implementation and commits. All seven conditional tasks remain deferred.
Verified baseline: `ResearchEntry.save` awaits `researchApi.reviseHypothesis` or `reviseArtifact` but ignores the returned record, immediately clears editing and reloads. The transport checks only a broad envelope/record ID. A stale, foreign or altered successful acknowledgement therefore discards the draft. The existing finding-create dialog already verifies its source/reference acknowledgement; the revision form already preserves uncertain drafts and prevents automatic replay for transport failures/conflicts.

View file

@ -154,6 +154,12 @@ the normal preview and confirmation steps.
4. Run **cost sensitivity** on the selected configuration and compare ordinary experiments with compatible inputs. Save findings with explicit run/report references.
5. Reopen those saved IDs to inspect or reproduce the work. The browser is the normal research interface; authorized AI clients use the same backend capabilities with separate grants and budgets.
When editing a saved hypothesis, note or finding, **Save new revision** clears the draft
only after the returned revision matches its entry, submitted text and retained citations.
An unverifiable acknowledgement may follow a committed write: the form preserves and
blocks the draft without retrying. Review it, then deliberately choose **Discard draft and
reload history** to inspect the saved revisions before deciding whether another edit is needed.
Open a hypothesis, note or finding and choose **Download saved revision** to take its
narrative and citations into local analysis. When viewing history, the file contains that
exact older revision. While editing, it exports the saved version and leaves your draft