Skip to content

Settle read-only verification from the registered checkout - #9439

Merged
huangruiteng merged 2 commits into
mainfrom
codex/read-only-verification-workspace
Nov 26, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/read-only-verification-workspace

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A read-only verification Todo could be claimed and completed in the registered Goal checkout. The accountable refresh then required an independent Git worktree even though the task produced verification evidence and made no source changes.

Change

Recognize the existing verify action when it explicitly requires filesystem_read, optionally with shell, and declares no repository or write scope. Keep the verified workspace receipt and allow the registered Goal checkout to supply it. Use that same decision in pre-work guidance and refresh. An explicit repository, write declaration, or Goal isolation policy still determines the applicable workspace checks.

Validation

Tested revision: bcecb5b9b3150e9f166cf7fd538afee695f30259

Current main integrated: 323b287ac7d0fde7326f0eda39017ed40370cd2e

  • File and SQLite CLI causality suites: 35 passed.
  • TypeScript workspace and settlement suites: 185 passed.
  • Strict mypy on changed production Python files: clean.
  • Ruff and diff checks: clean.
  • Standard premerge: 16/16 passed, including public/private boundary with zero manual holds.

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

让明确声明的只读 verify 在注册 Goal 仓库内用工作区回执完成同一 Turn 的结算。基线可从主 checkout 认领并完成这类 Todo,但 refresh 仍强制独立 Git worktree。在共享 Git 仓库用 LoopX CLI 领取并交付验证证据的代理。

登记工作区的只读核验结算。两种存储均拒绝不同 origin 的直接结算尝试,拒绝后写回和扣费均为零。声明写入与显式隔离仍服从原规则,声明外部任务仓库仍要求匹配仓库的独立 worktree。当前头在 File 和 SQLite 都从注册主 checkout 写入 canonical_checkout 回执,沿用原 Turn,重复 refresh 返回幂等重放,均仅写回、扣费各一次。

隔离的真实 CLI 验证限于指定源码、合成 Goal、File 与 SQLite 同一 Turn 的顺序重放。已安装发行版、远端 CI、其他 authority provider 与并发结算不在本轮核验范围。 基线协议 本次验收范围

改动思路 / Approach

TypeScript owner 判断 Todo 的 delivery workspace causality。Python guard 和 refresh 复用注册工作区资格,refresh 核对实际产生证据的 Git origin。只在 refresh 放行会保留执行前提示与最终要求的不一致,按只有读取权限进行泛化会放宽旧的模糊元数据。

todo add → todo claim → quota should-run → todo complete → refresh-state --settle-turn → replay。

具体改动 / Changes

精确提交 164fdd89607ad609d71311fa8a594721cd7b9579,目标分叉点 50aa5b4fd1c88b7225fc30e58423120e3ad5d426。8 个文件,+426 / −14,含 typed 分类、两个调用入口、同行协议文档及覆盖原契约的测试。

  • classifyDeliveryWorkspaceCausality。显式写入或仓库优先,只有积极声明才取得只读核验分类。 源码
  • uses_registered_verification_workspace。共享注册工作区资格,显式隔离与任务仓库覆盖该资格。 源码
  • observe_goal_delivery_workspace_isolation。在开工时让守卫读取相同资格。 源码
  • resolve_refresh_delivery_workspace。验证实际回执身份、工作区类型和隔离优先级。 源码
  • Peer agent workspace isolation。记录 CLI 声明、结算回执和隔离规则。 源码

对主干的风险 / Risks

本轮未发现阻塞问题。前后各 10 项真实 CLI 配对观察,当前头额外 4 项断言式 CLI 检查,35 项仓库聚焦回归和 quick premerge 均通过。 显式隔离下从主 checkout 发起真实 refresh 被拒,随后从独立 worktree 正常结算。领取后增加写范围,原 claim 的完成请求仍被拒。

外部仓库反例使用不同 origin 的独立测试仓库,失败调用没有写回或扣费。

我的整体评价 / Verdict

APPROVE。 工作区回执仍为必需,显式任务仓库、写能力或范围以及 Goal 隔离策略继续按原规则处理。同一 Turn 的写回和扣费复用既有结算机制。

English verdict: APPROVE at 164fdd8. The registered Goal checkout supplies the verification receipt on File and SQLite, explicit isolation and write declarations retain priority, and same-Turn replay writes back and charges exactly once.

Signed-off-by: huangruiteng <huangrt01@163.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · GPT-5 · OpenAI · self_reported

动机 / Motivation

受影响的是在注册 Goal checkout 中领取并完成只读验证证据的 Agent,以及需要同 Turn 完成写回与扣额的操作者。

修复前,合法的 filesystem_read verify 在注册 checkout 完成后仍被 refresh 拒绝;修复后,File 和 SQLite 都接受同一 checkout 的 verification receipt,原 Turn 结算一次,重放保持幂等。

普通只读 verification 使用 registered checkout;显式写入、任务仓库或 isolation 继续要求独立 worktree;foreign checkout、模糊 metadata 和非法写范围继续 fail closed。

本 PR 不放宽 write-class action、repository-bound delivery、权限、Todo completion 或 Goal acceptance。

改动思路 / Approach

The change extends the established typed classifier and reuses the same receipt/settlement chain。

Only explicit registered-checkout read-only verification is admitted; write, repository and isolation rules are unchanged。

入口是 quota should-run/refesh settlement entering delivery workspace causality。权威输入为 Normalized Todo contract, admitted Turn identity, current workspace policy and origin-checked receipt。决定边界:TypeScript classifyDeliveryWorkspaceCausality owns the typed delivery requirement; Python guard and refresh consume it。结果:A registered checkout verification receipt is accepted for the same Turn when no stronger workspace requirement applies。消费方:refresh-state settlement, durable writeback and quota spend。失败与重试:Explicit writes, repositories or isolation override eligibility; foreign or ambiguous evidence remains rejected and can be retried only with valid workspace proof。

具体改动 / Changes

按 docs/reference/protocols/peer-agent-runtime-v1.md 的 revision 323b287ac7d0fde7326f0eda39017ed40370cd2e 核对,workspace-readonly / workspace-precedence / workspace-turn-binding 分别对应下面的行为与验证。

关键代码讲解

  • classifyDeliveryWorkspaceCausality:Chooses the typed workspace requirement from repository, write, non-delivery and read-only verification facts;Adds declared_read_only_verification after stronger write/repository branches。
  • uses_registered_verification_workspace:Applies the TS classification only when no task repository or explicit isolation requirement overrides it;Qualifies the registered checkout for the declared read-only reason。
  • observe_goal_delivery_workspace_isolation:Projects the same workspace requirement before work starts;Guidance no longer demands an independent worktree for explicit registered-checkout verification。
  • resolve_refresh_delivery_workspace:Captures and validates the actual verification workspace receipt at settlement;Accepts a registered checkout receipt only when the shared requirement and origin match。

变更共 8,426 additions、14 deletions。Five production/documentation surfaces add typed classification and shared guard/refresh use; three test files cover File/SQLite positive settlement and explicit negative workspace boundaries.

  • workspace-readonly:显式 verify + filesystem_read,可选 shell,且没有 repository 或 write declaration 时,允许注册 Goal checkout 提供验证工作区回执;当前为 implemented。
  • workspace-precedence:显式仓库、写 capability/scope 或 Goal isolation 必须覆盖只读验证资格;当前为 implemented。
  • workspace-turn-binding:结算必须沿用原 Goal/Agent/Todo/Turn 和 effect;重复 refresh 保持幂等,不重复写回或扣额;当前为 implemented。

对主干的风险 / Risks

最强回归场景:A writable or repository-bound Todo is misclassified as registered-checkout verification。触发状态:Write scopes, filesystem_write, task_repository or explicit isolation present。修复边界:Those checks precede the verify branch and the helper requires no task repository or explicit requirement。影响范围:Workspace guard and settlement for the affected Turn。可观察性:CLI returns the original isolation requirement or rejects foreign evidence。恢复路径:Provide the required worktree; no receipt or debit is lost。

changed_invariant_positive=passed (35 passed in 28.99s at bcecb5b.);material_negative_or_failure=passed (35 focused tests passed with the negative cases.);typescript_settlement_parity=passed (185 passed, 0 failed.);strict_type_and_lint=passed (Mypy: no issues; Ruff: all checks passed.);repository_required_checks=passed (16/16 passed with zero manual holds.)。

  • PASSED · Registered checkout verification settles once on File and SQLite:35 passed in 28.99s at bcecb5b.
  • PASSED · Explicit write/repository/isolation and foreign checkout retain workspace requirements:35 focused tests passed with the negative cases.
  • PASSED · Typed workspace and settlement behavior across TypeScript owners:185 passed, 0 failed.
  • PASSED · Changed production Python files are clean:Mypy: no issues; Ruff: all checks passed.
  • PASSED · Risk-based premerge including public boundary:16/16 passed with zero manual holds.

我的整体评价 / Verdict

长程效果判断为 improved:Verification work can complete and settle in the same registered Turn without a needless worktree, while replay remains idempotent。用户体验判断为 improved:The operator uses the existing registered checkout and does not prepare a second worktree for a task that cannot write。视觉检查不适用,因为本次没有改变渲染界面或布局。

The refreshed head grants the registered-checkout path only to explicit read-only verification and keeps every stronger workspace requirement authoritative。

English verdict: APPROVE at bcecb5b. Explicit filesystem-read verification now settles from the registered checkout on File and SQLite, while write, repository and isolation cases retain their original workspace requirements.

@huangruiteng
huangruiteng merged commit f29c84f into main Nov 26, 2026
12 of 16 checks passed
@huangruiteng
huangruiteng deleted the codex/read-only-verification-workspace branch November 26, 2026 08:33
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