pub fn diff(repo: &Path, run_id: &str) -> Result<Option<String>>Expand description
The change a finished run produced, read from git.
The run record does not keep the diff, and should not: it would be a second copy of something git already stores exactly. A run’s commit lives on its own branch, or on the branch a promotion named.
The branch existing is not enough. A refused run has a branch — it was
created before the agent started — whose head is simply the base commit it
branched from, and showing that would present somebody else’s change as this
run’s output. So the head commit has to say it is this run’s, by the trailer
the runtime wrote into it. None means the run produced no commit, which is
a true answer rather than a missing one.