Skip to content

perf(control-plane,cli): shrink todo/envelope wire bloat and defer heavy CLI imports - #9504

Merged
huangruiteng merged 2 commits into
mainfrom
codex/s1-startup-interaction-slim-20261127
Nov 26, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/s1-startup-interaction-slim-20261127

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Summary

Eliminates large redundant todo.read / quota.turn_envelope.evaluate RPC wire payloads and defers heavy cold-start Python module imports (loopx.history, loopx.cli, worker_branch_plan, explore_results, heartbeat_prompt) across loopx.entrypoint without altering CLI/control-plane semantics.

1. Control-Plane RPC Wire Slimming (TypeScript + Python Adapter)

  • canonical_fields >1 MiB gzip transport (loopx/control_plane/todos/read_transport.ts): Widened canonical_fields gzip compression eligibility in readTodoRuntime from 1 MiB (1024 * 1024) to completeBytes, matching quota_projection.
  • Opt-out include_acceptance=false for non-acceptance consumers (read_projection.ts, read_transaction.ts, list_readback.py): Exported typed includeTodoAcceptance(input, query) validation (rejecting non-booleans and top-level vs query.include_acceptance conflicts) so non-acceptance list_goal_todos(..., include_acceptance=False) callers omit repeated goal_acceptance_contract / canonical_acceptance / source_projection blobs while keeping identical todos, first_executable_items, goal_acceptance_guard, and authority_read. Updated read-only callers in pr_wait_reconcile.py, pr_gate_reconcile.py, turn_context.py, heartbeat_prequota.py, and explore.py (todo-branch-plan, worker-branch-plan); callers reading goal_acceptance_contract (live_decision_replan.py) retain the True default.
  • compose_complete >1 MiB source transport (turn_envelope_codec.ts, turn_envelope.py): Raised pack_turn_source raw JSON threshold from 1 MiB to 16 MiB (with a 2 MiB encoded base64 cap) and decodeTurnSource limits to 2 MiB encoded / 64 MiB inflated JSON so >1 MiB compressible turn sources stay inline-compressed over TCP instead of falling back to uncompressed JSON.

2. Cold CLI & Command Startup Deferral

  • Per-symbol PEP 562 lazy exports (loopx/cli_commands/__init__.py): Replaced eager _load_exports() with _EXPORT_SUBMODULES __getattr__ lookup so importing one handler from loopx.cli_commands no longer imports unrelated command modules (quota, benchmark_dispatch, explore, etc.).
  • Selected entrypoint dispatch for explore (cli_runtime.py, explore.py, explore_planning_commands.py, explore_feishu_commands.py, harness_gate.py, explore_singleflight.py, turn_context.py, agent_registry.py): Added explore to _SELECTED_COMMANDS, moved worker/branch planner profile constants and board schema constants into lightweight leaf owners (harness_gate.py, explore_singleflight.py) with re-exports preserving backwards compatibility, deferred explore_results, todo_branch_plan, presentation.explore_views, and registry_codec.load_registry switches so explore --help and explore turn-context (when harness is off) no longer load loopx.cli, loopx.history, worker_branch_plan, or explore_results.
  • heartbeat-prequota & issue_fix light registry loading (support_control_heartbeat.py, support_control_registry.py, heartbeat_prequota.py, pr_gate_reconcile.py, pr_lifecycle_rollout.py, pr_review_ack.py, pr_wait_reconcile.py): Switched registry loads from loopx.history.load_registry to registry_codec.load_registry and deferred heartbeat_prompt / SchedulerRuntimeProfile / execution_profile out of heartbeat-prequota.

Paired Base (50b4cc9de4) vs Head (73875782db) Measurement

Measured sequentially in isolated worktrees on a synthetic 81-outcome / 662-todo SQLite fixture (loopx.entrypoint):

  • quota should-run --codex-app --context-delivery on total RPC wire (req + res): 11,824,834 B -> 6,106,744 B (-48.4%; req: 5,194,035 B -> 3,355,320 B, res: 6,630,799 B -> 2,751,424 B)
    • todo.read:canonical_fields response: 2,082,729 B -> 72,148 B (-96.5%)
    • todo.read:query (3 calls) response: 1,912,103 B -> 43,295 B (-97.7%)
    • quota.turn_envelope.evaluate:compose_complete request: 1,923,145 B -> 84,338 B (-95.6%)
    • (Note: single-shot Python RPC probe wall time was 5.9433s -> 7.7643s under level-1 compression + loopback cold Node setup; plain quota should-run CLI median dropped 3.6065s -> 3.2947s.)
  • Cold CLI wall time (median of 3 runs via python -m loopx.entrypoint, byte-identical stdout):
    • --version (12 B): 0.1445s -> 0.0547s (-62.1%)
    • explore --help (2,790 B): 3.0866s (runs [19.7342, 3.0866, 1.1036]) -> 0.1271s (runs [0.3601, 0.1101, 0.1271], -90.0% warm)
    • explore turn-context (13,752 B): 1.6667s -> 0.8481s (-49.1%)
    • heartbeat-prequota (2,900 B): 0.8656s -> 0.5592s (-35.4%)

Verification

  • TypeScript (tsc + node --test): npm run typecheck:control-plane (0 errors); 158/158 passed across todo_read.test.ts (including new File/SQLite include_acceptance=false parity/conflict and >1 MiB canonical_fields gzip compression tests), turn_envelope.test.ts (including >1 MiB decodeTurnSource + compose_complete round-trip/limit tests), turn_capability_context.test.ts, global_todo_readiness.test.ts, explore_turn_context.test.ts, and pr_wait_observation.test.ts.
  • Python (pytest, ruff, mypy):
    • ruff check on all 25 changed .py files: All checks passed!
    • mypy --follow-imports=silent on all 17 [tool.mypy] files (Success: no issues found in 17 source files) and 10 cleanly typed modified .py modules (Success: no issues found in 10 source files).
    • scripts/check_rfc_bilingual.py --base origin/main --head HEAD & --staged: passed.
    • loopx check --scan-path ...: errors=0, checks=6, 1703 files scanned.
    • Pre-final lint cleanup full suites: 641 passed across test_cli_entrypoint.py, test_todo_read_response_transport.py, test_long_history_todo_reads.py, test_turn_envelope_budget_warning.py, test_complete_numeric_transport.py, test_heartbeat_cli.py, test_heartbeat_prompt_support.py, test_source_cli_entrypoint.py, test_explore_turn_context.py, test_issue_fix_pr_gate_reconcile.py, test_pr_wait_observation.py, test_pr_wait_lifecycle.py, test_explore_worker_evidence.py, test_lark_sink_visibility_owner.py, plus test_core_distribution.py -k "not installed_core" (2 passed, 57 deselected).
    • Post-final-edit re-runs: 239 passed (test_heartbeat_cli.py, test_heartbeat_prompt_support.py, test_long_history_todo_reads.py, test_explore_worker_evidence.py, test_explore_turn_context.py, test_issue_fix_pr_gate_reconcile.py, test_pr_wait_observation.py, test_pr_wait_lifecycle.py) + 5 passed, 300 deselected (test_cli_entrypoint.py -k "cli_commands_package or selected_explore").
  • Canary & CQR: Goal change-quality (cqr_2f9e55bf657ee2077634) valid (decision=pass); canary premerge --tier standard --from-git-diff --git-diff-base origin/main passed (direct_checks 4/4, python_compile 1/1, catalog_canaries 10/10, risk_profile_smokes 8/8, gate.status=passed, merge_gate_passed=True).

…avy CLI imports

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

[P2] 惰性加载同时扩大了 standalone Core 的命令面。独立从基线与候选构建并安装两个 loopx-core wheel。在没有 loopx.cli 或 companion wheel 的环境中,基线目录没有 explore,实际读取与帮助均退出 2。候选目录新增 explore,真实 turn-context 返回 0,并登记普通包的全部 Explore 子命令。候选只声明加载优化,未解释新增的独立发行面。 把 selected Explore 的注册与 standalone Core 支持判定分开。若只优化现有普通安装,Core 保持既有拒绝。若要扩大 Core 支持,请说明该交付意图并补安装态、既有 Goal/Agent 与扩展权限的端到端验收。 源码

动机 / Motivation

削减大 Goal 的 Todo/Turn RPC 冗余和 CLI 冷加载,同时保持目前的发行和调用契约。 基线使用有界未压缩内联和完整 Python CLI facade。独立 Core 只暴露当前选定的命令集合。 大 Goal 的调度与只读消费者、普通 CLI 及 standalone Core 的维护者和用户。

大 Goal 会重复付出验收 transport 成本,节省数据在双后端已见。Core 的路由公开后会产生用户依赖和后续兼容成本。 在真实 File 和 SQLite 的同一份 112-outcome 快照上,quota should-run 仍带回全部 112 个 outcome,历史显式详情仍有 8 个要求。探针记录的 Todo/Turn RPC 线缆从约 3.97 MB 降至约 196 kB;todo list 的用户结果、explore turn-context、prequota 结果与 canonical revision、记录和租约未变。 定向 Node 基线 151 项、候选 155 项通过;候选 Python 47 项通过。额外实测两个完全独立的 Core wheel 和 File/SQLite 的实际 transport。 证据来自隔离试验、实际 Node/Python RPC、两种本地 provider 及完整 Core wheel。未测托管 CI、生产时延、或新增 Explore 工作流的外部写路径。 验收契约

改动思路 / Approach

该改动沿用 loopx.entrypoint / quota CLI → Python adapter → 原 TypeScript todo.read/Turn composition → canonical File/SQLite。继续复用原事务、注册和压缩协议。问题在轻量加载集合也被 Core 用作能力表,单点加名改变了发行契约。 接受者仍逐项拿到相同 canonical 事实;省略 acceptance 限于内部已明确选择的消费者。独立 Core 的 selected 集合意外扩展整组命令。 给 monolithic Explore 增加选定加载时保留原 Core 路由和目录;无需第二套解析器或 RPC。

具体改动 / Changes

精确提交 7387578,本次对照目标 50b4cc9。30 文件 +997/−417。回归覆盖占 510 行以上;主体为一组传输边界扩展、按符号惰性加载及既有 Explore 模块重排。

关键代码讲解

  • _SELECTED_COMMANDS。把 explore 加入后,独立 Core 从原拒绝变为实际读回并加入目录。 源码

  • includeTodoAcceptance。保持默认完整,校验顶层及下层的布尔值和冲突。 源码

  • pack_turn_source。压缩 1 MiB 以上的样本,真实 RPC 对照保留全部验收项。 源码

  • canonical_fields 压缩。按现有 bounded codec 输出,比较实际 wire 字节与解码读回。 源码

  • lossless-wire-with-stable-distribution(not_met)。同样 canonical 事实、输出和明确的发行入口。已安装 Core 的目录及操作选择遵循其支持边界。

对主干的风险 / Risks

独立从基线与候选构建并安装两个 loopx-core wheel。在没有 loopx.cli 或 companion wheel 的环境中,基线目录没有 explore,实际读取与帮助均退出 2。候选目录新增 explore,真实 turn-context 返回 0,并登记普通包的全部 Explore 子命令。候选只声明加载优化,未解释新增的独立发行面。 新增发行面上的后续兼容和测试义务。当前实测未观察到新的执行权限。 把 selected Explore 的注册与 standalone Core 支持判定分开。若只优化现有普通安装,Core 保持既有拒绝。若要扩大 Core 支持,请说明该交付意图并补安装态、既有 Goal/Agent 与扩展权限的端到端验收。

我的整体评价 / Verdict

REQUEST_CHANGES。 线缆优化由真实 File/SQLite 对照支持。请把既有发行范围与加载优化分开,或明确交付 Core 支持并补合适的资格。 大 Goal 可以保留实质验收并减少传输。应在现有发行面中交付优化。

English verdict: REQUEST_CHANGES at 7387578. Wire savings and lossless File/SQLite readback are verified. The exact standalone wheel unexpectedly adds the entire Explore CLI group, including a successful real read. Preserve the previous distribution boundary or explicitly qualify the expansion.

Comment thread loopx/cli_runtime.py Resolved
…rdinary lazy dispatch

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

减少大型 Goal 的 Todo 和 Turn envelope 传输量,延后普通 CLI 的重导入,保留既有的发行命令边界。 基线的大批验收事实以更大的 RPC 传输。上一候选把普通安装的 Explore 快速入口同时注册给独立 Core,扩大了发行命令面。 大型 Goal 的日常读回调用方、普通 LoopX CLI 用户与 standalone Core 使用者。

重复传输在大型验收集上增大 RPC 成本。若同时扩大独立 Core 功能,维护者还须承担新的发行和兼容验证。 隔离 File/SQLite 的 112 条验收与选中 Todo 动作逐一一致,canonical revision、读模型和租约无变化。新候选仍能通过普通 CLI 读取 Explore,同一批被采样 RPC 从约 3.97 MB 降到约 196 KB。 精确候选 158 项 TypeScript 回归、6 项 CLI 定向用例通过。再次用真实 Core wheel 观察目录和三个不提供路径,并在普通安装验证真实读取。 数量只覆盖配对夹具和被采样的两种 RPC。生产分布、总体延迟与远端 CI 未独立核验。 验收契约

改动思路 / Approach

该改动沿用 loopx.entrypoint → 分发选定命令;todo.read 和 quota.turn_envelope.evaluate → 原有本地授权读回。把普通安装专用的 Explore 留在快速分发路径,在独立 Core 中复用旧版可用性判断。显式 acceptance 默认保持完整,受限压缩只改变 wire 表示。 发行面、解析路径与传输角色分别由已有判断持有。只读调用方显式否决重复验收,调用方缺省仍取完整事实。 继续用现有 _standalone_core 判断,普通快路径不进入 Core 支持列表。统一复用既有解码流程。

具体改动 / Changes

精确提交 2441f6d,本次对照目标 50b4cc9。31 个文件,+1028/−421。集中在有界传输、验收选择和分发,当前修复增量只改发行分发与回归。

关键代码讲解

  • _run_command。Explore 快路径要求普通安装,独立 Core 复用原拒绝。 源码

  • includeTodoAcceptance。默认继续完整验收,显式关闭时只省掉无用分支,校验冲突和类型。 源码

  • readTodoRuntime。复用有界 gzip 传输大量 canonical 字段。 源码

  • pack_turn_source。扩大可压缩源范围,TypeScript 解码仍按明确大小上限。 源码

  • CLI lazy exports。已有 API 按符号加载,缩短普通 Explore 和前置入口导入。 源码

  • lossless-wire-with-stable-distribution(implemented)。现有发行的命令面与真实 canonical readback 保持一致。普通安装 Explore 性能调整仅影响加载。

对主干的风险 / Risks

安装两个精确版本的独立 Core wheel,无 companion 和 loopx.cli。基线和候选均从 commands 隐去 Explore,help、turn-context 和 worker-branch-plan 帮助保持退出 2。 样本测量不能代表任务分布中的总体延迟和成本。Core 与普通安装的双分支会持续依赖两个发行基准。 对独立 Core 与普通安装分别执行目录、实读和拒绝回归,同时比对配对完整验收。

我的整体评价 / Verdict

APPROVE。 现有独立 Core 命令面的阻塞项已关闭。普通 Explore 的成功读取及 File/SQLite 验收保持。 发行边界恢复后,可以在不扩大发行契约的情况下降低重复传输。

English verdict: APPROVE at 2441f6d. Approve the exact head. Standalone Core keeps Explore out of its catalog and rejects all three direct invocations, while the ordinary CLI and complete File/SQLite readback still work.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · Gemini · Google DeepMind · self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

未发现阻塞性问题(no blocking findings)。剩余边界风险:本轮独立复核了 PR 9504 的代码语义、TypeScript/Python/架构回归套件、独立打包安装的 loopx-core==2.4.1 发行边界、File 与 SQLite 后端对比、>1 MiB 压缩往返与 sys.modules 惰性加载验证;未单独重跑作者记录的冷启动墙钟耗时秒数及 81-outcome/662-todo quota should-run 全量压测统计,也未等待或查询远端 GitHub Actions CI(wait_for_ci: false)。

动机 / Motivation

高频调用 list_goal_todos、quota should-run、explore 与 heartbeat-prequota 的大型 Goal 调度/只读消费者、普通安装 CLI 用户,以及依赖最小命令边界的 standalone loopx-core 发行版运维与调用方。

在基准提交 50b4cc9 上,读取大量 Todo 的非 acceptance 消费者每次都重复接收 goal_acceptance_contract / canonical_acceptance / source_projection 大块载荷,超过 1 MiB 的 canonical_fields 与 pack_turn_source 回退未压缩传输,且 cli_commands 与 explore / heartbeat-prequota 会急切加载完整 CLI 与历史模块;在精确提交 2441f6d 上,上述路径在不改动默认对外契约的前提下实现按需压缩、opt-out 省略与按符号惰性加载,并将 fast explore 分发限制在普通安装中以保留 standalone Core 对 explore 的既有拒绝边界。

实测 TypeScript 158/158 与源码 Python 677/677 全部通过,File 与 SQLite 双后端上的 list_goal_todos(include_acceptance=False) 在保留完整 todos 与 authority_read 的同时省去 source_projection 与 acceptance 载荷,1,485,050 B 完整来源经 pack_turn_source 压缩为 11,220 B 并通过 decodeTurnSource 无损解码,独立构建安装的 loopx-core==2.4.1 在 commands 中不暴露 loopx explore 且 explore --help 与 explore turn-context 均以退出码 2 拒绝。 非目标方面:不扩大 standalone loopx-core 支持的命令范围、不改变 list_goal_todos(include_acceptance=True) 默认返回值或已有存储格式、不声明未经本轮独立复测的冷启动毫秒计时或远端 GitHub Actions CI 状态。

改动思路 / Approach

普通安装 CLI / 内部调用 ──► cli_runtime._run_command (not _standalone_core())
                              ├─ _FULL_INSTALL_SELECTED_COMMANDS ("explore") ─► 惰性解析/执行(不加载 loopx.cli / loopx.history)
                              └─ standalone loopx-core wheel ─────────────────► 跳过 fast path -> _run_full_cli -> exit 2 拒绝

Todo / Turn RPC 传输 ───────► TS read_projection / read_transaction / read_transport / turn_envelope_codec
                              ├─ includeTodoAcceptance: 仅显式 include_acceptance=false 省略 acceptance/source_projection;布尔冲突 fail closed
                              └─ canonical_fields (<=completeBytes gzip L1) & pack_turn_source (<=16 MiB raw / <=2 MiB b64) 无损往返

图示基于精确头 2441f6d15f 源码路径整理(cli_runtime.py、read_projection.ts、read_transport.ts、turn_envelope_codec.ts),用于说明路由与边界隔离而非替代测试证据。

架构与复用评估: TypeScript 控制面继续唯一校验 includeTodoAcceptance、compression 与 decodeTurnSource 边界,Python cli_runtime 严格区分普通安装惰性加速集合与 standalone Core 发行目录而不增设第二命令权威或状态。 常量搬迁仅下沉至叶子 owner(harness_gate.py、explore_singleflight.py)并通过 worker_branch_plan.py、todo_branch_plan.py、explore_results.py 原名重导出,历史外部导入方与内部直连方均兼容;registry_codec.load_registry 替代 loopx.history.load_registry 直接复用底层的注册表编解码器(loopx/history.py 本身即重导出同一函数),不新增状态模型、不增设兼容分支或缓存副作用。

当前PR边界:仅对已确认无需 acceptance 合同的内部只读调用方显式传入 include_acceptance=False、放宽已有 lossless gzip/deflate codec 阈值并将普通安装下的 cli_commands / explore / heartbeat-prequota 改为惰性加载,保持 standalone Core 与默认契约不变。

具体改动 / Changes

对照规范 packages/loopx-core/README.md(基准提交 50b4cc9de43498b57c8589c1bda03a787762416a)与当前精确头 2441f6d15f5fb7a7d52dc8e4b558c9ed9b24c6ff,基础分叉 50b4cc9de4..2441f6d15f 共改动 31 个文件(+1028/-421),其中最新提交 2441f6d15f 在不回退惰性启动收益的前提下专修上一轮 PRRT_kwDOStEbEs68hUm4 指出的 standalone Core 命令面泄漏:

  • core-cli-isolation(implemented):_FULL_INSTALL_SELECTED_COMMANDS 与 _run_command 将 "explore" 从 _SELECTED_COMMANDS 分离,独立 Core wheel 的 _available_selected_commands() 不包含 explore,由 test_core_distribution.py 与实装 loopx-core==2.4.1 验证。
  • lossless-wire-slimming(implemented):includeTodoAcceptance(read_projection.ts / read_transaction.ts / list_readback.py)与 readTodoRuntime / pack_turn_source / decodeTurnSource 由 158/158 TS 与 File/SQLite 探针验证。
  • ordinary-lazy-parity(implemented):cli_commands/__init__.py 按符号惰性加载与 explore / heartbeat-prequota / issue_fix 模块拆解由 test_cli_entrypoint.py 306/306 与基准/候选字节一致探针验证。

关键代码讲解

  • _FULL_INSTALL_SELECTED_COMMANDS 与 _run_command:将 "explore" 从 _SELECTED_COMMANDS 移入 _FULL_INSTALL_SELECTED_COMMANDS 并在 _run_command 以 not _standalone_core() 门控。普通全量安装保留快速惰性调度;独立 loopx-core wheel 因 _available_selected_commands() 仅读 _SELECTED_COMMANDS,在 commands --format json 中隐藏 loopx explore 且执行 explore 时回落 _run_full_cli 报 "unavailable in the standalone core"(退出码 2)。
  • includeTodoAcceptance 与 projectCanonicalTodoFields / todoListPayload:集中校验顶层与 query.include_acceptance 的布尔类型并拒斥二者冲突;仅当明确传入 false 时省略 goal_acceptance_contract、source_projection 与 canonical_acceptance,默认保持 true,todos、first_executable_items、goal_acceptance_guard 与 authority_read 在 File/SQLite 上完全一致。
  • readTodoRuntime canonical_fields 压缩 与 pack_turn_source / decodeTurnSource:前者把 canonical_fields 的 gzip level-1 压缩窗口从 1 MiB 放宽至 completeBytes 并要求 base64 后仍显著缩减才切换分片,后者将未压缩来源上限放宽至 16 MiB(编码上限 2 MiB、TS 解压校验上限 64 MiB),保持与既有 deflate-base64-json-v0 codec 的严格 UTF-8 与尾部字节校验。
  • _EXPORT_SUBMODULES 与 __getattr__:用符号到子模块名映射表取代全量 _load_exports(),按需 import_module 单一命令模块(保留 __all__ 与 __dir__ 全部 100 个历史导出);配合 harness_gate.py、explore_singleflight.py 与 registry_codec.load_registry,消除 explore 与 heartbeat-prequota 对 loopx.cli、loopx.history 等重模块的连带导入。

对主干的风险 / Risks

  • 重导出兼容与模块延迟导入边界: cli_commands.__init__ 与 explore / issue_fix 仅延迟模块加载时机,未修改子命令注册签名与导出集合;独立探针确认执行 explore --help、explore turn-context 与 heartbeat-prequota 后 sys.modules 均未加载 loopx.cli、loopx.history、worker_branch_plan、explore_results 或 heartbeat_prompt,且相对于 50b4cc9de4 的业务 JSON / 帮助文本输出字节级一致(仅临时目录摘要与 duration_ms 因运行环境而异)。
  • 独立 Core 与受限环境降级: 在缺失 loopx.cli 的自建 loopx-core==2.4.1 环境中,commands --format json 不再列出 explore,且 explore --help / explore turn-context 稳定返回退出码 2;live_decision_replan.py 等真正消费 goal_acceptance_contract 的调用方保持默认 include_acceptance=True,只有 pr_wait_reconcile、pr_gate_reconcile、turn_context、heartbeat_prequota 与 explore 的 todo/worker-branch-plan 传 False,不存在静默吞字段风险。mypy --follow-imports=silent 在未修改行 pr_lifecycle_rollout.py:93-96 与 pr_gate_reconcile.py:507-528 仍存在 8 处既有的 dict | None 空值注解告警(其余 8 个修改源文件零错误);git merge-tree 对最新 origin/main@ff55255012 可干净合并(8e3d9a6e87,0 冲突)。

语义与 CI 对齐

本 PR 不新增领域状态枚举,复用既有 deflate-base64-json-v0 协议、registry_codec.load_registry 与 cli_runtime 的独立 Core 识别机制;control-plane-maintainability-ratchet-smoke.py(unreviewed_count=0)、semantic-vocabulary-drift-smoke.py、check_rfc_bilingual.py 与 ruff check 均通过。按 Goal 策略 wait_for_ci: false,未轮询远端 CI。

我的整体评价 / Verdict

APPROVE。 该方案在不改变默认对外语义、不扩大 standalone loopx-core 发行边界的前提下,实质消除了大 Goal 读取 acceptance 冗余与多处 CLI 启动连带加载,并对超过 1 MiB 的可压缩 Todo/Turn 负载恢复了有界压缩传输,且上一轮阻塞问题 PRRT_kwDOStEbEs68hUm4 已在 2441f6d15f 修复并经独立 wheel 实测确认。

  • 长程与用户体验判断: long_horizon 为 improved——减少大 Goal 周期唤醒与调度阶段的冗余传输与冷加载,且不削弱 live_decision_replan 与标准读取的完整性;user_experience 为 preserved,visual_review 为 not_applicable(本次仅涉及 CLI 启动分发、Python 模块导出与 Control-Plane RPC 传输编解码,无 Web UI 或视觉渲染变更;未验证范围 unverified_scope:未独立重测作者记录的冷启动墙钟耗时秒数与 81-outcome/662-todo quota should-run 全量压测,也未等待或查询远端 GitHub Actions CI)。
  • 验证收据: npm run typecheck:control-plane (PASS, 0 errors);control_plane_ts 6 套测试 (PASS, 158/158);16 套 Python CLI/传输/explore/pr-wait/架构套件 (PASS, 677/677 in 286.04s);自建 loopx-core==2.4.1 独立 wheel 测试与实装 explore 拒绝验证 (PASS, test_core_distribution.py 3/3 + commands/explore 拒绝 probe);基线 50b4cc9de4 vs 审查头 2441f6d15f File/SQLite include_acceptance=False、>1 MiB 压缩往返及 sys.modules 惰性探针 (PASS);ruff check、mypy 8/10 无误(2 文件 8 处既有未改行提示)、check_rfc_bilingual.py、maintainability-ratchet、semantic-vocabulary-drift 与 394 文件 loopx check (PASS, 0 errors)。

English verdict: APPROVE at 2441f6d. Verified that standalone loopx-core preserves explore unavailability while ordinary installs lazily dispatch explore/heartbeat-prequota without loading loopx.cli/history, and lossless File/SQLite acceptance opt-out plus >1 MiB wire compression hold (TS 158/158, Python 677/677, core wheel isolation probe passed).

@huangruiteng
huangruiteng merged commit f67d0c8 into main Nov 26, 2026
9 of 11 checks passed
@huangruiteng
huangruiteng deleted the codex/s1-startup-interaction-slim-20261127 branch November 26, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants