diff --git a/docs/development/control-plane-course/07-host-scheduler-and-heartbeat.md b/docs/development/control-plane-course/07-host-scheduler-and-heartbeat.md index ae8c0f90b7..d7996da2ef 100644 --- a/docs/development/control-plane-course/07-host-scheduler-and-heartbeat.md +++ b/docs/development/control-plane-course/07-host-scheduler-and-heartbeat.md @@ -212,17 +212,17 @@ Scheduler ACK 本身不构成 delivery,不 spend。 ### 兼容投影不能改变状态权威 / Compatibility preserves state authority -`app_automation` 与 `codex_app` 是同一 proposal 的宿主投影,不是两个 scheduler -writer。读取优先采用 common state;仅有旧 Codex state 时,保留它经 TS 验证的 -`state_key`。两份投影的 backoff、host facts 与 ACK/failure 命令都必须携带同一个键。 -否则 common state 的当前 identity/index 会被误写到旧键,触发真实的初始档位冲突; -即使 CAS digest 相等也不代表 proposal 的状态归属正确。 - -`app_automation` and `codex_app` project one proposal, not two scheduler writers. -Reads prefer common state; a legacy-only Codex installation retains its -TS-validated legacy key. Both projections must carry that same key through -backoff, host facts and ACK/failure commands. Equal CAS digests do not prove that -a proposal belongs to the chosen state scope. +新决策统一使用 `app_automation` 携带调度建议和宿主行动。旧捕获仍可读取其中的 +`codex_app`。读取优先采用 common state。仅有旧 Codex state 时,保留 TS 验证过的 +`state_key`,并将同一个键贯穿 backoff、host facts 与 ACK/failure 命令。 +写回前须校验状态归属及 CAS 摘要,否则可能把已推进的档位写入错误的状态键。 + +New decisions use `app_automation` for the cadence proposal and Host actions. +Saved captures can still carry `codex_app`. Reads prefer common state. A +legacy-only Codex installation retains the TS-validated state key through +backoff, Host facts, and ACK/failure commands. Before writing, validate the +state scope and CAS digest to keep the recorded progression in its original +state. 兼容 Python API 与手工 Codex CLI 未显式传 `state_key` 时,从当前 packet 取得实际键; 显式键仍须匹配,不得静默改写。Trae 仍只接受 common key。这不是隐式迁移:不能把 diff --git a/docs/operations/automation-minimum-interval.md b/docs/operations/automation-minimum-interval.md index 7f701d62dc..8d4108440b 100644 --- a/docs/operations/automation-minimum-interval.md +++ b/docs/operations/automation-minimum-interval.md @@ -33,8 +33,8 @@ caller intent, not authentication against other processes sharing the OS user. For an already bound App turn, inspect its `quota should-run` scheduler packet using that turn's normal identity and selection contract. Do not create a new -turn solely to observe a timer. `scheduler_hint.app_automation` and its legacy -`codex_app` projection expose the floor, desired RRULE, apply/ACK state and +turn solely to observe a timer. `scheduler_hint.app_automation` exposes the +floor, desired RRULE, apply/ACK state and `guarantee`. Apply the desired schedule with the App's `automation_update` tool, preserving task binding, prompt, status and notification preference. Then view that same automation and compare its actual schedule before running the returned diff --git a/docs/quota-allocation.md b/docs/quota-allocation.md index b907de93e3..16cb1a44f1 100644 --- a/docs/quota-allocation.md +++ b/docs/quota-allocation.md @@ -1798,6 +1798,11 @@ trigger uses a fresh Turn identity to evaluate the live frontier; it never re-executes or spends for the closed Turn. Native Goal runtimes continue to that fresh guard instead of blocking the Goal. Explicit Goal stop or quota pause still takes precedence. Actual fresh-Turn waits retain their existing backoff. +New scheduler decisions expose App cadence, applicability, and follow-up +commands only under `scheduler_hint.app_automation`. This includes shutdown, +minimum-interval waits, and the explicit unavailable state for schedulers owned +outside the App. A saved decision retains its original representation. Older +Codex state still uses its recorded state key when it is the selected authority. For Codex App and local schedulers, `recommended_interval_minutes` is the next target interval. For Codex App heartbeats, `recommended_rrule` is emitted only when `app_automation.stateful_backoff.apply_needed=true`; if the desired RRULE is @@ -1823,10 +1828,16 @@ CLI-produced ACK hints bind that argument vector to the exact registry and effective runtime root that produced `quota should-run`. Hosts must execute the complete vector; stripping its leading global options can route a project-launched ACK into project-local scheduler state instead of the shared -control plane. `fallback_hint.cli_args` receives the same registry binding, and -its `--turn-instance-id` value is always the reference the current host shell can -expand: `"${LOOPX_TURN:?}"` on POSIX and `$LOOPX_TURN` on native Windows, so a -PowerShell host does not replay an empty Turn. When the decision is +control plane. `fallback_hint.cli_args` receives the same registry and runtime +root bindings. The bridge reads `scheduler_hint.app_automation` from the +complete decision. It accepts a legacy `codex_app` packet from an earlier CLI +version. An executable-bound guard also passes its selected CLI to the +bridge. When that installation ships an executable POSIX fallback launcher +beside the CLI, the command also names that launcher. For older saved commands +without a runtime root, the registry route supplies it. When the Turn is still +expressed as a shell variable, the +fallback's `--turn-instance-id` uses `"${LOOPX_TURN:?}"` on POSIX and +`$LOOPX_TURN` on native Windows. When the decision is heartbeat-receipted, ACK, failure, and fallback hints also bind the originating concrete `turn_instance_id`, and `fallback_hint.route_binding.turn_instance_bound` records whether that binding is present. The follow-up rebuilds the same diff --git a/examples/agent-diagnose-packet-smoke.py b/examples/agent-diagnose-packet-smoke.py index 968eafe478..935bdae529 100644 --- a/examples/agent-diagnose-packet-smoke.py +++ b/examples/agent-diagnose-packet-smoke.py @@ -357,7 +357,7 @@ def main() -> int: scheduler_hint = selected["quota_signals"]["scheduler_hint"] assert scheduler_hint["schema_version"] == "diagnose_scheduler_hint_summary_v0", selected assert "local_scheduler" not in str(scheduler_hint), scheduler_hint - assert scheduler_hint["codex_app"]["no_spend_for_cadence_change"] is True, scheduler_hint + assert scheduler_hint["app_automation"]["no_spend_for_cadence_change"] is True, scheduler_hint assert selected["agent_reasoning_checklist"], selected assert any( " diagnose " in command and f"--goal-id {GOAL_ID}" in command diff --git a/examples/control_plane/control-plane-integrated-canary-smoke.py b/examples/control_plane/control-plane-integrated-canary-smoke.py index c1ca0a8c28..3d9a9df544 100644 --- a/examples/control_plane/control-plane-integrated-canary-smoke.py +++ b/examples/control_plane/control-plane-integrated-canary-smoke.py @@ -32,6 +32,7 @@ PRIMARY_AGENT_ID = "codex-main-control" CANARY_TODO_ID = "todo_integrated_canary" CANARY_TODO_TITLE = "Design bounded status/quota/review-packet/Todo/read-path canary" +DURABLE_NEXT_ACTION = "Keep the fixture-only integrated canary under two minutes." SUCCESSOR_TODO_TITLE = "Continue integrated canonical successor routing canary" CONTINUATION_TITLE = "[P1] Continue same-agent canonical continuation through status and quota." MONITOR_TODO_ID = "todo_integrated_due_monitor" @@ -54,7 +55,7 @@ def write_fixture(root: Path) -> tuple[Path, Path, Path]: "---\n\n" "# Control Plane Integrated Canary\n\n" "## Next Action\n\n" - "- Keep the fixture-only integrated canary under two minutes.\n\n" + f"- {DURABLE_NEXT_ACTION}\n\n" "## Agent Todo\n\n" "- [ ] [P2] Markdown fallback todo that should lose to the event log.\n" "