Skip to content

ReviewService

Defined in: src/review.ts:198

new ReviewService(deps): ReviewService

Defined in: src/review.ts:252

ReviewServiceDeps

ReviewService

clearStallState(session): void

Defined in: src/review.ts:462

Reset the prior review verdict’s escalation counters WITHOUT re-triggering a review. Used by the “dismiss” quota action so the block clears on the next poll tick without spawning a new critic run. Only acts when a prior verdict row exists.

Session

void


consider(session, git, opts?): Promise<ReviewOutcome>

Defined in: src/review.ts:269

Decide whether git warrants a fresh critic run for session, and start one. With opts.force (the operator’s manual re-review via forceReview) the same-head dedup, the spawn ceiling, and the patch-id churn-skip are bypassed — but the hard preconditions (PR open + CI green + critic enabled + not already running) still gate.

Session

GitState

boolean

Promise<ReviewOutcome>


forceReview(session, git): Promise<ReviewOutcome>

Defined in: src/review.ts:479

Operator-initiated (re)start of a critic review for session, bypassing the auto path’s same-head dedup, spawn ceiling, and patch-id churn-skip. Aborts a hung in-flight run first.

Session

GitState

Promise<ReviewOutcome>


forget(sessionId): void

Defined in: src/review.ts:1052

string

void


inflightWorktrees(): string[]

Defined in: src/review.ts:1048

Worktree paths of critic runs currently owned in-memory — the GC sweep must spare these (a re-adopted #631 orphan’s tick() still needs its worktree).

string[]


reapOrphans(): Promise<string[]>

Defined in: src/review.ts:951

Boot reconcile: close dangling reviewer_spawns rows from the last run and kill any still-alive orphaned critic processes.

An “orphan” is a review that was in flight when the server last restarted. Because inflight is in-memory only, tick() never finalizes it; the still-alive claude holds the stable herdr name “review TASK-”, and the next consider() for that session collides with agent_name_taken. This sweep detects and reaps them.

The orphan SIGNAL is the surviving disposable worktree — finalize() always removes it, so a present worktree means finalize() NEVER ran (i.e., a true restart-orphan). A row whose worktree is already gone (finalize ran but captureUsage’s if (usage) guard left the row uncompleted) is NOT an orphan: it’s a completed-but-unclosed row. We close those too (step a), but we do NOT reap/drop/re-kick them — preserving any genuine-timeout error verdict’s errorRound/streak escalation accounting.

Returns the taskSessionIds that should be re-kicked by the caller (index.ts wiring in a separate task). Logs a one-line summary of what was reaped.

Promise<string[]>


reviewingIds(): string[]

Defined in: src/review.ts:1042

Session ids with a critic run currently in flight (for client bootstrap).

string[]


snapshot(): Record<string, ReviewVerdict>

Defined in: src/review.ts:1037

Record<string, ReviewVerdict>


tick(): Promise<void>

Defined in: src/review.ts:664

Finalize any in-flight review whose verdict file is ready or that timed out.

Promise<void>