ReviewServiceDeps
Defined in: src/review.ts:118
Properties
Section titled “Properties”autoAddress?
Section titled “autoAddress?”
optionalautoAddress?: (sessionId,text) =>boolean
Defined in: src/review.ts:153
Steer critic findings into a session’s live PTY (typically SessionService.reply). Returns false (or throws — both treated as not-delivered) when the steer can’t land; only a true return advances the round. Absent → the auto-address loop is disabled regardless of per-repo config.
Parameters
Section titled “Parameters”sessionId
Section titled “sessionId”string
string
Returns
Section titled “Returns”boolean
optionalcap?:number| (() =>number)
Defined in: src/review.ts:159
Max auto-address rounds before escalating to the human (default 3). Pass a thunk to read a live, UI-configurable value per-use — the cap is resolved on every read so a settings change takes effect on the next critic run without a restart.
computePatchId?
Section titled “computePatchId?”
optionalcomputePatchId?: (worktreePath,base) =>Promise<{baseSha:string|null;files:string[];patchId:string|null; }>
Defined in: src/review.ts:176
Injectable content fingerprint of git diff base...HEAD in the worktree (default:
real git patch-id). Returns the patch-id (null when there’s no diff or git fails →
never skips), the concrete base SHA it fetched-and-diffed (null on a total git failure →
prompt falls back to the local base, backstop is skipped), and the changed-file set (the
same fresh base feeds the buildVerdict scope backstop).
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
string
Returns
Section titled “Returns”Promise<{ baseSha: string | null; files: string[]; patchId: string | null; }>
detectBackend?
Section titled “detectBackend?”
optionaldetectBackend?: () =>SandboxBackend
Defined in: src/review.ts:188
Injectable sandbox backend probe seam (tests inject () => null so no real bwrap is
spawned). Presence-checked (not ??) because the seam legitimately returns null.
Returns
Section titled “Returns”herdr:
Pick<HerdrDriver,"start"|"stop"|"list"|"closeTab">
Defined in: src/review.ts:133
membraneEnv?
Section titled “membraneEnv?”
optionalmembraneEnv?: () =>object
Defined in: src/review.ts:190
Injectable membrane env seam (tests inject a stub so no host paths are touched).
Returns
Section titled “Returns”object
claudeDir
Section titled “claudeDir”claudeDir:
string
extraEnv?
Section titled “extraEnv?”
optionalextraEnv?:Record<string,string>
home:
string
nodeBinReal
Section titled “nodeBinReal”nodeBinReal:
string
model?
Section titled “model?”
optionalmodel?:string|null
Defined in: src/review.ts:160
optionalnow?: () =>number
Defined in: src/review.ts:161
Returns
Section titled “Returns”number
onActivity?
Section titled “onActivity?”
optionalonActivity?: (id,summary) =>void
Defined in: src/review.ts:146
Fired each tick a critic is still running, with its latest meaningful tool-use summary (e.g. ”$ git diff”, “read review.ts”) — surfaced live in the UI badge tooltip so the operator can see what the critic is doing, not just that it’s busy. Only fired when a summary is available; the run-ended (onReviewing false) signal clears it client-side.
Parameters
Section titled “Parameters”string
summary
Section titled “summary”string
Returns
Section titled “Returns”void
onChange
Section titled “onChange”onChange: (
id,verdict) =>void
Defined in: src/review.ts:136
Parameters
Section titled “Parameters”string
verdict
Section titled “verdict”Returns
Section titled “Returns”void
onReviewing?
Section titled “onReviewing?”
optionalonReviewing?: (id,reviewing) =>void
Defined in: src/review.ts:138
Fired when a critic run starts (true) and when it ends (false) for a session.
Parameters
Section titled “Parameters”string
reviewing
Section titled “reviewing”boolean
Returns
Section titled “Returns”void
readActivity?
Section titled “readActivity?”
optionalreadActivity?: (worktreePath,criticSessionId) =>string|null
Defined in: src/review.ts:182
Injectable reader for the critic’s latest tool-use summary (default: parse its JSONL transcript via readActivitySignal). null = no parseable activity yet.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
criticSessionId
Section titled “criticSessionId”string
Returns
Section titled “Returns”string | null
readUsage?
Section titled “readUsage?”
optionalreadUsage?: (worktreePath,criticSessionId) =>Promise<SessionUsage|null>
Defined in: src/review.ts:185
Injectable reader of a finished reviewer’s token totals from its transcript (default: readSessionUsage). null = transcript missing/unreadable → totals stay null.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
criticSessionId
Section titled “criticSessionId”string
Returns
Section titled “Returns”Promise<SessionUsage | null>
readVerdict?
Section titled “readVerdict?”
optionalreadVerdict?: (worktreePath) =>VerdictRead<RawVerdict>
Defined in: src/review.ts:170
Injectable verdict reader (default: read VERDICT_FILE from the worktree). 3-way result so tick() can fail fast on a present-but-unparseable verdict and gate a repaired parse on the critic spawn having finished.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
Returns
Section titled “Returns”resolveForge
Section titled “resolveForge”resolveForge: (
repoPath) =>GitForge|null
Defined in: src/review.ts:135
Parameters
Section titled “Parameters”repoPath
Section titled “repoPath”string
Returns
Section titled “Returns”GitForge | null
store:
Pick<SessionStore,"getRepoConfig"|"getReview"|"putReview"|"bumpReviewHead"|"dropReview"|"snapshotReviews"|"addSignal"|"recordReviewerSpawn"|"completeReviewerSpawn"|"listReviewerSpawns"|"get">
Defined in: src/review.ts:119
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs?:number
Defined in: src/review.ts:162
worktree
Section titled “worktree”worktree:
Pick<WorktreeMgr,"createDetached"|"remove"|"gitCommonDir">
Defined in: src/review.ts:134
worktreeExists?
Section titled “worktreeExists?”
optionalworktreeExists?: (p) =>boolean
Defined in: src/review.ts:166
default: existsSync — whether a reviewer’s disposable worktree is still on disk.
reapOrphans() uses it to tell a true restart-orphan (worktree survives) from an
already-finalized review (finalize reaps the worktree).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean