Expand description
G6 in the Instance (process v1 §5): the locked-path check on submit and before verify, and the gate’s own rerun of the declared command at the judged commit. Both run here, in the Instance’s process, never through an agent’s shell.
What the agent’s repository cannot change. Every git call runs with
an empty environment, no global or system config, no replace objects,
no attributes file, and hooks, fsmonitor, external diff and textconv
off. The judged commit and spec_commit are fetched into a private
bare repository in the gate’s own directory (over git’s transport, so
every object is hashed again on the way in; no refs/replace, no
alternates, no filters, no config of the agent’s repository). The
commit-to-commit check and the rerun tree come only from that copy; the
tree is written blob by blob, with no checkout, so no smudge filter or
attribute applies.
The locked-path check judges the commit and the handed-in worktree:
the commit against spec_commit in the private copy (what the rerun
runs), and the worktree with git diff <spec_commit> and git ls-files --others --exclude-standard (§5). Every path under a locked path
(under_locked, the matcher Cloud’s contract tests use) is kept, each
once with its strongest kind; any type change of a locked path (file ↔
symlink ↔ directory) is type_changed, and a path that was a symlink
at spec_commit and now resolves outside the repository is
outside_repo. A locked path that itself lies outside the repository
is refused.
The rerun (run) runs its tree outside $HOME (cargo reads every
parent’s .cargo/config.toml; a run under one is refused), with an
empty environment plus a fixed allowlist (a fixed PATH, the gate’s own
CARGO_HOME, CARGO_TARGET_DIR and TMPDIR under the Instance’s data
dir), and the locked paths laid over from spec_commit (files the
judged commit added under a locked path are not in the tree), read-only
during the run and compared with spec_commit after every command (a
build script that rewrote a locked test fails locked_paths_changed).
A judged commit that changes, against spec_commit, cargo’s
configuration or toolchain file, any build script, or the build-script
and test-target keys of any manifest (manifest) is refused: those
choose what runs the tests.
The compiler’s list (list): before the rerun, for an M/H task
whose command runs cargo, the same command runs at spec_commit in a
tree, target directory and log of its own, with a target runner that
lists each test binary’s tests instead of running them. The locked
tests it lists must pass in the rerun, besides those the parser names.
Known gap: the code of the judged commit (its library, proc-macros,
path and registry dependencies with their build scripts) runs at build
time, as the same Unix user as the agent and the Instance. It can still
change ~/.rustup, ~/.local/bin, ~/.cargo/bin, the toolchain or this
Instance’s files, or act on the run in ways no file check sees. The code
under test runs inside the test binary and can end it with exit 0: the
harness report (gate_report.rs) catches that unless the code also forges a
complete, consistent report. The
locked files’ content, inode, mode and change time are checked after
every command, so a rewrite shows even when the bytes were put back.
Only a sandboxed run on pounce under the gate, with the locked paths
bind mounted read-only and no write access outside the run (§5),
closes the rest.
Structs§
- Gate
Dirs - The gate’s directories:
workunder the Instance’s data dir (private copies, the gate’sCARGO_HOME, targets),runsoutside$HOME, the directory each run’s own directory is created in directly. - Gate
Inputs - What G6 runs for one task: its risk, the commit its locked paths are pinned to, those paths, and the declared command.
Enums§
- Gate
Error - Why the gate could not judge: never a pass.
- Missing
- What G6 needs and the task view does not carry.
Constants§
- RERUN_
TIMEOUT - The longest the gate’s own run may take.
Functions§
- changed_
reason - The reason of a locked-path failure: every differing path with its kind.
- check_
locked_ paths - The locked-path check of the handed-in worktree
rootagainstspec_commit(§5): every path undercheckedbyte-identical, nothing new, deleted, untracked or of another type, no locked symlink resolving outside. It runs in the agent’s repository (the worktree is there) with the hardenedgit;g6_recordadds the commit-to-commit check from a private copy, which no config of that repository reaches. - g6_
record - The G6 record of the worktree
rootat the judged commitartifact, worked out in the gate’s directoriesdirs: the locked-path check of the commit and of the worktree first (a failure stops there,rule: locked_paths_changed), then the gate’s rerun ofartifact, whose locked files are checked again after every command (a change there is the same failure). The worktree must be atartifact; otherwise the check would judge something else, and the gate refuses. - head_
commit HEADof the worktreerepo.- inputs_
for - The inputs of G6 for a process task: from Cloud’s process fields and
what it serves beside them (
gate; M/H: the feature list; S: the repo’s declared command) and, for S, the commit this Instance’s claim started from. - recheck_
commit - The check before verify (E48): the judged commit
artifactagainstspec_commit, commit to commit (the verifier has no handed-in worktree), in a private copy fetched fromrepointo the Instance’s G6 directorywork, sorepo’s config, replace refs and attributes cannot hide a change. Nothing runs here, so no cargo config matters. The same kinds as on submit, exceptuntracked(only a worktree has it) andoutside_repo(a changed link text ismodified). - resolve_
commit - The full commit id
revnames inrepo.