Skip to content

feat(history): snapshot actual LLM (provider/model) per review record (RENG-38) - #154

Open
Liewzheng wants to merge 1 commit into
mainfrom
feat/history-llm-snapshot
Open

feat(history): snapshot actual LLM (provider/model) per review record (RENG-38)#154
Liewzheng wants to merge 1 commit into
mainfrom
feat/history-llm-snapshot

Conversation

@Liewzheng

Copy link
Copy Markdown
Owner

Summary

Records which LLM (provider/model) was actually used for each review in the history, instead of only showing the currently configured one.

Changes

  • Migration 0002: adds LLM snapshot columns to expert_reports and reviews.
  • Signal chain, end to end: capture the actual provider/model at review execution → report payload → persistence → API projection → new LLM column in the frontend history view.
  • Backfill: snapshot fields are populated on write for new records.
  • Legacy data: pre-migration rows simply show NULL for the LLM snapshot — the API projection and frontend degrade gracefully (no value rendered), no backfill required.

Test evidence

  • 1529 lib tests green
  • 163 integration tests green
  • Frontend build green

Plane: RENG-38

…cord (RENG-38) (0.10.2)

Every history record now shows which LLM actually produced each expert
report, at expert granularity:

- CompletionResult carries the provider name; complete_with_fallback
  attributes a success to the exact fallback-chain config that answered.
- ExpertReport/AggregatedReport gain #[serde(default)] Option
  llm_provider/llm_model, backfilled at all expert/aggregator production
  points (pipeline, orchestrator, expert runner); pre-0.10.2 JSON still
  deserializes.
- Migration 0002_llm_snapshot.sql: expert_reports.llm_provider/llm_model
  + reviews.llm_summary (deduped [{provider, model}] JSON, written on
  terminal completion so the list page never parses reviews.result).
  Name snapshots, not FKs: llm_providers is rewritten DELETE+INSERT on
  every config save, so foreign keys would dangle.
- API: GET /reviews/{id} experts gain llmProvider/llmModel; GET /reviews
  items gain llmSummary. History page: per-expert provider/model tag in
  the detail drawer + a compact LLM list column; records predating the
  snapshot render as unknown/- instead of erroring.

Deferred: lead-overview/verifier/adjudicator passes call the LLM but
produce no expert_reports row, so their provider/model is not yet
snapshotted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant