Repository navigation
fix(monitor): never project a User gate completion from an observation - #8770
Conversation
An admitted due Monitor that still has open User gates now gets the existing User lifecycle completion command ahead of its poll actions, on unchanged observations too. The Monitor Turn's settlement identity stays separate; observation never grants approval. Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com> Co-Authored-By: Claude <noreply@anthropic.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max
复审提交 bbbecd4456abe852c50bc4a75a30b5f8eb99c92a,实际分叉 859a23ee9534539536343206e23452253528dd07,对照主干 74ca883d5bd3e4bc64671bac54210eac9e97ed05。
[P2] 待用户决定的无关事项收到可执行的批准命令。 一个到期 Monitor 在等输入文件,同一 Agent 的另一项发布工作正在等待用户明确批准。两者无关联,监控的本地文件存在。 File 和 SQLite 的 guard 都在独立 Monitor 的动作中显示了通用批准模板,甚至在 Monitor 尚无活动租约时也会出现。分叉基线仅提供观察及原用户提示。当前投影没有确认所观察的前置条件属于哪个 gate,因此一个仍待用户决定的事项也会收到面向 Agent 的批准命令。 实现位置
动机 / Motivation
维护受阻 Agent 工作和定时 Monitor 的操作者,需要让已授权的外部前置条件接上后续工作。 文件已就绪时,原 Monitor 可以记录观察,却没有告诉 Agent 如何以已获授权的身份关闭关联事项。候选在 poll 之前加入 User gate 的完成命令。 候选在 File 和 SQLite 上恢复了已经授权的文件前置条件。目标工作先转为 open,下一轮仍要取得自己的租约。两条 Monitor 观察各留回执,业务扣额为零。 本次评审的入口是 quota guard 的 CLI 指令以及其引导的原 Todo 完成事务,监控回执、独立新轮授权及用户决策各有原 owner。
改动思路 / Approach
把观察提示留在现有 Monitor 指令,把批准命令交给已验证的关联和明确的 User 决策路径。 公开给 Monitor 的动作只处理它获准核验的前置条件;对无关或仍待人决定的事项给出只读定位。 既有 User 完成通过 scope 与关联任务的原事务处理,现有 Monitor 依赖判定只决定是否可以观察。 缺少可验证的 Monitor 与 gate 关联、及预先授权的证据条件时,显示只读定位和用户行动。仅在现有权威事实证明这两项条件后,为那个精确 gate 提供完成动作。若暂无可复用的类型和检查,保留人工流程和所属 gate 的原有效完成入口。
具体改动 / Changes
3 个文件,增加 205 行,删除 1 行。 本轮按主干的 docs/reference/protocols/quota-monitor-observation-receipt-v0.md 核对「Monitor 原轮观察和无额度结算」和「独立观察不授予用户决策」。后者的失败可与已通过的行为并存。独立的监控观察有明确边界,绑定 Agent 和 Gate lease 并不证明用户本人批准。Monitor 协议 · Todo owner 约定
- _build_interaction_cli_channel负责决定进入该分支的条件。扩大了 Agent 自动载入的后续指令。原 poll 仍绑定同一 Monitor,合法后继仍要重新准入。
- _monitor_user_gate_handoff_actions 是本次实际验证的调用链,回读使用原结果类型。
- planUserCompletion仍是原规则的一部分。既有 User 完成通过 scope 与关联任务的原事务处理,现有 Monitor 依赖判定只决定是否可以观察。 关联合同或实现
对主干的风险 / Risks
分叉基线 32 项通过、10 项跳过,精确候选 34 项通过、10 项跳过。Ruff、DCO、diff、双语检查及与当前主干的模拟合并通过。 关联 User 完成与 Monitor scope 补充套件 77 项通过。 File 和 SQLite 的 guard 都在独立 Monitor 的动作中显示了通用批准模板,甚至在 Monitor 尚无活动租约时也会出现。分叉基线仅提供观察及原用户提示。当前投影没有确认所观察的前置条件属于哪个 gate,因此一个仍待用户决定的事项也会收到面向 Agent 的批准命令。 在本机 Bash 和隔离的 File、SQLite 中运行。未核验 PostgreSQL、原生 PowerShell、真实发布或托管 CI。
我的整体评价 / Verdict
请求修改。保留已验证的正向修复,同时补上上述反例。用两库重放已授权关联、无关 owner gate、缺少活动租约以及已结算的轮次。断言无关事项不产生 Agent 批准命令或审批事务,合法证据仍能使唯一目标在自己的新轮恢复。
English verdict: REQUEST_CHANGES at bbbecd4. The allowed prerequisite resumes correctly. An independent due Monitor is also given a runnable approval recipe for an unrelated User gate that still requires an owner decision. The fixture shows the recipe before the Monitor holds an active lease and while the independent owner decision remains outstanding.
Replace the projected completion command with a read-only notice. A due Monitor that is admitted while the agent has open User gates is told that its observation cannot complete or approve a gate, which attempts stay rejected, and that work continuing on an observed change belongs in the poll's own successor. Unrelated owner decisions receive no command. Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com> Co-Authored-By: Claude <noreply@anthropic.com>
|
Thank you — the P2 is right, and the fix is to remove the command rather than narrow it (commit What I checked. I looked for an existing typed fact that could prove the two conditions you named: that the observed prerequisite belongs to one specific gate, and that the agent is pre-authorized to confirm it. I did not find one. User Todos cannot carry a What changed. The projected User completion command is gone. An admitted, Turn-bound due Monitor whose agent has open User gates now gets a single read-only notice between the Monitor instruction and the unchanged poll: an observation never completes or approves a User gate; do not pass this Turn's id or claim proof to a gate completion and do not attach evidence through No gate id and no completion or approval command is projected, for linked or unrelated gates. The notice is not shown before the Turn is bound, and the projection is unchanged when the agent has no open gate. Tests. The PR title and description are updated to match. If a typed "evidence prerequisite an agent may confirm" is something you want, I am happy to draft it separately; it is not part of this change. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max
[P2] 独立观察被提示成另一个用户门禁的证据。 同一 Agent 只有一个无关发布门禁时,guard 仍明确准入库存 Monitor。真实的观察只结算 Monitor,库存后继可用;发布门禁仍 open、发布工作仍 blocked,输出却要求将库存证据作为那个待用户动作。 保留「观察永不批准」和原 poll;拿掉无条件的报给门禁语句。仅在另有已核实关联且通知合同允许时,按原用户通知路径陈述事实。 位置。
动机 / Motivation
之前为了避免来回尝试,把一个可执行的 gate 完成命令交给 Monitor;旧评审复现了它会波及独立的 owner 决定。 同一 Goal 里既要定时读取外部事实、又有另一个待用户决定的操作人员和 Agent。 例如,负责检查公开库存的 Monitor 到期;同一个 Agent 还有一项向外发布的决定,没有证据表明库存变化与发布批准有关。 两个后端都只准入独立 Monitor,能记录变化并在新 Turn 选中库存核验后继;新版却指示把这条观察作为另一个门禁的待用户操作来汇报。 只核验源代码 CLI 与独立的 File/SQLite。未运行装包、真实模型采纳、Windows pwsh 或 PostgreSQL;这个 PR 不增加临时授权。
改动思路 / Approach
输出新增只读说明;无门禁时及旧选中前绑定路径不变。已有 Gate、settlement、poll 和状态机全部复用。 共用原 poll/settlement builder 足够;只需缩窄新增的提示。不存在独立观察可自动派生确切 Gate 关系的事实来源。 保留已有的 owner 生命周期、Monitor 边界和独立后继,修复一个把证据错误指向门禁的从句。
依据 docs/reference/canonical-todo-completion-update.md,规范版本 8d7d234。条款简称用于对应原文的作用域、结果读回和恢复要求:
- MONITOR-OWN-TURN:在原 Turn 或 provider CAS 按确切主体操作,保持作用域和已有授权。 已复核。
- USER-OWN-DECISION:用户决定保持独立;只变动绑定且覆盖的目标范围,不从观察或复制 evidence 推论权限。 已复核。
- UNRELATED-SCOPE:观察与用户决策分权,同一个观察不能代接用户的批准或误绑另一项 pending action。 未通过。
具体改动 / Changes
完整 diff 只有 CLI 说明、生命周期文档和真实双存储回归。上一轮错误的 complete 命令已移除;不能把“没命令”当作提示内容也安全。
- MONITOR_USER_GATE_NOTICE:说明观察的证据边界,不发完成命令。由旧可执行审批改为说明;该段最后一句把未绑定的观察交给 gate。
- _build_interaction_cli_channel:在已有 poll 指令前插入说明。取这个 Agent 的开放门禁集合,没有比对 gate 与 observation。
- _due_monitor_cli_actions:生成原 poll 和原 Turn 收尾说明。命令、结果哈希、租约证明及不扣额原样保留。
- open_user_gate_todo_items:读取现有待办投影中的开放 gate。可回答是否有门禁,不能表示所观察对象跟门禁是否相同。
上一轮结论和当前改动的对照:此前的复审;作者修后说明。当前验证只用上面列出的提交和隔离环境。
对主干的风险 / Risks
File 及 SQLite 的同一场景基线:原投影没有报给门禁的指令;File/SQLite 的观察及独立后继均兑现。 这次提交:两种存储的后继仍兑现,但两者均输出将库存证据报告为无关发布门禁的待办。 不是对 Agent 行为的观测;结论仅是发给它的命令和文字的真实改变。 触及 CLI 投影;不扩用户触点。若需把另外已核实的证据报告给 owner,应使用原 user_channel 决策。
- PASS — tests/control_plane/test_monitor_gate_handoff.py 与同轮结算、到期重排测试:64 passed, 2 skipped
- FAIL — 建立同 lane 却不相关的公开库存 Monitor 与生产发布 gate,在 File/SQLite 运行 guard、真实变化 poll 和后继选择,断言没有交代把库存证据作为发布 gate 的证据,原 gate 原封不动。 同一 Agent 只有一个无关发布门禁时,guard 仍明确准入库存 Monitor。真实的观察只结算 Monitor,库存后继可用;发布门禁仍 open、发布工作仍 blocked,输出却要求将库存证据作为那个待用户动作。
- PASS — RFC 双语差异及 whitespace 确认通过,Ruff 对新增测试通过;不请求或等远端 CI。
- UNVERIFIED — 远端 CI、未执行的宿主及 provider 见范围说明。评审与合并资格分开。
我的整体评价 / Verdict
REQUEST_CHANGES。保留「观察永不批准」和原 poll;拿掉无条件的报给门禁语句。仅在另有已核实关联且通知合同允许时,按原用户通知路径陈述事实。 共用原 poll/settlement builder 足够;只需缩窄新增的提示。不存在独立观察可自动派生确切 Gate 关系的事实来源。 保留已有的 owner 生命周期、Monitor 边界和独立后继,修复一个把证据错误指向门禁的从句。 CLI 没有视觉或布局改动。
English verdict: REQUEST_CHANGES at fa606c4. Removing the gate completion command preserves owner authority, but a bound inventory Monitor is still told to present unrelated evidence as a pending release gate action. File/SQLite base/head reproduce the text regression with the same successful successor.
The notice told the agent to report the observed evidence as the pending user action of an open gate, even when the gate was unrelated to the observation. Keep only the boundary (an observation never completes or approves a gate) and the original poll. Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed in commit The notice now only states the boundary and points to the existing successor route: a Monitor observation never completes or approves a User gate; do not pass this Turn's id or claim proof to a gate completion or attach evidence through The regression (File and SQLite, with a linked gate and an unrelated scoped release decision) now also asserts the notice contains no reporting instruction; it and |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max
评审提交 f74ec79d4044a4e23735545ff3232a394285a91e,实际 Git 共同基点 859a23ee9534539536343206e23452253528dd07。与主干快照 59e68906d4082f43fae52e4219e374c5e97539a9 的合树检查通过。 上一版评审
本次复审未发现阻断项。
动机 / Motivation
Agent 跟踪输入文件时,需要记录观察并交给后继处理。同一 Agent 还可能在等人批准另一项操作。 原说明曾要求把库存观察作为发布门禁的待办证据。新提交删除了这个报告动作,观察只送回绑定的 Monitor,发布决定仍由原用户门禁处理。 File 和 SQLite 都只记录一次观察,重试走原回执,业务扣额为零。独立库存后继在新的 scoped guard 获准,发布门禁仍待决定。 本次验证覆盖源码 CLI、独立 File 和 SQLite、用户门禁与后继回读。实际 Windows 运行、PostgreSQL 和宿主对新提示的采纳仍待验证。 源代码上的提示与原观察路径已验证,实际 Windows 宿主对追加提示的采用仍待验证。
改动思路 / Approach
原 Monitor 指令生成处已有期限、选中待办和原 Turn。把提示留在这个入口,观察写回及用户决定仍由各自的原事务处理。 本项交付到期 Monitor 的提示修复。当前生产机制只在原投影增加一条说明,后继仍由原 monitor-poll 发出。
静默继续会让 Agent 重试错误的门禁动作。在现有提示处消除这条错误引导即可。 按照已有的说明型调用原则,实际核验观察以后是否还有独立工作。当前改动的验收边界是 CLI 引导及原工作能否继续。
具体改动 / Changes
完整差异为 3 个文件,增加 142 行,删除 1 行。上一头误指用户动作的从句已删除。无门禁、无绑定 Turn、已结算的路径保留原动作。
按 docs/reference/protocols/quota-monitor-observation-receipt-v0.md 的 859a23ee9534539536343206e23452253528dd07 版本逐项核验。下列短名对应规范中的实际条款。
MONITOR-OWN-TURN观察仍绑定 Monitor 的原 Agent、Todo 和 Turn,重放不产生第二观察或扣额。 通过。INDEPENDENT-SUCCESSOR实际物质变化可通过既有 Monitor 后继发出独立工作,后继另行准入。 通过。USER-DECISION-SCOPE独立观察只处理该观察,不产生审批或关联无关用户决定。 通过。
关键代码讲解
- _primary_due_monitor 识别到期、选中、必须观察的原 Monitor;普通工作、已结算的原轮及辅助观察不走新增提示。
- MONITOR_USER_GATE_NOTICE 规定观察证据交回原 poll,既无审批命令也不把观察指给某个 gate。
- _build_interaction_cli_channel 在原执行指令首段与 poll 命令之间加一条提示;未绑定 Turn 和无 gate 不增加这条提示。
- open_user_gate_todo_items 沿用当前 Agent 的门禁投影,显式 User Todo 类型先判定。开放门禁的存在只决定是否显示提示。
对主干的风险 / Risks
在分叉点和当前提交,实际读取合成公开库存文件、用 SHA-256 提交原观察、再重放。两库原命令和门禁状态相同,新头只多一条提示。强制要求该提示的同一测试在分叉点两库都失败;新头两库都通过。
本地 108 通过、2 跳过(源码 CLI 及 Monitor/门禁相关套件),6 项直接及 19 项选定检查通过。每个提交都有 DCO。 用 --next-agent-todo 添加后继时,CLI 要求显式 --next-action-kind。例子加上 validate 即可直接走已复验路径。
我的整体评价 / Verdict
批准。原观察和后继均可以继续,已明确保留用户决定。新说明只显示在已绑定的相关 Monitor 入口。真实宿主采纳仍待验证。合入资格以当时的分支与线程读回为准。
English verdict: APPROVE. The bound Monitor keeps its original no-spend poll and independent successor. The notification no longer associates an observed change with an unrelated owner decision.
Goal And Delivered Outcome
continuous_monitorwatched for an externally supplied file while the same agent had an open User gate linked to blocked work. Once the file appeared, the agent tried to complete the gate with the Monitor's--turn-instance-id(correctly rejected:settlement binding does not match the original quota guard), then tried a plaintodo updatewith evidence (correctly rejected:handoff_mode_requires_lease), and then kept polling. Nothing in the projected actions told it that an observation cannot settle a gate, or where work that should continue on an observed change belongs.--material-changewith--next-agent-todo).This revision replaces the first version of this PR, which projected a User completion command. Review showed that command reached unrelated owner decisions, and there is no existing typed fact that ties a Monitor's observation to one gate or pre-authorizes an agent to confirm it. The command is removed; no gate id and no completion or approval command is projected.
Author Declaration
loopx/control_plane/work_items/interaction_contract.py(MONITOR_USER_GATE_NOTICE, inserted in_build_interaction_cli_channel)tests/control_plane/test_monitor_gate_handoff.pytest_monitor_due_requeue.pykeeps the single binding action for an unbound Turnunblock_resume.state=resumeddocs/reference/canonical-todo-completion-update.mdNo approval inference, schema, authority, lease or scheduler rule changes.
Scope And Continuation
Validation
tests/control_plane/test_monitor_gate_handoff.pypwshmissing/empty-hash cases oftest_monitor_poll_shell.pythat fail identically on unmodifiedmainon this non-UTF-8-locale Windows host (the capturedstderrisNone)Type of Change
LoopX Area
Boundary Checklist
Signed-off-bytrailer.🤖 Generated with Claude Code