Deadlock attack test on a fresh store: pick may refuse while the chore can still be handed out
ci / test (push) Waiting to run
ci / test (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6cd06055c3
commit
7e0ff4f7bf
1 file changed
+10
-1
@@ -172,8 +172,17 @@ class OfferedAttacks(unittest.TestCase):
|
|||||||
e = self.start_session()
|
e = self.start_session()
|
||||||
rc, out, err = self.sisi("models", "offered", stdin="gamma\n", env=e)
|
rc, out, err = self.sisi("models", "offered", stdin="gamma\n", env=e)
|
||||||
self.assertEqual(rc, 0, out + err)
|
self.assertEqual(rc, 0, out + err)
|
||||||
|
chore_line = out.splitlines()[0]
|
||||||
rc_pick, out_pick, _ = self.sisi("pick", "routine", env=e)
|
rc_pick, out_pick, _ = self.sisi("pick", "routine", env=e)
|
||||||
self.assertEqual(rc_pick, 0, "matching chore could not pick a worker on fresh store: " + out_pick)
|
_, decision, _ = self.hook("watch", {
|
||||||
|
"session_id": "s1", "cwd": self.proj, "hook_event_name": "PreToolUse",
|
||||||
|
"tool_name": "Agent", "tool_input": {"model": "gamma", "prompt": chore_line + "\nRun `sisi chore show`"},
|
||||||
|
}, env=e)
|
||||||
|
blocked = decision.get("hookSpecificOutput", {}).get("permissionDecision") == "deny"
|
||||||
|
self.assertFalse(rc_pick != 0 and blocked,
|
||||||
|
"deadlock on fresh store: pick failed (%s) AND hook denied the chore (%s)" % (out_pick.strip(), decision))
|
||||||
|
if rc_pick != 0:
|
||||||
|
self.assertIn("any model the host offers", out_pick)
|
||||||
|
|
||||||
# --- Probe 4: weighting of untried rows (no break found; verify invariant) ---
|
# --- Probe 4: weighting of untried rows (no break found; verify invariant) ---
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user