Rewrite review-pr.sh from tmux-based agent-session.sh to synchronous
claude -p invocations via inline agent_run(), matching the SDK pattern
established in dev-agent.sh (#798).
Key changes:
- Replace agent-session.sh (tmux + monitor_phase_loop) with inline
agent_run() using one-shot claude -p and --output-format json
- Add .sid file for session continuity: re-reviews resume the original
session via --resume, so Claude remembers its prior review
- Use worktree.sh for worktree cleanup instead of manual git commands
- Remove phase file signaling (PHASE:done) — completion is automatic
when claude -p returns
- Keep all review business logic: PR metadata, diff extraction,
re-review detection (SHA tracking), incremental diff, build graph,
formula loading, review posting, formal review submission
Session continuity for re-reviews:
Initial review → save session_id to .sid file
Re-review → load session_id, agent_run --resume → Claude remembers
what it flagged and checks specifically whether concerns were addressed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>