Skip to content

Add durable AutoReviewRun store and restart reconciliation #325

@shiny-code-bot

Description

@shiny-code-bot

Summary

Build the foundation for #324: a durable repo-scoped AutoReviewRun store in code-core, near the existing review lock/epoch state.

This slice should not change prompt injection or LLM behavior yet. It creates the durable source of truth that later TUI/exec/ledger work will use.

Scope

  • Define AutoReviewRun, status/phase/freshness enums, finding digests, and sidecar paths.
  • Store records under the existing repo-scoped review state area in CODE_HOME.
  • Prefer simple JSON/NDJSON plus atomic writes/compaction unless a concrete locking issue requires SQLite.
  • Persist terminal output/detail sidecars by stable run id.
  • Add load/compact/reconcile APIs.
  • On restart/load, mark orphaned in-flight records as lost/cancelled only after reconciling available AgentManager/worktree/lock evidence.

Acceptance Criteria

  • Run records can be created, updated, loaded, compacted, and queried by repo.
  • Terminal review output can be written/read as a sidecar by run id.
  • Restart reconciliation has deterministic tests for active, terminal, and orphaned runs.
  • Store writes are atomic enough for TUI/exec use or guarded by an explicit file-lock strategy.
  • No per-turn ledger/prompt injection is added in this slice.

Relationships

Parent: #324
Evidence archive: #76

Finish Line

Every Code has a repo-scoped durable AutoReviewRun store that records run lifecycle state, survives restart, reconciles orphaned in-flight runs, and preserves terminal review output sidecars without changing assistant prompt injection yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    planDurable planning issueplan:donePlan completed or superseded

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions