gofmt gate: NOT CHECKED (out loud) on the Go-less CI runner, INCONCLUSIVE elsewhere; decoys for both (CI run 1371 was red)
gates / gates (push) Successful in 49s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-10-05 20:15:54 +02:00
parent 1453cfc69b
commit 6f1ba1fe43
3 changed files with 39 additions and 2 deletions
+24 -1
View File
@@ -213,11 +213,34 @@ try:
_rc, _out = gate("gofmt_gate.py")
finally:
os.remove(_gf)
if _rc != 1 or "zz_gofmt_decoy_tmp.go" not in _out:
if "NOT CHECKED in CI" in _out:
print(" -- %-20s not runnable here (CI, no Go toolchain) — the two cases below pin that mode" % "gofmt")
elif _rc != 1 or "zz_gofmt_decoy_tmp.go" not in _out:
fails.append("gofmt: an unformatted planted file was not convicted (rc=%d)\n%s" % (_rc, _out[-400:]))
else:
print(" ok %-20s decoy rejected" % "gofmt")
# The gate's two no-Go modes (2026-10-05): with no gofmt reachable, CI passes OUT LOUD and a dev machine is
# INCONCLUSIVE. PATH is emptied of Go for both; only the CI marker differs.
import tempfile as _tf
_EMPTY_PATH_DIR = _tf.mkdtemp(prefix="nogo-")
def _gofmt_without_go(ci):
env = {k: v for k, v in os.environ.items() if k not in ("GITEA_ACTIONS", "GITHUB_ACTIONS", "GOROOT")}
env["PATH"] = _EMPTY_PATH_DIR # nothing on it: sys.executable is called by its full path
if ci:
env["GITEA_ACTIONS"] = "true"
p = subprocess.run([sys.executable, os.path.join("scripts", "gofmt_gate.py")], cwd=CTRL, env=env,
capture_output=True, text=True)
return p.returncode, p.stdout + p.stderr
for _ci, _want_rc, _want_txt, _name in ((True, 0, "NOT CHECKED in CI", "gofmt/ci-without-go"),
(False, 2, "INCONCLUSIVE", "gofmt/dev-without-go")):
ran += 1
_rc, _out = _gofmt_without_go(_ci)
if _rc != _want_rc or _want_txt not in _out:
fails.append("%s: want rc=%d and %r, got rc=%d\n%s" % (_name, _want_rc, _want_txt, _rc, _out[-300:]))
else:
print(" ok %-20s %s" % (_name, "passes out loud" if _ci else "stays undetermined"))
# --- go-parity (v0.252.0, R-557): a Go-side message key may only carry base-commit text. ---
# --- Three shapes, because the gate makes three different claims. ---
GO_KEYS = os.path.join(HERE, "i18n_go_keys.json")