Skip to content

Use the complete work contract for Trae App heartbeats - #8785

Merged
huangruiteng merged 2 commits into
codex/c1-work-contract-review-20261107from
codex/c1-trae-complete-work-contract-20261115
Nov 14, 2026
Merged

huangruiteng merged 2 commits into
codex/c1-work-contract-review-20261107from
codex/c1-trae-complete-work-contract-20261115

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis / optional anchor. Controller / Executor RFC, C1 caller replacement.
  • The generated Trae App bootstrap reached the ordinary quota writer even for a bound Turn. The CLI now routes those decisions through the existing TypeScript composer, including the returned selection and interrupted-Turn recovery commands.
  • Automatic delivery uses the stateless reader. Explicit off delivers the full contract inline, with declared file reads available for materials that still live at their source. The original agent still performs durable writeback and one quota spend. Turnless probes keep their scheduler observation path.
  • This PR targets the branch for #8266 at b8ac1ec5443b. The Trae-only diff is unchanged. It can be reviewed independently and retargeted after that dependency is integrated.

Author Declaration

  • Written by model_agent, OpenAI Codex.
  • Implemented against the C1 caller replacement and default-boundary criteria; validated on dependency b8ac1ec5443b.
Criterion Disposition Symbol / path Test or command
Use the same verified source for bound Trae App admission and selection implemented loopx/cli_commands/quota.py::_publish_quota_result test_stateless_app_wake_defaults_to_complete_source_and_recovers_agent_spend and test_guided_start_begins_one_turn_and_executes_returned_selection
Preserve delivery preferences, original identity and single settlement implemented existing quota selection/recovery binding and settlement plan test_original_turn_can_resume_and_settle_without_mutating_todo and the generated heartbeat test
Preserve refusal before effects implemented native context admission and replan validation Unsupported native-on and an incomplete replan writeback are refused before debit
Validate packaged Host adoption and comparative model cost deferred C1 program Local isolated wheel exercises the CLI. Live Trae App and model outcome/cost comparisons remain open

Scope And Continuation

Trae App’s bound heartbeat and guided-start callers move off the ordinary writer. The scheduler, quota receipts and storage providers keep their current owners. The ordinary packet remains the current route for other ordinary callers. Recorded unsigned captures stay on their original recovery route. This slice can be reverted as one commit while preserving receipts. Run the supported recovery reader for any capture produced before rollback.

Validation

  • Tested revision 6fe2ec767ee636b1ad22c0c4ced541165a0ef566, against b8ac1ec5443b.
  • Run state finished.
  • Input classes synthetic.
Check kind Result Public-safe evidence / limitation
regression_parity passed Four Trae App File/SQLite × auto/off fixtures reached the unsigned writer on the dependency head and failed the v1 check. The same generated startup and settlement flow succeeds here.
real_entrypoint passed Ran the generated App bootstrap, real CLI guard, reader and exact recovery commands. Progressive pages deliver the complete acceptance text and original receipt before work. Lost writeback response, interrupted Turn and replay preserve one spend.
real_backend passed Isolated File and SQLite with both delivery modes. Unsupported native-on leaves no receipt or debit.
integration passed Rebuilt isolated macOS Core wheel executed all four Trae cases outside the source checkout. Seven additional installed Core CLI tests passed on the preceding revision.
integration passed Five targeted guided-selection and missing-replan-delta cases passed.
regression_parity passed 97 source cases passed across generated heartbeats, original Turn settlement, guided selection and the ordered-settlement assertion that failed on the prior dependency.
static passed Quick premerge against the dependency head, including bilingual RFC and public-boundary checks.
static passed Standard premerge passed 6 direct and 19 automated checks, including the previously failing semantic vocabulary audit.
real_entrypoint passed On a matched synthetic SQLite fixture, auto guard plus three selected-read pages used 36,828 → 36,899 bytes. Off guard plus its required Goal file read used 67,893 → 67,209 bytes. These counts cover those CLI outputs.
manual not_run Live Trae App adoption, native Windows and matched model outcomes/cost are open.

Frontend / Visual Evidence

  • UI impact none. The existing App uses its generated CLI bootstrap and reader.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Control plane
  • Host or runtime integration

Shared-authority RFC fixture impact

Existing File and SQLite providers exercise the caller migration. Authority storage and provider routing are outside this diff.

Boundary Checklist

  • Public-safe source and validation evidence.
  • No benchmark run duplicated.
  • Scoped to the named caller.
  • Both RFC language files and the exact-base check passed.
  • UI impact marked.
  • DCO sign-off.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.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

评审提交 8651972ec554a4a98ddf28795913c9dba907b50e,对照堆叠目标 2c099be41e6878298ae273de28b983fc2c205700(#8266 分支)。

动机 / Motivation

用 Trae App 或 Antigravity App 接续已绑定 Turn 的操作者。 自动唤醒时要拿到原任务和验收上下文。恢复原 Turn 还要沿用用户选择的交付模式,以及原写回和一次用量结算。 目标分支的实际 Trae 启动命令仍返回无 contract_binding 的旧决策。自动模式仍能读到原验收文本,显式关闭仍给出同一文件的读指令。 候选为两种模式都提供可校验的完整来源。自动模式从原 capture 读完整验收内容,显式关闭时完整决策随 guard 返回,必读文件仍可用。File 和 SQLite 都保留同一 Turn 和 agent 结算。 验证覆盖生成的启动器、真实源码 CLI 和隔离的 File/SQLite。已安装的 Trae App、Windows 原生运行、真实模型采用、同预算效果与总成本仍待验收。托管 CI 未查询。

改动思路 / Approach

Quota CLI 解析已注册 scheduler profile。既有 TypeScript composer、stateless reader 和 agent 结算分别持有完整来源、交付与扣额。 将带 Turn 的 Trae 加入 Antigravity 已有分支,沿用同一选择和恢复入口,并保留显式 complete-turn 的不同结算路径。

具体改动 / Changes

关键代码讲解

  • stateless_app_work_turn 同时要求已解析的 App profile 和实际 Turn。没有 Turn 的观察保留原路由。来源选择
  • preserve_app_delivery 把原模式带入 selection/recovery。_prepare_quota_result_context 复用现有完整来源、reader 和原结算方案。传递交付模式 捕获和结算入口
  • 6 个文件(+155/−61),其中生产代码 +7/−6。现有类型和结算 owner 复用。无 Turn 的 Trae scheduler 观察没有完整来源绑定或新回执。显式关闭走 inline,实测执行原必读命令能读全验收内容,定向测试确认无 capture 目录。丢失原写回响应后,恢复只保留原扣额且重放总计一次;缺语义 delta 的重规划在 durable write 前拒绝。 File 和 SQLite 双后端用例

按 docs/architecture/rfcs/controller-executor-unified-contract-v0/contract-and-context.md 核验,bound-app-complete-source、same-turn-recovery 和 turnless-observation 均已通过。原结算与历史恢复约束 Trae 启动和恢复合同

对主干的风险 / Risks

本 PR 的实际目标是 #8266 分支。父分支已有评审阻塞,合并前仍需处理父分支和现有校验。 本次比较限定在该堆叠目标与候选。验证覆盖生成的启动器、真实源码 CLI 和隔离的 File/SQLite。已安装的 Trae App、Windows 原生运行、真实模型采用、同预算效果与总成本仍待验收。托管 CI 未查询。

语义与 CI 对齐

20 个定向用例和 4 个独立 File/SQLite 组合通过。与基线匹配的四个 Trae 启动用例均缺完整来源绑定。预合并 19 项中通过 18 项。相同语义词汇检查在堆叠基线与此提交均因 work_lane_contract 有 4 个 TS 模块、上限为 3 而失败。另一个旧启动提示逐字断言也在两版同样失败。 托管 CI 未查询。

我的整体评价 / Verdict

通过此提交的独立评审。原 Turn 的连续性已验证,Trae 用户可以通过保存的交付模式拿到完整可核验的来源。合并仍受 #8266 及该分支既有校验影响。

English verdict: APPROVE at 8651972. The generated Trae bootstrap delivers the checked source on File and SQLite, preserving the original Turn and one agent-owned spend. Turnless observation is unchanged. Parent integration and inherited validations remain open.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@huangruiteng
huangruiteng merged commit 71ccd34 into codex/c1-work-contract-review-20261107 Nov 14, 2026
15 of 18 checks passed
@huangruiteng
huangruiteng deleted the codex/c1-trae-complete-work-contract-20261115 branch November 14, 2026 19:06
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