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§
- Post
Commit Gate - What:
The settled gate:
the landed commit, every event it produced, and whether the backup must not run.
Why:
eventsalready carries thecommit-landedevent whenblockedis true, so the caller renders one list. - Post
Commit Outcome - 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.
- Post
Commit Request - 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_pushand 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.