3232PRIMARY_AGENT_ID = "codex-main-control"
3333CANARY_TODO_ID = "todo_integrated_canary"
3434CANARY_TODO_TITLE = "Design bounded status/quota/review-packet/Todo/read-path canary"
35+ DURABLE_NEXT_ACTION = "Keep the fixture-only integrated canary under two minutes."
3536SUCCESSOR_TODO_TITLE = "Continue integrated canonical successor routing canary"
3637CONTINUATION_TITLE = "[P1] Continue same-agent canonical continuation through status and quota."
3738MONITOR_TODO_ID = "todo_integrated_due_monitor"
@@ -54,7 +55,7 @@ def write_fixture(root: Path) -> tuple[Path, Path, Path]:
5455 "---\n \n "
5556 "# Control Plane Integrated Canary\n \n "
5657 "## Next Action\n \n "
57- "- Keep the fixture-only integrated canary under two minutes. \n \n "
58+ f "- { DURABLE_NEXT_ACTION } \n \n "
5859 "## Agent Todo\n \n "
5960 "- [ ] [P2] Markdown fallback todo that should lose to the event log.\n "
6061 " <!-- loopx:todo todo_id=todo_markdown_fallback status=open "
@@ -176,17 +177,17 @@ def find_queue_item(status_payload: dict[str, Any], *, goal_id: str = GOAL_ID) -
176177def assert_selected_agent_todo (
177178 summary : dict [str , Any ],
178179 * ,
179- compact_quota : bool = False ,
180+ complete_quota : bool = False ,
180181) -> None :
181- item_lane = "first_executable_items" if compact_quota else "first_open_items"
182+ item_lane = "first_executable_items" if complete_quota else "first_open_items"
182183 items = summary .get (item_lane ) if isinstance (summary .get (item_lane ), list ) else []
183- if not items and not compact_quota :
184+ if not items and not complete_quota :
184185 items = summary .get ("items" ) if isinstance (summary .get ("items" ), list ) else []
185186 assert [item .get ("todo_id" ) for item in items ] == [CANARY_TODO_ID ], summary
186187 item = items [0 ]
187- if compact_quota :
188+ if complete_quota :
188189 assert summary ["payload_compaction" ]["schema_version" ] == (
189- "quota_cli_todo_summary_compaction_v0 "
190+ "quota_todo_summary_payload_compaction_v0 "
190191 ), summary
191192 assert item ["text" ] == f"[P1] { CANARY_TODO_TITLE } " , summary
192193 # The shared diagnostic projection retains each visible record in full.
@@ -228,7 +229,7 @@ def assert_bounded_delivery_state_machine_bundle(quota_payload: dict[str, Any])
228229 scheduler = quota_payload ["scheduler_hint" ]
229230 assert scheduler ["action" ] == "run_now" , scheduler
230231 assert scheduler ["cadence_class" ] == "active_work" , scheduler
231- codex_app = scheduler ["codex_app " ]
232+ codex_app = scheduler ["app_automation " ]
232233 assert codex_app ["recommended_rrule" ] == "FREQ=MINUTELY;INTERVAL=3" , scheduler
233234 assert codex_app ["no_spend_for_cadence_change" ] is True , scheduler
234235 assert codex_app ["stateful_backoff" ]["apply_needed" ] is True , scheduler
@@ -259,7 +260,7 @@ def assert_scheduler_ack_state_machine(
259260 runtime_root : Path ,
260261 quota_payload : dict [str , Any ],
261262) -> dict [str , Any ]:
262- codex_app = quota_payload ["scheduler_hint" ]["codex_app " ]
263+ codex_app = quota_payload ["scheduler_hint" ]["app_automation " ]
263264 backoff = codex_app ["stateful_backoff" ]
264265 ack_payload = run_cli (
265266 registry_path ,
@@ -300,7 +301,7 @@ def assert_scheduler_ack_state_machine(
300301 AGENT_ID ,
301302 "--codex-app" ,
302303 )
303- steady_codex_app = steady_payload ["scheduler_hint" ]["codex_app " ]
304+ steady_codex_app = steady_payload ["scheduler_hint" ]["app_automation " ]
304305 assert steady_codex_app ["stateful_backoff" ]["apply_needed" ] is False , steady_payload
305306 assert steady_codex_app ["stateful_backoff" ]["state_status" ] == "same_identity" , steady_payload
306307 assert steady_codex_app ["host_action" ] == "none" , steady_payload
@@ -394,9 +395,9 @@ def assert_todo_completion_successor_state_machine(
394395 assert routed ["effective_action" ] == "normal_run" , routed
395396 assert routed ["agent_lane_next_action" ]["todo_id" ] == successor_id , routed
396397 assert routed ["agent_lane_next_action" ]["text" ] == f"[P1] { SUCCESSOR_TODO_TITLE } " , routed
397- assert "title" not in routed ["agent_lane_next_action" ], routed
398+ assert routed ["agent_lane_next_action" ][ "title" ] == SUCCESSOR_TODO_TITLE , routed
398399 assert routed ["agent_lane_next_action" ]["preserves_goal_next_action" ] is True , routed
399- assert "active_state_next_action" not in routed , routed
400+ assert routed [ "active_state_next_action" ] == DURABLE_NEXT_ACTION , routed
400401 assert routed ["goal_route_hint" ]["selected_action_differs_from_durable" ] is True , routed
401402 assert routed ["goal_route_hint" ]["goal_next_action_mutation" ] == "none" , routed
402403 assert routed ["interaction_contract" ]["mode" ] == "bounded_delivery" , routed
@@ -499,6 +500,7 @@ def assert_due_monitor_poll_state_machine(root: Path, *, provider: str) -> None:
499500 "--codex-app" ,
500501 )
501502 assert quota_payload ["ok" ] is True , quota_payload
503+ assert quota_payload ["schema_version" ] == "loopx_turn_envelope_v1" , quota_payload
502504 assert quota_payload ["should_run" ] is True , quota_payload
503505 assert quota_payload ["decision" ] == "run" , quota_payload
504506 assert quota_payload ["effective_action" ] == "normal_run" , quota_payload
@@ -790,7 +792,7 @@ def run_fixture_canary(root: Path, *, provider: str) -> None:
790792 assert CANARY_TODO_TITLE in quota_payload ["recommended_action" ], quota_payload
791793 assert_selected_agent_todo (
792794 quota_payload ["agent_todo_summary" ],
793- compact_quota = True ,
795+ complete_quota = True ,
794796 )
795797 assert_bounded_delivery_state_machine_bundle (quota_payload )
796798 assert_scheduler_ack_state_machine (registry_path , runtime_root , quota_payload )
0 commit comments