Gate judges a session by its own edits, measured, not guessed
ci / tests (macos-latest, python 3.10) (push) Canceled after 0s
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.10) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s

The end-of-turn gate attributes changed files to the session that changed
them: edit tool calls by path, and shell commands by a snapshot of the tree
before and after. A session answers for failing checks, and is asked for a
retrospective, only over its own files. Another agent's work in progress is
allowed once, marked unverified, with a note that the work is not done.
Single-session behaviour is unchanged, shown by a property test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-23 03:34:05 -07:00
1 parent e5b603486b
commit 5744f3149c
15 files changed
+1387 -41

No files matched your search

+18
View File
@@ -227,6 +227,24 @@ class WiringTests(WiringBase):
self.assertEqual(self.sisi("uninstall").returncode, 0)
class WatchHookTests(WiringBase):
def test_watch_hooks_registered_with_bash_matcher_and_removed(self):
before = snapshot(self.home)
wiring.install()
d = json.load(open(self.path(".claude/settings.json")))
for ev in ("PreToolUse", "PostToolUse"):
groups = d["hooks"][ev]
cmds = [h["command"] for g in groups for h in g["hooks"]]
self.assertTrue(any("watch --tool claude-code" in c for c in cmds), (ev, cmds))
self.assertTrue(any(g.get("matcher") == "Bash" for g in groups), (ev, groups))
self.assertEqual(wiring.doctor()[0]["status"], "wired")
snap = snapshot(self.home)
wiring.install()
self.assertEqual(snapshot(self.home), snap) # idempotent
wiring.uninstall()
self.assertEqual(snapshot(self.home), before) # removed exactly
class SubagentHookTests(WiringBase):
def test_subagent_stop_registered_idempotent_and_removed(self):
before = snapshot(self.home)