Persist full ResearchResult alongside trace (observability gap) #54
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Discovered during M3.1 stress testing (Issue #44). Blocks M3.2 (#45) and M3.3 (#46).
Problem
The JSONL trace at
~/.marchwarden/traces/<trace_id>.jsonlrecords step events and final counts only:The actual
ResearchResultpayload — gap categories, citations, discovery_events, open_questions, confidence_factors, synthesized answer — is never persisted. It exists only in the terminal output of the run.cli.main replay <trace_id>re-renders trace events but cannot reconstruct the result, because the result was never written.Why this blocks Phase 3
teeQ2/Q3/Q4 output to recover gap categories. Q1's gap categories are lost — trace says "5 gaps fired" but not which ones.Fix
Write the final
ResearchResultas a sibling file~/.marchwarden/traces/<trace_id>.result.json(pydantic.model_dump_json(indent=2)) at the same point we currently emit thecompletestep event inresearchers/web/agent.py.Update
cli.main replayto load and render the result file when present.Acceptance
askrun, both<trace_id>.jsonland<trace_id>.result.jsonexist.replay <trace_id>shows the rendered result tables (gaps, citations, etc.) in addition to the step log.glob ~/.marchwarden/traces/*.result.json, deserialize each intoResearchResult, and count gap categories across runs.Out of scope
Per-event gap/citation logging during the run (timeline analysis). Can come later if needed.