defaultComputePatchId
defaultComputePatchId(
worktreePath,base):Promise<{baseSha:string|null;files:string[];patchId:string|null; }>
Defined in: src/critic-core.ts:184
Fingerprint the branch diff with git patch-id so a rebase (same diff, new SHA) is a
no-op, AND return the concrete base it diffed against + the changed-file set. patch-id
ignores line numbers, so it stays stable when the rebased-onto base shifts hunks elsewhere;
it changes only when the branch’s own changed lines or their context change. patchId is
null on no diff or any git failure → caller never skips (reviews) — UNCHANGED skip semantics.
baseSha is the SHA the prompt + the buildVerdict backstop both key off (one source of
truth); null on a total git failure → prompt falls back to the local base, backstop is
skipped. files is the repo-relative changed-file list; [] on any git failure / no diff.
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
string
Returns
Section titled “Returns”Promise<{ baseSha: string | null; files: string[]; patchId: string | null; }>