Skip to content

PlanGateServiceDeps

Defined in: src/plan-gate.ts:116

optional baseSha?: (repoPath, base) => string

Defined in: src/plan-gate.ts:162

default: git rev-parse origin/<base> (fallback <base>) in the repo.

string

string

string


optional cap?: number | (() => number)

Defined in: src/plan-gate.ts:147

Max adversarial rounds before escalating to the human (default 5). Pass a thunk to read a live, UI-configurable value per-use — resolved on every read so a settings change takes effect on the next run without a restart.


optional detectBackend?: () => SandboxBackend

Defined in: src/plan-gate.ts:168

Injectable sandbox backend probe seam (tests inject () => null so no real bwrap is spawned). Presence-checked (not ??) because the seam legitimately returns null.

SandboxBackend


herdr: Pick<HerdrDriver, "start" | "stop" | "list">

Defined in: src/plan-gate.ts:130


optional membraneEnv?: () => object

Defined in: src/plan-gate.ts:170

Injectable membrane env seam (tests inject a stub so no host paths are touched).

object

claudeDir: string

optional extraEnv?: Record<string, string>

home: string

nodeBinReal: string


optional model?: string | null

Defined in: src/plan-gate.ts:148


optional now?: () => number

Defined in: src/plan-gate.ts:149

number


onChange: (id, gate) => void

Defined in: src/plan-gate.ts:139

string

PlanGate

void


optional onReviewing?: (id, reviewing) => void

Defined in: src/plan-gate.ts:141

Fired when a plan review starts (true) and when it ends (false) for a session.

string

boolean

void


optional readPlan?: (worktreePath) => string | null

Defined in: src/plan-gate.ts:152

default: read .shepherd-plan.md from the live worktree.

string

string | null


optional readPlanBlocks?: (worktreePath) => VisualBlock[]

Defined in: src/plan-gate.ts:154

default: read + parse + plan-ground .shepherd-plan-blocks.json from the live worktree. [] when absent/garbage.

string

VisualBlock[]


optional readUsage?: (worktreePath, reviewerSessionId) => Promise<SessionUsage | null>

Defined in: src/plan-gate.ts:165

Injectable reader of a finished reviewer’s token totals from its transcript (default: readSessionUsage). null = transcript missing/unreadable → totals stay null.

string

string

Promise<SessionUsage | null>


optional readVerdict?: (worktreePath) => RawPlanVerdict | null

Defined in: src/plan-gate.ts:160

default: read PLAN_VERDICT_FILE from the reviewer’s disposable worktree.

string

RawPlanVerdict | null


release: (sessionId) => void

Defined in: src/plan-gate.ts:138

Release an APPROVED autonomous (auto/autopilot) session into execution (SessionService.releasePlanGate).

string

void


reply: (sessionId, text) => boolean

Defined in: src/plan-gate.ts:136

Steer reviewer findings into the live planning agent’s PTY (SessionService.reply).

string

string

boolean


optional resolveForge?: (repoPath) => GitForge | null

Defined in: src/plan-gate.ts:134

Resolve the forge for a repo so begin() can fetch the originating issue’s body as UNTRUSTED reviewer context. Optional + optional-chained: absence ⇒ no issue context (never blocks).

string

GitForge | null


store: Pick<SessionStore, "getPlanGate" | "putPlanGate" | "dropPlanGate" | "snapshotPlanGates" | "getRepoConfig" | "addSignal" | "get" | "recordReviewerSpawn" | "completeReviewerSpawn" | "listReviewerSpawns">

Defined in: src/plan-gate.ts:117


optional timeoutMs?: number

Defined in: src/plan-gate.ts:150


worktree: Pick<WorktreeMgr, "createDetached" | "remove" | "gitCommonDir">

Defined in: src/plan-gate.ts:131


optional worktreeExists?: (worktreePath) => boolean

Defined in: src/plan-gate.ts:158

default: existsSync — whether a reviewer’s disposable worktree is still on disk. adoptOrphans() uses it to tell a true restart-orphan (worktree survives) from an already-finalized review (finalize reaps the worktree).

string

boolean