Expand description
Startup recovery of interrupted commit transactions.
What:
Startup recovery of interrupted commit transactions for the invocation’s worktree.
Why:
Before configuration loads,
and before read-only commands that already asked Git for the
repository location,
every dead owner’s transaction is recovered or fails closed;
live
owners are skipped.
The legacy single-journal directory is not recovered here:
the
command stops and says how to recover it with the previous executable (the owner’s
verdict,
doc/planning/cli-git-rust-open-decisions.md,
“Legacy single-journal directory”).
An empty registry costs one directory read and no Git process
(src/policy-engine/commit-transaction-recovery.ts).
In TS you’d write (pseudocode):
await recoverCommitTransaction({ args, gitPath, identity });Enums§
- Recovery
Stop - What: Why recovery stopped the command. Why: The legacy directory and a recovery failure are reported differently.
Functions§
- leaves_
live_ transactions - What: Whether outcomes leave a transaction another process may still be running. Why: Until index writers coordinate with live transactions, a guarded command beside one is refused instead of racing it. A dead owner’s kept staging candidate touched nothing and does not count; an unattributed one may still be written by a live owner.
- legacy_
notice - What: The message for the legacy single-journal directory. Why: The owner chose to stop with instructions instead of porting its recovery.
- outcomes_
json - What:
The outcomes as the incumbent’s debug JSON.
Why:
JSON.stringify(outcomes)in the recovery debug line. - recover_
commit_ transactions - What:
Recover every interrupted transaction of the invocation’s worktree;
returns the
outcomes,
empty when there was nothing to do.
Why:
recoverCommitTransaction, with the legacy directory stopping the command. - recovery_
directories - What:
The Git directory whose registry this invocation recovers,
or nothing outside a worktree
and in a bare repository.
Why:
resolveCommitTransactionTargets: only worktrees hold transactions.