Skip to main content

Module post_commit

Module post_commit 

Source
Expand description

The post-commit gate over a landed commit: its events, its blocking and the backup it allows. What: The post-commit policy gate over a landed commit’s own changes, and the backup that follows it. Why: The incumbent (src/policy-engine/post-commit-lifecycle.ts) checks the committed bytes of every path a landed commit changed, and only a gate that passes lets the commit reach auto-push. A blocked gate keeps the commit local and names it in a commit-landed event; the command exits 2. The landed commit is an input, so the integrator can call this after any landing.

In TS you’d write (pseudocode):

const result = await runPostCommitLifecycle({ rawArgs, transformedArgs, gitPath, cwd, landedOid, ... });
if (!result.blocked) await autoPush({ gitPath, cwd, landedOid: result.oid });

Structs§

PostCommitGate
What: The settled gate: the landed commit, every event it produced, and whether the backup must not run. Why: events already carries the commit-landed event when blocked is true, so the caller renders one list.
PostCommitOutcome
What: The result of the gate and the backup it allowed or prevented. Why: The exit status and the auto-push result come from one place, so the caller only reports them.
PostCommitRequest
What: The inputs of one post-commit gate. Why: The landed commit names the delta; the global prefix and the environment make every query read the repository the commit landed in.

Constants§

POST_COMMIT_BLOCKED_EXIT_CODE
Exit status the command returns when the gate blocks the backup, as the incumbent’s PolicyDecisionError(2).

Functions§

run_post_commit
What: Run the gate, print its events, and back up the landed commit only when the gate allows it. Why: The incumbent prints the events before the backup and never backs up a blocked commit; a failed backup is reported by auto_push and never changes the outcome’s exit code.
run_post_commit_gate
What: Run the post-commit policies over the landed commit’s delta. Why: Only a gate with no blocking event, no failure and no pending correction lets the backup run; a warning-only result is allowed, as in the incumbent. A landed name that is not an object name is an engine failure, so the commit is kept and reported.