Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix: pre-landing review fixes (remote-gate reuse also refuses a tree that changes scripts/lib/gh-issue.ts; header comment lists every guarded path)

garrytan8923ce6bdd02
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9fefc26f3f..053b00ddc5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,7 +14,7 @@ identifiers and attribution are available in the pre-removal Git revision
**The remote gate takes its receipt from GitHub's full-ci when the exact tree already passed there, so a merge slot no longer pays for a second full test pass on Ubicloud.**
-`scripts/pregate-remote-gate.sh` prints the `PREGATE_REMOTE:` line that clears /ship's remote-gate obligation, and it used to start Ubicloud VMs every time, even when GitHub had just run the same tests on the same tree. Now, when the working tree is clean and both the Test and E2E full runs passed on GitHub for that exact tree (`full-suite` and `e2e-full-suite` green in the latest attempt, their tree artifacts naming the tree), it prints the same line from those runs and starts no VM. A full run still in progress on the tree is waited for, up to 90 minutes. A full run on the tree that failed refuses with the run's URL instead of spending on VMs. The newest full run on the tree decides, across every recent commit with that tree, so an older pass cannot outrank a newer failure. Any other tree runs the VM gate as before, including a tree that differs only in release stamps (gstack's stamp rule covers that case), a tree that changes `.github/workflows/test.yml`, `.github/workflows/e2e.yml`, `scripts/ci-reuse.ts`, `scripts/ci-full-suite-tree.sh` or `scripts/ci-executed-counts.ts` relative to master (its runs would attest to themselves), a dirty working tree, or `GBRAIN_PREGATE_REUSE=0`. On reuse, `tests=` counts the executed test identities of both runs.
+`scripts/pregate-remote-gate.sh` prints the `PREGATE_REMOTE:` line that clears /ship's remote-gate obligation, and it used to start Ubicloud VMs every time, even when GitHub had just run the same tests on the same tree. Now, when the working tree is clean and both the Test and E2E full runs passed on GitHub for that exact tree (`full-suite` and `e2e-full-suite` green in the latest attempt, their tree artifacts naming the tree), it prints the same line from those runs and starts no VM. A full run still in progress on the tree is waited for, up to 90 minutes. A full run on the tree that failed refuses with the run's URL instead of spending on VMs. The newest full run on the tree decides, across every recent commit with that tree, so an older pass cannot outrank a newer failure. Any other tree runs the VM gate as before, including a tree that differs only in release stamps (gstack's stamp rule covers that case), a tree that changes `.github/workflows/test.yml`, `.github/workflows/e2e.yml`, `scripts/ci-reuse.ts`, `scripts/lib/gh-issue.ts`, `scripts/ci-full-suite-tree.sh` or `scripts/ci-executed-counts.ts` relative to master (its runs would attest to themselves), a dirty working tree, or `GBRAIN_PREGATE_REUSE=0`. On reuse, `tests=` counts the executed test identities of both runs.
### Itemized changes
diff --git a/docs/ci-event-parity.md b/docs/ci-event-parity.md
index 0d91a8605d..22ab5cc1dc 100644
--- a/docs/ci-event-parity.md
+++ b/docs/ci-event-parity.md
@@ -114,8 +114,8 @@ across the head and every recent head with the same tree, so neither an empty
commit nor an older pass elsewhere skips a newer failure; a failed one refuses
with no receipt. A run that did not run the full job (a diagnostic dispatch, a
push that reused) is skipped. A tree that changes `.github/workflows/test.yml`,
-`.github/workflows/e2e.yml`, `scripts/ci-reuse.ts`, `scripts/ci-full-suite-tree.sh`
-or `scripts/ci-executed-counts.ts` relative to `origin/master` never reuses, since its runs would attest to themselves, and the
+`.github/workflows/e2e.yml`, `scripts/ci-reuse.ts`, `scripts/lib/gh-issue.ts`,
+`scripts/ci-full-suite-tree.sh` or `scripts/ci-executed-counts.ts` relative to `origin/master` never reuses, since its runs would attest to themselves, and the
check runs without the model and database keys, like the gate. Every other case runs the gate: a dirty tree, a commit GitHub
doesn't have, a missing workflow, an API error, or `GBRAIN_PREGATE_REUSE=0`.
diff --git a/scripts/pregate-remote-gate.sh b/scripts/pregate-remote-gate.sh
index 159c1630d9..991bb55331 100755
--- a/scripts/pregate-remote-gate.sh
+++ b/scripts/pregate-remote-gate.sh
@@ -18,9 +18,10 @@
# receipt, no VMs). <tests> and <failed> are then the runs' executed identities.
# Any other tree, a stamp-only one included, runs the gate below; gstack's
# stamp rule (`gstack-pregate clear --receipt`) handles a stamp-only head.
-# A tree that changes .github/workflows/test.yml, .github/workflows/e2e.yml or
-# scripts/ci-reuse.ts relative to origin/master (or has no origin/master)
-# never reuses: its runs would attest to themselves. The reuse check runs
+# A tree that changes .github/workflows/test.yml, .github/workflows/e2e.yml,
+# scripts/ci-reuse.ts, scripts/lib/gh-issue.ts, scripts/ci-full-suite-tree.sh or
+# scripts/ci-executed-counts.ts relative to origin/master (or has no
+# origin/master) never reuses: its runs would attest to themselves. The reuse check runs
# without the model and database keys, like the gate.
# GBRAIN_PREGATE_REUSE=0 always runs the gate.
#
@@ -84,7 +85,7 @@ if [ "${GBRAIN_PREGATE_REUSE:-1}" != 0 ] && [ -n "$repo" ] && [ "$before" = "$(g
echo "pregate-remote-gate: no origin/master to compare the full-ci workflows against, so it runs the gate instead of reusing" >&2
reuse_ok=0
fi
- for path in .github/workflows/test.yml .github/workflows/e2e.yml scripts/ci-reuse.ts scripts/ci-full-suite-tree.sh scripts/ci-executed-counts.ts; do
+ for path in .github/workflows/test.yml .github/workflows/e2e.yml scripts/ci-reuse.ts scripts/ci-full-suite-tree.sh scripts/ci-executed-counts.ts scripts/lib/gh-issue.ts; do
[ "$reuse_ok" = 1 ] || break
git diff --quiet origin/master HEAD -- "$path" && continue
echo "pregate-remote-gate: the tree changes $path relative to origin/master, so it runs the gate instead of reusing its own runs" >&2
diff --git a/test/scripts/pregate-remote-gate.test.ts b/test/scripts/pregate-remote-gate.test.ts
index e59f4d59a7..74e9d66200 100644
--- a/test/scripts/pregate-remote-gate.test.ts
+++ b/test/scripts/pregate-remote-gate.test.ts
@@ -151,7 +151,7 @@ describe('pregate-remote-gate.sh', () => {
});
it('a tree that changes the full-ci workflows or the scripts that attest its runs relative to origin/master never reuses its own runs', () => {
- for (const path of ['.github/workflows/test.yml', '.github/workflows/e2e.yml', 'scripts/ci-reuse.ts', 'scripts/ci-full-suite-tree.sh', 'scripts/ci-executed-counts.ts']) {
+ for (const path of ['.github/workflows/test.yml', '.github/workflows/e2e.yml', 'scripts/ci-reuse.ts', 'scripts/ci-full-suite-tree.sh', 'scripts/ci-executed-counts.ts', 'scripts/lib/gh-issue.ts']) {
rmSync(join(repo, '.git', 'reuse-args'), { force: true });
rmSync(join(repo, '.git', 'gate-ran'), { force: true });
mkdirSync(join(repo, path, '..'), { recursive: true });