pub fn run_train_ci(
repo: &Path,
tip: &str,
spec: &CommandSpec,
ci: &mut dyn CiExecutor,
) -> Result<Verdict, String>Expand description
Checks one train commit with a CiExecutor instead of asking the
host forge (D18).
The forge path and this one answer the same question by opposite
means. Asking the forge requires publishing the speculative merge of
every open PR to a remote and trusting whatever ran there; this
checks the train in the worktree that just built it, with an
operator-declared command, on a provider the operator picked. What
comes back is a Verdict rather than a bool, so the caller can
still tell “the train is bad” from “we could not find out” — the
distinction the whole seam exists for, and one the forge’s
status/conclusion enums also make and the bool did not.
repo is checked out at tip first, forcibly: the train build owns
this worktree and left it detached at the train it built, but an
advisory differential run between the two may have moved it.
The job is content-addressed by tip under git’s own codec, so the
subject a cache keys on and the subject a RecordCheck names are
the commit itself rather than a queue-local id. may_write_cache
stays false: a train holds unreviewed code from every open PR, which
is exactly the untrusted case the flag is for.
§Errors
Git could not resolve or check out tip, the executor could not be
reached, or it answered with something other than one verdict for
the one job. All three mean we did not find out, never that the
train is bad — a caller must not land on this and must not blame a
change for it.