Skip to content

Recover the original Chat Todo and Monitor confirmations - #8725

Merged
huangruiteng merged 6 commits into
mainfrom
codex/audit-chat-creation-receipt-pr-20261114
Dec 3, 2026
Merged

huangruiteng merged 6 commits into
mainfrom
codex/audit-chat-creation-receipt-pr-20261114

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Recover the original Todo or Monitor confirmation

This revision integrates the original PR with main and addresses the legacy assignment finding. An interrupted 2.3.0 confirmation can prove that it created a Todo. Its assignment write did not record a proposal ID. The reopened card shows the verified Todo and its current assignee, and explains why the original assignment remains unverified. A retained, attributable assignment or Task receipt still follows the existing recovery path.

旧版在原生指派提交后、保存聊天回执前中断时,原卡可以显示已创建的 Todo 和当前负责人。指派证据不足时,两次重试均保留原回执和存储版本。主干现有的监控仓库、关注范围,以及已接收 Task 的恢复路径都保留在本次整合中。

Packaged first screen at f223d1b50b

Desktop, 1200 px (top 680 px) Narrow, 390 px
Original confirmation showing the created Todo, current assignee and retry action on desktop On a narrow screen the verified creation, current owner and original retry are visible above advanced diagnostics

Both views use the compiled Chat bundle and its matching HTTP server. The fixture contains synthetic records created by the v2.3.0 producer. The card presents the recovery result and action in the first viewport at both widths. The previous screens and earlier revisions are preserved below.

Validation

  • The released native Chat handler created and assigned one Todo on File and on SQLite. The fixture interrupted the chat checkpoint after the native assignment. On the integrated head, reopening each original card twice returned the verified creation and current owner. Both original creation receipts, provider revisions, all Todo records and both cursors stayed unchanged.
  • 160 focused Python checks cover original Todo, Monitor and Task confirmation. A further 64 adjacent checks passed. All 31 focused TypeScript checks passed, including the disposable PostgreSQL 16 reviewed-create case. Twelve packaged-browser cases passed across File and SQLite, 1200 px and 390 px, at three interruption points.
  • The dashboard build, control-plane TypeScript typecheck, configured mypy, Ruff and diff-selected premerge checks passed. The released legacy-card upgrade was exercised on File and SQLite. PostgreSQL upgrade of that old Chat record, installed native WebViews and live Feishu recovery remain unverified.
  • Independent review is requested for f223d1b50b8fc2691b61cf79666ffb991279e3ef. Integrated diff

Integration order verified against main at 44f6fb6d1a

#8727 at f84fbdf contains the full #8725 head f223d1b. Once each PR meets its own review requirements, land #8725 first using a merge commit to preserve that ancestry. At the main revision above, #8727 then integrates cleanly. The resulting Git tree is 5c6c946cb8477249ebfdc39d38cdf3e7f6689079. If the base advances, recompute the merge previews.

Squashing the first PR reproduced conflicts in 9 files on the second PR in either order. We also tested recovery after squashing #8725. On the original #8727 branch, merging the updated base and resolving just the nine conflicts from the independently verified combined tree produced the identical final tree. Any pushed resolution needs review at its new head.

The combined tree passed 183 Python tests, 32 focused TypeScript tests, 400 PostgreSQL storage checks, and 18 packaged browser scenarios. On File and SQLite, a confirmation interrupted by the published 2.3.0 handler after saving the assignment returned the original Todo and creation receipt on repeated calls. The provider revision and cursor stayed fixed.

Earlier revisions and qualification

When Chat loses a Todo or Monitor confirmation, the user can reopen the original card and recover its original proposal, Todo and receipt. The canonical writer checks the selected Goal's source and reviewed provider before creating work. The prepared confirmation retains the reviewed source, first schedule and exact operation for replay.

A retained Todo confirmation from before source binding uses the original native create receipt and the reviewed revision from that store's history. If the Todo remains unchanged and the Agent is still registered, retry completes assignment on the original Task. If the source or assignment cannot be verified, the original card shows the recorded Todo and gives the user a recovery path after refresh. A prepared or committed operation keeps its original confirmation. An unsubmitted stale preview can still be regenerated.

Chat 确认中断后可从原卡继续。升级前留下的确认以原创建回执和历史来源为依据,恢复同一个 Todo 的指派。来源无法验证时,原卡仍显示已经记录的任务和恢复指引。新格式确认继续复用原操作和首次排期。

Review range

The exact source head is 4ed3a60432f084a35902bbaaf25f327dc9e4361f. The current main comparison at 41ea75e89892ed88d0ae543e97e31aad0a181c47 contains 43 files, +2,610 and −372. The stack includes the original #8717 work. The GitHub PR page still uses snapshot f3bdad238739 and displays 1,822 files. The full verified comparison is linked here. Verified compare Prior review

Historical validation at 193e6d53d8

  • An actual Chat server at the pinned main created the old checkpoint and then interrupted before assignment. The previous PR head returns two HTTP 400 responses and leaves the Todo unassigned. On the current head, File and SQLite each return two HTTP 200 responses with the original confirmation receipt, one Todo and one assignment commit.
  • Packaged Chat at 1200 and 390 pixels reopens the retained confirmation and applies the original proposal. Native readback confirms that each provider advances once, both proposal and Todo counts stay at one, and the receipt persists after reload. Switching the File registry to a different store causes a 409 with an actionable message that survives reload. The alternative store remains untouched and restoring the original source makes the same card usable.
  • 192 related Python checks, 64 focused TypeScript checks, dashboard and control-plane type checks, Ruff, and 19 standard premerge checks pass. PostgreSQL 16.15 passes the 398-case authority-store integration suite on a disposable database. The browser upgrade path uses disposable File and SQLite authorities.
  • The SHA-256 ownership test fails at the same matcher on pinned main and this head, tracked by Reuse canonical SHA-256 validators for private results #8836. New-head independent review and hosted CI are pending. Installed desktop App, live Feishu, and an upgrade of retained Chat records on PostgreSQL remain unverified. Digest ownership repair

Visual evidence

Packaged Chat with synthetic records persisted by the previous server. The previous head keeps the old confirmation on disk and shows an empty activity view. The candidate exposes that confirmation and its retry in the existing Chat layout.

Previous head · File · 1200 × 854 193e6d53d8 · File · 1200 × 854 193e6d53d8 · SQLite · 390 × 854
Previous Chat leaves the retained confirmation out of the conversation Desktop Chat restores the original confirmation and retry control Narrow Chat shows the same original confirmation and retry control

Legacy assignment recovery at 97bcd88b0d

An older Chat confirmation can have a saved assignment even though the caller lost the final response. The original card now verifies its historical creation receipt, source lineage and matching saved assignment. A pending assignment still checks the current Todo and Agent registration before writing.

  • Reproduced HTTP 409 on File and SQLite before the repair. The installed wheel now returns the original Todo and receipt on both providers, with the provider revision unchanged. A mismatched saved assignee and a replacement store remain rejected.
  • Reopened the original card and retried at 1200 px and 390 px on both providers using the exact installed bundle. All four runs recovered the existing assignment without another write. The HTTP regression tests seed the original assignment format.
  • 140 Python tests and six focused installed-wheel tests passed. TypeScript reported 29 passed and one skipped. Ruff and the RFC diff check passed.
  • Reconciled the original branch with 41ea75e898. The six direct and 19 selected premerge checks completed with one inherited maintainability advisory. That revision still required a change-quality receipt and independent review. The existing Use the selected Goal runtime for Chat task reads and writes #8717 changes are retained in the branch.

Original task execution recovery at 4ed3a60432

Confirmations retained from 2.3.0 can now recover the original completed Session and Turn after upgrade. Confirmations with a newer managed claim can recover the same claim while its execution proof is current. A missing claim, a changed owner or lease, and a changed Todo before any claim still prevent a new dispatch.

升级后,从原确认卡可读回同一个已完成的 Turn。已有执行认领时,待启动的请求继续检查当前 Goal、认领者和租约。未取得认领且任务被外部修改时,仍会挡住新启动。

  • The published 2.3.0 wheel produced retained confirmations via the real Chat HTTP handler on File and SQLite with an isolated upstream host fixture. The exact candidate wheel returned the original native receipt and completed Turn twice. Both stores kept the same revision and each Task had a single dispatch.
  • The regression reproduces four HTTP 409 responses on the previous head for lost claim acknowledgement and completed Turns. All ten final File and SQLite legacy cases pass, including changed Todo and missing claim guards.
  • 178 focused Python tests passed on the exact head. The default TypeScript suite passed 6,669 tests with 91 opt-in checks skipped. The separately enabled PostgreSQL store and service suites passed 399 and 11 tests on disposable PostgreSQL 16.14. Repository mypy, Ruff, TypeScript typecheck and dashboard conversation-return checks passed.
  • The exact packaged Chat assets and matching source server passed 12 browser cases across File and SQLite at 1200 px and 390 px. The retained-confirmation browser screenshots above show the earlier UI revision.
  • The exact change-quality receipt is cqr_69bb86b5266974276d6a. The repository premerge gate passed with 6 direct and 19 selected checks executed. It classified 1 failure as an inherited advisory. Independent review of the current head is pending. The live desktop App, Feishu and PostgreSQL recovery of a retained 2.3.0 Chat record remain unverified.

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 a00b3dc0e1161f2bcce4f5e626ddc2597338de9a,目标分支基线 3347c7f8dbb0a20cfe5bda7bfdbb69af69c1ef0c。

[P2] 打包 Chat 将已提交的确认导向新提案。 在打包 Chat 确认创建 Todo。让真实 provider 提交后,第一次保存 todo_created checkpoint 时抛出 I/O 错误。 页面显示「未写入」,唯一可见的重试先生成新 proposal,再要求确认。实测新确认返回 todo_already_exists 和另一份 receipt。原确认仍能经 HTTP 取回 todo_added 和原回执。 创建和 checkpoint 失败分支

动机 / Motivation

这项改动面向在 Chat 或飞书确认创建 Todo 或 Monitor,并需在中断后恢复原结果的用户。 在同一中断条件下,目标基线的原确认会被当前 provider revision 判成 stale。 页面显示「未写入」,唯一可见的重试先生成新 proposal,再要求确认。实测新确认返回 todo_already_exists 和另一份 receipt。原确认仍能经 HTTP 取回 todo_added 和原回执。 候选直接重试同一 HTTP 确认返回原始 Todo 和回执。File、SQLite 中均只保留一个 Todo,provider revision 保持不变。 实测使用合成 Goal、真实本机 Chat HTTP 和 File/SQLite;飞书走模拟确认,PostgreSQL integration 跳过。已安装 App、真实飞书及托管 CI 未验证。

改动思路 / Approach

现有 Todo provider 拥有提交和回执,ChatActionStore 持有原确认,Dashboard 负责展示该确认的真实状态和恢复动作。 先保存原确认的 provider revision、源注册表摘要和 operation ID,SQLite 与 File 的写路径仍用现有 CAS。已有回执时可以重新读取原操作。从当前 Goal 的持久提案和类型化原操作状态投影未知/待恢复结果,呈现同一 proposal 的重试。在已准备或已提交时保留其身份,并约束 regenerate,避免让现成恢复路径被新确认替代。 保存原确认

具体改动 / Changes

关键代码讲解

新增 v3 传入源摘要和原 provider revision。TypeScript 在新写入前检查来源及 revision,在已提交时先读原回执。HTTP 的通用错误响应随后仍把打包页面交给 apply_failed,可见按钮触发 regenerate。实测第二次确认只找到了已经创建的任务,同时给出另一个 proposal 和 receipt ID。回执、来源和 CAS 通用失败回传 界面重试

基线 docs/project-agent-todo-contract.md 的 原操作回执 和 新请求来源约束 已验证。Chat 原确认恢复 仍有上述反例。现有前端交付要求从普通入口走到错误恢复和读回。基线写入合同 前端验收路径

对主干的风险 / Risks

独立同条件下,基线回原提案得到 stale,候选 HTTP 能恢复原回执。页面第二次确认未重复写 Todo,仍让用户多确认一次且拿到不同的回执。当前 main 的合成检查还发现 local_authority_runtime.ts 冲突,需要基线集成后再验证。后续 #8727 只代表一个单独候选。

语义与 CI 对齐

28 项 Python、5 项 TypeScript 与 17 项 standard premerge 通过,另有一项 PostgreSQL 集成测试跳过。 模拟飞书确认和原生 HTTP 复读通过。当前实际展示缺口来自精确头的打包页面。

我的整体评价 / Verdict

请求修改。从当前 Goal 的持久提案和类型化原操作状态投影未知/待恢复结果,呈现同一 proposal 的重试。在已准备或已提交时保留其身份,并约束 regenerate,避免让现成恢复路径被新确认替代。 用同一个 File/SQLite 提交后故障,在打包 Chat 确认、刷新和重试原操作。断言原 proposal、Todo 和 receipt ID 一致、权威修订不变,且未提交的过期预览仍可重建。

1200 × 854 桌面和 390 × 854 窄屏均显示原任务和「未写入」,主按钮要求重新确认。窄屏按钮在首屏,两次明确确认才能得到另一个提案的结果。 实测使用合成 Goal、真实本机 Chat HTTP 和 File/SQLite;飞书走模拟确认,PostgreSQL integration 跳过。已安装 App、真实飞书及托管 CI 未验证。

English verdict: REQUEST_CHANGES at a00b3dc. An original HTTP retry recovers the committed receipt, but packaged Chat falsely reports no write and regenerates a different confirmation instead of exposing that retry.

Comment thread loopx/chat_actions.py Resolved
@huangruiteng
huangruiteng changed the base branch from codex/audit-chat-goal-routing-pr-20261114 to main November 14, 2026 12:18
@mergify

mergify Bot commented Nov 14, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 14, 2026
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 14, 2026

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 05007a8e6a62b3e37041151d4e1722a1ad606e5d。GitHub 目标基线为 58cc5817e35ea9a0dc4697f7791279c6d80946bc。

[P2] 创建确认在保存计划前失败后失去恢复入口。 在 Chat 确认创建 Todo,首次保存 todo_create_prepared 时发生一次 I/O 错误,尚未调用权威 Todo writer。 两种存储都没有写入 Todo。HTTP 对原确认的四个处置入口均返回 409,而原 apply 在故障消失后能创建一次。页面的 review plan 没有重试动作,刷新后待确认列表也排除了原确认。 仅在有准备记录时才提供重试

动机 / Motivation

在 Chat 中确认创建 Todo 或 Monitor 的使用者。 在 Goal 中确认创建 Todo 或 Monitor,短暂写入故障结束后应能找回原确认和结果。 已写入 Todo 或 Monitor 但丢失确认回执时,File 和 SQLite 均保留原确认,重试取回同一个 Todo 与回执,权威修订不再变化。 已验证本地打包 Chat、合成 Goal 和真实 File/SQLite。新反例来自实际 HTTP 与当前前端 selector,已安装 App、真机飞书和 PostgreSQL 端到端尚未核验。

改动思路 / Approach

Chat 保存确认计划,Canonical Todo owner 检查来源与 revision 后写一次。已提交时从原 operation 返回回执,页面需要让这个恢复路径可见。 让已确认但未准备成功的创建有可见的原操作重试。由现有 Chat action owner 统一标记可安全重试的状态,再让待确认列表和详情使用同一标记。继续保护任何可能已经写入的确认。 原确认交给 Canonical Todo owner

具体改动 / Changes

关键代码讲解

  • 先保存原 operation ID、registry 摘要和 store identity,再进入 Todo/Monitor 的真实 writer。两个存储在提交后丢回复都可找回同一回执。取消、推迟、拒绝和重新生成均被拦截,原操作续跑只读回已提交的结果。
  • 首次保存准备记录失败时,实际响应仍进入 canonical_action_failed。后端保护原确认,前端等待并不存在的准备记录。待确认列表只纳入可重试的失败项,所以刷新后找不到原卡。待确认列表的筛选
  • 差异含 33 个文件,+1,735/−292。大部分验证来自跨存储写入、回执和打包场景。独立确认逻辑放在现有 Chat Todo owner,后续分支继续复用它。

按现有 Todo 合同和前端交付要求核对。original-operation-replay、source-and-no-write 已验证,recoverable-confirmation-before-plan 未满足。原确认与来源约束 用户入口的恢复要求

对主干的风险 / Risks

在 GitHub 目标基线制造相同的写入前 I/O 中断,两个 provider 都保持原修订,HTTP 允许重新生成可确认的 preview。 影响范围是 Chat 已确认创建后的首个准备写失败。用户仍能看到当时错误,但刷新后会失去原确认的恢复入口。 在 HTTP 保存失败对象后,Python 保护通用失败状态;TypeScript 仅把已保存计划或已完成检查点投影为可恢复。 使用两个隔离存储,在首次保存确认计划和权威写入后分别注入一次故障,刷新确认抽屉,验证原动作可重试、来源变化仍被拒绝,原 Todo/Monitor 和回执在重复提交后保持一致。

语义与 CI 对齐

精确头的 110 项 Python、25 项 TypeScript(1 项跳过)、19 项预合并检查通过。后续 12 项打包 HTTP 测试通过。File 和 SQLite 的写前反例均可复现。 托管 CI 未查询。已合成检查与最新 main 的变化,代码结论绑定上述提交。

我的整体评价 / Verdict

请求修改。让已确认但未准备成功的创建有可见的原操作重试。由现有 Chat action owner 统一标记可安全重试的状态,再让待确认列表和详情使用同一标记。继续保护任何可能已经写入的确认。 打包 Chat 的 1200×854 桌面和 390×854 窄屏上,已保存确认的任务标题和「重试原操作」都在首屏。窄屏保留了原结果和返回入口。提前中断时,实际失败响应使当前页面把确认排除在列表外。 已验证本地打包 Chat、合成 Goal 和真实 File/SQLite。新反例来自实际 HTTP 与当前前端 selector,已安装 App、真机飞书和 PostgreSQL 端到端尚未核验。

English verdict: REQUEST_CHANGES. A transient failure before writing the create plan makes the original confirmation disappear after reload, even though retrying its original HTTP action succeeds. Keep that action visible while continuing to fence committed work.

@mergify

mergify Bot commented Nov 14, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added needs-rebase Mergify: the pull request has merge conflicts with its base branch and removed needs-rebase Mergify: the pull request has merge conflicts with its base branch labels Nov 14, 2026

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 7bdda5bfea4846cca5e7bb3b3caa5f8c6d75ee8a,目标基线 eaff94c7449c2fa3ce49edf3adc7e6258ccd8b0c,上一评审头 05007a8e6a62b3e37041151d4e1722a1ad606e5d。

[P2] 创建确认在保存计划前失败后失去恢复入口。 在 Chat 确认创建 Todo,首次保存 todo_create_prepared 时发生一次 I/O 错误,尚未调用权威 Todo writer。 File 和 SQLite 首次都没有写入 Todo。HTTP 取消、推迟、拒绝及重新生成均返回 409;原 apply 能创建一次。实际打包页面刷新后丢失原确认和重试入口。 重试要求已保存的计划

动机 / Motivation

在 Chat 中确认创建 Todo 或 Monitor 的使用者。 在 Goal Chat 中确认创建后,即使写入前中断也能找回原操作。 提交后的回执丢失在 File 和 SQLite 都可恢复原 Todo 或 Monitor。重试保留原任务、确认回执和 provider revision。 验证使用本地打包 Chat、合成 Goal、实际 File/SQLite;已安装 App、真实飞书和 PostgreSQL 端到端待核对。

改动思路 / Approach

Chat 保存确认计划,Canonical Todo owner 校验来源与 revision 后写一次。页面用现有 review plan 投影原操作的恢复或结果。 复用现有 Chat action owner 对原确认的安全重试判断,让待确认列表和详情都能提供它。可能已经写入的确认仍走原 operation。 原确认和计划的 owner

具体改动 / Changes

关键代码讲解

  • 原 proposal 冻结 operation ID、来源摘要与 store identity。Todo 和 Monitor 在权威写入后丢确认回执时,从原 ID 恢复,不增加一次 provider revision。
  • 写前失败仍会产生 retry_safe=true 的 canonical_action_failed。后端保护原确认,前端等待尚未保存的计划,待确认列表依赖 retryOriginal 收入失败项。待确认列表
  • 全 PR 有 33 文件,+1742/-297。上次评审之后,这 33 个路径中 27 个字节相同。其余涉及导航、确认详情、服务及 plan 编译。最新提交还移除了已核验结果里的闲置确认控件,写前恢复条件仍可复现。

original-operation-replay 和 source-and-no-write 已核对,recoverable-confirmation-before-plan 尚未满足。原确认和来源 前端任务恢复

对主干的风险 / Risks

在当前 GitHub 目标基线模拟写入前的相同故障,两种存储都保持原修订,重新生成可得 201 和待确认预览。 最新增量移除了已核验创建结果的一个失效按钮,同时叠加现有 Goal/会话导航更新。仍按旧条件决定写前恢复,并通过两个 provider 和实际页面重测。 使用原确认分别注入首次准备写入失败和提交后回执丢失,在真实 File/SQLite、打包桌面和窄屏刷新,断言原确认可恢复并只写一份。

语义与 CI 对齐

当前 110 项 Python 和 32 项 TypeScript 通过,另 1 项 PostgreSQL 跳过。标准 premerge 共执行 19 项,CLI 输出预算 smoke 超时,quota-plan smoke 因导入失败退出;补齐本地测试导入路径后,后者在相同基线和候选上单独运行均通过。 托管 CI 未查询。打包本地页面和直接 HTTP 给出一致的恢复缺口。

我的整体评价 / Verdict

请求修改。复用现有 Chat action owner 对原确认的安全重试判断,让待确认列表和详情都能提供它。可能已经写入的确认仍走原 operation。 1200×854 桌面和 390×854 窄屏完成加载后,正常待确认项仍显示;两处都找不到首次准备失败的原确认和重试按钮。 验证使用本地打包 Chat、合成 Goal、实际 File/SQLite;已安装 App、真实飞书和 PostgreSQL 端到端待核对。 在故障结束后,用户应能从原 Goal 对话找到并继续已有确认。

English verdict: REQUEST_CHANGES at 7bdda5b. The exact packaged Chat still hides an original confirmation after a transient prepare failure. Both providers can recover the original action via HTTP; expose that recovery in the original Chat view.

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 54c8d23b5c3d22d28bd02cb4a746bc87ba331c0d;对照目标基线 b46a76d2d64b3c14877bdf288953c56ae1c7793b。

[P2] 首次保存准备记录前中断后,原确认无法恢复。 确认请求在保存首份创建计划和写入任务之前退出;前端刷新后只读回 applying,且没有 checkpoint 或失败结果。 桌面和窄屏的原卡都还在,抽屉只显示禁用的「正在应用」,没有重试。File/SQLite 两种存储都没有首写;同一 apply 能成功完成一次,第二次返回原回执。 对应代码

[P2] 首次计划丢失后,Monitor 重试使用未审阅的新修订。 Monitor 确认遇到首份计划保存错误,未写入;有人对同一 Goal 完成一次有效修改,provider revision 前进,来源注册表不变。 同一 Monitor 提案重试返回 200,用新的修订号保存计划并新增 Monitor;同条件的 Todo 返回 409,仍未写入。两个后端结果一致。 对应代码

动机 / Motivation

在 Goal 里从对话确认待办或定时检查(Monitor)的人。 提交待办或定时检查后,即使首次确认中断,也应能重新打开原确认并完成它。 以前确认中断后,提交人得自己核对后台有没有留下任务,避免重复创建。 要么只能等待,要么离开当前确认查询后台,核对是否已写入和是否会重复。 可捕获的准备写入错误保留原提案;未变更修订时只创建一次。写入已发生但回执丢失时,重试仍保留原 Todo/Monitor 和回执。 验证使用源码构建的打包 Chat、实际本机 HTTP 和隔离 File/SQLite;PostgreSQL 用例跳过,未验证装机 App、实际飞书租户或托管 CI。

改动思路 / Approach

以原提案 ID 找回操作。Hub 的 action store 保留确认和步骤,Goal 对应的 Todo 存储判定能否写入并生成回执,Dashboard 展示原记录和恢复入口。 复用现有操作锁和已经有来源绑定的 provider 写入。保留一个类型化恢复条件,并将阶段与原确认依据配对;不再建独立重试协议或让界面从错误文案推断写入。 服务判定恢复和初次写入权限;provider 拥有唯一写入和原回执;页面只展示原确认和读回结果。 先保存同一提案的准备信息,再交给已注册 Goal 的权威存储;已有原回执时按同一 ID 核验和更新展示。 首份计划和写入后的回执是两道不同的持久化边界;真实请求退出不会留下可捕获的错误记录。

具体改动 / Changes

关键代码讲解

apply;compileActionReviewPlan;_apply_monitor_create。原提案的锁会阻止仍在执行的同一次 apply;锁释放后,服务能够安全读回或重放。当前抽屉在首份记录缺失时要求先看到已经持久化的失败,遗漏了请求先退出的分支。Monitor 的动作指纹只有注册表和来源路径;记录尚未保存时,服务给它的计划写入了恢复时的存储版本,无法证明这个版本是操作者审阅过的。生产 24 文件,+749/-289;测试和夹具 8 文件,+1023/-9;其余为文档和工作流。

基线写入约束、打包任务验收及本提交的原确认约束:original-create-result 已验证;preplan-interruption-recovery 未满足;reviewed-monitor-revision 未满足。

对主干的风险 / Risks

首份计划和写入后的回执是两道不同的持久化边界;真实请求退出不会留下可捕获的错误记录。 桌面和窄屏的原卡都还在,抽屉只显示禁用的「正在应用」,没有重试。File/SQLite 两种存储都没有首写;同一 apply 能成功完成一次,第二次返回原回执。 同一 Monitor 提案重试返回 200,用新的修订号保存计划并新增 Monitor;同条件的 Todo 返回 409,仍未写入。两个后端结果一致。 由已有 action owner 区分仍有持锁请求和可恢复的原确认;为后者开放同一 apply,继续由原锁、来源和修订号把关,保留对取消和重新生成的限制。 在原 Monitor 确认依据中保留已审阅的修订号及存储见证,在首写前比较;有原提交回执时仍按原 operation ID 恢复,不让重试静默采用当前修订。 恢复权限只覆盖所选的原提案。服务须区分活请求、陈旧依据和可安全重试的原确认;有历史回执时沿用原结果。基线 HTTP 已能恢复 applying 提案,本轮缺口是被当前交付承诺覆盖的页面和未写 Monitor 的修订检查。

语义与 CI 对齐

PASS:82 项定向 Python、26 项定向 TypeScript、19 项标准 premerge(含 diff 与双语 RFC 检查)。 标准门首次因本机示例导入路径和临时目录位于私有树下失败,换用隔离的系统临时目录并保留示例导入路径后通过。全量类型检查在基线和候选的同一位置报 TS2345。 验证使用源码构建的打包 Chat、实际本机 HTTP 和隔离 File/SQLite;PostgreSQL 用例跳过,未验证装机 App、实际飞书租户或托管 CI。 旧 wire 的降级和缺见证对照仍由同一验证入口拒绝;原 Todo 修订过期后可重新审阅且不写任务。用打包 Chat/HTTP 在标为 applying 后、保存准备记录前中断请求,刷新后从原抽屉重试;核验只创建一次、返回同一回执,另设仍持锁和旧修订对照。 让首份 Monitor 计划写入报错,再通过另一项 Todo 写入推进修订,重试同一提案;断言原请求拒绝首写,且此前已提交的 Monitor 仍可读回原回执。

我的整体评价 / Verdict

请求修改。正常的已提交恢复能继续工作;请求退出前后仍有两处未满足的约束,持续恢复和页面可操作性都还未验收。桌面保留原卡,窄屏抽屉中长标题可完整换行;首份准备前的中断在两处都只显示禁用的「正在应用」。 优先修复共同的确认 owner,再重跑上述两个对照和原回执、浏览器恢复;沿用现有状态字段和权限边界。验证使用源码构建的打包 Chat、实际本机 HTTP 和隔离 File/SQLite;PostgreSQL 用例跳过,未验证装机 App、实际飞书租户或托管 CI。

English verdict: REQUEST_CHANGES at 54c8d23. A persisted applying confirmation can stay disabled after reload, and an unwritten Monitor can adopt an unreviewed revision on retry.

Comment thread loopx/chat/todo_creation.py Resolved
@mergify

mergify Bot commented Nov 15, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added needs-rebase Mergify: the pull request has merge conflicts with its base branch and removed needs-rebase Mergify: the pull request has merge conflicts with its base branch labels Nov 15, 2026

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 af94fe6d0b9acdcc0375bd39149a8c5ad4fdd301,对照目标基线 cbdc7655482e3db8cc70c5b0c4e49451d902a360。

[P2] 无关提交后恢复已创建 Todo 的指派。 确认时选择了具体 Agent。Todo 已写入并保存 todo_created 回执,另一个请求随后写入同 Goal 的无关 Todo。 当前提交在两个后端首次 apply 和原提案 retry 均返回 HTTP 400,报告修订已变化。原 Todo 已持久化且未指派,用户重试时仍使用刚创建时的 Goal 修订。 指派的修订前置

动机 / Motivation

在 Chat 中确认创建并指派任务或设置 Monitor 的操作者。 两种恢复触发点包括首份创建计划之前的请求中断,以及创建落库和后续指派之间的独立 Todo 写入。 原确认在首份计划前失联时,基线刷新后仍卡在 Applying。修复了首份计划前中断后的恢复。打包 Chat 刷新后能从原卡片继续,File 与 SQLite 都只创建一次。无写入的 Monitor 在另一个写入推进修订后返回 409,保持原数据。 独立覆盖打包 Chat 的桌面路径、真实 HTTP 与隔离 File/SQLite。真实安装宿主和 PostgreSQL 集成不在本次证据范围。

改动思路 / Approach

Chat 执行者持有原 proposal 和创建 checkpoint,canonical Todo provider 管理修订、权限和回执。 复用已有原生 create、update、claim 和 source witness。分配继续用原操作身份,缺少有依据的目标冲突恢复。 当前恢复读取原 checkpoint 后复用其 creation receipt,再发出原指派操作。保留原创建和指派 operation id。遇到 Goal 修订推进时,在原 store 内确认同一创建回执和目标 Todo 的指派前置条件,再用原子校验继续指派;目标、归属或来源实质变化时返回可操作的冲突。

具体改动 / Changes

关键代码讲解

原确认的中断恢复已经核验。File 和 SQLite 的两种视口、三种中断位置共 12 个打包浏览器用例都回读了原提案和单条新增记录。确认持有者检查

Monitor 的首写修订已经核验。File 与 SQLite 的基线在其他 Todo 更新后仍创建 Monitor,候选在原审阅过期时返回 409,两个实际存储的行和修订均保持不变。Monitor 首写检查

创建后的指派恢复仍有反例。在精确目标基线,File 和 SQLite 两个完整 HTTP 入口都返回 200,原 Todo 保持一次创建并完成指派。 候选把创建时修订留在 checkpoint。每次重试都传同一旧值,无关 Todo 的提交令该指派始终被拒绝。指派调用 · 现有 Todo 写入契约

对主干的风险 / Risks

用户已确认指定 Agent,也已经有了可见任务。两个后端的原提案重试均没有新写入,目标任务仍未指派。无关 Todo 自己的写入保持有效。现有用例覆盖了来源替换与恢复原来源,仍要验证来源有效而同 Goal 修订已推进的情况。

语义与 CI 对齐

112 项 Python 检查、26 项 TypeScript 检查和本地 standard premerge 的 25 项执行通过。PostgreSQL 用例跳过。 对照试验只在原 Todo 创建和指派之间增加一次无关提交。直接检查通过覆盖不了这段顺序,目标及无关记录已经分别读回。

我的整体评价 / Verdict

请求修改。原确认的恢复和过时 Monitor 拒写已在当前提交复验。把原任务的指派恢复加到真实 HTTP 回归中,覆盖无关更新与目标或来源变化两种情况,并核对同一任务、同一操作及实际归属。1200 × 854 和 390 × 854 的打包 Chat 都能读全原任务标题。刷新后可找到原卡的重试入口,成功后显示原回执和查看更新后的 Goal。高级诊断保留在折叠区。 独立浏览器覆盖桌面和窄屏,实际安装宿主仍待验证。

English verdict: REQUEST_CHANGES at af94fe6. An unrelated Todo update leaves the original confirmed assignment permanently retrying a stale Goal revision.

Comment thread loopx/chat/todo_creation.py Resolved

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 379e72aad527319a5c10d18903b29f064f5a131f,本地和 GitHub 比较以当前 main f3bdad2387397e078fbc887e7cb7ed80adaf7510 为参考,实际 merge base f3bdad2387397e078fbc887e7cb7ed80adaf7510。净改动 40 个文件(+2197/−334)。GitHub PR 面板的 157 个文件沿用较早的 cbdc765548。 精确比较

[P2] 保留旧版原确认的安全接续

在基线运行实际 Chat HTTP,确认创建并指派一个 Todo。在 provider 提交和 todo_created checkpoint 持久化后、指派前注入一次中断。用候选代码重启同一隔离服务,保留同一 registry、provider、Todo 和 proposal,读回原 native create receipt,再对原确认提交两次。 File 和 SQLite 都能读回唯一的原 create receipt,原 Todo 内容保持一致。候选两次都返回 HTTP 400,任务始终未指派,provider cursor 不变。主干原版本重开同一场景,两次返回 200 和同一回执,只提交一次指派。 候选的取消与重新生成也都返回 409。File 打包 Chat 显示无新动态,原卡在列表 API 中仍为 failed。从原 proposal 的旧操作 ID、原创建回执和可验证的原存储谱系核对同一 Todo,保留当前注册与 CAS 校验。来源证据不足时,读回可证实的已创建结果,并显式引导对同一个 Todo 重新审阅指派。 代码

动机 / Motivation

面向确认创建 Todo 或 Monitor 后需要重新打开 Chat 的使用者。 主干先写 provider,再保存 Chat 的创建 checkpoint。候选先持久化创建准备,让原确认能在丢响应后重放。 File 和 SQLite 的四个无关修订/直接续做对照都只指派一次。末次换源下 Todo 与 Monitor 共四例返回 409,两库零新增。1200 px 英文 File 和 390 px 中文 SQLite 两个打包 Chat 场景在已提交突然中断后从原卡片恢复同一回执,两次点击合计只有一次创建。 独立验证覆盖本地 File、SQLite 与打包 Chat。 既有来源契约 恢复验收

改动思路 / Approach

增加原提案执行锁与写入前 checkpoint,沿同一 native create 重放,复用 #8717 的 source resolver 和创建后的原指派。 同一原卡片继续使用一个已确认操作,减少重新发起请求和再次选择 Agent 的成本。更小的 UI 刷新方案拿不到第一次创建回执;当前持久方案能恢复新版记录。对主干旧确认仍需完成既有结果读回并恢复指派。引用作者列出的 #8727 展示回执后续,单独保留该阶段的资格。 Chat 保留确认和界面状态,native Todo owner 处理权限、比较并交换(CAS)与命令回执,隔离 provider 状态用同一入口读回。 同一原操作要求

具体改动 / Changes

关键代码讲解

  • _save_create_plan 原 proposal 和 reviewed CAS、source、store 持久化后才尝试首写,Monitor 保存首次时钟。 恢复沿用同一命令。 代码

  • _apply_todo_create 按原效果回执接续当前指派。 旧记录缺 source 时抛出 400,同一原记录无法推进。 代码

  • createLocalCoordinationTodo 在当前 authority guard 内核对 expected store 并进入同一 TS receipt/CAS owner。 同源已提交可以重放,换源零写入。 代码

  • compileActionReviewPlan 从 typed proposal 支撑原卡恢复,核对已创建记录的来源字段。 旧安装确认为 failed 且缺新字段时,列表仍有记录,Goal Chat 不展示原卡。 代码

验收覆盖 same-confirmation 已验证,monitor-source 已验证,retained-confirmation 未达到,original-assignment 已验证。40 文件包括 #8717 的来源路由、确认及写入恢复、打包 Chat 的卡片和前端 schema,以及浏览器 smoke 的工作流接线。 来源契约 上一轮评审

对主干的风险 / Risks

当前恢复覆盖新版 checkpoint。存量确认仍可留下已创建、未指派的任务,刷新后无法从同一 Goal Chat 取得原确认操作。 任务恢复契约

语义与 CI 对齐

150 项 Python 通过,62 项 TypeScript 通过、1 项跳过。运行时仍有旧记录跨版本失败,精确候选的原生 bundle 构建、差分检查与两种视口恢复通过。 三个精确版本的 Python 摘要归属检查均出现同一历史失败,关联 #8836。托管 CI 未查询。旧 v2 到 witness-only v3 原命令回执重放测试通过。独立打包验证覆盖已提交的确认。 摘要归属修复

我的整体评价 / Verdict

请求修改。从原 proposal 的旧操作 ID、原创建回执和可验证的原存储谱系核对同一 Todo,保留当前注册与 CAS 校验。来源证据不足时,读回可证实的已创建结果,并显式引导对同一个 Todo 重新审阅指派。 让旧版已创建但未指派的确认在原卡显示可执行恢复。保留有来源绑定的新确认的防重和原时钟。 用实际 HTTP、File 和 SQLite 从旧版本持久化后的同一记录重放两次,验证原回执、目标归属和单次写入。把旧文件和 SQLite 投影纳入打包 Chat 的同一原卡路径。

Ego Lite 中 File 1200 × 854 和 SQLite 390 × 854,恢复入口和原任务标题完整可见,成功回读同一原回执。旧记录的 File 1200 × 854 对照保留在 API,Chat 显示无新动态。 旧格式确认的窄屏、展开的诊断信息、安装 App 和实时飞书未验证。

English verdict: REQUEST_CHANGES at 379e72a. Fresh prepared confirmations recover correctly, but an interrupted confirmation kept from main cannot resume its original assignment and disappears from packaged Goal Chat.

Comment thread loopx/chat/todo_creation.py Resolved
loopx-agent added a commit that referenced this pull request Nov 15, 2026
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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 40de5dd70711026730d44a165670997aea7bc5d7。以当前主干 f3bdad2387397e078fbc887e7cb7ed80adaf7510 为 merge base,本地 Git 与 GitHub 对照均为 41 个路径(+2204/−340)。上一轮评审后只修改了打包浏览器的 Goal 创建 smoke。产品文件逐字一致,以下旧确认结果已在新 head 复验。 完整差分

[P2] 让升级前已创建的确认续做原指派

在精确主干上用 Chat HTTP 确认创建并指派。等原创建提交及老格式 todo_created 持久化,在指派前中断。候选重开同一 registry 和实际存储,提交原确认两次。File 和 SQLite 都能读回唯一的原创建回执,Todo 与原内容一致。候选两次返回 HTTP 400,指派与 provider revision 均未推进,取消和重新生成返回 409。基线两次返回 HTTP 200 和同一个原回执,只写一次指派。File 的 1200 px 打包 Chat 读到同一个 Goal,原确认仍在 HTTP API,页面没有恢复卡片。 验证同一原创建回执及历史来源,按当前注册和原 Todo 前置条件安全续做指派。证据不足时,让原卡展示已创建的结果并引导用户为同一个 Todo 重新审阅指派。保留替换库拒绝、原操作防重和首次确认时钟。 代码

动机 / Motivation

检查使用现有 Chat HTTP、隔离 File/SQLite、实际构建的 Chat 和受控外部会话。已安装桌面 App、生产飞书运输和独立 PostgreSQL 资格仍待验证。

上一轮评审后只修改了打包浏览器的 Goal 创建 smoke。产品文件逐字一致,以下旧确认结果已在新 head 复验。

重新打开已注册 Goal 的使用者,要完成原 Todo 创建、指派和展示。

用户确认创建 Todo 或 Monitor 后遇到中断,可以重开同一确认,取回原任务并安全接续其工作。 新格式确认从原卡恢复同一 Todo 和 receipt。独立 Todo 推进同源修订后,两库各只写一次指派。末次换源使 Todo 和 Monitor 首写均返回 409,两库零新增。 来源契约 R1 恢复验收

改动思路 / Approach

Chat 保留确认和界面状态,native Todo owner 处理权限、比较并交换(CAS)与命令回执,隔离 provider 状态用同一入口读回。

先保存原确认计划,使用同一 native create 重放,并由 #8717 的来源 resolver 和后续指派的 CAS owner 处理权限。 单独重载页面只能再次读已有投影,后续还需要从 canonical 回执和原操作恢复。让旧确认使用同一个来源及指派校验能避免产生新的业务操作。 来源契约 R1 恢复验收

具体改动 / Changes

关键代码讲解

  • _save_create_plan 先持久化 reviewed source 和 provider CAS,再执行首写。 代码

  • The created Task predates source binding 旧确认要求指派时仍在此拒绝恢复。 代码

  • createLocalCoordinationTodo 核对原提交、注册来源和 provider CAS。晚来源变化使原库与替代库均保持零新增。 代码

  • workspaceProposal 消费 typed 状态决定原卡操作。 代码

逐项验收为 same-confirmation 已验证;monitor-source 已验证;retained-confirmation 未达到;original-assignment 已验证。

对主干的风险 / Risks

升级期间中断的旧确认可能长期留下未指派任务。用户刷新后无法在对应 Goal Chat 继续原动作。新版已审核来源和实际写入的防重通过独立复验。 来源契约 R1 恢复验收

语义与 CI 对齐

150 项 Python、62 项 TypeScript 与 8 个独立 File/SQLite HTTP 观察通过,TypeScript 跳过 1 项。两份候选和基线的全树摘要规范检查均有相同一项历史失败。打包 Chat 构建通过。 托管 CI 未查询。 检查使用现有 Chat HTTP、隔离 File/SQLite、实际构建的 Chat 和受控外部会话。已安装桌面 App、生产飞书运输和独立 PostgreSQL 资格仍待验证。 摘要归属修复

我的整体评价 / Verdict

请求修改。验证同一原创建回执及历史来源,按当前注册和原 Todo 前置条件安全续做指派。证据不足时,让原卡展示已创建的结果并引导用户为同一个 Todo 重新审阅指派。保留替换库拒绝、原操作防重和首次确认时钟。 用升级前真实写入、升级后两次 apply 及打包 Chat 校验原 receipt、原任务、指派次数和替代库拒绝。

在 1200 × 854 File 和 390 × 854 SQLite 打包 Chat 中,长标题和原确认重试可触达。保留旧 File 确认的 1200 px 页面显示「无新动态」,HTTP 仍可读该确认。

独立截图为取样的桌面和窄屏打包 Chat。未实测已安装桌面、真实飞书运输和旧版 PostgreSQL。

English verdict: REQUEST_CHANGES at 40de5dd. An interrupted assignment from the previous code still cannot resume on its original confirmation after upgrading.

Comment thread loopx/chat/todo_creation.py Resolved

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审 head 193e6d53d8594eb00425440978c2480a3eb14e0c,对照主干 f3bdad2387397e078fbc887e7cb7ed80adaf7510。本次也核对了合入的 #8717 依赖和 #8725 自身的原卡恢复路径。 依赖评审

动机 / Motivation

在 Chat 创建 Goal 任务并选择 Agent 的用户,需要在确认响应丢失后从原卡读回同一个 Todo、原指派和原回执。 主干已经可以在 todo_assigned 保存后重放原成功回执。 新版修复了升级前只来得及保存 todo_created 的情况,重开原卡会为原 Todo 补做一次指派。 已完成指派的旧确认仍需从同一张卡读回成功。 本次检出的是本地 File、SQLite 和打包 Chat,实际安装 App、线上 Feishu 和 PostgreSQL 的旧记录升级仍待验证。

改动思路 / Approach

继续由 Chat proposal 保存确认状态,由 canonical Todo owner 核验存储谱系、操作回执和写入版本。 保留源与 CAS 校验,将历史成功读回和新指派的写入条件分别应用到对应阶段。 当前 PR 的交付边界是打包 Chat 按原 proposal 恢复已证实的创建与指派,换源或真实任务变更仍由原权限边界拒绝。 在已经提交指派的情况下,原始创建快照和当前 Todo 全量相等无法证明恢复安全。缺失的是对已完成阶段的回执核验。

具体改动 / Changes

在 f3bdad2387397e078fbc887e7cb7ed80adaf7510 的 docs/project-agent-todo-contract.md 中,Canonical registry source witnesses 要求源摘要在新写入前仍有效,并允许按原操作读回历史回执。准备记录固定原 operation、源、provider revision 和 Monitor 首次应到时间。File 与 SQLite 的晚换源和替换库场景拒绝写入。 docs/architecture/rfcs/loopx-overall-roadmap-v0.md 中的 R1 要求原确认在响应丢失后可恢复,且由发起界面显示原结果。在 todo_created 持久化、指派尚未执行的情况下,File 与 SQLite 连续两次返回 200,读回同一个原始创建回执、一个 Todo,只新增一次指派。打包 Chat 的 390 px 界面从原卡完成这一恢复。 来源契约 · R1 · 确认执行 · 原卡交互

对主干的风险 / Risks

  • [P2] 已完成指派的旧确认在升级后无法读回成功。 用主干的真实 Chat HTTP 提交创建和指派,在 todo_assigned 保存后中断确认响应,再重启服务,复用原 proposal、registry 和 store。主干在 File、SQLite 上都连续两次返回 200 和原回执,当前 head 两库均连续两次返回 409,原 Todo、指派和版本均未变化。Native 查询分别读回原创建回执和它的前序 revision。创建快照与当前 Todo 只在 claimed_by 和 last_actor_agent_id 有差异,这是原指派造成的变更。代码在检查已完成的 todo_assigned 之前就因这两个字段拒绝恢复。独立的 1200 px 打包 Chat 检查中,原卡要求恢复来源,重载后仍显示同一个 gate。 全量比较 · 已指派分支
  • 建议先核验原库谱系、创建回执和已保存指派的 Todo、Agent 及提交证据,再从原卡读回同一确认。对确实需要补做的指派,继续要求相同来源、当前注册和 Todo 和 revision 校验。回归应同时覆盖主干写成的 todo_assigned,以及真实换源、撤销注册和编辑后的拒绝。
  • 本轮通过 162 项 Python 检查、63 项 TypeScript 检查、Chat 构建和差异检查。TypeScript 的一项 PostgreSQL 用例跳过。摘要所有权检查在主干与候选均为 243 通过、1 失败,命中相同三处既有规则,相关源码没有变更。 已有摘要规则修复

我的整体评价 / Verdict

请求修改。 继续沿用现有原操作回执、可恢复的 Chat checkpoint 和 canonical writer,当前 PR 内修齐已完成指派的旧确认读回。 文件库 1200 × 854 第一屏显示原卡和重试。已有原指派时仍显示来源无法验证,重载后提示和原卡仍在。 SQLite 390 × 854 的原卡可进入重试,补做指派后抽屉显示结果,读回原创建回执。 实际安装 App、线上 Feishu、稠密混合状态和展开的诊断内容未在本轮验证。桌面误报来源问题会让用户在已经指派完成后继续重试或检查原任务,该分支尚未达到 R1 的原结果读回要求。

英文简短结论

English verdict: REQUEST_CHANGES at 193e6d53d8594eb00425440978c2480a3eb14e0c. The retained card recovers pre-assignment confirmations, but a persisted legacy assignment is compared to the pre-assignment Todo and both File and SQLite return HTTP 409 and leave the original receipt unreadable.

Comment thread loopx/chat/todo_source.py Resolved
@mergify

mergify Bot commented Nov 18, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 18, 2026

@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, max)

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

[P2] 已提交的旧指派在丢失 Chat 阶段后无法从原卡恢复

旧版 Chat 完成创建和原生指派后,在保存 todo_assigned 阶段前中断。切换到当前 head 打开同一原卡,File 和 SQLite 都连续两次返回 HTTP 409 并要求恢复原来源。原注册库、创建回执和已指派的 Todo 仍存在,重试没有写入新提交。 相关代码

动机 / Motivation

维护者确认创建并指派 Todo。进程若在提交后中断,需要从原卡找回已完成的操作。新实现把原 Todo、注册库和回执绑到同一来源,并支持找回已经留存的原执行。仅丢失 Chat 阶段时,原卡应读回已证实的历史和当前负责人,并避免重复提交。本次以隔离的 File 和 SQLite 验证;真实飞书、PostgreSQL 升级和安装态浏览器仍待验证。

改动思路 / Approach

Chat 保留确认和阶段。原 Goal 来源路由核验注册库和存储,原生 Todo owner 负责回执、指派和 revision 检查。按实际共同祖先核对 43 个净改动,与上一受审版本相比有 20 个净路径变化。服务端与原卡展示两端都有变化。用旧版真实 HTTP 分别在指派前和原生指派提交后中断,再用当前 head 对同一个原提案重试两次,核对回执、负责人和提交数。

具体改动 / Changes

精确 head 4ed3a60432f084a35902bbaaf25f327dc9e4361f,diff base 41ea75e89892ed88d0ae543e97e31aad0a181c47,43 个文件 +2610/-372。逐项复核 source-bound-write、interrupted-original-assignment、retained-task-execution。验收约定

关键代码讲解

  • 按原生创建回执及前序 revision 验证同一来源。源码
  • 缺少 Chat 指派阶段时,已指派的当前记录会与创建时的未指派记录比较。源码
  • 有明确原操作 ID 的 managed claim 可以证明已提交。源码
  • 原提案卡继续承担打开恢复和操作入口。源码

对主干的风险 / Risks

在 File 和 SQLite 上,旧卡只差保存指派阶段时会持续收到 409。原创建回执和 agent-a 都仍在。同一情形在最新主干能读回 200,但会额外提交一次指派。指派尚未发生的对照在新头只写一次并正常恢复。14 项相关 Python 与 64 项 TypeScript 通过,另有 1 项 TypeScript 跳过。扩大 Python 复验时本地卷空间不足,当前只采用已完成的范围。

语义与 CI 对齐

新版保留原注册库和 provider 验证。仅凭缺失的阶段和变化后的任务快照无法判断已经发生的操作。最新主干 5cfd6ae 试合并在 tests/control_plane/test_native_user_completion_update.py 有冲突。远端 CI 按本轮设置留待既有流程。

我的整体评价 / Verdict

请求修改。原生证据能绑定原确认时读回原指派;历史证据不够时,在原卡分别展示已证实的创建和当前负责人。把需要新写入的操作继续交给现有来源和 revision 检查。

复看了上一受审版本的 1200px 和 390px 首屏。桌面保留原提案卡,窄屏恢复抽屉将「重试原操作」放在展开诊断前。 本次失败从实际 HTTP 复现。当前 head 的 409 状态、展开诊断和长任务混排尚无独立浏览器复核。

English verdict: REQUEST_CHANGES. The original completed native assignment becomes unrecoverable after the legacy Chat checkpoint is lost. File and SQLite return 409 twice while retaining the original creation receipt and assignee.

Comment thread loopx/chat/todo_source.py Resolved
@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 26, 2026
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
… replay

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent force-pushed the codex/audit-chat-creation-receipt-pr-20261114 branch from f223d1b to ef6b6e3 Compare December 2, 2026 22:23
@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Rebased onto latest main (b343b8fcf6850) and resolved the [P2] monitor-replay-preserves-later-state finding at head ef6b6e3f621464c7394f700001c35f206adaabd0:

  • Rebase & modularization alignment (c502aac6a8005):
    • Rebased cleanly onto current main with zero merge commits or stale base drift.
    • Integrated creation-recovery state guards and save_checkpoint(..., once=True) into the Zero-Any loopx/control_plane/collaboration/action_store_common.py + loopx/chat_action_store.py modules, and unified prepared-plan Todo creation in loopx/chat/todo_action_create.py so ChatTodoActionMixin._apply_todo_create remains the single Zero-Any owner.
    • Preserved observed_at alongside expected_registry_sha256 in loopx/control_plane/coordination/todo_create.ts.
  • [P2] monitor-replay-preserves-later-state fix (ef6b6e3f621464c7394f700001c35f206adaabd0):
    • Added _reconcile_monitor_create_scope in loopx/chat/todo_creation.py and wired it into _apply_monitor_create.
    • First-time creation (status == "applied") writes signal_scope and records a durable monitor_scope_written checkpoint (once=True).
    • Replayed/recovered creations never overwrite a persisted scope: if monitor_scope_written already exists, if the creation matched an existing duplicate, if current_scope already differs, or if canonical authority moved past the committed creation revision (current_revision != commit_revision or current_todo != created_todo), the latest settings are preserved and the receipt reports signal_scope_status (preserved_current / applied / unverified) plus current_signal_scope.
    • When interrupted strictly between add_goal_todo commit and initial write_steward_monitor_scope with no subsequent mutation (current_scope is None and current_revision == commit_revision and current_todo == created_todo), replay safely backfills the initial scope once.
    • Also guarded monitor.update replay scope writes in loopx/chat/monitor_actions.py against stale provider_revision.
  • Verification (local-first, File + SQLite):
    • tests/control_plane/test_chat_create_confirmation_recovery.py: 36 passed on both File and SQLite, covering dual-replay after later confirmed 3h + disabled-inbox edits across all 3 interruption points (after_scope_checkpoint, before_scope_checkpoint, before_scope_write), missing-initial-scope backfill, same-revision scope-only edit preservation, and test_unprepared_monitor_confirmation_rejects_a_new_revision.
    • Broader chat/monitor/contract suite (test_chat_create_confirmation_recovery.py, test_chat_todo_actions_contract.py, test_chat_action_store_contract.py, test_chat_reviewed_create.py, test_chat_task_start_recovery.py, test_steward_generic_monitor_todo.py): 189 passed.
    • kernel-contracts local attribution & pass: prior CI failure was caused by stale Nov 14 base comparison (f3bdad23); locally on rebased head, cli-output-budget-regression-smoke.py (ok), tests/extensions/test_governed_capability_execution.py (42 passed), TypeScript control-plane & authority tests (471 passed), npm run typecheck:control-plane, and both mypy contract gates all pass.
    • @loopx/dashboard npm run build (tsc --noEmit && vite build && npm run build:chat): passed.
    • ruff check, mypy on touched modules, loopx check public-boundary scan, and loopx canary premerge --from-git-diff --git-diff-base origin/main: passed (1 pre-existing advisory maintainability finding on untouched loopx/control_plane/turn_driver/epoch_prefetch.py).

@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 2, 2026

@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 · self_reported

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

动机 / Motivation

在 Personal Workspace Chat 中确认创建 Todo 或持续 Monitor、且在原生写入后遭遇本地回执或 checkpoint 中断的操作者。改动前,确认创建开启收件箱信号的 Monitor 后若丢失最终 Chat 回执,用户再用另一张确认卡改为 3 小时调度并关闭收件箱信号,连续两次重放原创建卡会无条件写回旧关注范围并重新打开收件箱信号;改动后,原创建卡通过 monitor_scope_written checkpoint 与精确提交修订校验,在 File 和 SQLite 上两次重放均返回原 Todo 且严格保留 3 小时调度与关闭收件箱的设置。中断后的 Todo 与 Monitor 原确认卡可在 File 和 SQLite 上无重复恢复原操作,未准备重试拒绝漂移修订,桌面与窄屏界面保留原卡恢复入口,且 Monitor 重放绝不覆盖后续已确认的关注范围编辑。本次变更仅限于 Chat 创建确认恢复、来源/修订见证与 Monitor 关注范围条件回写,不涉及 Monitor 轮询运行、通知权限或远程部署策略。

本轮依据基准提交 b343b8fcf685091dc9e28a1e00af2f9fcc7293b1 的 docs/project-agent-todo-contract.md 逐项核对 source-bound-write、legacy-creation-readback 与 monitor-replay-preserves-later-state,三项验收准则在当前精确 head 均已闭环。

改动思路 / Approach

整体架构沿用 TypeScript 控制面与 Python Zero-Any 适配层的既有单一 owner,不引入额外持久化存储或并行状态机。当前 PR 边界涵盖 Chat 创建确认的来源/修订见证、原卡跨刷新恢复与 Monitor 关注范围的条件补写保护,可独立验收且单提交可回滚。

  • 对齐主干模块化与 Zero-Any 契约:把创建恢复状态保护(action_checkpoint_steps、is_todo_create_recovery、cancel / deferred / rejected 拦截与 save_checkpoint(..., once=True))收敛到 loopx/control_plane/collaboration/action_store_common.py 与 loopx/chat_action_store.py;把带准备计划的 Todo 创建统一放回单一 owner loopx/chat/todo_action_create.py,避免与 ChatTodoCreationMixin 重复实现;在 loopx/control_plane/coordination/todo_create.ts 同时保留主干的 observed_at 与来源见证 expected_registry_sha256。
  • Monitor 关注范围防覆盖与条件补写:在 loopx/chat/todo_creation.py 新增 _reconcile_monitor_create_scope 并接入 _apply_monitor_create。首次新建成功(status == "applied")后写入 signal_scope 并持久化 monitor_scope_written checkpoint(once=True);重放或恢复时若已存在 monitor_scope_written、命中既有重复项、磁盘范围已变更,或权威版本已离开原提交修订(current_revision != commit_revision 或 current_todo != created_todo),一律禁止回写旧参数,保留最新范围并在回执中如实返回 signal_scope_status 与 current_signal_scope。仅当中断恰好发生在原生 Todo 提交之后、write_steward_monitor_scope 之前且权威存储仍停留在原提交修订、Todo 内容完全未变且范围文件尚不存在时,才安全补写一次初始范围。同时在 loopx/chat/monitor_actions.py 对 monitor.update 的重放/恢复路径增加修订一致保护。

具体改动 / Changes

  • 精确 head ef6b6e3f621464c7394f700001c35f206adaabd0 相对当前 origin/main(b343b8fcf685091dc9e28a1e00af2f9fcc7293b1)净变更 31 个文件(+1,708 / -252),无合并纠缠与冲突标记。
  • loopx/chat/todo_creation.py:ChatTodoCreationMixin._reconcile_monitor_create_scope 与 _apply_monitor_create 实现 monitor_scope_written checkpoint、精确修订条件补写与未覆盖状态回执;_monitor_create_fingerprint 绑定 source_identity、registry_sha256、store_identity 与 provider_revision,阻止计划丢失后静默采用新修订。
  • loopx/chat/monitor_actions.py:ChatMonitorActionMixin._run_monitor_update 在 replayed/recovered 路径校验当前 provider_revision 与提交修订一致后才写 signal_scope。
  • loopx/chat/todo_action_create.py、loopx/chat/todo_actions.py、loopx/chat/todo_action_contracts.py、loopx/control_plane/collaboration/action_store_common.py、loopx/chat_action_store.py:在满足 Zero-Any 与 LOC/函数长度契约的前提下完成主干整合与单 owner 复用。
  • loopx/control_plane/coordination/todo_create.ts、local_authority_runtime.ts、authority_source.ts、action_review_plan.ts 与 apps/presentation/dashboard/src/features/personal-workspace/:完成 v3 来源见证、创建恢复 UI 计划与桌面/窄屏原卡恢复展示。
  • tests/control_plane/test_chat_create_confirmation_recovery.py:新增 File 与 SQLite 双后端回归测试,覆盖 after_scope_checkpoint、before_scope_checkpoint、before_scope_write 三类中断后经 3h + 关闭收件箱编辑并连续重放两次、未修改状态下缺失初始范围安全补写,以及同修订仅改范围后的保真场景。

对主干的风险 / Risks

  • File 与 SQLite 双后端验证(PASS):tests/control_plane/test_chat_create_confirmation_recovery.py 36 项全通;涵盖 test_chat_todo_actions_contract.py、test_chat_action_store_contract.py、test_chat_reviewed_create.py、test_chat_task_start_recovery.py 与 test_steward_generic_monitor_todo.py 的 189 项 Python 测试全通。
  • TypeScript 与 kernel-contracts 本地核验(PASS):此前远程 kernel-contracts 失败原因为 GitHub 使用了陈旧基准 f3bdad23 触发 CLI 输出预算误报;基于当前 origin/main 本地复跑 cli-output-budget-regression-smoke.py 通过,tests/extensions/test_governed_capability_execution.py 42 项通过,TypeScript 权威存储与 review-plan 套件 471 项通过,npm run typecheck:control-plane 与两组 kernel mypy 全部通过。
  • 前端构建、代码质量与边界扫描(PASS):@loopx/dashboard 的 tsc --noEmit && vite build && npm run build:chat 通过;ruff check、6 个核心 Python 模块 mypy、loopx check 公共边界扫描与 loopx canary premerge --from-git-diff --git-diff-base origin/main(含 semantic-vocabulary-drift-smoke.py)全部通过;canary premerge 仅记录 1 条未触及文件 loopx/control_plane/turn_driver/epoch_prefetch.py 的主干遗留 advisory 提醒。
  • 未覆盖边界:按 Goal 策略 wait_for_ci=false,本结论依据本地精确 head 验证得出,未等待远程 CI。

我的整体评价 / Verdict

原 [P2] 阻塞项(重放已提交的 Monitor 创建覆盖后续已确认关注范围)与全部历史审阅线程均已在精确 head ef6b6e3f621464c7394f700001c35f206adaabd0 根治并经 File/SQLite 双重放回归验证。已基于源码重建的 Chat 前端包在 1200px 桌面端与 390px 窄屏通过 Playwright 自动化与实渲染截图核验原确认恢复与执行结果视图,层级清晰、无横向溢出且 File 与 SQLite 共 12 组组合均仅产生一次原生 Todo 写入。长列表与展开诊断排版、原生桌面安装包、线上 Feishu 卡片回调与 PostgreSQL 后端未在本轮本地复测。整体架构复用清晰、无阻塞缺陷,建议通过。

English verdict: APPROVE at ef6b6e3. Rebased cleanly onto main, fixed Monitor create replay overwriting later confirmed signal_scope edits on File and SQLite, and verified all local Python (189), TypeScript (471), kernel-contracts, canary premerge, and 1200px/390px Playwright browser recovery checks.

loopx-agent added a commit that referenced this pull request Dec 2, 2026
…ecoverable

Rebase PR #8727 display-recovery slice linearly onto PR #8725 (ef6b6e3) and latest origin/main, routing Monitor display recovery through _reconcile_monitor_create_scope so replaying an interrupted Monitor creation confirmation preserves later confirmed schedule and signal scope edits on both File and SQLite.

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).

动机 / Motivation

从 Chat 确认创建 Monitor 或 Todo,并在首次写入或读回中断后用原卡恢复的用户。 主线已有原卡重试。候选增加创建前的来源绑定和已提交后的恢复路径,以保留回执与首次调度。 原确认可以读回并修复自己尚未交付的结果,同时保留之后已确认的设置。 独立验证使用 Chat HTTP 与 File/SQLite,故障只注入首次范围写入和线程排程。外部宿主未运行。

审读提交 ef6b6e3,冻结基线 b343b8f。

改动思路 / Approach

Chat 的来源绑定、创建与恢复,既有 Monitor scope writer 和回执。 按 proposal 的锁能串行化同一张卡,但另一次已确认的 Monitor 编辑具有不同 proposal。现有范围读取和无条件写入之间仍有窗口。

具体改动 / Changes

  • 串行确认和部分中断的正例通过。定向测试覆盖来源绑定、provider 修订、原提案串行化、持久化回执和首次调度。File/SQLite 上成功和随后重放均保留原 Todo;先完成的范围编辑在串行对照中得以保留。
  • [P2] 给旧确认的范围回填加条件写入。 初次确认以 HTTP 424 中断,此时已有唯一 Monitor Todo,首次范围写入尚未发生。旧确认重试读到范围缺失和原提交修订后暂停。用户随后从另一张卡确认把周期设为 3h,并关闭收件箱信号。恢复暂停的旧重试,持久化范围又变为开启;周期仍为 3h、Todo 仍只有一条。候选返回 signal_scope_status=applied,后续原卡重放返回同一回执。File 和 SQLite 同样失败。
  • 相同夹具在冻结基线也会重新打开信号。基线回执没有 signal_scope_status,两个候选都在这一冲突中记录 applied。#8727 继承 #8725 的范围恢复逻辑,两个提案直接触及原确认恢复,仍缺少保护这一竞态的约束。

原卡恢复须核验已记录的 Todo 和原回执。候选把这一契约延伸到 Monitor 的信号范围和展示恢复。 冻结验收依据

  • create_identity · 保留原回执、原操作标识及原权威来源。复验通过。
  • later_scope · 旧确认恢复不得覆盖已确认的后续范围更新。复验失败。
  • local_validation · 保持既有确认和重放规则,并运行本地标准门禁。复验通过。

关键代码讲解

对主干的风险 / Risks

186 项 Python、30 项 TypeScript;标准 premerge 6 项直接检查与 19 项选中检查,无阻断,另有 1 项维护性 advisory。并发反例在每个候选的两后端各失败一次。 同一目标的两次实际变更均通过各自的确认。本用例没有绕过确认或把状态写到生产 Goal。 相同夹具在冻结基线也会重新打开信号。基线回执没有 signal_scope_status,两个候选都在这一冲突中记录 applied。#8727 继承 #8725 的范围恢复逻辑,两个提案直接触及原确认恢复,仍缺少保护这一竞态的约束。 使用真实 Chat HTTP 和 File、SQLite;故障与线程交错由隔离夹具注入。

我的整体评价 / Verdict

请求修改。原创建的身份恢复成立,范围回填仍会覆盖用户较晚确认的设置。 原卡恢复的定向覆盖通过,阻塞点在范围回填的独立存储写入。 在 Monitor 范围持久化的同一临界区内执行有条件的首次写入,并验证对应的提交代际或 revision。编辑已经提交时保留当前范围,并返回 preserved_current。检查初次正常创建和并发编辑的写入边界。

English verdict: REQUEST_CHANGES. Both File and SQLite reproduce a stale Monitor confirmation reopening an Inbox signal after a later confirmed edit disabled it. The race also exists at the frozen base and remains inside the new recovery flow; the candidate additionally records the stale backfill as applied.

Comment thread loopx/chat/todo_creation.py Resolved
…get lock

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 · Gemini · Google · self_reported

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

动机 / Motivation

面向在 Chat 中确认创建 Todo 或 Monitor、并在首次写入或回执保存中断后用原确认卡重试恢复的用户与操作者。旧行为下,原创建在提交 Todo 后若中断于首次 signal scope 写入,旧卡重试在锁外读到空 scope 与原修订后暂停,另一张编辑卡确认将周期改为 3h 并关闭 Inbox 信号,旧卡恢复后仍无条件把 include_inbox 写回 True 并错误回报 applied;修复后,双方共享同一目标 scope 互斥锁并在锁内校验现存范围与规范修订,保留较晚确认的 include_inbox=False 并如实记录 preserved_current。本 PR 的可观察收益是:原 Todo/Monitor 确认卡在 File 与 SQLite 下均可按来源绑定幂等恢复原始回执与调度,且并发或重放回填绝不覆盖较晚确认的 Monitor signal scope。非目标:不修改外部飞书推送协议、不新增自动合并权限,也不改动 PostgreSQL 独立迁移流程。

本次 exact-head 审读针对提交 03929ccbfe06438117fad177ffef58a815b85b63(合并基线 b343b8fcf685091dc9e28a1e00af2f9fcc7293b1),验证前序 [P2] 跨 proposal 并发 TOCTOU 缺陷(PRRT_kwDOStEbEs6-4xD9)已彻底闭环。

改动思路 / Approach

整体按控制面来源绑定与目标 scope 临界区两层协同收口:

  1. TypeScript 控制面(todo_create.ts、local_authority_runtime.ts、action_review_plan.ts)持有创建预览与恢复的规范修订见证(provider_revision、registry_sha256、store_identity)。
  2. Python 侧在独立叶模块 loopx/capabilities/native_chat/steward_monitor_scope.py 中收口 per-target scope 路径、规范化、exclusive_file_lock 互斥锁及条件写入 write_steward_monitor_scope_if,并由 steward_monitor_turns.py 与 steward_monitor.py 保持恒等重导出。
  3. loopx/chat/todo_creation.py(_reconcile_monitor_create_scope)与 loopx/chat/monitor_actions.py(_run_monitor_update)统一通过 write_steward_monitor_scope_if 进入同一目标 scope 临界区,无论哪张卡先获得锁,最终磁盘态都保留较晚确认的 3h 与 include_inbox=False。

架构边界判断:来源绑定判定归属既有 TypeScript 控制面,monitor scope 互斥锁与条件写入收口于单一叶模块 steward_monitor_scope.py,无平行决策层且让 steward_monitor_turns.py 维持在 750 LOC 预算内。本次 PR 边界限定在 Chat Todo/Monitor 创建与更新确认恢复、per-target monitor scope 并发保护、配套恢复态 UI 提示与 File/SQLite/TS 回归测试。

具体改动 / Changes

本 PR 共变更 35 个文件(+2162 / -317),对照规范文档 docs/project-agent-todo-contract.md(基线提交 b343b8fcf685091dc9e28a1e00af2f9fcc7293b1),各项验收标准在当前 head 的落地情况如下:

  • source-bound-create-recovery:implemented(由 todo_create.ts 与 todo_creation.py 实现,经 test_chat_create_confirmation_recovery.py 与 todo_create_reviewed.test.ts 验证)。
  • legacy-card-safe-readback:implemented(由 action_review_plan.ts 与 todo_action_create.py 实现,经 action_review_plan.test.ts 与 test_chat_task_start_recovery.py 验证)。
  • concurrent-monitor-scope-preservation:implemented(由 steward_monitor_scope.py::write_steward_monitor_scope_if、todo_creation.py::_reconcile_monitor_create_scope 与 monitor_actions.py::_run_monitor_update 实现,经 File/SQLite 真实 Chat HTTP 并发交错测试验证)。

关键代码讲解

  1. loopx/capabilities/native_chat/steward_monitor_scope.py::write_steward_monitor_scope_if(L93):在锁外先调用 normalize_steward_monitor_scope 校验非空输入,再获取 exclusive_file_lock(steward_monitor_scope_path(...));入锁后原子读取磁盘 current_scope 并评估调用方 predicate(current_scope),仅条件为真时执行 _atomic_write_json 返回 (True, written),否则不改写文件并返回 (False, current_scope)。write_steward_monitor_scope 复用同一目标锁,保证直接写入与条件写入互斥。
  2. loopx/chat/todo_creation.py::ChatTodoCreationMixin._reconcile_monitor_create_scope(L107):将首次 status == "applied" 与重放回填统一走 write_steward_monitor_scope_if。在共享目标锁内同步执行 current_scope is None 与 _at_commit_revision()(核对规范 provider_revision == commit_revision 且 current_todo == created_todo);若另一张编辑卡已写入新 scope 或推进修订,立即跳过写入并返回 ("preserved_current", persisted_scope),不伪造 monitor_scope_written 检查点。
  3. loopx/chat/monitor_actions.py::ChatMonitorActionMixin._run_monitor_update(L120):将 Monitor 编辑后的 scope 写入迁移到同一 write_steward_monitor_scope_if,在共享目标锁内校验规范 provider_revision == commit_revision 后写入,确保并发创建回填与编辑更新严格串行。
  4. tests/control_plane/test_chat_create_confirmation_recovery.py(L578、L658):新增两组真实 ChatHTTPServer 并发交错回归(File 与 SQLite 双后端):test_real_chat_http_monitor_create_replay_interleaving_preserves_later_edit 精确复现锁前暂停并在编辑卡完成后恢复的场景,test_real_chat_http_monitor_scope_lock_serializes_backfill_and_concurrent_edit 验证回填持锁期间并发编辑阻塞在共享目标锁上并最终保留 3h 与 include_inbox=False。

对主干的风险 / Risks

  • 失败与并发路径:针对原 [P2] 跨 proposal 并发竞态,已在真实 ChatHTTPServer 与 File/SQLite 权威存储上双向验证(锁前暂停交错与持锁期间并发等待),均保证 Monitor 数量保持 1、cadence == "3h"、include_inbox is False,且旧卡重复重放返回一致回执。
  • 活跃调用方与默认隔离:write_steward_monitor_scope_if 直接服务于生产入口 _reconcile_monitor_create_scope 与 _run_monitor_update;当提案未携带 signal_scope 时两条路径直接短路,不产生锁文件或磁盘写入,保持 feature-off 零回归。
  • 权限与契约一致性:不扩张写入权限、不引入未登记状态枚举,且 steward_monitor_scope.py 为零 Any 严格类型实现,保持既有模块 DAG 与重导出恒等。
  • 本地验证矩阵(wait_for_ci=false):pytest tests/control_plane/test_chat_create_confirmation_recovery.py -v(40/40 PASS)、关联 Chat/Steward 套件 7 个测试文件(216 PASS,已核对 test_steward_monitor_contract.py 4 项基线既有失败与本次改动无关)、TS 单测 action_review_plan.test.ts + todo_create_reviewed.test.ts(30/30 PASS)、ruff check PASS、mypy --follow-imports=silent(触及严格模块 0 errors)PASS、loopx check --scan-path(7 文件公开边界清洁)PASS、loopx canary premerge --from-git-diff --git-diff-base origin/main PASS(含 semantic-vocabulary-drift-smoke.py、8 项风险冒烟与 1 项无关既有文件维护性 advisory)。

我的整体评价 / Verdict

  • 长期效果与用户体验:long_horizon 为 improved(中断创建可幂等恢复且不再回退较晚确认的 Monitor 配置);user_experience 为 improved(恢复卡片如实呈现当前生效的 signal scope)。可视化评审结论:PR #8725 变更了恢复态提示与按钮门控并在 PR 正文附带 1200 px 桌面与 390 px 窄屏打包首屏截图(已确认默认与窄屏恢复卡片首屏可见且无溢出),本轮提交 03929ccbfe064 仅改动后端 scope 并发锁与测试,未变更前端渲染。未覆盖范围:PostgreSQL 环境下 2.3.0 历史 Chat 记录升级、已安装原生 WebView 与真实飞书宿主。
  • 语义与代码体量:本 PR 复用既有 signal_scope_status 与 exclusive_file_lock 语义词汇,未新增未登记的共享状态契约;代码变更与修复价值成比例。远端 exact head 已复核为 03929ccbfe06438117fad177ffef58a815b85b63,所有必查项已验证且无阻塞项。

英文简短结论
English verdict: APPROVE — exact head 03929ccbfe06438117fad177ffef58a815b85b63 fixes the cross-proposal monitor signal-scope TOCTOU race with a shared per-target lock and conditional CAS write, verified by deterministic real Chat HTTP interleaving tests on File and SQLite plus full local premerge gates.

@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] 让 Monitor 回执如实报告未写入的信号范围。从原 Monitor 确认把调度从 2h 改为 3h 并关闭收件箱信号。在该 Monitor 的真实 Todo 提交后、写范围前,由同一 Goal 新增一项无关 Todo。冻结基线和上一 PR 头都关闭了信号。候选的两种后端均保留旧信号,首次与重试却都返回 HTTP 200、monitor_updated 和 projection_verified=true。重试回读同一回执,范围仍未写入。在每目标锁内用能区分同一 Monitor 变化与无关 Goal 修订的依据保护范围写入。CAS 未写入时,把真实的范围状态纳入回执并保留安全恢复入口。 条件写入和结果丢弃

动机 / Motivation

Goal Chat 的用户需要从原确认卡恢复已提交的 Todo,Monitor 的计划和信号范围也应准确反映已经确认的修改。 上轮的跨提案竞态允许旧创建卡的补写覆盖较新的范围编辑。当前提交把检查和范围写入移进同一个 per-target lock。 File 和 SQLite 的真实 Chat HTTP 验证了旧创建回放与同一 Monitor 的并发编辑。较新的 3 小时调度和关闭收件箱信号有效,回放原创建没有再写 Todo。 验证使用隔离 File/SQLite、本地原生 HTTP 和当前头构建的 Chat bundle。原生桌面 WebView、真实 Feishu 与 PostgreSQL 旧记录升级未验证。

审读提交 03929cc,冻结基线 b343b8f。 上轮评审

改动思路 / Approach

完整 diff 包括 Chat 创建计划、存储见证、原提案恢复、Monitor 范围及工作台确认卡。当前增量集中在 per-target 持久化与 File/SQLite 并发回归。 原确认绑定计划、源注册表与存储身份。Todo provider 提交调度,Monitor 范围由独立的每目标文件锁管理,Chat 回执负责对两处结果准确读回。

具体改动 / Changes

  • ORIGINAL-CARD。重开和重试能读回同一 Todo 与原确认结果。 独立验证通过。 todo_creation.py
  • MONITOR-REPLAY。旧创建不能覆盖同一个 Monitor 较新的范围。 独立验证通过。 steward_monitor_scope.py
  • SCOPE-READBACK。确认的范围要落盘,或准确报告范围状态与恢复入口。 配对反例见 P2。 monitor_actions.py

冻结规范

关键代码讲解

对主干的风险 / Risks

Chat 相关 179 项 Python、两组 TS 文件共 30 项通过。另跑 Steward 模块定向套件,冻结基线与候选均为 23 通过、4 失败,同名失败包括既有 pump 751/750 行以及夹具的 registry 路由读回。 standard premerge 6 项直检、19 项选中检查无阻断,含一项既有维护性 advisory。 无并发写入的编辑在两个后端都能关闭信号,已有同一 Monitor 的新范围优先。替换存储、未审查的首次写入和原提案重放由定向回归覆盖。 从原 Monitor 确认把调度从 2h 改为 3h 并关闭收件箱信号。在该 Monitor 的真实 Todo 提交后、写范围前,由同一 Goal 新增一项无关 Todo。冻结基线和上一 PR 头都关闭了信号。候选的两种后端均保留旧信号,首次与重试却都返回 HTTP 200、monitor_updated 和 projection_verified=true。重试回读同一回执,范围仍未写入。

我的整体评价 / Verdict

请求修改。 原确认的 Todo 恢复和旧创建覆盖新范围的竞态都已复验。当前头新增无关 Todo 修订触发的静默范围丢失。在每目标锁内用能区分同一 Monitor 变化与无关 Goal 修订的依据保护范围写入。CAS 未写入时,把真实的范围状态纳入回执并保留安全恢复入口。

当前头构建的确认卡在 1200 px 和 390 px 都把重试原操作放在主按钮,提交说明在按钮上方,诊断默认折叠。重试回到同一确认及 Todo,刷新后也能找到它。 图形验证覆盖 File 桌面宽度与 SQLite 窄屏的创建回执中断。范围编辑竞态使用实际 HTTP 读回,未做原生 WebView 或 Feishu 界面验证。

English verdict: REQUEST_CHANGES at 03929cc. The shared scope lock fixes stale-create overwrites, but an unrelated Todo commit now drops a confirmed signal-scope edit while Chat returns the same verified success on File and SQLite.

Comment thread loopx/chat/monitor_actions.py Resolved
loopx-agent added a commit that referenced this pull request Dec 3, 2026
…ecoverable

Rebase PR #8727 display-recovery slice linearly onto PR #8725 (ef6b6e3) and latest origin/main, routing Monitor display recovery through _reconcile_monitor_create_scope so replaying an interrupted Monitor creation confirmation preserves later confirmed schedule and signal scope edits on both File and SQLite.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent added a commit that referenced this pull request Dec 3, 2026
Add deterministic real Chat HTTP File/SQLite regression covering interrupted Monitor display recovery interleaving with a concurrent confirmed monitor.update under the shared per-target scope lock inherited from PR #8725 (03929cc).

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…hip and truthful receipts

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 · Gemini · Google · self_reported

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

动机 / Motivation

受影响调用方与操作者:在已启用 File 或 SQLite canonical authority 的 Goal 中确认 todo.create、monitor.create 与 monitor.update 的 Personal Workspace Chat 用户与 Steward 操作者。改动前(03929ccbfe06),用户确认把 Monitor 调度从 2h 改为 3h 并关闭 include_inbox,只要在 Todo 提交后、范围写入前同一 Goal 新增一项无关 Todo,Goal 级修订号就会前移并导致范围写入被跳过,但接口仍返回 HTTP 200、monitor_updated 和 projection_verified=true,重试也只会回读同一张旧回执;改动后(470997cec2e7),每目标锁内按单 Todo 提交所有权判定,无关 Goal Todo 不再阻断范围写入或初始回填,同 Monitor 的后续编辑会如实返回 preserved_current,无法校验时保留安全可重试的失败状态而非伪造成功回执。

可观测改进结果:在 File 与 SQLite 双后端真实 Chat HTTP 路径上,无关 Goal Todo 并发插入不再阻止 monitor.update 写入 include_inbox=false 或 monitor.create 重放回填初始范围;同 Monitor 的后续调度+范围或纯范围编辑会被保留并如实回报 signal_scope_status=preserved_current;权威不可校验时返回 monitor_signal_scope_unverified 且 receipt=None,恢复后重试即可成功写入。非目标:不修改磁盘 steward_signal_monitor_scope_v0 JSON 持久化结构,不引入远端 CI 等待,也不改动无关的 Goal 调度或 pump 模块。

改动思路 / Approach

将单 Todo 提交所有权判定收敛到 TypeScript 既有的 local_authority_read.ts 读层,能够在一个权威归属点同时解决 Goal 级修订误杀与纯 scope 编辑漏判,避免在 Python 侧复制 journal 语义或破坏磁盘 scope 结构。本 PR 边界严格限定在 File 与 SQLite canonical authority 下的 Chat Todo/Monitor 确认恢复与单目标信号范围持久化,不扩展到远端数据库集群或无关调度模块。

具体执行路径如下:

  1. 单 Todo 提交所有权判定:在 loopx/control_plane/coordination/local_authority_read.ts 新增 readLocalCoordinationTodoCommitCurrent(注册为 coordination.local_authority.todo_commit_current,Python 侧由 local_authority.check_canonical_todo_commit_current 薄包装)。给定 (runtime_root, goal_id, todo_id, provider_revision, cursor, operation_id),先校验锚点事务与 storeIdentity,再结合 head 上该 Todo 的 canonicalAuthoritySha256 摘要与 store.scanCommitted 增量扫描后续事务的 receipts 与 events(涵盖 changed=false 的纯 scope 编辑收据),最后复核 finalHead 与 storeIdentity,返回封闭状态 current / superseded / unavailable。
  2. 统一保护 monitor.update 与 monitor.create:两者在 write_steward_monitor_scope_if 的每目标排他锁内均以 check_canonical_todo_commit_current 判断所有权——无关 Goal Todo 提交不会阻塞范围写入或初始范围回填;同一 Monitor 的后续调度+范围或纯范围编辑会判定为 superseded,阻止旧请求覆盖新范围。
  3. 如实回执与安全重试恢复:_run_monitor_update 不再丢弃 (wrote, persisted_scope),明确写回 signal_scope_status(applied / preserved_current / unverified)与 current_signal_scope。todo_action_updates._finalize_reviewed_edit、遗留 _apply_monitor_update 与 todo_creation._apply_monitor_create 在 signal_scope_status == "unverified" 时均拒绝写入 applied + projection_verified=true 回执,改为 mark_failed(error_code="monitor_signal_scope_unverified", retry_safe=True),无缝复用既有 action_review_plan.ts 的 canonical_update_retry / todo_creation_retry 恢复入口。

具体改动 / Changes

规范基线映射:本次审查依据 PRRT_kwDOStEbEs6-6tKr(基线修订 03929ccbfe06438117fad177ffef58a815b85b63)核对两项准则——P2-SCOPE-OWNERSHIP(由 readLocalCoordinationTodoCommitCurrent 在每目标锁内实现单 Todo 提交所有权判定,已通过 File/SQLite 真实 HTTP 测试验证)与 P2-TRUTHFUL-RECEIPT-RECOVERY(由 _finalize_reviewed_edit 与 _apply_monitor_create 实现如实回执及 monitor_signal_scope_unverified 安全重试恢复,已通过双后端恢复测试验证)。

  • loopx/control_plane/coordination/local_authority_read.ts & loopx/control_plane/effect_runtime_handlers.ts & loopx/control_plane/coordination/local_authority.py:新增 readLocalCoordinationTodoCommitCurrent、transactionTouchesTodo 与 check_canonical_todo_commit_current,基于 AuthorityStore.scanCommitted 实现单 Todo 维度的提交所有权判定,异常或 store incarnation 漂移时 fail-closed 返回 unavailable。
  • loopx/chat/monitor_actions.py:_run_monitor_update 改用 check_canonical_todo_commit_current 保护 write_steward_monitor_scope_if,规范化并保留 (wrote, persisted_scope),将 signal_scope_status 与 current_signal_scope 写入返回结果;遗留 _apply_monitor_update 同步处理 unverified 失败标记与回执透传。
  • loopx/chat/todo_action_updates.py:抽取 _finalize_reviewed_edit(保持 apply_reviewed_todo_edit 符合 <= 85 行函数跨度约束及 Zero-Any 规则),在 signal_scope_status == "unverified" 时调用 mark_failed("monitor_signal_scope_unverified"),否则将真实 signal_scope_status 与 current_signal_scope 纳入已应用回执。
  • loopx/chat/todo_creation.py:_reconcile_monitor_create_scope 同步改用 check_canonical_todo_commit_current,确保初始创建后若仅新增无关 Goal Todo,重放仍能正确回填初始范围,同时任何后续同 Monitor 编辑(含并发交错与纯 scope 编辑)继续被保护;_apply_monitor_create 对 unverified 同样走 mark_failed 安全恢复。
  • tests/control_plane/test_chat_create_confirmation_recovery.py:新增 10 组真实 ChatHTTPServer 端到端回归测试(覆盖 File 与 SQLite 双后端,总计 50/50 通过),验证无关 Goal Todo 并发下 monitor.update 正常写入范围、同 Monitor 调度+范围与纯范围并发编辑如实返回 preserved_current、不可验证状态下保留 monitor_signal_scope_unverified 安全恢复并在重试后成功写入,以及 monitor.create 重放遇到无关 Goal Todo 时正常回填初始范围。

对主干的风险 / Risks

  • 兼容性与边界:持久化文件 steward_signal_monitor_scope_v0 格式零变化;未携带 signal_scope 的普通 monitor.update(如 pause / resume / stop)和 todo.update 回执结构完全不变,已由 test_chat_todo_actions_contract.py 和 test_reviewed_canonical_edits.py 回归验证。
  • 验证结果(本地实跑,不等待远端 CI):
    • PASS:uv run --extra test python -m pytest tests/control_plane/test_chat_create_confirmation_recovery.py -v(50/50 通过,File & SQLite 全绿)。
    • PASS:uv run --extra test python -m pytest tests/control_plane/test_chat_create_confirmation_recovery.py tests/control_plane/test_chat_todo_actions_contract.py tests/control_plane/test_reviewed_canonical_edits.py tests/test_steward_managed_monitor_context.py -q(78/78 通过)。
    • PASS:node --test tests/control_plane_ts/action_review_plan.test.ts tests/control_plane_ts/todo_create_reviewed.test.ts tests/control_plane_ts/local_authority_todo_source.test.ts tests/control_plane_ts/local_authority_operation_receipt.test.ts(35/35 通过)。
    • PASS:uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main(退出码 0,direct checks 4/4、semantic-vocabulary-drift-smoke、module_ceiling_colocation、risk profile smokes 8/8、public boundary 39/39 全部通过;control-plane-maintainability-ratchet-smoke.py 存在 1 项与本 PR 改动文件无关的既有 advisory 告警)。
    • PASS:ruff check 与 mypy --follow-imports=silent(todo_action_updates.py、todo_creation.py、local_authority.py 零错误)。
  • 残余风险:外部 Postgres/NoKV 实时集群未在本地工作树运行,但它们共享同一 AuthorityStore.scanCommitted 契约;所有 12 个历史 review thread(含 PRRT_kwDOStEbEs6-6tKr)均已修复并关闭。

我的整体评价 / Verdict

将单 Todo 提交所有权判定收敛到 TypeScript 既有的 local_authority_read.ts 读层,能够在一个权威归属点同时解决 Goal 级修订误杀与纯 scope 编辑漏判,避免在 Python 侧复制 journal 语义或破坏磁盘 scope 结构。本 PR 边界严格限定在 File 与 SQLite canonical authority 下的 Chat Todo/Monitor 确认恢复与单目标信号范围持久化,不扩展到远端数据库集群或无关调度模块。

在精确 head 470997cec2e7f81934199f182a363f093e4cc75f 上,原有 [P2] 缺陷已从根因彻底修复:长期演进(long_horizon: improved)与用户体验(user_experience: improved)均得到实质改善,可观测语义变更(新增真实 signal_scope_status / current_signal_scope 回执字段及 monitor_signal_scope_unverified 安全重试路径)已通过 File 与 SQLite 双后端真实 HTTP 对比验证。语义词汇复用既有状态集合并通过 semantic-vocabulary-drift-smoke.py 校验,代码体量与架构边界克制且符合 TypeScript-first 及函数跨度约束,无阻塞问题,建议批准(作者自有 PR 按规则以 COMMENTED 形式发布批准结论)。

English verdict: APPROVE — exact head 470997cec2e7f81934199f182a363f093e4cc75f resolves PRRT_kwDOStEbEs6-6tKr with per-Todo canonical commit ownership, truthful signal_scope_status receipts, and retryable unverified-scope recovery, verified by 50/50 File+SQLite real Chat HTTP recovery tests, 35/35 TS control-plane tests, and passing loopx canary premerge.

@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] 在原确认卡显示保留的 Monitor 信号范围。 同一 Monitor 的两个确认交错。旧确认要关闭 Inbox 信号,较新的确认保留该信号并修改 PR 过滤器,在旧确认尝试写入范围前完成。 原确认请求 include_inbox=false,实际仍为 true。候选 API 区分 preserved_current 与 applied,但 Chat workspaceProposal 丢弃两项新回执字段,仍将原卡投影为 completed/readback_verified,且与真正应用范围的新确认返回完全相同的「已完成:更新监控周期和范围」反馈类型。重开同一提案也无法从原卡区分。 在 Monitor 确认的结果投影消费 signal_scope_status 和 current_signal_scope。preserved_current 时在原卡说明已保留较新的范围,并显示该范围。保留原回执和原重放,不再提交写入。用两种存储的实际 HTTP 回执分别验证 applied、preserved_current 与 unverified 的展示。 原卡成功反馈

动机 / Motivation

管理 Monitor 和连续信号范围的操作者。重新打开原确认时,需要知道原操作提交了什么。同一 Monitor 的两个确认交错。旧确认要关闭 Inbox 信号,较新的确认保留该信号并修改 PR 过滤器,在旧确认尝试写入范围前完成。 候选保留最新 4h 周期、一个 Monitor 和新信号范围。旧确认 HTTP 200,回执给出 preserved_current 及实际 current_signal_scope,重复 apply 得到完全相同的原回执。 独立证据覆盖实际 File/SQLite HTTP 和用 Vite 构建的真实 Chat 投影/反馈函数。没有重跑视口浏览器、安装版 WebView、Feishu 或 PostgreSQL 旧记录升级。PR 正文所嵌截图对应 f223d1b,属于历史证据。

审读提交 470997c,冻结基线 b343b8f,并对照上一评审头 03929cc。

改动思路 / Approach

39 文件,+2,820/−334。覆盖 Chat 创建、指派和启动恢复,Monitor sidecar 锁及原始记录证据,前端原卡、双语提示、CI 和隔离测试。 TypeScript 以封存原 revision/cursor 与同 Todo 交易判定提交归属。Python 在每目标 scope lock 下决定范围落盘和冻结回执。Chat 复用已有 action review plan 和原提案身份。 请求与授权边界继续共用原提案;新字段是现有 receipt 的增量。旧回执缺字段继续按原显示。 现有持久化操作已经证明成功或保留,新投影可以直接复用该回执消除歧义,无需另一套写入或重试。

具体改动 / Changes

ORIGINAL-REPLAY。原卡读取同一原始回执,保留较新提交。

CONFIRMATION-READBACK。HTTP 返回较新的范围,Chat 原卡还缺少这项结果。原有创建与任务启动继续沿原确认身份恢复。冻结契约

关键代码讲解

对主干的风险 / Risks

原确认请求 include_inbox=false,实际仍为 true。候选 API 区分 preserved_current 与 applied,但 Chat workspaceProposal 丢弃两项新回执字段,仍将原卡投影为 completed/readback_verified,且与真正应用范围的新确认返回完全相同的「已完成:更新监控周期和范围」反馈类型。重开同一提案也无法从原卡区分。 独立运行的 189 项 Python、67 项 TypeScript 以及 dashboard tsc/Vite 构建通过。 standard premerge 在测试解释器下通过 6 项直检与 19 项选检。同一 CLI 输出预算 smoke 在冻结基线和候选都通过。完整维护性公告一致。

我的整体评价 / Verdict

请求修改。 同一 Todo 的提交归属与旧卡重放行为通过。请把已验证的范围处置和当前值带到用户确认卡。 在 Monitor 确认的结果投影消费 signal_scope_status 和 current_signal_scope。preserved_current 时在原卡说明已保留较新的范围,并显示该范围。保留原回执和原重放,不再提交写入。用两种存储的实际 HTTP 回执分别验证 applied、preserved_current 与 unverified 的展示。 已验证由实际回执生成的 UI 投影和反馈文本类型。视口画面没有重跑。 独立证据覆盖实际 File/SQLite HTTP 和用 Vite 构建的真实 Chat 投影/反馈函数。没有重跑视口浏览器、安装版 WebView、Feishu 或 PostgreSQL 旧记录升级。PR 正文所嵌截图对应 f223d1b,属于历史证据。

English verdict: REQUEST_CHANGES at 470997c. Request changes. On File and SQLite the exact head preserves a newer Monitor scope and reports preserved_current over HTTP, but the Chat card discards this disposition and shows the same completed feedback as an applied scope edit.

loopx-agent added a commit that referenced this pull request Dec 3, 2026
…ecoverable

Rebase PR #8727 display-recovery slice linearly onto PR #8725 (ef6b6e3) and latest origin/main, routing Monitor display recovery through _reconcile_monitor_create_scope so replaying an interrupted Monitor creation confirmation preserves later confirmed schedule and signal scope edits on both File and SQLite.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent added a commit that referenced this pull request Dec 3, 2026
Add deterministic real Chat HTTP File/SQLite regression covering interrupted Monitor display recovery interleaving with a concurrent confirmed monitor.update under the shared per-target scope lock inherited from PR #8725 (03929cc).

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

Consume signal_scope_status and current_signal_scope in ActionReviewPlan and Personal Workspace Monitor confirmation cards so superseded confirmations (preserved_current) explicitly display the preserved scope, use distinct completion feedback, and remain reachable on reopen/reload without extra writes, while unverified scope failures stay retryable. Align readLocalCoordinationTodoCommitCurrent catch failures with status=failed and register it in local_authority_provider.test.ts to satisfy TypeScript exhaustiveness (TS1360). Verify applied, preserved_current (including interleaved monitor.update cards with PR filter), and unverified recovery across real File and SQLite HTTP packaged browser smokes at 1200px (EN) and 390px (ZH-CN).

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 Chat 原确认卡恢复 Todo 或 Monitor 的操作者需要找回已写入的结果,并知道哪些设置对后续检查实际生效。 保留原操作身份、已记录 Todo、首次到期时间和原回执;恢复时只补原操作尚未完成的合法阶段。Monitor 的已应用、保留较新范围和未核验均显示在原卡。 编译后的 Chat 在 File 和 SQLite 均显示原请求 Inbox 开启、当前 Inbox 关闭和保留较新设置,并在正常新建时显示本次范围已应用。原提案和 Todo 身份保持相同。 本轮验证编译后的本地 Chat、隔离 File 和 SQLite。原生已安装 WebView、真实 Feishu 和 PostgreSQL 历史数据未复验。PR 正文中的公开截图仍早于本提交。

审读提交 ed91199,冻结基线 b343b8f。

改动思路 / Approach

整条 PR 共 41 文件,增加 3,410 行、删除 349 行,含后端恢复、共享权威读取、类型投影、双语 UI、文档和集成验证。较上次审读头变更 10 文件,增加 596 行、删除 21 行。 现有审批存储与 provider 操作回执负责锁定原写入身份。范围核验仍由 Monitor 范围 owner 作出,TypeScript 审批计划按回执读取已知处置,Chat 以同一状态显示卡片、详情和反馈。

确认先保存原操作,再做权威写入与读回。恢复按已提交回执与当前身份判断,区别待补范围和后续主动编辑。类型化 projection 不接管范围写入。

具体改动 / Changes

  • ORIGINAL-CONFIRMATION。保留最初建立的操作、Todo 和已存确认。 独立验证通过。 todo_creation.py
  • SCOPE-READBACK。明确区分原请求、当前实际范围及其核验状态。 独立验证通过。 personal-workspace-page.tsx
  • RECOVERY-AUTHORITY。读回故障可在同一张卡恢复且后写范围不得被覆盖。 独立验证通过。 monitor_actions.py

冻结的接口契约 · 原有权威检查

关键代码讲解

对主干的风险 / Risks

66 项 TypeScript 通过,dashboard typecheck 和 Vite 构建通过。打包 Chat 有 12 组 Todo 原确认和 4 组 Monitor 浏览器结果,每组 Monitor 同时覆盖 create 与 update。Python 212 项通过、4 项失败。 标准 premerge 的 6 项直接检查和 19 项选中检查通过。 无新开关。非 Monitor 确认、缺少可选范围字段的旧回执,以及普通首次执行保留原分支。未核验后恢复同一张卡;显示较新范围不回写旧值。

四个 Steward 测试以同一解释器和选择器在基线与候选同样失败。未改动的 pump 模块两边均为 751 行,其余三项共享不存在 registry 的夹具路径。维护性非阻断告警仍在。上次范围反馈发现见 原评审。

我的整体评价 / Verdict

通过。 上轮范围反馈问题已修复。实际卡能区分已应用、保留较新范围和未核验,同一确认的恢复未重复创建 Todo 或覆盖后续写入。

1200×888 桌面并列看到待恢复、保留与未核验卡,详情同时列出请求和当前范围。390×854 中文窄屏能在首屏看到两项范围,未核验态也显示重试入口。 本轮验证编译后的本地 Chat、隔离 File 和 SQLite。原生已安装 WebView、真实 Feishu 和 PostgreSQL 历史数据未复验。PR 正文中的公开截图仍早于本提交。

改动把现有回执和范围权威贯穿到原卡,不增加独立恢复协议。新增状态投影与当前默认行为的区别已有真实浏览器验证。

实际桌面和窄屏检查了原卡的请求、实际范围、保留状态及未核验重试反馈。

English verdict: APPROVE at ed91199. The actual Chat cards distinguish applied, preserved newer, and unverified Monitor scope. File and SQLite retain the original action and Todo across recovery. Four unrelated Steward failures reproduced on the frozen base.

@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.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewer: model_agent · Gemini 3.1 Pro · Google · self_reported

动机 / Motivation

本改动面向在 Personal Workspace 中通过 Chat 确认 Todo 或 Steward Monitor 提案的操作者,以及运行控制面 TypeScript 类型检查的维护者。此前当创建确认在提交中途断连、或同一 Monitor 的旧确认与新确认交错时,不仅存在重复写入与覆盖较新信号范围的风险,前端也丢弃了回执中的 signal_scope_status 与 current_signal_scope,导致实际保留较新范围的旧卡与真正生效的新卡完全无法区分(见 review thread PRRT_kwDOStEbEs6-8ESX),同时 readLocalCoordinationTodoCommitCurrent 触发控制面 TS1360 报错。

改动前,当关闭 Inbox 的旧 Monitor 更新确认在写入信号范围前中断,而保留 Inbox 且增加 PR 过滤与 4h 周期的较新确认先完成时,重试旧确认卡仍提示普通已完成并隐藏保留的较新范围,关闭抽屉或刷新后卡片也无法重开;改动后,旧确认卡明确显示已保留较新设置、并排展示原请求范围与当前实际范围及 PR 过滤器、给出区分性完成反馈并在刷新后仍可零写入重开,同时未核验范围失败保持可重试。

通过本次修改,File 与 SQLite 权威存储下的中断创建与交错 Monitor 确认均能幂等恢复单次写入并保护较新信号范围,1200px 英文与 390px 中文界面准确区分 applied、preserved_current 与 unverified 且刷新重开零额外写入,控制面 TypeScript 类型检查零报错。本 PR 不包含创建后展示待更新恢复(canonical_create_projection_pending,已独立归属堆叠 PR #8727),也不涉及 PostgreSQL 权威存储改动。

改动思路 / Approach

TypeScript 控制面统一持有提交归属核验与 ActionReviewPlan 状态机,Python 负责单目标文件锁 IO 与 Chat HTTP 适配,Dashboard 只做类型化只读投影,职责分层清晰且无平行决策源。入口仍为 POST /api/actions/<proposal_id>/apply,经 ChatActionService 路由到 todo_creation.py、monitor_actions.py 与 todo_action_updates.py。

  1. 控制面不变量与失败对齐:todo_create.ts 通过来源绑定 v3 请求校验注册表摘要、权威存储身份与修订号;readLocalCoordinationTodoCommitCurrent(local_authority_read.ts)在异常分支返回 status: "failed"、decision_read_from_provider: false,并与 local_authority_provider.test.ts 的完备性矩阵对齐,使所有异常均 fail-closed。
  2. 信号范围读回投影:在 action_review_plan.ts 复用 compileActionReviewPlan,新增闭合类型 MonitorSignalScopeStatus、MonitorSignalScopeReadback 与原因码 monitor_signal_scope_preserved / monitor_signal_scope_unverified。前端仅依据结构化字段渲染,不解析翻译文本;同时在 personal-workspace-page.tsx 的 restoreable 中仅为 preserved_current 的已应用 Monitor 卡保留跨刷新重开能力。
  3. 当前 PR 边界:本 PR 边界覆盖创建与更新回执恢复、Monitor 信号范围锁保护与确认卡 UI 投影及 provider 失败契约对齐;创建期展示待更新恢复保留在堆叠 PR #8727。

具体改动 / Changes

基于 exact head ed9119958be46fb9662996d31e91987d39aa06b5 对照契约文档 docs/project-agent-todo-contract.md(revision ed9119958be46fb9662996d31e91987d39aa06b5)逐条核验三项准则:

  • write-contract-v3-recovery:loopx/chat/todo_creation.py、loopx/control_plane/coordination/todo_create.ts 与 action_review_plan.ts 绑定来源注册表摘要、存储身份与修订号,已准备创建禁止重新生成、中断后从原卡重试恢复单次写入与原回执,旧版控制面在写入前拒绝 v3 请求。
  • monitor-scope-disposition-ui:loopx/control_plane/presentation/action_review_plan.ts 消费 receipt.signal_scope_status、receipt.current_signal_scope 与 failure.error_code === "monitor_signal_scope_unverified";personal-workspace-page.tsx、context-drawer.tsx、todo-completion-feedback.ts 与 i18n.tsx(EN + ZH-CN)格式化展示原请求范围、信号范围结果(Kept newer scope (superseded) / 已保留较新设置(已被取代))与当前实际范围(含 pr_filter),为 preserved_current 展示独立抽屉状态栏与完成提示,并在关闭/刷新后保持可重开且零额外写入;applied 回执若出现 unverified 则 fail-closed 到 repair/readback_unverified。
  • provider-failure-exhaustiveness:loopx/control_plane/coordination/local_authority_read.ts 的 readLocalCoordinationTodoCommitCurrent 在 catch 中返回 status: "failed",并在 tests/control_plane_ts/local_authority_provider.test.ts 的 providerCalls 中登记,彻底修复 TS1360。
  • 回归验证扩展:补充 tests/control_plane_ts/action_review_plan.test.ts 与 apps/presentation/dashboard/smoke/todo-confirmation-http-fixture.py / todo-confirmation-browser-smoke.mjs,覆盖 File 与 SQLite 真实 HTTP 下 monitor.create 与交错 monitor.update 的 applied、preserved_current(含 pr_filter 与刷新重开零写入、API 幂等重放)和 unverified 重试恢复。

对主干的风险 / Risks

  • 默认关闭隔离与兼容性:非 Monitor 提案与未携带 signal_scope_status 的历史回执不会产出 monitorSignalScope,维持原有交互与清理逻辑;普通 applied 的 Monitor 卡不会滞留时间线,仅 preserved_current 卡片保留跨刷新重开。
  • 验证结果(本地优先,wait_for_ci=false):
    • npm run typecheck:control-plane + 5 份 TS 测试套件:PASS(0 错误,71/71 通过)。
    • Dashboard tsc --noEmit + vite build --config vite.chat.config.ts + node apps/presentation/dashboard/smoke/todo-confirmation-browser-smoke.mjs:PASS(File & SQLite × 1200px EN & 390px ZH-CN 全量通过)。
    • Python pytest 5 份套件:PASS(81/81 通过)。
    • ruff check、loopx check --scan-path ... 与 loopx canary premerge --from-git-diff --git-diff-base origin/main:PASS(0 阻断失败,semantic-vocabulary-drift-smoke.py 与 8/8 风险冒烟通过;仅 1 条非改动文件的存量可维护性 advisory)。
  • 残余风险:仅 1 条非改动文件存量可维护性 advisory;创建期展示待更新恢复留在独立堆叠 PR #8727。

我的整体评价 / Verdict

在长程效果(long_horizon: improved)与用户体验(user_experience: improved)上,本 PR 完整闭环了中断创建回执恢复与 Monitor 交错信号范围的防覆盖与可视化读回。视觉走查方面,已基于 vite.chat.config.ts 打包产物与真实 SQLite/File HTTP 服务走查 1200px 英文与 390px 中文界面在默认时间线、展开详情抽屉及未核验恢复态下的完整渲染,层级清晰、双语标签与 PR 过滤器完整可读且无溢出遮挡。仅涉及 Chat 确认卡与详情抽屉视图,未修改 Dashboard 其他无关标签页。词汇层面扩展既有闭合类型 ActionReviewReason 并引入局部 MonitorSignalScopeStatus,已通过 semantic-vocabulary-drift-smoke.py。线程 PRRT_kwDOStEbEs6-8ESX 已在 exact head ed9119958be46fb9662996d31e91987d39aa06b5 修复并关闭,无未解决阻断项。

English Verdict: APPROVE

loopx-agent added a commit that referenced this pull request Dec 3, 2026
…ecoverable

Re-anchor PR #8727 display-recovery slice linearly onto PR #8725 (ed91199), preserving PR #8725 monitor signal-scope disposition, PR filter formatting, and reload/reopen reachability while keeping interrupted Todo and Monitor display confirmations recoverable on File and SQLite.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent added a commit that referenced this pull request Dec 3, 2026
Add deterministic real Chat HTTP File/SQLite regression covering interrupted Monitor display recovery interleaving with a concurrent confirmed monitor.update under the shared per-target scope lock inherited from PR #8725 (03929cc).

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

Approved at dd8bbc6 after merging the current base.

The current head preserves the original dual approval's Todo/Monitor confirmation recovery contract. The merge introduced one LOC-layout failure in run_todo_update; the archive branch is now a behavior-preserving private helper and the contract passes. Validation: 216 Python confirmation tests with 1 layout failure repaired then 5/5 contract tests, 66 TypeScript control-plane tests, Ruff, and local premerge with 10 catalog canaries, 8 risk smokes, public-boundary scan and no manual holds.

@huangruiteng
huangruiteng merged commit 34305df into main Dec 3, 2026
13 of 15 checks passed
@huangruiteng
huangruiteng deleted the codex/audit-chat-creation-receipt-pr-20261114 branch December 3, 2026 17:45
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