Gate: keep check and retro blocks when only a lead node is ready; only the join's own block goes
ci / test (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-12-02 10:59:21 -07:00
1 parent caefb1eaa6
commit f0ff5845ca
2 files changed
+2 -4

No files matched your search

+1 -3
View File
@@ -271,12 +271,10 @@ def gate(p, for_subagent=False):
if isinstance(x, list) and len(x) == 2 and x[1] in (starts.get(x[0]) if isinstance(starts.get(x[0]), list) else ())] if isinstance(x, list) and len(x) == 2 and x[1] in (starts.get(x[0]) if isinstance(starts.get(x[0]), list) else ())]
late = models.overdue({"starts": {w: [t for t in v if [w, t] not in seen] for w, v in starts.items() if isinstance(v, list)}, "meta": s.get("meta")}) late = models.overdue({"starts": {w: [t for t in v if [w, t] not in seen] for w, v in starts.items() if isinstance(v, list)}, "meta": s.get("meta")})
reason, demand = " ".join("sisi: " + LATE % (w, time.strftime("%H:%M", time.localtime(t))) for w, t in late), False reason, demand = " ".join("sisi: " + LATE % (w, time.strftime("%H:%M", time.localtime(t))) for w, t in late), False
held = False
if not reason and isinstance(s.get("plan"), dict): # ready worker nodes not started: dispatch them before the turn ends if not reason and isinstance(s.get("plan"), dict): # ready worker nodes not started: dispatch them before the turn ends
from . import plan from . import plan
reason = plan.gate(s) reason = plan.gate(s)
held = not reason and bool(plan.ready(plan.get(s) or {"nodes": []})) # only a lead node is ready: the lead may be waiting on its own job if not reason and not s.get("paused"):
if not reason and not s.get("paused") and not held:
checks = (s.get("done") or {}).get("checks") or [] checks = (s.get("done") or {}).get("checks") or []
unsaid = ["%d. %s" % (i, c["text"]) for i, c in enumerate(checks, 1) if not c["verdict"]] unsaid = ["%d. %s" % (i, c["text"]) for i, c in enumerate(checks, 1) if not c["verdict"]]
failed = [str(i) for i, c in enumerate(checks, 1) if c["verdict"] == "fail"] failed = [str(i) for i, c in enumerate(checks, 1) if c["verdict"] == "fail"]
+1 -1
View File
@@ -584,7 +584,7 @@ class Plan(unittest.TestCase):
for n in ("a", "b", "c"): for n in ("a", "b", "c"):
self.assertEqual(self.sisi("plan", "--done", n, "done by hand and tested", sid="s1")[0], 0) self.assertEqual(self.sisi("plan", "--done", n, "done by hand and tested", sid="s1")[0], 0)
out = self.hook("gate")[1] out = self.hook("gate")[1]
self.assertNotIn('"block"', out) self.assertNotIn("is yours and ready", out) # the lead may be waiting on its own job; unsaid checks still speak for themselves
def test_gate_still_blocks_on_a_ready_worker_node_beside_a_ready_lead_node(self): def test_gate_still_blocks_on_a_ready_worker_node_beside_a_ready_lead_node(self):
self.ready_plan() self.ready_plan()