Skip to main content

Module replay_revalidation

Module replay_revalidation 

Source
Expand description

Replay: the replayed index, the shadow HEAD move, and the pre-commit re-run decision of revalidation (replay_revalidation). What: The parts of revalidation after a replay that need no policy and no hook: the replayed index, the shadow HEAD move the policies see, and the decision whether pre-commit must re-run. Why: Policies and the pre-commit re-run belong to the integrator, which owns the policy engine and the hook dispatcher; these three steps are pure Git work the integrator calls before it.

In TS you’d write (pseudocode):

await runTransactionGit({ gitPath, cwd, indexPath, args: ['read-tree', mergedTree], objectDirectory });
await moveShadowHead({ context, onto });
const rerun = !context.noVerify && policyTree !== approvedTree;

Functions§

move_shadow_head
What: Moves the shadow’s target ref to the replay parent, so policies and hooks see the parent the commit will have. Why: A detached HEAD moves itself without dereferencing; a symbolic one moves the branch it names.
pre_commit_rerun_required
What: Whether pre-commit must see the replayed tree: the invocation did not bypass hooks, and the policies changed the tree pre-commit last approved. Why: An unchanged tree was already approved, so re-running the hook would only repeat its answer.
read_replayed_index
What: Reads the merged tree into the replay’s private index, with the shadow object store reachable. Why: The index is the input to policies and pre-commit; objects the merge wrote live in the shadow store.
replayed_index_path
What: The private index of one replayed tree: replay-<r>/commit.index under the transaction directory. Why: Policies and pre-commit see the replayed tree through this index, not the real one.