docs(research): plan AI client receipt and lineage corrections

This commit is contained in:
Boki 2026-10-27 16:50:41 -04:00
parent fe3fd55610
commit 14b28a3428
6 changed files with 84 additions and 4 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: 90 retained IDs — 79 done, 7 deferred, 4 merged.** RP01–RP14 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: 92 retained IDs — 79 done, 2 in progress, 7 deferred, 4 merged.** RP01–RP16 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.
@ -181,3 +181,6 @@ Owner authorized planning and per-task implementation commits. [Execution plan a
- [RP13: Isolated candidate reproduction](tasks/RP13.md) — done, `773314d2`; accept the existing null-review candidate preview without weakening built-in approval checks.
- [RP14: Backtest dialog navigation](tasks/RP14.md) — done, `0d022ecc`; preserve drafts and pending saves during same-tab strategy inspection.
- [RP15: CLI recovery evidence](tasks/RP15.md) — in progress; preserve accepted receipts when journal persistence fails.
- [RP16: Automatic publication lineage](tasks/RP16.md) — in progress; accept valid server-assigned parents and exact publication retries.

View file

@ -308,3 +308,7 @@ flowchart TD
R02 --> RP14
W03 --> RP14
A03 --> RP15
A03 --> RP16
R01 --> RP16

View file

@ -1,8 +1,8 @@
{
"schema_version": 1,
"plan_revision": "2026-10-27.104",
"plan_revision": "2026-10-27.105",
"repository_base": "b7aeca4",
"plan_status": "backtest_dialog_navigation_complete",
"plan_status": "ai_client_receipt_recovery_in_progress",
"execution_authorized": true,
"execution_scope": {
"authorized_by": "Owner: commit and continue with the rest of the tasks till 100%",
@ -3473,6 +3473,53 @@
"integration_base": "cf04fb36d00d3321cddf959b850dd94058256923",
"reviewer": "/root/review_recovery_changes",
"review_notes": "Independent backtest/strategy UI review: 72 tests / 488 assertions. Root full check passed: 1364 integration and 150 Rust tests. Complete Chromium suite: 21 scenarios / 783 assertions, including declined navigation and a committed save whose response is held while the strategy link is clicked. Exact original saved definition, one save and zero runs/dispatches verified. Application/authored types, lint, formatting and builds pass; real-data-research.md records evidence."
},
{
"id": "RP15",
"title": "Preserve research CLI recovery receipts after journal failure",
"epic": "E12",
"priority": "P1",
"severity": "High",
"status": "in_progress",
"dependencies": [
"A03"
],
"decision_dependencies": [],
"task_file": "backlog/tasks/RP15.md",
"complexity": "S",
"assignment": "/root/audit_recovery_next",
"write_locks": [
"research-cycle-cli-recovery"
],
"blocker": null,
"integration_state": "pending",
"completion_evidence": "real-data-research.md",
"release_gates": [],
"review_status": "pending"
},
{
"id": "RP16",
"title": "Accept automatic lineage in AI strategy publication",
"epic": "E12",
"priority": "P1",
"severity": "High",
"status": "in_progress",
"dependencies": [
"A03",
"R01"
],
"decision_dependencies": [],
"task_file": "backlog/tasks/RP16.md",
"complexity": "S",
"assignment": "/root/audit_research_entry_recovery",
"write_locks": [
"research-client-publication"
],
"blocker": null,
"integration_state": "pending",
"completion_evidence": "real-data-research.md",
"release_gates": [],
"review_status": "pending"
}
],
"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,13 @@
# RP15 — Preserve research CLI recovery receipts after journal failure
Parent E12. Priority P1 / High recovery defect. Complexity S. Dependency A03. Owner continuation authorizes this correction.
Verified baseline: `scripts/examples/research-cycle.ts` preserves an accepted resource in `ResearchCycleStopped.event` when journal persistence fails, but its executable catch prints only the message. A no-network subprocess probe runs the actual CLI, accepts one hypothesis, fails the second journal write, and exits with only an intent in the journal and no accepted IDs in output. Evidence: `/tmp/stock-bot-cycle-journal-probe/`. A subsequent `journal.close()` failure can also mask the primary error.
Scope: emit structured recovery evidence from the existing stopped event at the CLI boundary. Preserve exact accepted resource/revision IDs, operation, input, key and resource identity. Keep exit status nonzero and stop subsequent admissions. Cleanup failures must not suppress the primary recovery evidence. Do not label unacknowledged work accepted. Keep successful output compatible and fresh/exclusive journal creation unchanged. No automatic replay, silent fallback journal, client framework, credential output or backend/financial changes.
Ownership: agent owns `scripts/examples/research-cycle.ts`, `scripts/test/research-cycle.test.ts` and one small subprocess preload fixture if needed. Root owns docs/manifest, combined gates and commits. Parallel with RP16, which owns the client and its tests. Independent review required.
Acceptance/tests: run the actual executable with deterministic no-network fetch and journal faults after server acceptance; assert exact recovery event in stderr, empty success output, exit 1, original intent retained and no later mutation. Cover write/sync failure and a simultaneous close failure; ordinary pre-admission errors must not invent receipts or reveal the credential. Existing callable receipt/cancellation and successful workflow tests remain green.
Gates: research-cycle/client tooling suites, subprocess recovery regressions, authored types, scoped lint/formatting, root repository check. No browser suite required for a CLI-only change. Existing untrusted-candidate isolation and research authorization stay unchanged.

View file

@ -0,0 +1,13 @@
# RP16 — Accept automatic lineage in AI strategy publication
Parent E12. Priority P1 / High workflow defect. Complexity S. Dependencies A03 and R01. Owner continuation authorizes this correction.
Verified baseline: `ResearchClient.publishVersion` requires the response parent to equal its default null input. `StrategyCatalogService.publishVersion` instead assigns the latest version when no explicit parent is supplied. A real PostgreSQL probe with a provisioned research-agent credential confirms the first publication succeeds, the second and same-key retry return valid 201 receipts with the first version as parent, and exactly two rows exist, while the client rejects both receipts. Evidence: `/tmp/stock-bot-rp16-baseline.log`. The earlier service-credential probe was invalid because this client requires agent-created records; it is not regression evidence.
Scope: validate an explicit non-null parent exactly; accept and retain the server-assigned lineage when null requests automatic selection. Preserve schema/UUID, candidate origin, family and package hash checks, captured body and receipt key. Document null semantics beside the method. No extra lookup, catalog policy change, automatic retry, auth expansion or financial change.
Ownership: agent owns `scripts/research-client.ts` and `scripts/test/research-client.test.ts`. Root owns the real-agent regression in `test/postgres/ai-research-workflow.test.ts`, shared validation/docs and commits. Parallel with RP15; independent review required.
Acceptance/tests: first publication accepts null lineage; later default/null publication accepts the actual earlier version ID. Explicit parent mismatch still fails. Wrong family/origin/hash/invalid parent shape still fails. A repeated exact receipt recovers the same version even after a later publication becomes latest; it sends identical body/key, creates no duplicate and never executes candidate code. Verify these normal paths through real authorized routes and PostgreSQL with the existing fixture.
Gates: focused client/cycle tooling tests, authored types, scoped lint/formatting, root repository check, real PostgreSQL AI workflow tests. No browser change or browser suite needed. Preserve backend lineage and all existing authorization rules.