/** * The inline-receipt guard and the dirty-worktree notice — the two Pi-free * decisions the extension's lifecycle adapter binds (issue #182). * * `review-change` and `audit-pr` used to post their PR receipts through a bash * heredoc: a model assembled the marker inline, ran `gh pr comment --body "…"`, * re-read the thread and retried. Nothing proved the receipt landed, so a review * could print `REVIEW-PASS` while the PR had no current marker. Two scripts now * own that mechanically — `scripts/review-receipt.mjs emit` and * `scripts/audit-pr-gate.mjs comment` — each posting the body from standard input, * re-reading the PR and exiting 0 only when the marker names the reviewed head. * This guard blocks the inline path before it runs, so the unverifiable route is * impossible rather than discouraged. * * Pure on purpose: `index.ts` is the only file that imports Pi values, so these * predicates compile and are tested with no session. */ /** The narrow slice of a Pi `tool_call` the guard reads. */ export interface ToolCallLike { toolName: string; command?: string | undefined; } /** The Pi `tool_call` result shape: `block` plus an actionable `reason`. */ export interface ReceiptGuardDecision { block: boolean; reason?: string; } /** * The `tool_call` gate. Blocks exactly one shape: a bash command that invokes * `gh pr comment` and carries a receipt marker as inline text. A `--body-file` * invocation is the scripts' own path and is allowed; a command that merely * mentions a marker (editing the skill docs) is allowed; every non-bash tool is * allowed. */ export declare function receiptGuard({ toolName, command }: ToolCallLike): ReceiptGuardDecision; /** * The `agent_settled` notice. `porcelain` is `git status --porcelain` output; * an empty (or whitespace-only) string stays silent, and a non-empty one yields * one concise warning naming what is dirty. Decision only — the adapter runs * git and delivers the message. */ export declare function dirtyWorktreeWarning(porcelain: string): string | undefined; /** * How long the settled-turn `git status` probe may run before it is abandoned. * The probe is best-effort hygiene, not work: an unresponsive git must never * park the turn the way the old unbounded `spawnSync` could (issue #182 F4). */ export declare const GIT_STATUS_TIMEOUT_MS = 2000; /** * `git status --porcelain` for the settled-turn notice, time-bounded. A timeout, * a spawn error and a non-zero exit all read as a clean worktree — the notice is * best-effort by construction and must never fail a turn. */ export declare function readGitStatusBounded(cwd: string): string;