diff --git a/docs/development/backlog/README.md b/docs/development/backlog/README.md index ccdc51e6..4f70c62c 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: 100 retained IDs — 89 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: 101 retained IDs — 89 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. @@ -200,3 +200,5 @@ Owner authorized planning and per-task implementation commits. [Execution plan a - [RP23: Cross-study findings client](tasks/RP23.md) — done, `8dc8724c`; typed comparisons accept null/omitted source while preserving canonical versioned evidence and supplied-source identity checks. - [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) — in progress; reopen retained findings/notes and exact revision history through the existing research client. diff --git a/docs/development/backlog/dependencies.mmd b/docs/development/backlog/dependencies.mmd index fc4eacb8..070e22b1 100644 --- a/docs/development/backlog/dependencies.mmd +++ b/docs/development/backlog/dependencies.mmd @@ -336,3 +336,6 @@ flowchart TD R04 --> RP24 R09 --> RP24 RP23 --> RP24 + + A03 --> RP25 + RP23 --> RP25 diff --git a/docs/development/backlog/manifest.json b/docs/development/backlog/manifest.json index c3965204..8019008e 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.121", + "plan_revision": "2026-10-27.122", "repository_base": "b7aeca4", - "plan_status": "single_run_finding_acknowledgement_complete", + "plan_status": "typed_artifact_reads_in_progress", "execution_authorized": true, "execution_scope": { "authorized_by": "Owner: commit and continue with the rest of the tasks till 100%", @@ -3783,6 +3783,33 @@ "reviewer": "/root", "planning_commit": "2da899da", "review_notes": "Root reviewed universal source/reference identity comparison with absent/null normalization preserving historical citations. Nine red cases reproduced incorrect success/crash. Finding/source UI 62 tests / 328 assertions; complete built Chromium workbench 23 / 852, including real committed-write acknowledgement loss, blocked duplicate creation and exact saved evidence reopening. Application/authored types, contracts, strict scoped lint/formatting, secrets and diff passed. No independent review/full repository check/full integration rerun claimed. Disposable stores stopped; no real study writes or deferred work." + }, + { + "id": "RP25", + "title": "Reopen retained research artifacts through the typed AI client", + "epic": "E12", + "priority": "P2", + "severity": "Medium", + "status": "in_progress", + "dependencies": [ + "A03", + "RP23" + ], + "decision_dependencies": [], + "task_file": "backlog/tasks/RP25.md", + "complexity": "S", + "assignment": "/root", + "write_locks": [ + "research-client-artifact-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. Add existing read-only artifact/history APIs to the typed client; no real study edits, new research execution or deferred work.", + "integration_base": "b2f98814" } ], "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/RP25.md b/docs/development/backlog/tasks/RP25.md new file mode 100644 index 00000000..2f7c9084 --- /dev/null +++ b/docs/development/backlog/tasks/RP25.md @@ -0,0 +1,19 @@ +# RP25 — Reopen retained research artifacts through the typed AI client + +Parent E12. Priority P2 / Medium workflow gap. Complexity S. Dependencies A03, RP23. Owner continuation authorizes implementation and commits; all seven conditional tasks remain deferred. + +Verified baseline: `ResearchClient.saveFinding` creates a finding but exposes no artifact/history reads. RP23's authenticated workflow therefore reopens it with a raw transport call. The existing API already provides `GET /analysis-artifacts/:id` and `GET /analysis-artifacts/:id/revisions`, with completed-result evidence resolution and authenticated research read access. Immutable revision IDs already exist. + +Scope: add `artifact(id, signal?)` and `artifactRevisions(id, signal?)` to the existing client. Decode retained artifact/revision identity, authorship, source, evidence, units and availability. Reading supports operator/service/agent authorship, human/AI/unknown origin, notes, canonical evidence and qualified legacy evidence. Keep the strict AI/canonical creation response contract intact. Validate requested artifact/parent identities and unique history revision IDs/ordinals; do not silently substitute latest for a requested historical revision. No new endpoint, schema migration, financial calculation or generic client framework. + +Affected files: `scripts/research-client.ts`, `scripts/test/research-client.test.ts`, `test/postgres/ai-research-workflow.test.ts`, existing README usage. The caller chooses an exact saved revision ID from the returned verified history; this task does not implement automatic cycle resume or non-idempotent replay. + +Acceptance and tests: + +- A saved finding can be reopened and its original immutable revision selected after a subsequent human revision. Preserve original AI authorship, source and exact server-resolved evidence; expose the new revision's actual authorship without relabeling either narrative validated. +- Notes with no evidence and legacy references with explicit limitations remain readable. Canonical/legacy metric identities, availability, units and result/engine labels remain coherent. Invalid artifact IDs fail before transport; wrong returned artifact/parent, malformed envelopes/evidence and duplicate revision identities fail as read errors without retries or writes. +- Both methods use authenticated GET only, preserve the existing abort/deadline/HTTP-error behavior and never admit jobs. Existing strict creation and cycle/journal tests remain green. +- Extend the actual disposable PostgreSQL/native workflow by reusing completed runs and findings. Reopen via the new methods, create a fixture-only human revision with existing service behavior, retrieve exact old/new revisions, compare evidence and show unchanged run counts. Revoked credentials must fail reads. No real study records are edited. +- Run focused client/cycle and complete tooling tests, authored/application types, contracts, scoped lint/formatting, secrets and the actual PostgreSQL AI workflow. No native/web rebuild or browser change is required for this client-only addition. + +Definition of done: reproduce the missing client capability, implement the two existing API reads, review canonical versus legacy and read versus creation boundaries, pass relevant checks, document exact-revision usage, update task state and commit. No new architecture decision is needed.