diff --git a/docs/development/backlog/README.md b/docs/development/backlog/README.md index b494b0b9..4b3745d4 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: 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. +**Current total: 105 retained IDs — 93 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. @@ -208,3 +208,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) — done (`4b9c6428`); exact retained exports with complete content/hash verification in the typed client. +- [RP29: Original hypothesis reads](tasks/RP29.md) — in progress; reopen saved hypotheses and select their original immutable revisions through the typed client. diff --git a/docs/development/backlog/dependencies.mmd b/docs/development/backlog/dependencies.mmd index 12a8f5ca..2e289524 100644 --- a/docs/development/backlog/dependencies.mmd +++ b/docs/development/backlog/dependencies.mmd @@ -351,3 +351,7 @@ flowchart TD A03 --> RP28 RP07 --> RP28 RP27 --> RP28 + + A03 --> RP29 + R03 --> RP29 + RP25 --> RP29 diff --git a/docs/development/backlog/manifest.json b/docs/development/backlog/manifest.json index fcc4834b..29db4ca1 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.129", + "plan_revision": "2026-10-28.130", "repository_base": "b7aeca4", - "plan_status": "research_frozen_dataset_reads_complete", + "plan_status": "research_hypothesis_reads_in_progress", "execution_authorized": true, "execution_scope": { "authorized_by": "Owner: commit and continue with the rest of the tasks till 100%", @@ -171,8 +171,14 @@ "id": "E10", "title": "Cleanup and maintainability foundations" }, - { "id": "E11", "title": "Orchestrator and engine cleanup" }, - { "id": "E12", "title": "Real-data research workflow" } + { + "id": "E11", + "title": "Orchestrator and engine cleanup" + }, + { + "id": "E12", + "title": "Real-data research workflow" + } ], "first_wave": ["C01", "C03", "C04", "W01"], "tasks": [ @@ -3575,6 +3581,28 @@ "reviewer": "/root", "planning_commit": "04892a59", "review_notes": "Root reviewed exact known-hash export permission and reused strict content/hash validation under shared research reads. Missing capability/permission regressions reproduced. Final focused 58 tests / 716 assertions; integration 1,404 passed with 14 existing conditional skips / 10,605 assertions; tooling 161 / 14,435; actual PostgreSQL AI/agent 18 / 417. Actual issued/revoked credentials, tampered/missing exports, immutable original snapshots after template edits and unchanged read-only row counts verified. App/authored types, contracts, scoped lint/formatting, secrets, web build and diff passed. Initial old-denial test and mismatched-template fixture expectations corrected. No independent review/native rebuild/browser/full check claimed. Disposable store stopped; no real study changes or deferred work." + }, + { + "id": "RP29", + "title": "Reopen original research hypotheses through the typed client", + "epic": "E12", + "priority": "P2", + "severity": "Medium", + "status": "in_progress", + "dependencies": ["A03", "R03", "RP25"], + "decision_dependencies": [], + "task_file": "backlog/tasks/RP29.md", + "complexity": "S", + "assignment": "/root", + "write_locks": ["research-hypothesis-reads"], + "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. Read existing authenticated hypothesis records/history with original revision selection; preserve AI creation, financial and trading boundaries. No real research execution or deferred work.", + "integration_base": "aa7201d4" } ], "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/RP29.md b/docs/development/backlog/tasks/RP29.md new file mode 100644 index 00000000..a8a2138d --- /dev/null +++ b/docs/development/backlog/tasks/RP29.md @@ -0,0 +1,18 @@ +# RP29 — Reopen original research hypotheses through the typed client + +Parent E12. Priority P2 / Medium reproducibility gap. Complexity S. Dependencies A03, R03, RP25. Owner continuation authorizes implementation and commits. All seven conditional tasks remain deferred. + +Verified baseline: `ResearchClient.createHypothesis` records the accepted hypothesis/revision in the cycle journal, and findings refer to immutable hypothesis revision IDs. The existing authenticated `GET /api/v2/hypotheses/:id` and `/revisions` routes and PostgreSQL history already exist, but the typed client cannot read them. RP25 added the corresponding artifact reads. A later human edit therefore requires a separate transport to recover the original proposition and validation criteria. + +Scope: add `ResearchClient.hypothesis(id, signal?)` and `hypothesisRevisions(id, signal?)` through the existing read transport. Decode complete retained ownership/archive/timestamp fields and revision IDs, ordinals, parent identity, title, proposition, validation criteria and actual authorship. Permit human/AI/unknown origins and operator/service/agent authors on reads while retaining the narrow AI creation acknowledgement. Require unvalidated state; history must be nonempty with matching parents and unique revision IDs/ordinals. Preserve returned ordering; callers select the journal's exact revision ID, never latest as a substitute. + +Affected files: `scripts/research-client.ts`, `scripts/test/research-client.test.ts`, `test/postgres/ai-research-workflow.test.ts` and README usage. Reuse existing routes, persistence and authentication unchanged. No new permission, schema, endpoint, financial arithmetic, candidate execution, generic SDK framework, automatic cycle resume or real study execution. + +Acceptance/tests: + +- Exact authenticated GETs preserve original text/criteria, actual authorship, ownership, archival state and revision identities. Reading a human-edited latest hypothesis and its history recovers the original journal revision. Service-authored unknown-origin hypotheses remain readable. Reads do not manufacture validation evidence. +- Wrong record/parent IDs, missing or malformed fields, invalid authorship/state, empty/mixed-parent/duplicate histories are read errors. Invalid IDs fail before transport. Missing/revoked/HTTP-failed/aborted/deadline reads preserve existing read-error behavior without retries or writes. +- Actual issued research credentials read an AI-created hypothesis after a fixture-only human revision and archival, recover both immutable revisions with exact original content and retain an existing finding's original hypothesis revision linkage. A service-authored hypothesis is readable, unknown IDs return 404, and revocation returns 401. Read-only request and database counts remain unchanged. +- Run client/cycle and complete tooling suites; actual PostgreSQL AI workflow; application/authored types, contracts, strict scoped lint/formatting, secrets and diff checks. Existing backend/financial/UI behavior is unchanged, so no native rebuild or browser rerun is required. + +Definition of done: reproduce the missing read capability, implement the two narrow methods, review read-versus-create validation and immutable revision selection, pass gates, document use, update task state and commit.