gofmt gate in agent_gates.py with its decoys (R-1160); REPORT for the day
gates / gates (push) Successful in 49s
gates / gates (push) Successful in 49s
This commit is contained in:
1 parent
1edfd8e331
commit
0cbd500154
5 files changed
+127
-15
No files matched your search
@@ -66,6 +66,9 @@ COVERS = {
|
||||
"inside an HTML comment (R-426)",
|
||||
"observations": "R-419 in THIS repo's REPORT.md: an Observations note SAYING it carries no marker - vs the "
|
||||
"two genuine markers (R-426)",
|
||||
"gofmt": "R-1160: an unformatted .go file planted under internal/ of a SCRATCH copy is convicted by name - vs the "
|
||||
"same tree formatted (passes); with no gofmt reachable, CI passes OUT LOUD and a dev machine is "
|
||||
"INCONCLUSIVE, never a silent pass",
|
||||
"gate-decoys": "this suite, run as a gate of agent_gates.py's full run, which CI runs on every push (R-1116): "
|
||||
"every case above is a decoy of its own gate, and ONE case that stops convicting turns the run "
|
||||
"red - red-proved 2026-10-17 by flipping a reuse-refs FACT case to expect rc 0",
|
||||
@@ -291,6 +294,32 @@ def release_cases(base, ws):
|
||||
|
||||
|
||||
# ── the shared felhom.eu scripts, against THIS repo's inputs ─────────────────────────────────────
|
||||
def gofmt_cases(ws):
|
||||
"""R-1160: the gofmt gate in a scratch root (its ROOT is its own grandparent directory), never the real tree."""
|
||||
root = os.path.join(ws, "gofmt-root")
|
||||
os.makedirs(os.path.join(root, "scripts"))
|
||||
os.makedirs(os.path.join(root, "internal", "x"))
|
||||
shutil.copy(os.path.join(ROOT, "scripts", "gofmt_gate.py"), os.path.join(root, "scripts", "gofmt_gate.py"))
|
||||
gate = os.path.join(root, "scripts", "gofmt_gate.py")
|
||||
planted = os.path.join(root, "internal", "x", "zz_gofmt_decoy.go")
|
||||
io.open(planted, "w", encoding="utf-8").write(u"package x\n\nfunc F( ) int {return 1}\n")
|
||||
if shutil.which("gofmt") or shutil.which("go"):
|
||||
rc, out = run([sys.executable, gate], root)
|
||||
report("gofmt: FACT: an unformatted file under internal/", rc, out, 1, ("zz_gofmt_decoy.go", "GOFMT GATE FAILED"))
|
||||
io.open(planted, "w", encoding="utf-8").write(u"package x\n\nfunc F() int { return 1 }\n")
|
||||
rc, out = run([sys.executable, gate], root)
|
||||
report("gofmt: GENUINE: the same file formatted", rc, out, 0, ("gofmt gate OK",))
|
||||
else:
|
||||
print(" -- gofmt: not runnable here (no Go toolchain) - the two cases below pin that mode")
|
||||
for ci, want_rc, want, name in ((True, 0, "NOT CHECKED in CI", "gofmt: CI without Go"),
|
||||
(False, 2, "INCONCLUSIVE", "gofmt: dev without Go")):
|
||||
env = {"PATH": os.path.join(ws, "empty-path"), "HOME": ws}
|
||||
if ci:
|
||||
env["GITEA_ACTIONS"] = "true"
|
||||
rc, out = run([sys.executable, gate], root, env=env)
|
||||
report(name, rc, out, want_rc, (want,))
|
||||
|
||||
|
||||
def shared_cases(ws):
|
||||
"""A scratch WORKSPACE: a clone of this repo beside symlinks to the siblings, because the shared
|
||||
scripts reach across (REUSE.md cites hub paths; instructions_gate reads the workspace CLAUDE.md)."""
|
||||
@@ -353,6 +382,7 @@ def main():
|
||||
published_cases(base)
|
||||
release_cases(base, ws)
|
||||
shared_cases(ws)
|
||||
gofmt_cases(ws)
|
||||
finally:
|
||||
srv.shutdown()
|
||||
srv.server_close()
|
||||
|
||||
Reference in new issue
Block a user