feat: coordinator audit-loop wiring at merge point
Parent audit loop sits after all children are aggregated and before the parent final state; the single-task _audit_loop_wire is never applied to parents or children. Parent gates are per-child gates child:<name> (completed only); execution failures map to one deterministic finding per child; subjective findings are split off before evaluate and only audited as needs_review. Gate-rejected children (capability/tool/approval audit rows, or distinctive error markers) bypass evaluate and escalate directly without consuming a round; tolerated, paused and quota-missing parts are excluded, never findings. Rounds are counted only in the parent task_audit_loop_state; on pushback the packet is stored on the parent and split per failed child into that child's audit_loop_packet column, consumed once by the existing packet-injection path at next claim; pass and escalate clear parent and child packets. POST /tasks now allows audit_loop on coordinator parents (the old 400 rationale is gone); children still take no external switch.
This commit is contained in:
1 parent
f2005689fd
commit
017f76010f
4 files changed
+1012
-31
No files matched your search
@@ -347,16 +347,19 @@ class ServerCreateTests(unittest.TestCase):
|
||||
{"project_id": pid, "prompt": "bad", "audit_loop": "yes"},
|
||||
self.owner_key)
|
||||
self.assertEqual(status, 400)
|
||||
status, body = self._req(
|
||||
# 协调员接线轨:父任务带 audit_loop 不再 400——此前拒绝
|
||||
# 的理由是“父任务接线覆盖不到、接受即静默丢弃”,合流
|
||||
# 接线(worker._coord_audit_loop_merge)落地后该理由已
|
||||
# 消除;子任务仍不直接接受外部开关(worker 内部 INSERT
|
||||
# 不写该列)。非法值仍 400。
|
||||
status, task = self._req(
|
||||
"POST", "/tasks",
|
||||
{"project_id": pid, "prompt": "coord",
|
||||
"coordinator_parts": [{"name": "a", "prompt": "do a"}],
|
||||
"audit_loop": True},
|
||||
self.owner_key)
|
||||
self.assertEqual(status, 400)
|
||||
self.assertEqual(
|
||||
body["error"],
|
||||
"audit_loop cannot be used with coordinator tasks")
|
||||
self.assertEqual(status, 201, task)
|
||||
self.assertEqual(task["audit_loop"], 1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user