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

9 Commits

Author SHA1 Message Date
coreci b081af4fe3 verify(P02): passed — zero P0, four P1 fixed in-phase
---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---
2026-09-27 01:35:16 +00:00
coreci 8c1bc6bf4a fix(P02): verify-layer fixes — auto-scroll, timestamps, report shell, interface honesty
---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.
2026-09-27 01:35:11 +00:00
coreci 62e51aa58c docs(P02-T2.14): boundary review — api boundary clean, timer hygiene verified
---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).
2026-09-27 01:20:50 +00:00
coreci 1f7a2ffb46 test(P02-T2.11): flow, pause/resume, cancel, ledger, exports, multi-run regression
---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.
2026-09-27 01:20:44 +00:00
coreci 5ad75362d6 docs(P02-T2.10): README — plan & run + reading room screens
---ci---
phase: 2
milestone: v0.1
status: execute
persona: frontend-engineer
task: T-2.10
requirements:
  covered: [REQ-57, REQ-58, REQ-59]
---/ci---
2026-09-27 01:20:40 +00:00
coreci 5adafcc7d2 feat(P02-T2.7): reading room v0 — anchored citations, ledger panel, exports
---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.
2026-09-27 01:20:40 +00:00
coreci 20628bcc3a feat(P02-T2.4): plan & run screen — approval stage, live trace, pause/cancel
---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.
2026-09-27 01:20:40 +00:00
coreci cf4e43523e feat(P02-T2.1): mock engine — multi-run store, persisting approvals, pause-aware replay
---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.
2026-09-27 01:20:34 +00:00
coreci fd08422a95 docs(P02): phase 2 plan — plan & run + reading room v0
---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.
2026-09-27 00:45:17 +00:00