ReviewService
Defined in: src/review.ts:198
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ReviewService(
deps):ReviewService
Defined in: src/review.ts:252
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ReviewService
Methods
Section titled “Methods”clearStallState()
Section titled “clearStallState()”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.
Parameters
Section titled “Parameters”session
Section titled “session”Returns
Section titled “Returns”void
consider()
Section titled “consider()”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.
Parameters
Section titled “Parameters”session
Section titled “session”force?
Section titled “force?”boolean
Returns
Section titled “Returns”Promise<ReviewOutcome>
forceReview()
Section titled “forceReview()”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.
Parameters
Section titled “Parameters”session
Section titled “session”Returns
Section titled “Returns”Promise<ReviewOutcome>
forget()
Section titled “forget()”forget(
sessionId):void
Defined in: src/review.ts:1052
Parameters
Section titled “Parameters”sessionId
Section titled “sessionId”string
Returns
Section titled “Returns”void
inflightWorktrees()
Section titled “inflightWorktrees()”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).
Returns
Section titled “Returns”string[]
reapOrphans()
Section titled “reapOrphans()”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-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.
Returns
Section titled “Returns”Promise<string[]>
reviewingIds()
Section titled “reviewingIds()”reviewingIds():
string[]
Defined in: src/review.ts:1042
Session ids with a critic run currently in flight (for client bootstrap).
Returns
Section titled “Returns”string[]
snapshot()
Section titled “snapshot()”snapshot():
Record<string,ReviewVerdict>
Defined in: src/review.ts:1037
Returns
Section titled “Returns”Record<string, ReviewVerdict>
tick()
Section titled “tick()”tick():
Promise<void>
Defined in: src/review.ts:664
Finalize any in-flight review whose verdict file is ready or that timed out.
Returns
Section titled “Returns”Promise<void>