Skip to content

feat(host): add host-loop parity walkthrough smoke for GH-C70 - #3118

Closed
rootkiller6788 wants to merge 2 commits into
huangruiteng:mainfrom
rootkiller6788:feat/gh-c70-host-loop-parity
Closed

feat(host): add host-loop parity walkthrough smoke for GH-C70#3118
rootkiller6788 wants to merge 2 commits into
huangruiteng:mainfrom
rootkiller6788:feat/gh-c70-host-loop-parity

Conversation

@rootkiller6788

Copy link
Copy Markdown
Contributor

Summary

Issue Or Task

  • Closes #
  • Contributor task ID:

Validation

  • python3 -m py_compile loopx/*.py
  • loopx check --scan-root .
  • Other:

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Boundary Checklist

  • I did not commit .loopx/, .codex/goals/, live ACTIVE_GOAL_STATE.md, credentials, private benchmark traces, verifier output, raw agent sessions, internal document links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Review PR #3118 — exact head bbe45f62dd120a8bba03c61f2ad4330fb047462b

详细中文评审

动机

该 PR 为 GH-C70 补充 host-loop parity walkthrough smoke,证明同一份合成 quota envelope 在 codex-cli / claude-code / generic-cli 等 host 上产生一致的 Turn 计划、receipt 身份、结算身份与 disposition,并覆盖 signed action selection、bounded budget、execution committed、receipt validation、replan delta 与 public safety。这些是 Turn 驱动链路中跨 host 一致性的关键契约;此前缺少一条可运行、可回归的公开示例路径,本 PR 用 15 个场景覆盖。

改动思路

新增单文件 examples/host-loop-parity-walkthrough-smoke.py(+648),不触碰产品代码。示例直接调用真实模块:build_turn_envelopebuild_loopx_turn_planbuild_loopx_turn_transaction_planbuild_loopx_turn_command_validatordecide_loop_dispositionbuild_loopx_turn_host_requestbuild_host_mode_planloopx_turn_execution_committedvalidate_loopx_turn_receipt,并使用 ValidatedTurnReceipt.from_executionBoundedTurnBudget。15 个场景按信封签名 → 计划/交易 → disposition → 预算/执行 → receipt 校验 → host 模式 → 公共边界的顺序组织;每个载荷都经过 _assert_public_safe

具体改动

关键内容讲解

  • 场景 1(signed action selection):action_signature.source_hash == envelope_hash,不同 todo 产生不同 hash。
  • 场景 2/3/4(计划与交易):codex-cli/claude-code 走 READY_FOR_HOST,generic-cli 走 isolated-headless;transaction phases 含 host_execute/typed_result/validation/durable_writeback/quota_spend;settlement_plan.ordered_steps 均绑定 $.identity.effect_id;不同 host 的 turn_key 不同但结算身份一致,planned=False 时无 phases。
  • 场景 5(independent validation):build_loopx_turn_command_validator 返回 host 无关的 TaskValidator,并真实 spawn 子进程校验。
  • 场景 6/7/8/9/14(disposition):run_now/terminal/wait/replan 与 BoundedTurnBudget 归零后的 replan、以及 replan 携带 todo_delta/vision_delta/fresh_envelope_required
  • 场景 10/11/12/13(host request / host mode / committed / receipt):loopx_turn_host_request 投影同一 identity;build_host_mode_plan 映射 visible_tui 与 isolated_headless_turn;execution committed 校验 state/quota 持久效果;validate_loopx_turn_receipt 校验 turn_key 与 phase 顺序。
  • 场景 15(public safety):envelope/plan/host_req/txn 全部 public-safe,且显式断言无 bearer

对主干的风险

  • 阻断项(可复现的示例失败):场景 5 的 validator 命令硬编码裸 python,并断言 receipt 状态必须属于 ("passed", "inconclusive", "unavailable")。在本评审环境(python 解析为 xcode-select stub,退出码 72)中,该场景实测失败:receipt["status"] == "failed"recovery_kind == "repair_required",示例 1/15 不通过。turn_driver 的 validator 本身行为正确(对非零退出码如实返回 failed/repair_required),问题在示例的 interpreter 假设与断言过窄:walkthrough 应使用 sys.executable(运行示例的解释器)作为 validator 命令,或把 failed 视为合法结果并断言其对应非零退出码。
  • 其余 14 个场景在 exact head 本地全部通过;git diff --check 干净;CI dependency-review SUCCESS、pytest IN_PROGRESS(该示例不在 pytest 覆盖内)。
  • 无产品代码改动,不新增抽象;真实 Turn 驱动 API 均有活跃调用方,scope-fit 成立。
  • 公开边界:所有断言覆盖序列化载荷,无原始 session/路径/凭据。

我的整体评价

方向正确、覆盖面完整,但作为“贡献者可直接运行”的 walkthrough,示例必须在没有裸 python 的主机上也能通过;当前 1/15 场景在真实环境失败。请把场景 5 的 validator 命令改为 sys.executable(并相应调整状态断言,例如接受 failed 并断言 exit_code != 0recovery_kind == repair_required)。修复后即可放行;届时无需重新评审其余场景。

English Verdict

REQUEST_CHANGES — exact head bbe45f62dd120a8bba03c61f2ad4330fb047462b.

Key finding: the walkthrough is a contributor-facing runnable example, but scenario 5 hardcodes the bare python executable and only accepts passed/inconclusive/unavailable; on hosts where python is a stub or missing (verified here: xcode-select shim, exit 72), the validator correctly returns failed/repair_required and the smoke fails 1/15 at the exact head. Use sys.executable for the validator command (or accept failed and assert its non-zero exit semantics). The other 14 scenarios pass locally; no product code is touched.

Validation: local run of examples/host-loop-parity-walkthrough-smoke.py → 14/15 pass, scenario 5 fails with status=failed, exit_code=72; git diff --check clean; CI dependency-review SUCCESS, pytest pending.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Re-review PR #3118 — exact head 2b17499cc76987bf1641cef6830b6115ca072f05

详细中文评审

动机

这是对评审 4913899067(REQUEST_CHANGES)的复审。上一轮的唯一阻断项是场景 5 的 validator 命令硬编码裸 python 且断言过窄:在 python 解析为 stub/缺失的主机上,非零退出码会让示例 1/15 失败。作者提交 2b17499c 后,validator 改用 sys.executable,并同时覆盖 pass 与 fail 两条路径。本复审确认阻断项闭环,并重新验证全部 15 个场景。

改动思路

新 head 只改一个文件 examples/host-loop-parity-walkthrough-smoke.py(+25/-9):场景 5 的 build_loopx_turn_command_validator 命令从裸 python 改为 [sys.executable, "-c", "import sys; sys.exit(0)"];新增 fail_validator(sys.exit(3) + failure_recovery_kind="repair_required"),并分别断言 passed["status"] == "passed"exit_code == 0failed["status"] == "failed"exit_code == 3recovery_kind == "repair_required"。其余 14 个场景与产品代码均未改动。

具体改动

关键内容讲解

  • pass_validator:用运行示例的解释器执行 sys.exit(0),断言 receipt status == "passed"exit_code == 0——在任何有可用解释器的主机上都不依赖 python PATH。
  • fail_validator:用同一解释器执行 sys.exit(3),断言 status == "failed"exit_code == 3recovery_kind == "repair_required"——把上一轮“failed 是合法 validator 结果”的观察固化为正向断言,而不是放宽为集合成员判断。
  • public-safe 断言更新为 {"pass_status", "fail_status"},仍走 _assert_public_safe

对主干的风险

  • 阻断项已解决:示例在本评审主机(裸 python 为 xcode-select stub、退出码 72)上 15/15 全部通过,git diff --check 干净。
  • 无产品代码改动,不新增抽象;turn_driver 的 validator 行为与之前一致(非零退出码 → failed/repair_required)。
  • CI dependency-review SUCCESS、pytest 此前 IN_PROGRESS;该示例不在 pytest 覆盖内,但本地已独立验证完整 walkthrough。
  • 公开边界保持:仅聚合状态字段进入断言,无原始 session/路径/凭据。

我的整体评价

同意合并(APPROVE)。作者完整闭环了上一轮反馈:sys.executable 让 walkthrough 在任何主机可运行,pass/fail 双路径断言把 validator 的真实行为固化下来。当前 head 15/15 场景本地通过,变更聚焦且可逆。合并仍走 loopx-pr-merge。

English Verdict

APPROVE — exact head 2b17499cc76987bf1641cef6830b6115ca072f05.

Key finding: the prior blocker is resolved — the validator command now uses sys.executable, and scenario 5 asserts both the zero-exit pass path (passed, exit_code 0) and the non-zero fail path (failed, exit_code 3, recovery_kind repair_required). The full walkthrough passes 15/15 locally at the exact head (previously 14/15 on this host), and git diff --check is clean. No blockers remain.

Validation: local run of examples/host-loop-parity-walkthrough-smoke.py → 15/15 ok at the exact head; CI dependency-review SUCCESS, pytest pending.

@rootkiller6788
rootkiller6788 force-pushed the feat/gh-c70-host-loop-parity branch from 2b17499 to d8d2893 Compare August 12, 2026 08:09

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Re-verification — PR #3118 — exact head d8d2893374218932edaa2eb9974b67312ebe2fc6

复审结论(中文)

新 head d8d28933 是对更新后 main 的 rebase:examples/host-loop-parity-walkthrough-smoke.py 与已批准 head 2b17499c 逐字节一致(空 diff),包含此前的 sys.executable validator 修复与 pass/fail 双路径断言。在 exact head 本地运行 15/15 场景全部通过,git diff --check 干净。上一轮 APPROVE(review 4914134305)结论继续成立;无新增阻断项。

Re-verification Verdict (English)

Approval stands — exact head d8d2893374218932edaa2eb9974b67312ebe2fc6.

The new head is a rebase onto updated main; the PR file is byte-identical to the previously approved 2b17499c (empty diff for the touched file). The walkthrough passes 15/15 locally at the exact head and git diff --check is clean. No new findings; prior APPROVE (4914134305) remains valid.

Validation: local run of examples/host-loop-parity-walkthrough-smoke.py 15/15 ok at d8d28933; PR-file diff vs approved head empty.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

详细中文评审(durable_smoke_value 门槛)

精确评审头: 3118@d8d2893374218932edaa2eb9974b67312ebe2fc6

动机

本 PR 是单文件 examples/host-loop-parity-walkthrough-smoke.py(+664 行),演示 host-loop parity。按 durable_smoke_value 门槛,例程类 PR 必须证明对仓库/产品的真实、持久价值;本 PR 不满足。

改动思路

15 个 scenario 覆盖 host-loop parity、replan disposition、public safety 等。作为演示自洽,但 host parity 已有专门测试覆盖,且与同一作者的 #3130(805 行 host fake-fixture parity,已 REQUEST_CHANGES)主题重复。

具体改动(关键内容讲解)

  • existing_coverage_scantests/test_host_mode_planner.pytests/test_host_loop_activation.pytests/test_loopx_turn_driver.pytests/control_plane/test_quota_should_run_parity.py 已覆盖 host-loop/parity 关键路径;#3130 已因同一主题被判 REQUEST_CHANGES。
  • same_author_batch_scan#3113#3120 为同一作者 8 个同构 walkthrough 系列。
  • real_product_or_repo_value_verdict:正确做法是收敛为 thin focused pytest,或与 #3130 合并;664 行 example 是重复脚手架。

对主干的风险

代码本身无运行时风险。风险在模式:同作者以同形状 walkthrough 系列重复覆盖已有测试主题,占满评审队列。

我的整体评价

REQUEST_CHANGES。 修复建议(择一):(1) 收敛为 thin focused pytest;(2) 与 #3130 合并为一个有差异化价值的 walkthrough。贡献行为警告:按 PR #3134 政策,若同一作者在警告后再提交此类低价值同形状 PR,将禁止该账号继续向本仓库提交 PR(owner 执行屏蔽)。


English Verdict

REQUEST_CHANGES — exact head d8d2893374218932edaa2eb9974b67312ebe2fc6.

Under the durable_smoke_value gate, this 664-line example-only walkthrough duplicates existing host-loop/parity coverage and overlaps the same author's already-rejected #3130. Consolidate into thin focused tests or one differentiated walkthrough. Contribution warning: further low-value same-shape PRs will lead to the account being blocked from submitting PRs.

@rootkiller6788
rootkiller6788 deleted the feat/gh-c70-host-loop-parity branch August 12, 2026 12:23
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