Host-run commit gates

Updated Aug 22, 2026

By default the workflow host also re-runs the deterministic commitGates commands itself — a gatesGreen claim from an agent is verified, never trusted. The gates run at the start of every dual-review round (before any reviewer agent spends tokens; a red branch goes straight to a fix round carrying the host's log evidence) and once per addendum implementation (addenda have no fix rounds, so an unreproducible green claim fails the addendum outright). Gate runs are serialized across the whole worker pool so sequential execution benefits from the target project's build caching, and each command's full output is streamed to a log in a secure per-run directory (/tmp/df12-gates-XXXXXX/gate-<task>-<round>-N.out, created with mode 0700 and opened exclusively without following symlinks) with a bounded tail quoted in the failure evidence. A command that exceeds commitGateTimeoutSeconds is killed and reported as a failure. The run result's hostGates object reports the configuration and bounded counters (gate runs, failures); per-round pass/fail detail appears in each failed task's reviewRounds[].hostGates.

On POSIX, each gate child runs in its own process group. A timeout or log-write failure terminates that group, falling back to the direct child where group signalling is unavailable. The host resumes any paused output pipes before termination so a full log buffer cannot prevent the child from being reaped.

The run result's top-level codeScene object durably records the effective setting and command, plus bounded counters: runs (checks executed, excluding availability skips), failures (executed checks that failed, including code-health findings), probeFailures (availability probes that failed for another infrastructure reason), and skipped (the configured binary was not found on PATH). The command value redacts values in leading NAME=value assignments, for example CS_TOKEN=<redacted> cs-check-changed --base main; the original command is still used for execution. If tokenization cannot safely disambiguate malformed or control-operator syntax, the displayed command is <redacted command> instead of being partially redacted. A missing binary is therefore a clean skip, whereas probeFailures is a surfaced fault and is not counted as a skip.

env options (for example, -i) are unsupported and fail closed at the availability probe without executing the configured command; a bare env prefix with assignments remains supported.