Skip to content

fix(todo): allow validator revisions with managed claim proof - #7705

Merged
huangruiteng merged 1 commit into
mainfrom
codex/todo-validator-claim-revision-20261030
Oct 30, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/todo-validator-claim-revision-20261030

Conversation

@cocolord

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A Todo with a current managed claim could not revise its completion validator: Python rejected the combination, and the native v6 decoder accepted only ordinary progress. Allow the reviewed validator payload through both transports to the existing claim, lease and provider-CAS transaction.

  • Outcome basis: reproduced ordinary CLI defect; intended base: main.
  • Before → after: a current claim can preview, commit and replay a validator revision; stale provider revisions, foreign claims and retired executions still fail without changing canonical state.

Author Declaration

  • Written by: model_agent — TraeCode, OpenAI GPT-6 family.
  • Specification and revision: docs/reference/handoff-mode.md, “Ordinary Agent CLI work”, at a36e01c32b0a290a96466c766629a0b01850f823; the reproduced validator-revision defect described above is the specific repair basis.
Criterion Disposition Symbol / path Validation
Resolve the original claim against current execution implemented Existing claimExecutionProof through updateLocalCoordinationTodo Real File/SQLite CLI success and foreign/released/old-generation rejection
Preserve reviewed revision CAS and idempotent history implemented Existing executeCoordinationTodoUpdate and planCompletionValidationRevision Stale revision rejection, preview, replay, canonical digest/history and private declaration readback
Completion independently runs the bound validator implemented Existing terminal owner Failing revised validator blocks completion; passing replacement completes and releases execution

Scope And Continuation

  • Complete within the validator transport scope; no new capability, provider or authority owner. Python remains transport; TypeScript retains state decisions.
  • Future-facing pass: remove the duplicate Python prohibition and reuse the existing typed revision owner. Broader extraction of the large runtime adapter is deferred because it would make this narrow fix harder to review and revert.
  • Related ongoing work: perf(cli): load heartbeat prompt on demand #7704. This repair does not establish the larger runtime-composition or minimal/standard acceptance.

Validation

  • Tested revision: 56c7c33140a77dc564486c3c82609332c1e7e1fb
  • Run state: finished
  • Input classes: synthetic, public_fixture
Check kind Result Public-safe evidence / limitation
regression_parity passed New File/SQLite regression failed at the original Python rejection on the baseline; after removing that rejection alone it also caught the native v6 decoder defect.
real_entrypoint / real_backend passed 75 passed: uv run --extra test pytest -q tests/control_plane/test_todo_update_lease_recovery.py tests/control_plane/test_todo_completion_validation.py tests/control_plane/test_completion_validation_initial_binding.py tests/control_plane/test_canonical_claim_execution_proof.py tests/control_plane/test_todo_claim_argument_recovery.py.
unit passed 89 native tests: node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/todo_update.test.ts tests/control_plane_ts/local_authority_runtime.test.ts.
static passed npm run typecheck:control-plane; git diff --check.
integration passed uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main: 6 direct and 18 selected checks; zero failures, warnings or skips. Commit retains the tested source digests; committed diff and bilingual RFC gate rechecked.
  • Coverage: public CLI exercises real isolated File/SQLite stores, without relying on the Markdown display; revisions do not run validators. Existing explicit proof also reaches the same fence. Production deployments and external benchmark runs are outside this repair.
  • Review and merge: requires independent maintainer review, CI and runtime merge authorization.

Frontend / Visual Evidence

  • UI impact: none; no presentation surface changed.

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Shared-authority RFC fixture impact

N/A: repairs an existing CLI transport; no provider promotion, runtime routing, compatibility projection or migration acceptance claim.

Boundary Checklist

  • Public-safe code, fixtures and aggregate validation only; no private state, raw logs, credentials, internal links or local machine paths.
  • No benchmark-owned work duplicated.
  • Scoped to the reproduced validator transport defect.
  • No paired RFC changed.
  • UI impact marked none.
  • Every commit includes a DCO sign-off.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

@loopx-agent loopx-agent 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-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

APPROVE:完整精确头 56c7c33140a77dc564486c3c82609332c1e7e1fb 未发现阻断问题。 基点为 a36e01c32b0a290a96466c766629a0b01850f823。当前主干 225698b313f3bcd5c967220013b4a2254c586792 的独立合并预览无冲突;没有执行合并。

动机 / Motivation

已经通过普通 CLI 认领任务的 Agent,需要修订该任务的完成验证命令,随后按当前声明验收结果。

例如任务持有有效 claim reference,操作者带当前 provider revision 提交验证器替换;旧 Python 直接禁止这项组合,绕过该禁止后原 native v6 decoder 也不会接收它。新版本将同一受审请求送到现有修订事务。

本轮独立观察到合法修订、私有声明读回、失败验证保持任务开放、替换后成功完成,以及拒绝后通过正确任务认领恢复工作。

本次只修复既有 validator transport,不新增执行或验证权,也不改变 provider、宿主、默认策略或其它任务的归属。

改动思路 / Approach

原 claim/lease、provider CAS 和 validator revision owner 已能决定这项操作;删除 Python 的重复禁止,并让 v6 decoder 复用原 revision decoder,比新增协议版本或另一条执行分支更合适。

当前边界是从原 managed claim 到既有 validator 修订、独立读回及完成,不修改存储、租约维护或 terminal owner。

Python 仍准备私有命令声明、运输原 reference 和审阅 revision;TypeScript 先核对 CAS、当前任务与原执行,再运行已有修订计划。声明替换只记录新 digest 和历史,真正完成时才运行验证器。失败后仍可由当前 execution 修订命令并继续,避免重建 Todo、丢失历史或手工抄写 lease key。

真实 console 路径 独立观察
File/SQLite × soft_claim/hard_lease 的有效修订 preview 无效果;提交与独立读回成功;同 intent 重放无新修订
CAS 过时、错误 actor/reference、缺 CAS、混合编辑或改写重放 intent 拒绝且完整 canonical 快照不变
原 reference 用于另一任务或之后新建任务 拒绝;正确认领该任务后可以绑定验证器并完成
当前验证器返回失败,再替换为成功验证器 保留开放状态,随后按新 digest 验证完成

具体改动 / Changes

独立接受依据为 handoff-mode 的 Ordinary Agent CLI work 和 Revising an open Todo validator,spec_revision a36e01c32b0a290a96466c766629a0b01850f823。以下为评审条款标签,不是新增协议:managed-claim-reference(只解析原任务当前执行)、reviewed-validator-revision(独立编辑、provider CAS、digest/history 与同 intent 重放)和 current-validator-completion(新验证器独立执行,旧声明不替代新验收)均为 implemented。当前主干没有改这两份接受条款。

完整三文件 +110/-5:生产两文件 +6/-4,既有测试文件 +104/-1。未添加持久字段、第二套配置、迁移或新服务。较大的 runtime adapter 未顺势重构;本次只复用其既有 decoder 与事务,保留可回退的小边界。

关键代码讲解

  • update_canonical_todo_if_promoted:只移除 claim reference 对 validator 修订的禁止。Monitor observation 和直接 done 仍被原分支拒绝;v6 继续携带 reference、声明和 CAS,不把 Python 变成授权 owner。
  • updateLocalCoordinationTodo:v5 或带既有修订字段的 v6 调用原 decodeCompletionValidationRevision;null、旧 wire 和其它不合法组合仍经过原检查。未增加一个松散的任意 JSON 修订入口。
  • executeCoordinationTodoUpdate:未修改的 owner 先核对 provider revision,解析 claim 的任务/执行身份并执行 admission,再调用 planCompletionValidationRevision。receipt 在重放时先恢复原 intent,不借当前别的执行重复提交。
  • planCompletionValidationRevision:未修改的规则继续要求 open/active、原 digest 或明确首次绑定的缺失见证;产生单调修订历史。新通路同时覆盖修订和原有首次绑定,没有另造状态判断。

对主干的风险 / Risks

最强反例是接受 v6 的修订字段时,顺带接受另一个任务的 claim、旧执行或混合权限编辑。本轮独立 console 在两个真实 provider、两种 handoff mode 下完成四条修订链(56 次调用),覆盖 preview/commit/replay、完整声明/历史/其它任务字段、CAS 与 foreign 同时无效时的拒绝优先级,以及失败验证后的真正完成。另四条 scope/首次绑定链执行 48 次调用:既有和后来新建的 B/C 都不能借 A 的 reference;混合 claimed_by 编辑被拒绝;B 用自己的 reference 恢复并完成,C 保持开放。

相同缺陷驱动在不可变基点的四种组合均于 preview 被旧 Python 禁止(12 次调用),完整快照不变;这些拒绝作为缺陷对照保留。最初私有驱动错误地给 Agent Todo 的创建步骤附带 --agent-id,基点和 head 都在进入受审操作前拒绝;保留原失败,随后只修正该驱动为已支持的 --role/--claimed-by 创建方式,未改产品、断言或门限。

本轮 focused 75 PASS、native 两模块 89 PASS/0 SKIP;不可变基点运行相同五模块命令为 73 PASS,覆盖公共既有用例,head 额外两例为新增回归。Ruff、配置 17 文件 mypy、TS typecheck,以及 standard premerge 6 direct +18 selected PASS。测试采用隔离的实际 File/SQLite 状态与独立 Effect process;没有把 Markdown 显示当权威,也没有测试或改写运行中 Goal。未查询、轮询或等待 CI;DCO 已核对。

复跑命令为 uv run --extra test pytest -q tests/control_plane/test_todo_update_lease_recovery.py tests/control_plane/test_todo_completion_validation.py tests/control_plane/test_completion_validation_initial_binding.py tests/control_plane/test_canonical_claim_execution_proof.py tests/control_plane/test_todo_claim_argument_recovery.py;native 使用 node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/todo_update.test.ts tests/control_plane_ts/local_authority_runtime.test.ts,standard premerge 使用 --from-git-diff --git-diff-base 225698b313f3bcd5c967220013b4a2254c586792。

语义与 CI 对齐

这项修复有意把“有效 managed claim 也不能替换验证器”改为“由原修订 owner 审核”,其它硬边界保持。复用现有 v6 wire 和 typed revision schema,没有新增闭集词汇或泛化权限名称。旧 v5 显式执行证明与持久声明/receipt 兼容继续由原 decoder、CAS 和 terminal owner 承担;共部署的两段 transport 无需另设 v7 或 Python 特例。错误文字如实移除已修复的禁止,没有将机器约束降为建议。PostgreSQL provider/store 未改,本轮的本地 decoder 资格不冒充真实 PostgreSQL 运行结果。

我的整体评价 / Verdict

该 validator transport 切片达到目标。long_horizon 为 improved:原任务与执行历史得以保留,失败验收可经正确修订继续;user_experience 为 improved:已有认领 reference 可直接用于受审修订,不需用户重建任务、借用执行证明或额外确认原意图。

已检查现有 CLI、validator readback 及 Dashboard 的只读修订投影;没有渲染组件、页面布局或新的产品交互,视觉评审不适用。视觉未验证范围:none。

相邻整理已应用:删除重复 Python 禁止,复用已有 native decoder;较大 adapter 的拆分对本缺陷无必要,不新增仪式性后续任务。原生 Windows、外部 service 与安装态 Host/模型采用仍未在本轮资格化。批准源码不解除独立 merge-readiness、维护者授权或其它有效评审的约束。

English verdict: APPROVE — 56c7c33. The current managed claim reaches the existing reviewed validator transaction without weakening Task/claim/lease/CAS fencing. Independent File/SQLite journeys cover revision, first binding, replay, cross-task refusal, recovery and real completion; focused, native and required local checks pass. No merge or live adoption is performed.

@huangruiteng
huangruiteng merged commit 8112e89 into main Oct 30, 2026
29 of 38 checks passed
@huangruiteng
huangruiteng deleted the codex/todo-validator-claim-revision-20261030 branch October 30, 2026 06:39
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.

3 participants