ship: plan & run + reading room v0 (P2) #2

Merged
coreci-bot merged 9 commits from phase/02-plan-run-reading-room into milestone/v0.1-prototype 2026-09-27 01:36:03 +00:00
Owner

Phase 2 ship: Plan & Run screen (plan approval UI, scripted live trace with pause/resume/cancel), Reading Room v0 (page-anchored citations with hover/focus quotes, citation ledger panel, real Markdown/JSON exports). Mock multi-run store closes P1-3. REQ-57..59. Gates: typecheck/lint/test(33)/build green. Verify: PASS zero P0, four P1 fixed in-phase.

Phase 2 ship: Plan & Run screen (plan approval UI, scripted live trace with pause/resume/cancel), Reading Room v0 (page-anchored citations with hover/focus quotes, citation ledger panel, real Markdown/JSON exports). Mock multi-run store closes P1-3. REQ-57..59. Gates: typecheck/lint/test(33)/build green. Verify: PASS zero P0, four P1 fixed in-phase.
coreci-bot added 9 commits 2026-09-27 01:35:59 +00:00
---ci---
phase: 2
milestone: v0.1
status: plan
requirements:
  covered: []
  partial: []
---/ci---

PLAN.md refreshed at phase boundary per protocol: P2 covers REQ-57..59
(plan approval UI, scripted live trace with pause/cancel, reading room
with hover-anchored citations + ledger, real exports). Mock store
multi-run upgrade closes P1 flag P1-3. P1-1/P1-2 stay routed to P4.
---ci---
phase: 2
milestone: v0.1
status: execute
persona: frontend-engineer
task: T-2.1
requirements:
  covered: [REQ-57]
---/ci---

Map-based run store (closes P1-3: back-nav to earlier runs resolves),
approvePlan/cancelRun/completeRun persist status transitions, createRun
halts at awaiting_approval, getRunEvents handle gains pause()/resume()
with clean timer teardown, exports carry {report, ledger} in JSON with
researchx-<id> filenames.
---ci---
phase: 2
milestone: v0.1
status: execute
persona: frontend-engineer
task: T-2.4
requirements:
  covered: [REQ-57]
---/ci---

Three-stage RunView: awaiting_approval plan display (sub-questions,
source universe chips, outline, Approve as sole primary action),
streaming trace with progressive event rendering + auto-scroll +
Pause/Resume/Cancel wired to the subscription handle, and
done/cancelled terminal states with onward links. Trace region is
aria-live; cancel persists via cancelRun.
---ci---
phase: 2
milestone: v0.1
status: execute
persona: frontend-engineer
task: T-2.7
requirements:
  covered: [REQ-58, REQ-59]
---/ci---

Report reader route /run/[id]/report: [^pN] markers parsed into React
nodes (no dangerouslySetInnerHTML), superscript citation buttons with
hover+focus popovers showing exact quotes, verification badges, and
authority tiers; citation ledger panel lists all sources with real
links; Export Markdown/JSON buttons download real files via
Blob/objectURL with citations as real links.
---ci---
phase: 2
milestone: v0.1
status: execute
persona: frontend-engineer
task: T-2.10
requirements:
  covered: [REQ-57, REQ-58, REQ-59]
---/ci---
---ci---
phase: 2
milestone: v0.1
status: execute
persona: frontend-engineer
task: T-2.11
requirements:
  covered: [REQ-57, REQ-58, REQ-59]
---/ci---

run-view: plan renders before approval; approve streams progressively
to done with report link; pause halts event count; resume continues;
cancel persists + links to /choose. reading-room: parseReportBody
segments, markers render, focus reveals exact quote, ledger lists
sources, markdown carries real links, JSON round-trips {report,ledger}.
mock: multi-run store regression (P1-3 closure), approval persistence,
cancel/complete persistence, pause/resume/cancel subscription behavior.
Closes P1-4 run-view test gap.
---ci---
phase: 2
milestone: v0.1
status: execute
persona: ci-lead-developer
task: T-2.14
requirements:
  covered: [REQ-54]
---/ci---

Verified: no component/page imports @/lib/api/mock (production code);
all data flows through the ApiClient interface (cancelRun/completeRun
added to the interface — maps to POST /api/runs/{id}/cancel in REQ-25);
no dangerouslySetInnerHTML — report bodies parsed to React nodes;
replay timers cleared on cancel + subscription teardown on unmount;
gates re-run green (typecheck, lint, 33/33 tests, build).
---ci---
phase: 2
milestone: v0.1
status: execute
persona: ci-lead-developer
task: T-2.14
requirements:
  covered: [REQ-57, REQ-58]
---/ci---

P1-1: trace auto-scroll now sets container scrollTop (scrollIntoView
moved ancestors, not the inner fold). P1-2: trace events render their
timestamp (acceptance criterion). P1-3: report page gets the standard
main shell. P1-4: completeRun removed from the ApiClient interface —
DONE is engine-owned and arrives via the stream terminal event; the
mock owns the transition locally and persists it before onDone fires.
---ci---
phase: 2
milestone: v0.1
status: verify
requirements:
  covered: [REQ-57, REQ-58, REQ-59]
  partial: []
lessons:
  - "layer1 structural: all plan files exist, imports resolve, no stubs, gates re-run green (33/33)"
  - "layer2 behavioral: plan approval flow, pause/resume/cancel, reading room hover-quote, exports with real links all pinned by tests; P1-3 multi-run regression closed"
  - "layer3 security STRIDE: no injection surface — report bodies parsed to React nodes, download filenames are base36 hashes, ledger links carry noopener noreferrer"
  - "layer4 quality review: PASS, zero P0"
  - "P1-1 auto-scroll target wrong — FIXED in-phase (scrollTop, acceptance criterion)"
  - "P1-2 trace timestamps missing — FIXED in-phase (acceptance criterion)"
  - "P1-3 report page missing main shell — FIXED in-phase"
  - "P1-4 completeRun pollutes the swappable interface — FIXED in-phase (DONE is engine-owned, arrives via stream terminal; mock owns it locally)"
  - "P2 notes routed to P4: pause comment/code drift, unhandled-rejection guards for v0.2 clients, test under-advance flake risk, tooltip clipping"
---/ci---
coreci-bot merged commit d07e0b87b3 into milestone/v0.1-prototype 2026-09-27 01:36:03 +00:00
coreci-bot deleted branch phase/02-plan-run-reading-room 2026-09-27 01:36:03 +00:00
Sign in to join this conversation.