diff --git a/docs/development/backlog/README.md b/docs/development/backlog/README.md index f76f449d..a8272193 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: 95 retained IDs — 84 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: 96 retained IDs — 84 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. @@ -190,3 +190,5 @@ Owner authorized planning and per-task implementation commits. [Execution plan a - [RP18: October multi-session pilot](tasks/RP18.md) — done; nine retained native runs, exact reproduction, independent accounting/provenance review and opened web findings passed. The seven conditional tasks stay deferred. - [RP19: Final risk state](tasks/RP19.md) — done, `e6616fdc`; canonical results show exact native halt flags, limits and snapshot times without inferring halt history. + +- [RP20: Production research authentication](tasks/RP20.md) — in progress; repair the missing resolver in normal API startup before the next bounded AI study. diff --git a/docs/development/backlog/dependencies.mmd b/docs/development/backlog/dependencies.mmd index 48be2a5e..2224f5c8 100644 --- a/docs/development/backlog/dependencies.mmd +++ b/docs/development/backlog/dependencies.mmd @@ -315,3 +315,6 @@ flowchart TD A02 --> RP17 R08 --> RP17 + + A01 --> RP20 + A03 --> RP20 diff --git a/docs/development/backlog/manifest.json b/docs/development/backlog/manifest.json index fd235e7a..74025d5d 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.112", + "plan_revision": "2026-10-27.113", "repository_base": "b7aeca4", - "plan_status": "final_risk_visibility_complete", + "plan_status": "research_auth_composition_in_progress", "execution_authorized": true, "execution_scope": { "authorized_by": "Owner: commit and continue with the rest of the tasks till 100%", @@ -3620,6 +3620,33 @@ "reviewer": "/root/review_recovery_changes", "authorization": "Owner commit-and-continue authorizes the pilot-driven final risk visibility correction; no new research execution or deferred work.", "review_notes": "Accepted independent review: 48 component tests / 445 assertions. Root full check passed 1378 integration and 150 Rust tests; four scoped native/history browser scenarios passed 91 assertions. Exact retained states, limits and times survive reload without added runs or changed results. Types/lint/format/diff passed. Initial sandbox worker timeouts and manual browser build configuration corrected in verification; real-data-research.md records limits. No financial/API/schema change." + }, + { + "id": "RP20", + "title": "Enable research authentication in the normal API server", + "epic": "E12", + "priority": "P1", + "severity": "High", + "status": "in_progress", + "dependencies": [ + "A01", + "A03" + ], + "decision_dependencies": [], + "task_file": "backlog/tasks/RP20.md", + "complexity": "S", + "assignment": "/root/audit_recovery_next", + "write_locks": [ + "web-api-security-composition" + ], + "blocker": null, + "integration_state": "planned", + "completion_evidence": "real-data-research.md", + "release_gates": [], + "review_status": "pending", + "completed_commit": null, + "integration_base": "079d9a7c", + "authorization": "Owner commit-and-continue authorizes the bounded research follow-up and its production authentication prerequisite. No paper/live activation or deferred optimization." } ], "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/RP20.md b/docs/development/backlog/tasks/RP20.md new file mode 100644 index 00000000..823dba9d --- /dev/null +++ b/docs/development/backlog/tasks/RP20.md @@ -0,0 +1,19 @@ +# RP20 — Enable research authentication in the normal API server + +Parent E12. Priority P1 / High functional defect. Complexity S. Dependencies A01 and A03. The owner's “commit and continue” authorizes the bounded research follow-up and this prerequisite, including validated commits. Root owns planning/integration; one backend implementer owns API composition and focused regression tests. Independent review required. + +Verified evidence: `apps/stock/web-api/src/server-with-websocket.ts` constructs and supplies HTTP security without `resolveResearchCredential`. `routes/create-routes.ts` installs the resolver only when security is omitted. `libs/core/di/src/http/security.ts` therefore reports research disabled in normal startup. Test hosts explicitly install the resolver and mask the omission. Operator research-credential provisioning and research bearer requests cannot use the deployed application's intended A01 path. + +Scope: wire `ResearchAgentsService.authenticate` into the normal application's shared HTTP/WebSocket security instance. Prefer one small composition seam used by production and its regression tests; preserve explicit supplied-security behavior, token/environment validation, browser sessions, CORS, synchronous WebSocket authorization and existing service lifecycle. Do not expose research tokens as privileged identities. Avoid a new authentication framework or mutable global resolver state. + +Exclusions: new roles or capabilities, wider agent permissions, financial/native/schema changes, general server-lifecycle refactoring, research execution, paper/live activation and performance work. A later bounded study uses this existing credential path; it is not part of this fix. + +Acceptance and mandatory tests: + +- Regression executes the same composition invoked by normal server startup, fails on the missing resolver, and verifies credential-backed operator provisioning can reach its existing service. Tests must not silently supply an independently configured research resolver. +- An issued research token authenticates an allowed scoped research request through the real resolver; invalid/revoked credentials fail. Preserve agent identity and existing budget enforcement rather than using an operator fallback. +- Research tokens cannot provision credentials, enter browser sessions, upgrade WebSockets, or call paper/live/administrative routes. Disabled-auth provisioning stays fail-closed. Explicit supplied security keeps its declared capabilities. +- Existing research-agent API/security tests and scoped types/lint/format pass. Root runs the repository check and affected disposable PostgreSQL research-agent tests. No tests or provisioning against development accounts. +- Independent review checks production wiring, shared security identity, denial-before-side-effects and whether tests actually cover the startup seam. Record exact commands and limitations before closing. + +Regression risks: tests reconstructing a different security object again; accidentally permitting async research identities on the privileged WebSocket path; weakening disabled-auth rules; moving startup validation without preserving failure behavior. Keep the implementation focused on composition, not authorization policy.