/** * Resolve a workspace stuck at `preserved_dirty` (ADR 0042). * * When a run ends with uncommitted work, the provider preserves the worktree * rather than destroying the only copy of that work. That decision is correct, * and until this existed it was also permanent: cleanup re-attempted, found the * tree still dirty, preserved again, and incremented a counter. The only exit * was to leave Harnery and remove the directory by hand, after which Harnery's * records described a workspace that no longer existed. * * The shape of the fix is deliberate. Neither mode deletes anything directly. * Each one makes the working tree *clean* by an explicit, named act, and then * hands off to the ordinary cleanup path, which releases a clean workspace as it * always has. So reclaim adds no second removal path that could diverge from the * audited one, and a force-delete of live work exists nowhere in the codebase. */ export type ReclaimMode = "salvage" | "discard"; export type ReclaimPreparation = { action: "salvaged"; branch: string; commit: string; detail: string; } | { action: "discarded"; detail: string; } | { action: "already_clean"; detail: string; } | { action: "already_gone"; detail: string; }; export interface PrepareReclaimInput { worktreePath: string; mode: ReclaimMode; runId: string; } /** * Bring the worktree to a clean state so ordinary cleanup can release it. * * Returns `already_gone` rather than throwing when the directory has been * removed out from under us. A workspace whose worktree no longer exists has * effectively been reclaimed; treating that as an error is what produced an * attempt counter that only ever went up. */ export declare function prepareReclaim(input: PrepareReclaimInput): ReclaimPreparation; /** Named for the run rather than the workspace, because the run id is what an * operator has in hand when they come looking for the work later. */ export declare function salvageBranch(runId: string): string; //# sourceMappingURL=reclaim.d.ts.map