diff --git a/docs/product/releases/v2.4.0.md b/docs/product/releases/v2.4.0.md index 9a7da73510..adc67b804e 100644 --- a/docs/product/releases/v2.4.0.md +++ b/docs/product/releases/v2.4.0.md @@ -21,9 +21,9 @@ loopx doctor ### Highlights - **Create a Goal from Chat and search loaded history.** Review a draft and confirm once to create the Goal and open its conversation when runtime and permissions are ready; search loaded conversations back to original messages, keep saved Research answers intact across Desktop reopenings, recover interrupted answers or pre-dispatch requests, diagnose lost workers, and preserve readable quoted Markdown. [#8676](https://github.com/loopx-project/loopx/pull/8676), [#8780](https://github.com/loopx-project/loopx/pull/8780), [#8863](https://github.com/loopx-project/loopx/pull/8863), [#8868](https://github.com/loopx-project/loopx/pull/8868), [#8880](https://github.com/loopx-project/loopx/pull/8880), [#8892](https://github.com/loopx-project/loopx/pull/8892), [#8983](https://github.com/loopx-project/loopx/pull/8983), [#9120](https://github.com/loopx-project/loopx/pull/9120), [#9125](https://github.com/loopx-project/loopx/pull/9125) -- **Steward monitors, exact-head PR review signals, and protected merge confirmations.** Generic probe-gated `continuous_monitor` Todos support `context_handoff` and bounded `steward_user_actions`, exact-head GitHub PR review screening powers `/confirm` `pr.merge` previews with head/review drift checks, report/queue/pre-dispatch recovery (including stopped/saved candidate recovery and minor JSON delimiter glitch tolerance) hardens cross-endpoint Steward reliability, and opt-in `steward_memory` adds isolated OpenViking memory scoped strictly to verified owner private Steward chats. [#9074](https://github.com/loopx-project/loopx/pull/9074), [#9077](https://github.com/loopx-project/loopx/pull/9077), [#9081](https://github.com/loopx-project/loopx/pull/9081), [#9083](https://github.com/loopx-project/loopx/pull/9083), [#9093](https://github.com/loopx-project/loopx/pull/9093), [#9143](https://github.com/loopx-project/loopx/pull/9143), [#9155](https://github.com/loopx-project/loopx/pull/9155), [#9157](https://github.com/loopx-project/loopx/pull/9157), [#9159](https://github.com/loopx-project/loopx/pull/9159), [#9164](https://github.com/loopx-project/loopx/pull/9164) +- **Steward monitors, exact-head PR review signals, and protected merge confirmations.** Generic probe-gated `continuous_monitor` Todos support `context_handoff` and bounded `steward_user_actions`, exact-head GitHub PR review screening and queue model-coverage tracking power `/confirm` `pr.merge` previews with head/review drift checks, report/queue/pre-dispatch recovery (including stopped/saved candidate recovery and minor JSON delimiter glitch tolerance) hardens cross-endpoint Steward reliability, and opt-in `steward_memory` adds isolated OpenViking memory scoped strictly to verified owner private Steward chats. [#9014](https://github.com/loopx-project/loopx/pull/9014), [#9074](https://github.com/loopx-project/loopx/pull/9074), [#9077](https://github.com/loopx-project/loopx/pull/9077), [#9081](https://github.com/loopx-project/loopx/pull/9081), [#9083](https://github.com/loopx-project/loopx/pull/9083), [#9093](https://github.com/loopx-project/loopx/pull/9093), [#9143](https://github.com/loopx-project/loopx/pull/9143), [#9155](https://github.com/loopx-project/loopx/pull/9155), [#9157](https://github.com/loopx-project/loopx/pull/9157), [#9159](https://github.com/loopx-project/loopx/pull/9159), [#9164](https://github.com/loopx-project/loopx/pull/9164) - **Recover original work with Complete Turn and `quota_settlement_plan_v2`.** Installed workspaces discover the Manager via the installed CLI and resume authorized Tasks on their original Turn, debit identity, and rebound hard-lease fence; Complete Turn / native host callers compose `loopx_turn_envelope_v1` with runtime-owned `quota_settlement_plan_v2` (`--settle-turn --settlement-receipt`), while ordinary unhosted JSON `quota should-run` retains `quota_packet` as the qualified public default. [#8489](https://github.com/loopx-project/loopx/pull/8489), [#8615](https://github.com/loopx-project/loopx/pull/8615), [#8802](https://github.com/loopx-project/loopx/pull/8802), [#8830](https://github.com/loopx-project/loopx/pull/8830), [#8956](https://github.com/loopx-project/loopx/pull/8956), [#9030](https://github.com/loopx-project/loopx/pull/9030), [#9084](https://github.com/loopx-project/loopx/pull/9084), [#9097](https://github.com/loopx-project/loopx/pull/9097), [#9111](https://github.com/loopx-project/loopx/pull/9111), [#9154](https://github.com/loopx-project/loopx/pull/9154), [#9157](https://github.com/loopx-project/loopx/pull/9157), [#9158](https://github.com/loopx-project/loopx/pull/9158), [#9160](https://github.com/loopx-project/loopx/pull/9160), [#9161](https://github.com/loopx-project/loopx/pull/9161) -- **Antigravity Carbon, per-endpoint preferences, and bidirectional Steward failover.** Registers Antigravity `Carbon` (`gemini-4-carbon-{high,medium,low}`) while keeping `Argon` as the product default, adds `endpoint_models` preferences in `steward_executor_machine_defaults_v1` (with JSON-mode editor guidance), enables bidirectional Codex/Antigravity flexible failover (`loopx-codex-provider-routing 0.15.9`) with Antigravity reasoning-effort capacity aliases and `flexible_primary_available` transitions, recovers Codex loopback relay `401` failures, prevents truncated Codex API relay traffic, and preserves Codex session history across model switches. [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167) +- **Antigravity Carbon, per-endpoint preferences, and bidirectional Steward failover.** Registers Antigravity `Carbon` (`gemini-4-carbon-{high,medium,low}`) while keeping `Argon` as the product default, adds `endpoint_models` preferences in `steward_executor_machine_defaults_v1` (with JSON-mode editor guidance), enables bidirectional Codex/Antigravity flexible failover (`loopx-codex-provider-routing 0.15.9`) with Antigravity reasoning-effort capacity aliases and `flexible_primary_available` transitions, recovers Codex loopback relay `401` failures and Steward active-cascade `resume_failed` states, prevents truncated Codex API relay traffic, and preserves Codex session history across model switches. [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167), [#9170](https://github.com/loopx-project/loopx/pull/9170) - **Multi-agent collaboration and hardened Lark group/private channels.** Peers read pending results via `read_peer_returns` and `consume_peer_result` without reopening the Manager Inbox, Goal lifetime guard locks batch per Goal, and Lark gains reconnect queue recovery, read-only Steward shortcuts, Turn-scoped native images, shared card callbacks, single-pass card escaping, international setup URL recognition, and input-aware noop backoff reset. [#8668](https://github.com/loopx-project/loopx/pull/8668), [#8695](https://github.com/loopx-project/loopx/pull/8695), [#8741](https://github.com/loopx-project/loopx/pull/8741), [#8871](https://github.com/loopx-project/loopx/pull/8871), [#8921](https://github.com/loopx-project/loopx/pull/8921), [#8990](https://github.com/loopx-project/loopx/pull/8990), [#9027](https://github.com/loopx-project/loopx/pull/9027), [#9085](https://github.com/loopx-project/loopx/pull/9085), [#9114](https://github.com/loopx-project/loopx/pull/9114), [#9117](https://github.com/loopx-project/loopx/pull/9117), [#9119](https://github.com/loopx-project/loopx/pull/9119) - **Desktop App 2.4.0, `dsh-loopx-plugin 0.1.1-beta.7`, LooChat workbench, and remote task gateway.** Desktop App prepares updates before workspace teardown, bounds readiness probes, skips immutable-release frontend re-hashing, adds release/chat-bundle download retries, and verifies `default_contract` before caching macOS preview updates; `dsh-loopx-plugin 0.1.1-beta.7` requires LoopX 2.4.0+, qualifies DSH `0.2.2-rc.1..rc.3` (including `quota_settlement_plan_v2` closeout tests), surfaces GoalBar admission failures, and isolates hot uninstall; `apps/workbench/` introduces the experimental LooChat conversation layer; and the remote task gateway adds scoped read ACLs and a PostgreSQL/TLS Compose self-hosting bundle. [#8508](https://github.com/loopx-project/loopx/pull/8508), [#8675](https://github.com/loopx-project/loopx/pull/8675), [#8723](https://github.com/loopx-project/loopx/pull/8723), [#8739](https://github.com/loopx-project/loopx/pull/8739), [#8765](https://github.com/loopx-project/loopx/pull/8765), [#8843](https://github.com/loopx-project/loopx/pull/8843), [#8861](https://github.com/loopx-project/loopx/pull/8861), [#8879](https://github.com/loopx-project/loopx/pull/8879), [#8887](https://github.com/loopx-project/loopx/pull/8887), [#8899](https://github.com/loopx-project/loopx/pull/8899), [#9029](https://github.com/loopx-project/loopx/pull/9029), [#9089](https://github.com/loopx-project/loopx/pull/9089), [#9147](https://github.com/loopx-project/loopx/pull/9147) @@ -85,11 +85,11 @@ loopx authority-archive upgrade --all-known --require-current - **SQLite reliability & ENOSPC matrix:** Expanded regression coverage across lagging persisted-cursor consumers, backup/restore lineage, concurrent CAS and lost-response retries, and disk-full injection (`SQLITE_FULL` and real macOS `ENOSPC` sparse volume fail-closed recovery). [#8367](https://github.com/loopx-project/loopx/pull/8367), [#8482](https://github.com/loopx-project/loopx/pull/8482), [#8498](https://github.com/loopx-project/loopx/pull/8498), [#9126](https://github.com/loopx-project/loopx/pull/9126) - **Type safety, CLI modularization & test isolation:** Eliminated `Any` annotations with ratchet baselines across control-plane, quota, Lark, reward-memory, benchmark, and domain-pack modules (`#8971`–`#8993`, `#8013`), modularized large CLI, `issue-fix`, and Lark/Chat modules (`#8897`, `#8909`, `#8911`, `#8920`, `#8925`, `#8929`, `#8931`, `#8933`, `#8939`), pruned ceremonial/obsolete smoke stacks (`#8883`, `#8884`, `#9073`), pinned C1/Complete Turn output budgets, CLI help catalogs, architecture import guards, onboarding gates, UTF-8 host transports, and settlement tests (`#8940`, `#8994`, `#9010`, `#9019`, `#9025`, `#9042`, `#9044`, `#9048`, `#9052`, `#9102`, `#9104`, `#9152`, `#9154`, `#9156`, `#9158`, `#9160`, `#9161`), and bound `doctor` package update readback to its owning Python environment (`#9009`). [#8013](https://github.com/loopx-project/loopx/pull/8013), [#8897](https://github.com/loopx-project/loopx/pull/8897), [#8933](https://github.com/loopx-project/loopx/pull/8933), [#8940](https://github.com/loopx-project/loopx/pull/8940), [#8971](https://github.com/loopx-project/loopx/pull/8971), [#8994](https://github.com/loopx-project/loopx/pull/8994), [#9009](https://github.com/loopx-project/loopx/pull/9009), [#9044](https://github.com/loopx-project/loopx/pull/9044), [#9102](https://github.com/loopx-project/loopx/pull/9102), [#9104](https://github.com/loopx-project/loopx/pull/9104), [#9152](https://github.com/loopx-project/loopx/pull/9152), [#9154](https://github.com/loopx-project/loopx/pull/9154), [#9156](https://github.com/loopx-project/loopx/pull/9156), [#9158](https://github.com/loopx-project/loopx/pull/9158), [#9160](https://github.com/loopx-project/loopx/pull/9160), [#9161](https://github.com/loopx-project/loopx/pull/9161) -- **Canary & release qualification gates:** Strengthened base/head CLI probe and budget-baseline isolation (`#8948`, `#9103`), runtime snapshot qualification (`#8919`, `#8922`, `#8952`, `#9018`), canary timeout/incomplete diagnostics (`#9001`), Git pathname preservation (`#8426`, `#8429`, `#8558`, `#8585`, `#8645`, `#8678`), and local-first verification and public smoke workflows (`#9040`, `#9152`), alongside `--max-workers` concurrent live portfolio qualification, an `8 KiB` host-tool error output cap preserving deep-path replan context recovery, digest consumer manifest & multi-goal bootstrap smoke alignment, and standalone `test_effect_turn_live_quota_decision` import qualification (`#9168`). [#8426](https://github.com/loopx-project/loopx/pull/8426), [#8645](https://github.com/loopx-project/loopx/pull/8645), [#8919](https://github.com/loopx-project/loopx/pull/8919), [#8922](https://github.com/loopx-project/loopx/pull/8922), [#8948](https://github.com/loopx-project/loopx/pull/8948), [#8952](https://github.com/loopx-project/loopx/pull/8952), [#9001](https://github.com/loopx-project/loopx/pull/9001), [#9018](https://github.com/loopx-project/loopx/pull/9018), [#9040](https://github.com/loopx-project/loopx/pull/9040), [#9103](https://github.com/loopx-project/loopx/pull/9103), [#9152](https://github.com/loopx-project/loopx/pull/9152), [#9168](https://github.com/loopx-project/loopx/pull/9168) +- **Canary & release qualification gates:** Strengthened base/head CLI probe and budget-baseline isolation (`#8948`, `#9103`), runtime snapshot qualification (`#8919`, `#8922`, `#8952`, `#9018`), canary timeout/incomplete diagnostics (`#9001`), Git pathname preservation (`#8426`, `#8429`, `#8558`, `#8585`, `#8645`, `#8678`), and local-first verification and public smoke workflows (`#9040`, `#9152`), alongside `--max-workers` concurrent live portfolio qualification, an `8 KiB` host-tool error output cap preserving deep-path replan context recovery, digest consumer manifest & multi-goal bootstrap smoke alignment, standalone `test_effect_turn_live_quota_decision` import qualification (`#9168`), and `--settle-turn` vision-closeout receipt / creation-allowance wakeup race hardening (`#9178`). [#8426](https://github.com/loopx-project/loopx/pull/8426), [#8645](https://github.com/loopx-project/loopx/pull/8645), [#8919](https://github.com/loopx-project/loopx/pull/8919), [#8922](https://github.com/loopx-project/loopx/pull/8922), [#8948](https://github.com/loopx-project/loopx/pull/8948), [#8952](https://github.com/loopx-project/loopx/pull/8952), [#9001](https://github.com/loopx-project/loopx/pull/9001), [#9018](https://github.com/loopx-project/loopx/pull/9018), [#9040](https://github.com/loopx-project/loopx/pull/9040), [#9103](https://github.com/loopx-project/loopx/pull/9103), [#9152](https://github.com/loopx-project/loopx/pull/9152), [#9168](https://github.com/loopx-project/loopx/pull/9168), [#9178](https://github.com/loopx-project/loopx/pull/9178) ## Benchmarks & Integrations -- **Antigravity, Codex & Steward executor routing:** External hosts can opt into `--complete-turn` (`loopx_turn_envelope_v1`) with digest-bound `context-read` pagination and verified original capture recovery (`#8489`, `#8940`, `#9022`, `#9048`). Steward executor routing adds Antigravity `Carbon` (`gemini-4-carbon-{high,medium,low}`) while retaining `Argon` as default, optional `endpoint_models` preferences in `steward_executor_machine_defaults_v1` (with JSON-mode authoring notes in `configuration_ui.py`), bidirectional `codex` / `antigravity` flexible failover (`loopx-codex-provider-routing 0.15.9`) with `reasoning_effort` alias capacity resolution (`#9147`), `flexible_primary_available` conversation transitions (`#9145`), and native Steward monitor/report fallback parity; legacy session model preservation (`#8977`, `#8984`), Antigravity schedule patrol and Stop hooks (`#8874`), Codex API relay untruncated streaming/payload handling and loopback relay `401` recovery (`#8713`, `#9167`), UTF-8 Codex App stdout decoding (`#8485`), quiet completion receipts (`#8454`), failed-start Session adapter retention (`#9134`), and managed chat observer lock handoff (`#9130`) complete the host layer. [#8454](https://github.com/loopx-project/loopx/pull/8454), [#8485](https://github.com/loopx-project/loopx/pull/8485), [#8489](https://github.com/loopx-project/loopx/pull/8489), [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8874](https://github.com/loopx-project/loopx/pull/8874), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9130](https://github.com/loopx-project/loopx/pull/9130), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167) +- **Antigravity, Codex & Steward executor routing:** External hosts can opt into `--complete-turn` (`loopx_turn_envelope_v1`) with digest-bound `context-read` pagination and verified original capture recovery (`#8489`, `#8940`, `#9022`, `#9048`). Steward executor routing adds Antigravity `Carbon` (`gemini-4-carbon-{high,medium,low}`) while retaining `Argon` as default, optional `endpoint_models` preferences in `steward_executor_machine_defaults_v1` (with JSON-mode authoring notes in `configuration_ui.py`), bidirectional `codex` / `antigravity` flexible failover (`loopx-codex-provider-routing 0.15.9`) with `reasoning_effort` alias capacity resolution (`#9147`), `flexible_primary_available` conversation transitions (`#9145`), and native Steward monitor/report fallback parity; legacy session model preservation (`#8977`, `#8984`), Antigravity schedule patrol and Stop hooks (`#8874`), Codex API relay untruncated streaming/payload handling and loopback relay `401` recovery (`#8713`, `#9167`), Steward active-cascade `resume_failed` recovery and bounded thinking-only error loops (`#9170`), UTF-8 Codex App stdout decoding (`#8485`), quiet completion receipts (`#8454`), failed-start Session adapter retention (`#9134`), and managed chat observer lock handoff (`#9130`) complete the host layer. [#8454](https://github.com/loopx-project/loopx/pull/8454), [#8485](https://github.com/loopx-project/loopx/pull/8485), [#8489](https://github.com/loopx-project/loopx/pull/8489), [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8874](https://github.com/loopx-project/loopx/pull/8874), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9130](https://github.com/loopx-project/loopx/pull/9130), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167), [#9170](https://github.com/loopx-project/loopx/pull/9170) - **Lark group & private channel hardening:** Private Lark replies stay off the main blocking path, preserve queued messages on reconnect, offer read-only Steward shortcut cards, deliver Turn-scoped native images and recover legacy captured images, steer mentions into frozen original Turns, share callback dispatch across query and operation cards, escape Goal Channel operation card text in a single pass, recognize international Lark setup URLs, coalesce listener snapshots, cache recovery lookups, and reset noop recovery backoff when Turn/session inputs change. [#8270](https://github.com/loopx-project/loopx/pull/8270), [#8668](https://github.com/loopx-project/loopx/pull/8668), [#8695](https://github.com/loopx-project/loopx/pull/8695), [#8741](https://github.com/loopx-project/loopx/pull/8741), [#8858](https://github.com/loopx-project/loopx/pull/8858), [#8870](https://github.com/loopx-project/loopx/pull/8870), [#8871](https://github.com/loopx-project/loopx/pull/8871), [#8893](https://github.com/loopx-project/loopx/pull/8893), [#8903](https://github.com/loopx-project/loopx/pull/8903), [#8921](https://github.com/loopx-project/loopx/pull/8921), [#8990](https://github.com/loopx-project/loopx/pull/8990), [#8999](https://github.com/loopx-project/loopx/pull/8999), [#9041](https://github.com/loopx-project/loopx/pull/9041), [#9096](https://github.com/loopx-project/loopx/pull/9096), [#9098](https://github.com/loopx-project/loopx/pull/9098), [#9100](https://github.com/loopx-project/loopx/pull/9100), [#9114](https://github.com/loopx-project/loopx/pull/9114), [#9119](https://github.com/loopx-project/loopx/pull/9119) - **Desktop App 2.4.0 & `dsh-loopx-plugin 0.1.1-beta.7`:** Desktop App prepares updates before workspace teardown, bounds readiness probes, opens the usable workspace before optional updates, skips immutable-release frontend re-hashing (`#9089`), adds download retries to chat-bundle packaging and Desktop release/updater workflows (`#9147`), and checks signature-verified archives for supported runtime `default_contract` before preparing macOS preview updates (`#9029`). `dsh-loopx-plugin 0.1.1-beta.7` adds `DSH 0.2.2-rc.1..rc.3` compatibility, aligns integration closeout tests with `quota_settlement_plan_v2` (`#9147`), surfaces GoalBar `continuationAdmission` failures, isolates hot uninstalls from the shared Web server, fences Start/Pause with Core source fingerprints, preserves replacement cancellation/error pauses, and fixes Windows continuation paths. [#8504](https://github.com/loopx-project/loopx/pull/8504), [#8675](https://github.com/loopx-project/loopx/pull/8675), [#8723](https://github.com/loopx-project/loopx/pull/8723), [#8739](https://github.com/loopx-project/loopx/pull/8739), [#8879](https://github.com/loopx-project/loopx/pull/8879), [#8899](https://github.com/loopx-project/loopx/pull/8899), [#9029](https://github.com/loopx-project/loopx/pull/9029), [#9087](https://github.com/loopx-project/loopx/pull/9087), [#9089](https://github.com/loopx-project/loopx/pull/9089), [#9147](https://github.com/loopx-project/loopx/pull/9147) - **Windows & Benchmark tooling (no net long-horizon outcome claim):** Windows receives PowerShell settlement quoting, bounded error payloads, UTF-8 decoding, source lease clock-skew tolerance, file identity checks, and local NTFS `loopx-jev` capture (`#8599`, `#8620`, `#8641`, `#8643`, `#8761`). Benchmark adapters add `benchmark.runtime.planning_batch` initial task planning (`#9090`), idle-boundary staged CLI activation (`#8501`), governed single-worker Turn extraction (`#8499`), Codex resume restoration (`#9031`), Frontier shared task clocks (`#8875`), and restored frozen v1 archive and standalone benchmark import boundaries (`#9151`); no net long-horizon benchmark outcome or total-cost improvement is claimed in this release. [#8499](https://github.com/loopx-project/loopx/pull/8499), [#8501](https://github.com/loopx-project/loopx/pull/8501), [#8599](https://github.com/loopx-project/loopx/pull/8599), [#8620](https://github.com/loopx-project/loopx/pull/8620), [#8641](https://github.com/loopx-project/loopx/pull/8641), [#8643](https://github.com/loopx-project/loopx/pull/8643), [#8761](https://github.com/loopx-project/loopx/pull/8761), [#8875](https://github.com/loopx-project/loopx/pull/8875), [#9031](https://github.com/loopx-project/loopx/pull/9031), [#9090](https://github.com/loopx-project/loopx/pull/9090), [#9151](https://github.com/loopx-project/loopx/pull/9151) @@ -410,9 +410,9 @@ loopx doctor ### 主要变化 - **一次确认创建 Goal 与对话历史检索。** 在 Chat 审核并确认一次草稿即可创建 Goal 并打开原会话;支持在已载入会话中搜索并跳回原消息,桌面重开后保留已保存研究回答、恢复中断回答及派发前请求、诊断失联 worker 与清晰引用 Markdown。 [#8676](https://github.com/loopx-project/loopx/pull/8676), [#8780](https://github.com/loopx-project/loopx/pull/8780), [#8863](https://github.com/loopx-project/loopx/pull/8863), [#8868](https://github.com/loopx-project/loopx/pull/8868), [#8880](https://github.com/loopx-project/loopx/pull/8880), [#8892](https://github.com/loopx-project/loopx/pull/8892), [#8983](https://github.com/loopx-project/loopx/pull/8983), [#9120](https://github.com/loopx-project/loopx/pull/9120), [#9125](https://github.com/loopx-project/loopx/pull/9125) -- **管家通用监控、精确 Head PR 审查信号与受保护合并确认。** 原生管家支持基于探针门控的自然语言 `continuous_monitor`(含 `context_handoff` 与受控 `steward_user_actions`)、精确 Head PR 审查筛选与 `/confirm` `pr.merge` 合并预览、跨端点派发前失败与报告/队列恢复(含已停止或已保存报告候选恢复及轻微 JSON 分隔符容错)、以及默认关闭的独立 OpenViking 管家长期记忆(仅限本人私聊)。 [#9074](https://github.com/loopx-project/loopx/pull/9074), [#9077](https://github.com/loopx-project/loopx/pull/9077), [#9081](https://github.com/loopx-project/loopx/pull/9081), [#9083](https://github.com/loopx-project/loopx/pull/9083), [#9093](https://github.com/loopx-project/loopx/pull/9093), [#9143](https://github.com/loopx-project/loopx/pull/9143), [#9155](https://github.com/loopx-project/loopx/pull/9155), [#9157](https://github.com/loopx-project/loopx/pull/9157), [#9159](https://github.com/loopx-project/loopx/pull/9159), [#9164](https://github.com/loopx-project/loopx/pull/9164) +- **管家通用监控、精确 Head PR 审查信号与受保护合并确认。** 原生管家支持基于探针门控的自然语言 `continuous_monitor`(含 `context_handoff` 与受控 `steward_user_actions`)、精确 Head PR 审查筛选与队列模型覆盖追踪(`#9014`)及 `/confirm` `pr.merge` 合并预览、跨端点派发前失败与报告/队列恢复(含已停止或已保存报告候选恢复及轻微 JSON 分隔符容错)、以及默认关闭的独立 OpenViking 管家长期记忆(仅限本人私聊)。 [#9014](https://github.com/loopx-project/loopx/pull/9014), [#9074](https://github.com/loopx-project/loopx/pull/9074), [#9077](https://github.com/loopx-project/loopx/pull/9077), [#9081](https://github.com/loopx-project/loopx/pull/9081), [#9083](https://github.com/loopx-project/loopx/pull/9083), [#9093](https://github.com/loopx-project/loopx/pull/9093), [#9143](https://github.com/loopx-project/loopx/pull/9143), [#9155](https://github.com/loopx-project/loopx/pull/9155), [#9157](https://github.com/loopx-project/loopx/pull/9157), [#9159](https://github.com/loopx-project/loopx/pull/9159), [#9164](https://github.com/loopx-project/loopx/pull/9164) - **Complete Turn 与 `quota_settlement_plan_v2` 原任务恢复。** 已安装工作台经 CLI 发现 Manager 并沿原 Turn、扣额身份与重绑定硬租约护栏恢复已授权任务;Complete Turn 与原生宿主组合 `loopx_turn_envelope_v1` 与 `quota_settlement_plan_v2`(`--settle-turn --settlement-receipt`),普通未托管 JSON `quota should-run` 继续保留 `quota_packet` 公开默认。 [#8489](https://github.com/loopx-project/loopx/pull/8489), [#8615](https://github.com/loopx-project/loopx/pull/8615), [#8802](https://github.com/loopx-project/loopx/pull/8802), [#8830](https://github.com/loopx-project/loopx/pull/8830), [#8956](https://github.com/loopx-project/loopx/pull/8956), [#9030](https://github.com/loopx-project/loopx/pull/9030), [#9084](https://github.com/loopx-project/loopx/pull/9084), [#9097](https://github.com/loopx-project/loopx/pull/9097), [#9111](https://github.com/loopx-project/loopx/pull/9111), [#9154](https://github.com/loopx-project/loopx/pull/9154), [#9157](https://github.com/loopx-project/loopx/pull/9157), [#9158](https://github.com/loopx-project/loopx/pull/9158), [#9160](https://github.com/loopx-project/loopx/pull/9160), [#9161](https://github.com/loopx-project/loopx/pull/9161) -- **Antigravity Carbon、每端点模型偏好与双向容灾切换。** 注册 Antigravity `Carbon`(`gemini-4-carbon-{high,medium,low}`)并保留 `Argon` 默认,在 `steward_executor_machine_defaults_v1` 增加 `endpoint_models` JSON 模式配置说明,支持 Codex 与 Antigravity 双向 `flexible` 切换(配合 `loopx-codex-provider-routing 0.15.9`、`reasoning_effort` 容量别名与 `flexible_primary_available` 状态转换)及原生监控/周报回退对齐,修复 Codex API relay 请求/响应截断与回环中继 401 故障恢复,并在切换模型时保留 Codex 原会话历史。 [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167) +- **Antigravity Carbon、每端点模型偏好与双向容灾切换。** 注册 Antigravity `Carbon`(`gemini-4-carbon-{high,medium,low}`)并保留 `Argon` 默认,在 `steward_executor_machine_defaults_v1` 增加 `endpoint_models` JSON 模式配置说明,支持 Codex 与 Antigravity 双向 `flexible` 切换(配合 `loopx-codex-provider-routing 0.15.9`、`reasoning_effort` 容量别名与 `flexible_primary_available` 状态转换)及原生监控/周报回退对齐,修复 Codex API relay 请求/响应截断、回环中继 401 故障与管家主动级联 `resume_failed` 恢复(`#9170`),并在切换模型时保留 Codex 原会话历史。 [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167), [#9170](https://github.com/loopx-project/loopx/pull/9170) - **多 Agent 协作与飞书群聊/私聊加固。** 对等体可通过 `read_peer_returns` 与 `consume_peer_result` 直接读回协作结果而无需重开 Manager Inbox,并按 Goal 批量加锁和缓存扫描;飞书连接器支持重连排队保留、只读管家快捷卡片、Turn 作用域原生图片、共享卡片回调、单趟卡片转义、国际版 Lark 配置识别及按输入重置退避。 [#8668](https://github.com/loopx-project/loopx/pull/8668), [#8695](https://github.com/loopx-project/loopx/pull/8695), [#8741](https://github.com/loopx-project/loopx/pull/8741), [#8871](https://github.com/loopx-project/loopx/pull/8871), [#8921](https://github.com/loopx-project/loopx/pull/8921), [#8990](https://github.com/loopx-project/loopx/pull/8990), [#9027](https://github.com/loopx-project/loopx/pull/9027), [#9085](https://github.com/loopx-project/loopx/pull/9085), [#9114](https://github.com/loopx-project/loopx/pull/9114), [#9117](https://github.com/loopx-project/loopx/pull/9117), [#9119](https://github.com/loopx-project/loopx/pull/9119) - **Desktop App 2.4.0、`dsh-loopx-plugin 0.1.1-beta.7`、LooChat 工作台与远程任务网关。** Desktop App 在关闭工作区前准备更新、限制就绪探测耗时、跳过不可变发布包前端重哈希、为发布/ChatBundle 下载补齐重试,并在缓存 macOS preview 更新前核验 `default_contract`;`dsh-loopx-plugin 0.1.1-beta.7` 要求 Core 2.4.0+、兼容 DSH `0.2.2-rc.1..rc.3` 与 `quota_settlement_plan_v2` 结案回归、在 GoalBar 暴露准入失败并隔离热卸载;新增实验性 LooChat 工作台(`apps/workbench/`)及远程任务网关的逐资源读 ACL 与 PostgreSQL/TLS Compose 自托管示例。 [#8508](https://github.com/loopx-project/loopx/pull/8508), [#8675](https://github.com/loopx-project/loopx/pull/8675), [#8723](https://github.com/loopx-project/loopx/pull/8723), [#8739](https://github.com/loopx-project/loopx/pull/8739), [#8765](https://github.com/loopx-project/loopx/pull/8765), [#8843](https://github.com/loopx-project/loopx/pull/8843), [#8861](https://github.com/loopx-project/loopx/pull/8861), [#8879](https://github.com/loopx-project/loopx/pull/8879), [#8887](https://github.com/loopx-project/loopx/pull/8887), [#8899](https://github.com/loopx-project/loopx/pull/8899), [#9029](https://github.com/loopx-project/loopx/pull/9029), [#9089](https://github.com/loopx-project/loopx/pull/9089), [#9147](https://github.com/loopx-project/loopx/pull/9147) @@ -455,11 +455,11 @@ loopx doctor - SQLite 回归矩阵覆盖落后消费者、备份 lineage、并发 CAS/响应丢失重试以及 `SQLITE_FULL` / 真实 macOS `ENOSPC` 磁盘满 fail-closed 与恢复。 [#8367](https://github.com/loopx-project/loopx/pull/8367), [#8482](https://github.com/loopx-project/loopx/pull/8482), [#8498](https://github.com/loopx-project/loopx/pull/8498), [#9126](https://github.com/loopx-project/loopx/pull/9126) - 控制面、配额、Lark、奖励记忆、基准与领域包消除 `Any` 并建立基线护栏,大体积 CLI、`issue-fix` 与 Lark/Chat 模块完成拆分,补齐 C1 规划/交付/结算与 UTF-8 传输/扩展/工作台回归,加固 CLI help 目录、架构导入守卫与新手引导选标门禁,精简冗余示例,并使 `doctor` 升级读回绑定所属 Python 环境。 [#8013](https://github.com/loopx-project/loopx/pull/8013), [#8897](https://github.com/loopx-project/loopx/pull/8897), [#8933](https://github.com/loopx-project/loopx/pull/8933), [#8940](https://github.com/loopx-project/loopx/pull/8940), [#8971](https://github.com/loopx-project/loopx/pull/8971), [#8994](https://github.com/loopx-project/loopx/pull/8994), [#9009](https://github.com/loopx-project/loopx/pull/9009), [#9044](https://github.com/loopx-project/loopx/pull/9044), [#9102](https://github.com/loopx-project/loopx/pull/9102), [#9104](https://github.com/loopx-project/loopx/pull/9104), [#9152](https://github.com/loopx-project/loopx/pull/9152), [#9154](https://github.com/loopx-project/loopx/pull/9154), [#9156](https://github.com/loopx-project/loopx/pull/9156), [#9158](https://github.com/loopx-project/loopx/pull/9158), [#9160](https://github.com/loopx-project/loopx/pull/9160), [#9161](https://github.com/loopx-project/loopx/pull/9161) -- 加固 base/head CLI 差分与预算基线隔离(`#8948`、`#9103`)、runtime snapshot 默认契约校验、canary 超时诊断与 Git 原始路径保留,并沉淀本地优先验证规范与公开 smoke 门禁修复(`#9152`),同时支持 `--max-workers` 并发真实模型行为评估、深路径重规划上下文恢复的 `8 KiB` 宿主工具错误输出上限,并对齐摘要消费者清单、多 Goal 引导 smoke 契约与 `test_effect_turn_live_quota_decision` 独立导入(`#9168`)。 [#8426](https://github.com/loopx-project/loopx/pull/8426), [#8645](https://github.com/loopx-project/loopx/pull/8645), [#8919](https://github.com/loopx-project/loopx/pull/8919), [#8922](https://github.com/loopx-project/loopx/pull/8922), [#8948](https://github.com/loopx-project/loopx/pull/8948), [#8952](https://github.com/loopx-project/loopx/pull/8952), [#9001](https://github.com/loopx-project/loopx/pull/9001), [#9018](https://github.com/loopx-project/loopx/pull/9018), [#9040](https://github.com/loopx-project/loopx/pull/9040), [#9103](https://github.com/loopx-project/loopx/pull/9103), [#9152](https://github.com/loopx-project/loopx/pull/9152), [#9168](https://github.com/loopx-project/loopx/pull/9168) +- 加固 base/head CLI 差分与预算基线隔离(`#8948`、`#9103`)、runtime snapshot 默认契约校验、canary 超时诊断与 Git 原始路径保留,并沉淀本地优先验证规范与公开 smoke 门禁修复(`#9152`),同时支持 `--max-workers` 并发真实模型行为评估、深路径重规划上下文恢复的 `8 KiB` 宿主工具错误输出上限、对齐摘要消费者清单、多 Goal 引导 smoke 契约与 `test_effect_turn_live_quota_decision` 独立导入(`#9168`),并修复 `--settle-turn` 视觉结案回执读取及 `creation_allowance` 测试唤醒竞态(`#9178`)。 [#8426](https://github.com/loopx-project/loopx/pull/8426), [#8645](https://github.com/loopx-project/loopx/pull/8645), [#8919](https://github.com/loopx-project/loopx/pull/8919), [#8922](https://github.com/loopx-project/loopx/pull/8922), [#8948](https://github.com/loopx-project/loopx/pull/8948), [#8952](https://github.com/loopx-project/loopx/pull/8952), [#9001](https://github.com/loopx-project/loopx/pull/9001), [#9018](https://github.com/loopx-project/loopx/pull/9018), [#9040](https://github.com/loopx-project/loopx/pull/9040), [#9103](https://github.com/loopx-project/loopx/pull/9103), [#9152](https://github.com/loopx-project/loopx/pull/9152), [#9168](https://github.com/loopx-project/loopx/pull/9168), [#9178](https://github.com/loopx-project/loopx/pull/9178) ### 基准与集成 -- **Antigravity、Codex 与管家执行器路由:** 外部 Host 可显式使用 `--complete-turn` 与摘要绑定 `context-read`;管家配置新增 Antigravity `Carbon`(`gemini-4-carbon-{high,medium,low}`,默认仍为 `Argon`)、每端点 `endpoint_models` JSON 模式偏好说明、Codex 与 Antigravity 双向 `flexible` 容灾切换(配合 `loopx-codex-provider-routing 0.15.9`、`reasoning_effort` 容量别名与 `flexible_primary_available` 状态转换)及回退路径的原生监控/周报支持,同时修复 Codex API relay 请求/响应截断与回环中继 401 恢复、Codex 模型切换历史保留、UTF-8 输出解码、静默完成回执、失败重试 Session 适配器保留及受管观察锁交接(`#9167`)。 [#8454](https://github.com/loopx-project/loopx/pull/8454), [#8485](https://github.com/loopx-project/loopx/pull/8485), [#8489](https://github.com/loopx-project/loopx/pull/8489), [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8874](https://github.com/loopx-project/loopx/pull/8874), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9130](https://github.com/loopx-project/loopx/pull/9130), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167) +- **Antigravity、Codex 与管家执行器路由:** 外部 Host 可显式使用 `--complete-turn` 与摘要绑定 `context-read`;管家配置新增 Antigravity `Carbon`(`gemini-4-carbon-{high,medium,low}`,默认仍为 `Argon`)、每端点 `endpoint_models` JSON 模式偏好说明、Codex 与 Antigravity 双向 `flexible` 容灾切换(配合 `loopx-codex-provider-routing 0.15.9`、`reasoning_effort` 容量别名与 `flexible_primary_available` 状态转换)及回退路径的原生监控/周报支持,同时修复 Codex API relay 请求/响应截断与回环中继 401 恢复、管家主动级联 `resume_failed` 恢复与纯思考错误循环有界处理(`#9170`)、Codex 模型切换历史保留、UTF-8 输出解码、静默完成回执、失败重试 Session 适配器保留及受管观察锁交接(`#9167`)。 [#8454](https://github.com/loopx-project/loopx/pull/8454), [#8485](https://github.com/loopx-project/loopx/pull/8485), [#8489](https://github.com/loopx-project/loopx/pull/8489), [#8713](https://github.com/loopx-project/loopx/pull/8713), [#8874](https://github.com/loopx-project/loopx/pull/8874), [#8977](https://github.com/loopx-project/loopx/pull/8977), [#8984](https://github.com/loopx-project/loopx/pull/8984), [#9130](https://github.com/loopx-project/loopx/pull/9130), [#9134](https://github.com/loopx-project/loopx/pull/9134), [#9141](https://github.com/loopx-project/loopx/pull/9141), [#9145](https://github.com/loopx-project/loopx/pull/9145), [#9147](https://github.com/loopx-project/loopx/pull/9147), [#9167](https://github.com/loopx-project/loopx/pull/9167), [#9170](https://github.com/loopx-project/loopx/pull/9170) - **飞书群聊与私聊加固:** 私聊反馈不阻塞主回复,重连保留排队消息,提供只读管家快捷卡片,支持 Turn 作用域原生图片与历史图片恢复、mention 定向回原冻结 Turn、查询与操作卡片共享回调分发、单趟卡片文本转义、国际版 Lark URL 识别、监听快照合并与恢复缓存,并在输入变化时重置空转退避。 [#8270](https://github.com/loopx-project/loopx/pull/8270), [#8668](https://github.com/loopx-project/loopx/pull/8668), [#8695](https://github.com/loopx-project/loopx/pull/8695), [#8741](https://github.com/loopx-project/loopx/pull/8741), [#8858](https://github.com/loopx-project/loopx/pull/8858), [#8870](https://github.com/loopx-project/loopx/pull/8870), [#8871](https://github.com/loopx-project/loopx/pull/8871), [#8893](https://github.com/loopx-project/loopx/pull/8893), [#8903](https://github.com/loopx-project/loopx/pull/8903), [#8921](https://github.com/loopx-project/loopx/pull/8921), [#8990](https://github.com/loopx-project/loopx/pull/8990), [#8999](https://github.com/loopx-project/loopx/pull/8999), [#9041](https://github.com/loopx-project/loopx/pull/9041), [#9096](https://github.com/loopx-project/loopx/pull/9096), [#9098](https://github.com/loopx-project/loopx/pull/9098), [#9100](https://github.com/loopx-project/loopx/pull/9100), [#9114](https://github.com/loopx-project/loopx/pull/9114), [#9119](https://github.com/loopx-project/loopx/pull/9119) - **Desktop App 2.4.0 与 `dsh-loopx-plugin 0.1.1-beta.7`:** Desktop App 在关闭工作区前准备更新、限制就绪探测耗时、先打开可用工作区、跳过不可变版本前端重哈希、为 `chat_bundle.py` 与桌面发布/更新工作流增加下载重试(`#9147`),并在缓存 macOS preview 更新前核验签名包里的 `default_contract`;`dsh-loopx-plugin 0.1.1-beta.7` 兼容 DSH `0.2.2-rc.1..rc.3`、对齐 `quota_settlement_plan_v2` 集成结案测试(`#9147`)、在 GoalBar 展示准入失败、隔离热卸载、保持替代后取消/错误暂停归属、用来源指纹保护 Start/Pause 并支持 Windows 原生路径。 [#8504](https://github.com/loopx-project/loopx/pull/8504), [#8675](https://github.com/loopx-project/loopx/pull/8675), [#8723](https://github.com/loopx-project/loopx/pull/8723), [#8739](https://github.com/loopx-project/loopx/pull/8739), [#8879](https://github.com/loopx-project/loopx/pull/8879), [#8899](https://github.com/loopx-project/loopx/pull/8899), [#9029](https://github.com/loopx-project/loopx/pull/9029), [#9087](https://github.com/loopx-project/loopx/pull/9087), [#9089](https://github.com/loopx-project/loopx/pull/9089), [#9147](https://github.com/loopx-project/loopx/pull/9147) - **Windows 与基准工具(不宣称长程净收益):** Windows 修复 PowerShell 引号、错误载荷上限、文件身份核对及本地 NTFS `loopx-jev` 捕获;基准工具新增初始规划批写入(`benchmark.runtime.planning_batch`)、空闲边界 staged CLI 切换预览、单 worker 回合提取、Codex 恢复、Frontier 共享时钟,并恢复冻结 v1 归档与独立 `benchmark/` 导入边界(`#9151`)。本版本不宣称可比长程任务结果或完整成本净收益。 [#8499](https://github.com/loopx-project/loopx/pull/8499), [#8501](https://github.com/loopx-project/loopx/pull/8501), [#8599](https://github.com/loopx-project/loopx/pull/8599), [#8620](https://github.com/loopx-project/loopx/pull/8620), [#8641](https://github.com/loopx-project/loopx/pull/8641), [#8643](https://github.com/loopx-project/loopx/pull/8643), [#8761](https://github.com/loopx-project/loopx/pull/8761), [#8875](https://github.com/loopx-project/loopx/pull/8875), [#9031](https://github.com/loopx-project/loopx/pull/9031), [#9090](https://github.com/loopx-project/loopx/pull/9090), [#9151](https://github.com/loopx-project/loopx/pull/9151) diff --git a/loopx/control_plane/testing/replan_vision_closeout_behavior.py b/loopx/control_plane/testing/replan_vision_closeout_behavior.py index 7fc2493a27..4e0835397e 100644 --- a/loopx/control_plane/testing/replan_vision_closeout_behavior.py +++ b/loopx/control_plane/testing/replan_vision_closeout_behavior.py @@ -45,8 +45,8 @@ def __init__(self, code: str, detail: str = "") -> None: "Use the supplied Vision schema version and a proposed vision_patch with acceptance_summary. " "Write path_delta using its schema, outcome, prior_assumption, observed_reality, " "one retained, changed or stopped item, and the evidence_id or source_ref actually read. " - "If required_fields includes agent_vision.stride_decision, use stride_control.minimal_example " - "for its shape and bind independent axes and minimum_evidence to this same source. " + "If required_fields includes agent_vision.stride_decision, set top-level stride_decision " + "from stride_control.minimal_example and bind independent axes and minimum_evidence to this same source. " "Keep prose strings under 80 characters and cite the observed source. " "Add optional fields only when the evidence requires them. " "Fill the projected refresh-state action with the draft path and keep the original Turn and obligation binding. " @@ -133,6 +133,46 @@ def _rows(state: _QualificationState) -> list[dict[str, Any]]: return [json.loads(line) for line in index.read_text(encoding="utf-8").split("\n") if line] +def _verify_vision_settlement( + state: _QualificationState, + *, + binding: Mapping[str, Any], + execute: Callable[..., str], +) -> None: + replay = QuotaToolContext.from_output( + execute( + state.fixture.quota_guard_command, + fixture=state.fixture, + turn_instance_id=state.turn_instance_id, + ) + ).packet + following = QuotaToolContext.from_output( + execute( + state.fixture.quota_guard_command, + fixture=state.fixture, + turn_instance_id=f"{state.turn_instance_id}-readback", + ) + ).packet + spends = [row for row in _rows(state) if row.get("classification") == "quota_slot_spent"] + if replay.get("effective_action") != EffectiveAction.HEARTBEAT_SETTLED_SKIP.value or len(spends) != 1: + raise ValueError("vision_closeout_settlement_readback_failed") + remaining = dict(following.get("autonomous_replan_obligation") or {}) + remaining_kinds = {item["kind"] for item in remaining.get("triggers", [])} + if remaining.get("obligation_id") == binding["id"] or remaining_kinds.intersection( + {"required_agent_vision_missing", "vision_checkpoint_missing"} + ): + raise ValueError("vision_closeout_rearmed_after_settlement") + # A real successor requirement may follow a newly authored continuing + # vision. Do not force the model to declare as_needed or no_followup just + # to obtain a quiet next wake. + assert state.vision_closeout is not None + state.vision_closeout.update(settled=True, spend_count=1, original_obligation_closed=True) + state.semantic_reentry_observation = { + "effective_action": following.get("effective_action"), + "trigger_kinds": sorted(remaining_kinds), + } + + def dispatch_vision_closeout( command: str, state: _QualificationState, *, execute: Callable[..., str], ) -> tuple[str, str, bool] | None: @@ -166,12 +206,13 @@ def dispatch_vision_closeout( raise VisionHostAdmissionRejected("vision_closeout_evidence_not_observed", "No refresh was executed: path_delta.evidence_refs must identify the source evidence actually read. Accepted references: " + json.dumps(sorted(observed_refs))) output = execute(command, fixture=state.fixture, turn_instance_id=state.turn_instance_id) rows = _rows(state) - if not rows: + writebacks = [row for row in rows if row.get("classification") != "quota_slot_spent"] + if not writebacks: raise VisionHostAdmissionRejected( "vision_closeout_durable_writeback_missing", "No run receipt was written; revise the vision decision and retry.", ) - row = rows[-1] + row = writebacks[-1] semantic = dict(row.get("autonomous_replan_ack") or {}).get("semantic_delta") or {} checkpoint = dict(row.get("vision_checkpoint") or {}) identity = dict(row.get("settlement_identity") or {}) @@ -181,25 +222,14 @@ def dispatch_vision_closeout( raise ValueError("vision_closeout_durable_writeback_incomplete") state.semantic_delta = semantic state.vision_closeout = {"checkpoint_satisfied": True, "bound_writeback": True, "settled": False} + if any(row.get("classification") == "quota_slot_spent" for row in rows): + _verify_vision_settlement(state, binding=binding, execute=execute) + return output, "semantic_replan_writeback", True return output, "semantic_replan_writeback", False if state.vision_closeout is None: raise ValueError("vision_closeout_spend_before_writeback") + if state.vision_closeout.get("settled"): + raise ValueError("vision_closeout_already_settled") output = execute(command, fixture=state.fixture, turn_instance_id=state.turn_instance_id) - replay = QuotaToolContext.from_output(execute(state.fixture.quota_guard_command, fixture=state.fixture, - turn_instance_id=state.turn_instance_id)).packet - following = QuotaToolContext.from_output(execute(state.fixture.quota_guard_command, fixture=state.fixture, - turn_instance_id=f"{state.turn_instance_id}-readback")).packet - spends = [row for row in _rows(state) if row.get("classification") == "quota_slot_spent"] - if replay.get("effective_action") != EffectiveAction.HEARTBEAT_SETTLED_SKIP.value or len(spends) != 1: - raise ValueError("vision_closeout_settlement_readback_failed") - remaining = dict(following.get("autonomous_replan_obligation") or {}) - remaining_kinds = {item["kind"] for item in remaining.get("triggers", [])} - if remaining.get("obligation_id") == binding["id"] or remaining_kinds.intersection({"required_agent_vision_missing", "vision_checkpoint_missing"}): - raise ValueError("vision_closeout_rearmed_after_settlement") - # A real successor requirement may follow a newly authored continuing - # vision. Do not force the model to declare as_needed or no_followup just - # to obtain a quiet next wake. - state.vision_closeout.update(settled=True, spend_count=1, original_obligation_closed=True) - state.semantic_reentry_observation = {"effective_action": following.get("effective_action"), - "trigger_kinds": sorted(remaining_kinds)} + _verify_vision_settlement(state, binding=binding, execute=execute) return output, "quota_spend_slot", True diff --git a/tests/control_plane/test_creation_allowance_hold.py b/tests/control_plane/test_creation_allowance_hold.py index 6793d22b5d..668859f471 100644 --- a/tests/control_plane/test_creation_allowance_hold.py +++ b/tests/control_plane/test_creation_allowance_hold.py @@ -19,24 +19,52 @@ from loopx.configure_goal import configure_goal +class _ObservedCalls(list): + def __init__(self, on_len): + super().__init__() + self._on_len = on_len + self.baseline_started = 0 + + def __len__(self) -> int: + self.baseline_started = self._on_len() + return super().__len__() + + @pytest.fixture def consumption(monkeypatch): - condition, calls = threading.Condition(), [] + condition = threading.Condition() + started = 0 + completed_start_seq = 0 + + def current_started() -> int: + with condition: + return started + + calls = _ObservedCalls(current_started) consume = ManagedSessionTurn.consume_creation_request def observe(self, creation): + nonlocal started, completed_start_seq + with condition: + started += 1 + entry_seq = started try: return consume(self, creation) finally: with condition: calls.append(deepcopy(creation)) + completed_start_seq = max(completed_start_seq, entry_seq) condition.notify_all() monkeypatch.setattr(ManagedSessionTurn, "consume_creation_request", observe) def after(previous): with condition: - assert condition.wait_for(lambda: len(calls) > previous, timeout=15) + baseline = calls.baseline_started + assert condition.wait_for( + lambda: list.__len__(calls) > previous and completed_start_seq > baseline, + timeout=30, + ) return calls, after @@ -338,3 +366,60 @@ def pause_before_native_guard(payload, **kwargs): controller.resume_creation_requests() assert controller.store.turn_for_client(saved["session_id"], "managed." + saved["operation_id"])["turn_id"] == turn["turn_id"] assert capture.read_bytes() == after + + +def test_in_flight_consumption_started_before_count_does_not_unblock_after(consumption) -> None: + from types import SimpleNamespace + + stale_entered = threading.Event() + release_stale = threading.Event() + waiter_unblocked = threading.Event() + + class _StubTurn: + def __init__(self, *, wait_on_stale: bool) -> None: + self.wait_on_stale = wait_on_stale + self.controller = SimpleNamespace( + _session_adapter_lock=lambda _sid: contextmanager(lambda: (yield))() + ) + self.store = SimpleNamespace( + turn_for_client=lambda _sid, _cid: { + "status": "completed", + "loopx_request": {"id": "op", "creation_request": { + "session_id": "s1", + "agent_id": "codex", + "operation_id": "op", + "todo_id": "todo_1", + }}, + } + ) + + def _request(self, _sid, _aid, _oid, _tid): + if self.wait_on_stale: + stale_entered.set() + assert release_stale.wait(timeout=5) + return {"id": "op"} + + creation = {"session_id": "s1", "agent_id": "codex", "operation_id": "op", "todo_id": "todo_1"} + stale_thread = threading.Thread( + target=ManagedSessionTurn.consume_creation_request, + args=(_StubTurn(wait_on_stale=True), creation), + daemon=True, + ) + stale_thread.start() + assert stale_entered.wait(timeout=5) + + count = len(consumption[0]) + release_stale.set() + stale_thread.join(timeout=5) + + waiter = threading.Thread( + target=lambda: (consumption[1](count), waiter_unblocked.set()), + daemon=True, + ) + waiter.start() + assert not waiter_unblocked.wait(0.2) + + ManagedSessionTurn.consume_creation_request(_StubTurn(wait_on_stale=False), creation) + waiter.join(timeout=5) + assert waiter_unblocked.is_set() + assert len(consumption[0]) == 2 diff --git a/tests/control_plane/test_replan_vision_closeout_receipt.py b/tests/control_plane/test_replan_vision_closeout_receipt.py index f69f601bf6..cf5b50f564 100644 --- a/tests/control_plane/test_replan_vision_closeout_receipt.py +++ b/tests/control_plane/test_replan_vision_closeout_receipt.py @@ -62,3 +62,150 @@ def execute(command, **_kwargs): execute=execute, ) assert len(executed) == 1 + + +def _vision_closeout_state(tmp_path): + project = tmp_path / "project" + project.mkdir() + source = project / "work.json" + source.write_text("{}", encoding="utf-8") + frontier = project / "frontier.json" + frontier.write_text( + json.dumps({"uncovered": [{"source_ref": "work.json", "evidence_id": "evidence-a"}]}), + encoding="utf-8", + ) + (project / "vision.json").write_text( + json.dumps({"path_delta": {"evidence_refs": ["evidence-a"]}}), + encoding="utf-8", + ) + runtime_root = tmp_path / "runtime" + runs_dir = runtime_root / "goals" / "goal-a" / "runs" + runs_dir.mkdir(parents=True, exist_ok=True) + expected_identity = {"goal_id": "goal-a", "agent_id": "agent-a", "turn_key": "sha256:" + "a" * 64} + fixture = SimpleNamespace( + project_root=project, + runtime_root=runtime_root, + frontier_target=frontier, + work_source_target=source, + quota_guard_command="loopx quota should-run --goal-id goal-a", + ) + state = SimpleNamespace( + fixture=fixture, + turn_instance_id="turn-a", + work_source_read=True, + semantic_delta=None, + vision_closeout=None, + semantic_reentry_observation=None, + quota_packet={ + "goal_id": "goal-a", + "heartbeat_receipt": {"settlement_identity": expected_identity}, + "interaction_contract": { + "cli_channel": { + "replan_settlement_contract": { + "settlement_binding": {"cli_argument": "--binding", "id": "obligation-a"} + } + } + }, + }, + ) + return state, runs_dir / "index.jsonl", expected_identity + + +def test_refresh_state_with_settle_turn_completes_vision_closeout_without_duplicate_spend( + tmp_path, +) -> None: + state, index_path, expected_identity = _vision_closeout_state(tmp_path) + writeback_row = { + "classification": "bounded_replan_progress", + "autonomous_replan_ack": {"semantic_delta": {"accepted": True, "obligation_id": "obligation-a"}}, + "vision_checkpoint": {"satisfied": True}, + "settlement_identity": expected_identity, + } + spend_row = {"classification": "quota_slot_spent"} + executed = [] + + def execute(command, **_kwargs): + executed.append(command) + if "refresh-state" in command: + index_path.write_text( + json.dumps(writeback_row) + "\n" + json.dumps(spend_row) + "\n", + encoding="utf-8", + ) + return json.dumps({"ok": True, "appended": True}) + if "quota should-run" in command: + return json.dumps({"ok": True, "effective_action": "heartbeat_settled_skip"}) + raise AssertionError(f"unexpected command: {command}") + + _, kind, completed = dispatch_vision_closeout( + "loopx refresh-state --binding obligation-a --turn-instance-id turn-a " + "--agent-vision-json vision.json --settle-turn", + state, + execute=execute, + ) + assert kind == "semantic_replan_writeback" + assert completed is True + assert state.vision_closeout == { + "checkpoint_satisfied": True, + "bound_writeback": True, + "settled": True, + "spend_count": 1, + "original_obligation_closed": True, + } + assert state.semantic_reentry_observation == { + "effective_action": "heartbeat_settled_skip", + "trigger_kinds": [], + } + assert len(executed) == 3 + + with pytest.raises(ValueError, match="vision_closeout_already_settled"): + dispatch_vision_closeout( + "loopx quota spend-slot --binding obligation-a --turn-instance-id turn-a", + state, + execute=execute, + ) + + +def test_refresh_state_without_spend_waits_for_explicit_spend_slot(tmp_path) -> None: + state, index_path, expected_identity = _vision_closeout_state(tmp_path) + writeback_row = { + "classification": "bounded_replan_progress", + "autonomous_replan_ack": {"semantic_delta": {"accepted": True, "obligation_id": "obligation-a"}}, + "vision_checkpoint": {"satisfied": True}, + "settlement_identity": expected_identity, + } + spend_row = {"classification": "quota_slot_spent"} + + def execute(command, **_kwargs): + if "refresh-state" in command: + index_path.write_text(json.dumps(writeback_row) + "\n", encoding="utf-8") + return json.dumps({"ok": True, "appended": True}) + if "spend-slot" in command: + with index_path.open("a", encoding="utf-8") as stream: + stream.write(json.dumps(spend_row) + "\n") + return json.dumps({"ok": True}) + if "quota should-run" in command: + return json.dumps({"ok": True, "effective_action": "heartbeat_settled_skip"}) + raise AssertionError(f"unexpected command: {command}") + + _, kind, completed = dispatch_vision_closeout( + "loopx refresh-state --binding obligation-a --turn-instance-id turn-a " + "--agent-vision-json vision.json", + state, + execute=execute, + ) + assert kind == "semantic_replan_writeback" + assert completed is False + assert state.vision_closeout == { + "checkpoint_satisfied": True, + "bound_writeback": True, + "settled": False, + } + + _, spend_kind, spend_completed = dispatch_vision_closeout( + "loopx quota spend-slot --binding obligation-a --turn-instance-id turn-a", + state, + execute=execute, + ) + assert spend_kind == "quota_spend_slot" + assert spend_completed is True + assert state.vision_closeout["settled"] is True