PlanGateServiceDeps
Defined in: src/plan-gate.ts:116
Properties
Section titled “Properties”baseSha?
Section titled “baseSha?”
optionalbaseSha?: (repoPath,base) =>string
Defined in: src/plan-gate.ts:162
default: git rev-parse origin/<base> (fallback <base>) in the repo.
Parameters
Section titled “Parameters”repoPath
Section titled “repoPath”string
string
Returns
Section titled “Returns”string
optionalcap?: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.
detectBackend?
Section titled “detectBackend?”
optionaldetectBackend?: () =>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.
Returns
Section titled “Returns”herdr:
Pick<HerdrDriver,"start"|"stop"|"list">
Defined in: src/plan-gate.ts:130
membraneEnv?
Section titled “membraneEnv?”
optionalmembraneEnv?: () =>object
Defined in: src/plan-gate.ts:170
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/plan-gate.ts:148
optionalnow?: () =>number
Defined in: src/plan-gate.ts:149
Returns
Section titled “Returns”number
onChange
Section titled “onChange”onChange: (
id,gate) =>void
Defined in: src/plan-gate.ts:139
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
onReviewing?
Section titled “onReviewing?”
optionalonReviewing?: (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.
Parameters
Section titled “Parameters”string
reviewing
Section titled “reviewing”boolean
Returns
Section titled “Returns”void
readPlan?
Section titled “readPlan?”
optionalreadPlan?: (worktreePath) =>string|null
Defined in: src/plan-gate.ts:152
default: read .shepherd-plan.md from the live worktree.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
Returns
Section titled “Returns”string | null
readPlanBlocks?
Section titled “readPlanBlocks?”
optionalreadPlanBlocks?: (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.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
Returns
Section titled “Returns”readUsage?
Section titled “readUsage?”
optionalreadUsage?: (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.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
reviewerSessionId
Section titled “reviewerSessionId”string
Returns
Section titled “Returns”Promise<SessionUsage | null>
readVerdict?
Section titled “readVerdict?”
optionalreadVerdict?: (worktreePath) =>RawPlanVerdict|null
Defined in: src/plan-gate.ts:160
default: read PLAN_VERDICT_FILE from the reviewer’s disposable worktree.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
Returns
Section titled “Returns”RawPlanVerdict | null
release
Section titled “release”release: (
sessionId) =>void
Defined in: src/plan-gate.ts:138
Release an APPROVED autonomous (auto/autopilot) session into execution (SessionService.releasePlanGate).
Parameters
Section titled “Parameters”sessionId
Section titled “sessionId”string
Returns
Section titled “Returns”void
reply: (
sessionId,text) =>boolean
Defined in: src/plan-gate.ts:136
Steer reviewer findings into the live planning agent’s PTY (SessionService.reply).
Parameters
Section titled “Parameters”sessionId
Section titled “sessionId”string
string
Returns
Section titled “Returns”boolean
resolveForge?
Section titled “resolveForge?”
optionalresolveForge?: (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).
Parameters
Section titled “Parameters”repoPath
Section titled “repoPath”string
Returns
Section titled “Returns”GitForge | null
store:
Pick<SessionStore,"getPlanGate"|"putPlanGate"|"dropPlanGate"|"snapshotPlanGates"|"getRepoConfig"|"addSignal"|"get"|"recordReviewerSpawn"|"completeReviewerSpawn"|"listReviewerSpawns">
Defined in: src/plan-gate.ts:117
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs?:number
Defined in: src/plan-gate.ts:150
worktree
Section titled “worktree”worktree:
Pick<WorktreeMgr,"createDetached"|"remove"|"gitCommonDir">
Defined in: src/plan-gate.ts:131
worktreeExists?
Section titled “worktreeExists?”
optionalworktreeExists?: (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).
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
Returns
Section titled “Returns”boolean