Repository navigation
fix(coordination): reject bound-Todo foreign claims and unqualified goal_ref on the canonical claim wire - #5248
Conversation
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. 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 HEADFor a same-repository clone whose Keep the DCO |
…dback Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
…alification Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
Signed-off-by: Lihua <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Reviewed head 60d59d6c3beabf202391095054cbe88b9985d81e
[P2] 共享运行目录里的房间恢复会互相覆盖重试游标。 两个 collector 使用同一个运行目录,各自只恢复自己配置的房间。两个范围都有原卡更新持续失败的记录。 File 和 SQLite 各让房间 A、B 交替执行三轮。限额为 1 时,A 每轮都重试同一张失败原卡,后面的有效原卡得到零次尝试。单独运行 A 的对照在第二轮读回原回执。 游标路径
动机 / Motivation
获准的房间成员在领取已提交后,需要在发起领取的同一张卡上看到 LoopX 回执。 上一轮同一个 collector 持续重试失败的前缀。当前版本让单个范围轮转,两个不同范围共用运行目录时仍会互相改变起点。 单个范围能恢复原回执。两个范围交替时,已经领取的有效回执仍可能送不到原卡。 本次交付限定在受控领取与私有恢复。Agent 工作选择中的发现、执行及向原请求返回结果由既有管家流程接续。 维护者确认的交付范围
改动思路 / Approach
Todo owner 负责接受领取。投递重试沿用 collector,游标只负责本范围的扫描顺序。 本次范围包含 Agent CLI、受限房间回调和私有续接。管家自动委派走现有入口。 可信的原领取意图经过 TypeScript Todo 事务,按 actor、source、revision 和原期限提交一次。Lark 回调把已接受的 receipt 保存在发起交互的记录。回调传输失败时,collector 校验当前权限后再尝试更新同一张卡。继续复用这一过程,只需让已生效的房间范围各自推进轮转。 原交互恢复规范
具体改动 / Changes
基点为 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25,完整提案 32 个路径、+3468 / −33。从 8307eab7e 以来变动集中在恢复循环、回归用例和说明。其余 29 个路径核对无差异。当前主干与提案重叠在 effect handler 注册表,静态合并预演通过。 前轮评审
按 docs/architecture/rfcs/agent-im-openviking-collaboration-v0.md 的 Reconnect And Replay 与 Smallest Useful Slice 核对验收。
| 条目 | 当前证据 |
|---|---|
| canonical-ownership | CLI 与回调都调用现有 Todo CAS,新版本的测试仍覆盖两个本地进程竞争。 |
| uncertain-send-retry | 同意图重放读回已接受的原消息和回执。 |
| callback-committed-receipt | 提交后的投影读失败用例继续读回原卡的同一回执。 |
| current-scope | 当前绑定、用户身份和有效期在领取或私有续接时复核。 |
| bounded-result-recovery | 单范围的原反例已通过。共享运行目录中的两个范围仍会阻塞有效回执。 |
| live-reconnect | 真实飞书、两个鉴权主机与 daemon 续接留待联调。 |
关键代码讲解
executeClaimAttempt用现有 Todo CAS 解释来源及期限,保留 managed v2 入口,沿用 v3 和 v4 的受控 wire。 领取入口run_goal_channel_work从原领取意图获得稳定的投递身份,允许在回包丢失后定位原结果。 CLI 路径recover_room_claim_results在锁内过滤失效或已送达记录。计数只在实际传输前增加,游标保存上一轮最后尝试的文件名。当前游标固定在整个运行目录下。 轮转恢复run_room_resume从现行来源与当前身份读回私有上下文,能够衔接现有 quota 和 Recall 验证。 私有续接
对主干的风险 / Risks
File 和 SQLite 各让房间 A、B 交替执行三轮。限额为 1 时,A 每轮都重试同一张失败原卡,后面的有效原卡得到零次尝试。单独运行 A 的对照在第二轮读回原回执。 两个范围的合成传输都收到了自己的失败卡尝试。实际 File/SQLite 快照表明已领取归属和 revision 在恢复期间相同。第二个范围写回共享游标后,第一个范围下轮从第二个范围的位置开始扫描,转回自己原来的前缀。配置允许不同房间范围使用同一个运行目录。 生产恢复调用
让游标随 collector 的有效投递范围隔离,保留每轮尝试上限和现有权限复核。 在 File、SQLite 上交替运行两个房间的恢复,断言 A 的有效消息收到原回执,B 保留自己的恢复进度,并核对两边的 canonical 状态和每轮上限。
语义与 CI 对齐
- PASS — 当前完整相关套件 245 个 Python 与 11 个 TypeScript 用例通过,变更范围 Ruff 和 RFC 双语检查通过。 单范围在限额 1 与默认限额 20 下都读回后面的原卡回执,持续失败卡继续可重试。
- FAIL — 两个真实本地 provider 的交替范围反例均复现。当前使用私有排序状态,影响现有原卡回执的恢复保证。
- FAILED — 预合并 6 项直接检查通过,19 项所选检查通过 18 项。CLI 输出预算 smoke 在本轮超时,失败原因待定位。
我的整体评价 / Verdict
请求修改。当前提交解决了原单范围阻塞,多个 collector 实际相互覆盖游标的问题影响原卡回执的长期可见性。修复可以留在当前投递 owner 中,使用现有配置划分范围,并以交替恢复的同一反例验收。
通过合成飞书传输核对原卡内容与回执读回。 真实飞书渲染、独立鉴权主机、daemon 重连、安装版与 PostgreSQL 仍待验证。
English verdict: REQUEST_CHANGES at 60d59d6. The single-collector fix works. Collectors sharing one runtime root still overwrite each other's recovery cursor, starving eligible result cards. Isolate the cursor by delivery scope and retain the attempt cap.
| # failures are never terminal: their record, card and receipt evidence | ||
| # stay untouched, and only a verified delivery exits the retry queue. | ||
| # The cursor is an ordering hint; losing it only repeats this order. | ||
| cursor_path = runtime_root / "room-claim-offers" / ".recovery-cursor.json" |
There was a problem hiding this comment.
[P2] 恢复游标需随投递范围隔离。 两个合法房间范围使用同一个运行目录时,会在同一路径保存重试位置。File 和 SQLite 各提交三次实际领取,交替恢复三轮。A 每轮只重试同一张失败卡,健康卡得到零次尝试。单独运行 A 时第二轮读回原回执。沿用现有作用域与每轮上限,为各范围保留自己的恢复位置,并补上两个范围交替的回归。
The rotation cursor lived at one fixed path under the shared runtime directory. Configuration allows different room scopes to share that directory: two collectors each recover only their own configured chats, but every finished round wrote the same cursor, so each scope's next round started from the other scope's position and rotated back into its own dead prefix — with limit=1, scope A retried the same failing card every round while its valid cards behind it received zero attempts (reproduced on File and SQLite by alternating the two scopes over three rounds; scope A alone recovered on round two). The cursor is now keyed by the collector's effective delivery scope — Bot app id, sender profile and the sorted allowed chat ids — using the existing configuration division. Collectors with identical scopes keep sharing one cursor; different scopes keep independent rotation. The per-round cap and the in-lock eligibility rechecks are unchanged, and single-scope behavior is identical (the cursor file name changes once; an old cursor is an ordering hint whose loss merely repeats the prior order for one round). Regression (File and SQLite): four committed claims across two room scopes in one runtime directory, each scope's first-sorted card persistently unpatchable, alternating recoveries under limit=1 — round 1 fails each scope's own dead prefix, round 2 delivers each scope's valid receipt onto its original message in its own room, dead records keep their evidence, the per-round cap holds on every call, and the canonical revision never advances. Red/green proof: reverting only the cursor path to the shared unkeyed file makes both backends fail exactly as the reviewer's alternating reproducer described. Signed-off-by: Lihua <[email protected]>
|
Fixed on a new head Root cause, as your alternating reproducer showed. The rotation cursor lived at one fixed path under the shared runtime directory. Two collectors with different room scopes each recover only their own configured chats, but every finished round wrote that shared cursor — so each scope's next round started from the other scope's position and rotated back into its own dead prefix. With limit=1, scope A retried the same failing card every round while its valid cards received zero attempts; scope A alone recovered on round two. Fix — cursor keyed by the collector's effective delivery scope. The cursor filename is now derived from the existing configuration division: Bot app id + sender profile + sorted allowed chat ids (sha256, 16 hex chars, still a dotfile the Alternating dual-scope matrix (File and SQLite; four committed claims across two room scopes in one runtime directory; each scope's first-sorted card persistently unpatchable; recoveries alternate A, B, A, B under limit=1):
Red/green proof: reverting only the cursor path to the shared unkeyed file makes both backends fail exactly as your reproducer described (scope A's valid card starved behind the cross-scope cursor writes); restoring the scope key turns both green. All prior regressions stay green: single-scope rotation (limit 1 and default-20/21-records), revoked-record starvation, committed-receipt retention, restart recovery — 216 related Python cases pass in total. CLI output-budget smoke attribution. I could not reproduce the timeout. Standalone with the same base the canary injects ( Validation on |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Reviewed head d783ab158e5e3b6c7dc3a3ace2ffefbb83f5c87c
动机 / Motivation
获准的房间成员领取工作后,需要在发起领取的原卡上看到回执,Agent 也需要按当前权限恢复私有上下文。 早先两个房间共用运行目录时,一个房间会覆盖另一个房间的重试位置。持续失败的旧卡会挡住排在后面的有效回执。 当前 collector 各自继续原来的扫描顺序,仍有效的回执能回到原卡,已确认的归属保持稳定。 本次交付受控 Agent CLI、房间领取回执和私有续接。管家自动委派仍是默认链路。 真实飞书房间渲染、多主机鉴权、daemon 重连、当前发布版和 PostgreSQL 留待集成验收。 原评审 · 维护者确认的范围
改动思路 / Approach
保留 canonical Todo 主控与现有 Lark 投递。作用域游标只给当前 collector 保存恢复顺序。 本次范围包含 Agent CLI、受限房间回调和私有续接。管家自动委派走现有入口。 现有 Todo CAS 处理领取、期望 revision 和原操作回执。显式启用的 collector 负责把回执送回原消息。游标从 Bot app、profile 与允许房间集合派生,因此两组获准的投递在共享目录内各自推进。本次沿现有投递 owner 修复等待,无须增加独立队列或调度服务。 恢复代码
具体改动 / Changes
相对 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25 共 32 个路径,新增 3551 行、删除 33 行。上一头 60d59d6c3 到当前头只有四个路径变化,集中在作用域游标、测试传输及房间说明。完整差异覆盖 CLI、typed claim、回调、投递恢复、私有续接和验证。当前主干 8e9a28a86 与这组改动的静态合并预演成功。
依据 docs/architecture/rfcs/agent-im-openviking-collaboration-v0.md 的 Reconnect And Replay 与 Smallest Useful Slice,按 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25 核对本次交付。 接受的 RFC
| 条目 | 当前证据 |
|---|---|
| canonical-ownership | 真实 CLI 与受控回调共用现有 Todo owner。同 revision 竞争只提交一次,独立读回确认归属。 |
| uncertain-send-retry | 首次已送达但回应丢失后,同意图读回同一回执与原消息。期间新增无关 Todo 的对照也通过。 |
| callback-committed-receipt | 提交后的投影读失败时,原卡继续显示已确认的回执号。 |
| current-scope | 领取和私有续接复核当前绑定、来源、调用身份与执行前提。阻塞 provider 读取跨过 offer 截止时拒绝领取。 |
| bounded-result-recovery | File 和 SQLite 的交替范围复验在第二轮把有效回执送回原卡,仍失败的记录保留重试资格。 |
| live-reconnect | 真实飞书和多宿主 daemon 续接留待集成。 |
关键代码讲解
executeClaimAttempt复用 canonical owner 的 CAS。受控 v4 在 provider 读取后复核截止,已接受状态按原回执重放。 领取事务run_goal_channel_work按原领取意图读取或送回结果。独立的 projection 保留当前 revision 和归属。 CLIhandle_room_claim_callback核对授权 principal 和原消息,再把接受回执交给现有投递;recover_room_claim_results在当前作用域内补送原卡。 回调 · 游标run_room_resume通过当前 quota 和已有 Turn Recall 恢复私有上下文,authority 变化时拒绝沿用旧观察。 私有续接
对主干的风险 / Risks
前轮在同一运行目录交替恢复时,File 和 SQLite 都只重试失败的首张卡,A 房间有效卡在三轮中没有得到尝试。 当前以相同夹具交替运行 A、B,各范围每轮最多尝试一次。File 和 SQLite 中 A 房间的有效卡都在第二轮收到同一回执,B 继续处理自己的失败记录。完整 canonical 快照保持相同。 原顺序的单范围、默认限额 20、撤销前缀和重启补送也在相关套件复核。 交替恢复回归
共享领取 owner 保留 managed v2。v3/v4 承载守护来源和截止时间,语义沿原 claim contract 扩展。File/SQLite 的合法直接领取和同 key 重放保持原序列,本地对照确认一次写入。与 bound Agent 不符及缺少合格生命周期身份的旧请求显式拒绝。新登记 Agent 在建立自己的房间连接前仍无法从可选入口领取。 直接领取与当前身份
语义与 CI 对齐
当前提交通过 241 项相关 Python 测试、2 项独立双房间复验、14 项独立领取与回执对照及 22 项 TypeScript 测试。Ruff、RFC 双语与本地标准 premerge 通过。 前轮曾超时的 CLI 输出预算 smoke 在本次标准预合并通过。实际 File/SQLite 领取与真实持久回执通过当前 CLI 和回调路径验证。只替换飞书传输,验证更新请求的 message ID、回执正文及读回。 过期、撤销、错误绑定及来源变化保持拒绝。提交后的读失败保留原回执,未知发送响应按原操作查回原卡。
我的整体评价 / Verdict
同意此精确 head 的代码评审。沿维护者确认的范围,后端与 Agent CLI 可独立验收。正常工作选择中的自主发现、完整执行和原请求结果返回由既有 owner 接续。 长程上各投递范围能继续恢复,保留每轮上限与真实拒绝。用户在原卡上读取已接受的回执,默认管家链路保持原行为。本次验收覆盖 CLI 和现有 Lark 卡片的回执后端。对照 apps 与 examples 无改动,回执字段通过原消息 payload 和 readback 核对。 真实飞书房间渲染、多主机鉴权、daemon 重连、当前发布版和 PostgreSQL 留待集成验收。
English verdict: APPROVE at d783ab1. Scope-keyed recovery restored the original receipt in the isolated File and SQLite counterfactuals and preserved canonical state and the per-round cap. Live multi-host adoption remains unqualified.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Reviewed head d783ab158e5e3b6c7dc3a3ace2ffefbb83f5c87c
[P2] 原领取卡是 Card JSON 2.0,提交后的结果更新使用了 1.0。 飞书用户在受控原卡上点击领取,Todo 已接受,回调尝试更新发起领取的消息。 飞书文档对既有 2.0 卡片更新为 1.0 列出错误 200830。 在 File 与 SQLite 的实际领取上,捕获的首次 POST 与重试 PATCH 都以 1.0 payload 更新 2.0 原卡。按飞书版本约束拒绝该请求时,领取照常提交,原卡看不到回执,两种存储的恢复结果均为 attempted=1、delivered=0、failed=1。 飞书卡片回调错误码 结果卡构造
动机 / Motivation
房间成员点击领取后,需要在原卡确认工作已被接手并看到回执。Agent 重连后也要能读回同一份领取记录。 上一版本在两个房间共用一个目录时会互相覆盖恢复位置,这轮的游标修复已复验。 按房间轮转的本地反例已通过。原卡和结果卡的版本错配使飞书送达验收仍卡住。 维护者确认先交付 Agent CLI、受控回调和私有续接,保留管家默认自动委派。 交付范围 前轮游标问题
改动思路 / Approach
继续使用现有 Todo owner、领取回执和投递会话。collector 以当前 Bot、发送 profile 和房间集合划分恢复位置。 受控卡片仅在明确启用时工作。Agent CLI 可独立查验领取、回执与私有续接,归属仍由同一 Todo owner 写入。 授权有效时提交一次领取。失败后由 collector 校验同一消息的投递范围和权限,再重试原消息。结果卡的结构需要与已经发送的原卡契约兼容。
具体改动 / Changes
基点 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25,完整提案 32 个文件、+3551 / −33。上轮到这一头四路径变化,其中一个生产文件,其他 28 路径与已评审提交的 blob 一致。与确认的主干静态合并预演通过。对照 docs/architecture/rfcs/agent-im-openviking-collaboration-v0.md 的 Reconnect And Replay 与 Smallest Useful Slice。 RFC
| 条目 | 当前证据 |
|---|---|
| canonical-ownership | CLI 与回调共用 Todo CAS,同一 revision 竞争只接受一次。 |
| uncertain-send-retry | CLI 发送后丢响应,期间有无关 Todo 更新仍读回原消息和同一回执。 |
| callback-committed-receipt | 结果已有原 receipt,提供给两种飞书更新接口的 1.0 JSON 与 2.0 原卡不兼容。 |
| current-scope | 提交与续接各自校验当前来源、身份和授权,超期或失效样本拒绝。 |
| bounded-result-recovery | 两房间各自轮转,合成传输的正常结果在第二轮回原消息。兼容性问题会让不可接受的结果一直失败。 |
| live-reconnect | 本轮验收到本地 CLI/回调数据,真实环境待验证。 |
关键代码讲解
build_room_claim_card发出的原卡有schema: "2.0"和body.elements。 原卡handle_room_claim_callback提交后把build_work_card的结果保存到last_result_card并用于回调更新。结果使用顶层elements。 构造和保存 结果结构recover_room_claim_results的投递范围和扫描位置已隔离,PATCH 仍携带同一结果 JSON。 恢复及读取 交替回归run_room_resume使用当前绑定和原有 Recall/权限检查,续接返回仅供当前 Agent 读取。 续接
对主干的风险 / Risks
在 File 与 SQLite 的实际领取上,捕获的首次 POST 与重试 PATCH 都以 1.0 payload 更新 2.0 原卡。按飞书版本约束拒绝该请求时,领取照常提交,原卡看不到回执,两种存储的恢复结果均为 attempted=1、delivered=0、failed=1。 测试内仅将结果改成 2.0 结构,同一 Bot、原 message ID 与回执通过 PATCH 和读回,canonical 快照一致。 为回调的成功与拒绝结果生成与原卡兼容的 2.0 payload,将同一结构用于首次更新和已提交回执恢复。 在回调和恢复运输 fixture 中校验原卡与更新的 JSON 版本,核对同一回执回到原 message ID,并确认没有第二次领取。 飞书更新要求
两房间共享目录时,File 与 SQLite 都能在每轮各限一次的交替恢复中跨过失败前缀,第二轮读回各自原回执。错误 Bot、profile 或房间的尝试为零。这部分测试的 transport 接受任意版本,支持的是轮转和权限结论。 同提交的并行评审也验证了这些恢复条件。本轮另核对了飞书的版本约束。 同提交评审
语义与 CI 对齐
正常测试 259 个 Python、22 个 TypeScript,控制面 typecheck 和预合并 6 项直接、19 项所选检查均通过。变更范围 Ruff 与双语 RFC 检查通过。 按供方约束检查更新格式的两项独立反例失败。全局 Ruff 的 F401 和配置 mypy 的 arg-type 与当前主干逐字一致,仍是合入检查缺口。托管 CI 状态未读。 v3/v4 扩展现有 claim 的来源与期限字段,managed v2 及默认关闭下的既有直接调用覆盖已跑。 静态检查修复
我的整体评价 / Verdict
请求修改。游标隔离已经达到本地恢复的范围要求,原始消息上的结果仍会被版本约束拦住。将两种更新的结果改为兼容 2.0,再核对原回执和权属。飞书消息版本在新路径上有变化,未取得同一原卡从领取到回执的实际呈现。 飞书真实卡片渲染与同一消息读回待复验。 测试使用实际 File/SQLite 权威及合成 Lark transport,版本拒绝依据飞书文档。已安装 App、真实飞书房间送达与渲染、多主机、daemon 续接和 PostgreSQL 尚待验收。 Agent 自主发现、受控执行及结果返回原请求由管家与工作选择链路接续验收。
English verdict: REQUEST_CHANGES at d783ab1. The scoped rotation fix passes. A successful room claim sends a 1.0 replacement to a 2.0 card on both callback update and recovery. An independent File/SQLite reproduction enforces Feishu's documented version constraint and leaves the original card without its receipt. Keep the update compatible with the original 2.0 schema.
| # the durable offer. The native owner checks after its reads. | ||
| raise RoomClaimCallbackError("offer_expired") | ||
| committed_receipt = claimed.get("receipt") if isinstance(claimed.get("receipt"), Mapping) else None | ||
| card = build_work_card(claimed) if ( |
There was a problem hiding this comment.
[P2] 原领取卡是 Card JSON 2.0,提交后的结果更新使用了 1.0。 在 File 与 SQLite 的实际领取上,捕获的首次 POST 与重试 PATCH 都以 1.0 payload 更新 2.0 原卡。按飞书版本约束拒绝该请求时,领取照常提交,原卡看不到回执,两种存储的恢复结果均为 attempted=1、delivered=0、failed=1。 飞书文档对既有 2.0 卡片更新为 1.0 列出错误 200830。 为回调的成功与拒绝结果生成与原卡兼容的 2.0 payload,将同一结构用于首次更新和已提交回执恢复。 测试内仅将结果改成 2.0 结构,同一 Bot、原 message ID 与回执通过 PATCH 和读回,canonical 快照一致。 飞书错误码 原卡
The scoped offer card is a Card 2.0 payload (schema 2.0 with body.elements), but the committed-receipt result card still used the 1.0 form (top-level elements). Lark rejects updating an existing card with a payload of a different schema (error 200830), so on a real room the confirmation and every recovery patch were refused: the claim committed, the original card never showed the receipt, and recovery logged attempted=1, delivered=0, failed=1 on both File and SQLite (the reviewer's counterexample; only the structure was at fault — switching the result payload to 2.0 made patch and readback pass). One shared Card 2.0 builder now serves every room-facing card: the committed confirmation, the honest unconfirmed hint (both callback result branches), the first in-place update and the recovery patch — the same structure the original offer card carries, so an update always matches its original card. Unified decision on the CLI side: run_goal_channel_work's new-message delivery POSTs the same 2.0 confirmation — new interactive messages accept the current 2.0 schema (the offer card already sends 2.0 through that transport), and one card builder for every room write avoids a second structure for the same receipt. The test transport now enforces Lark's version constraint: an update or patch whose schema differs from the target message's existing card is rejected with error 200830, and every accepted update payload is recorded. With the gate installed, the previous code fails 20 callback-suite cases exactly as the counterexample described; after the fix all pass. A new regression (File and SQLite) asserts the schema match (2.0 with body.elements) on the original offer card and on the recovery-patched payload, the same receipt landing on the original message id exactly once, and no second canonical claim. Signed-off-by: Lihua <[email protected]>
|
Fixed on a new head Root cause, exactly your counterexample. The scoped offer card is a Card 2.0 payload ( Fix — one shared Card 2.0 builder for every room-facing card. A single
Unified decision on the CLI side (prescription 2). Version validation in the transport (prescription 3). The test fixture now enforces Lark's constraint at both write sites — New regression (
The room-work reference (EN body + 中文边界) now states the card contract: all room-facing cards are Card 2.0, the first update and the committed-receipt recovery share one structure matching the original card, and the CLI's new-message delivery uses the same confirmation. Validation on |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Reviewed head 59f2ca99cb204968676d4974a58154227bef5609
[P2] 领取回执把合法 Agent 标识渲染成另一个字符串。 登记的 Agent 标识含有合法下划线,例如 agent-ops,领取已提交并生成房间回执。 真实 File 和 SQLite 均把任务交给 agent-ops,但以飞书声明支持的 CommonMark 规则渲染 2.0 回执时,显示为 agent-ops。 上一提交的纯文本结果保留 agent-ops。同一份 2.0 payload 只对标识应用现有转义时,渲染也保留原串。 原消息无法据此准确核对接手者。在共享结果卡构造处保留动态标识的字面义,复用现有 _card_text 转义,并保留 Card JSON 2.0。 结果卡 飞书富文本契约
动机 / Motivation
使用受控领取的房间成员需要在原消息确认接手者和回执号。 上一提交以 1.0 格式更新 2.0 原卡,领取提交后原卡仍无法显示回执。 当前提交在 File 和 SQLite 上都能把 2.0 回执送回原消息,首次回调和失败后恢复均成立。 这次提供 Agent CLI、受控卡片回调和私有续接,默认的管家自动委派沿用原有入口。 真实飞书渲染、独立鉴权主机与 daemon 续接,以及 Agent 常规发现任务和结果回到原请求,仍待各自验收。 维护者确认的交付范围
改动思路 / Approach
卡片 schema 和文字解释由 Lark adapter 负责。canonical 归属、当前范围和私有续接由已有的 Todo、授权和 Recall 入口负责。 本次结果卡调整覆盖原消息和 CLI 新消息,回执仍绑定实际接受的领取。 领取与续接继续经过当前身份、期限及来源校验。房间投递在提交后生成确认,收到响应时核对原消息。响应丢失时,collector 在当前 Bot、发送 profile 和房间范围重试同一份回执。 投递入口 恢复
具体改动 / Changes
完整提案 32 个文件,+3630 / −33,基点 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25。本轮变更四个路径,其他 28 处的 blob 和模式均与上次评审一致。已核对同一比较基点、变动的 provider 调用与文档,再对当前的主干 8e9a28a866da06cc6fd63e78709910fe35dad564 做静态合并预演。普通领取在相同 Todo CAS 上运行,投递失败仍可读回原接受事实。 上一轮评审 新提交
依据 docs/architecture/rfcs/agent-im-openviking-collaboration-v0.md 在 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25 的 Reconnect And Replay 与 Smallest Useful Slice。
| 验收项 | 当前提交证据 |
|---|---|
| canonical-ownership | 两个独立 CLI 进程共用同一 CAS,同 revision 仅一项取得权属。 |
| uncertain-send-retry | CLI 丢响应后复用同一接受、投递键和回执。 |
| callback-committed-receipt | 两种后端的 POST 和 PATCH 均通过 2.0 更新约束,并读回原消息。 |
| current-scope | 原身份、Bot、房间、来源和有效期在执行或恢复前复核。 |
| bounded-result-recovery | 同一 2.0 记录恢复后不再尝试,领取状态保持一致。 |
| live-reconnect | 当前验证限本地后端和合成消息传输,真实环境待验。 |
关键代码讲解
build_work_card为原接受事实或实时预览构造卡片,收据中仍独立使用不可变 ID。新模板把动态标识插入 Markdown。 构造handle_room_claim_callback通过现有权威提交一次,保存同一 2.0 结果 JSON,首次更新使用原消息和当前 callback token。 回调recover_room_claim_results在投递范围内找待更新的原消息,复用已保存 payload。 恢复run_room_resume通过当前 scope 读取私有上下文,并持续沿用既有 Quota 和 Recall。 续接
对主干的风险 / Risks
原反例的两个后端各含首次更新和恢复两个场景。父提交四例的 1.0 更新均被模型化的版本约束拒绝。当前四例均以 2.0 读回同一消息和回执,恢复不推进 canonical 状态且后续尝试为零。 这解决了上轮报告的卡片版本错配。合成传输从原消息读回的 JSON 相同,因此状态为 verified。复验时应在两个后端核对 JSON 和渲染后的标识。 上轮版本问题 既有转义
飞书支持 2.0 新消息。7.20 前的客户端会显示升级提示,这个渲染边界也适用于新 CLI 房间卡片。房间的默认关闭、直接领取和旧 managed v2 的测试保持原范围。 飞书 2.0 说明 发送接口
语义与 CI 对齐
三组房间测试 162 例、Recall 与 outbound guidance 81 例通过。预合并 6 项直接检查、19 项所选检查均通过。 22 个 TypeScript 用例及控制面 typecheck 通过。 变更范围 Ruff 与 Git 差分通过。 首次批量 Python 校验因磁盘空间不足退出,分批重跑后完成。两个独立显示用例仍为 FAIL。全局 Ruff 和配置 mypy 复用了上轮与同一主干一致的失败证据,本提交的诊断源文件 blob 一致。它们仍是合入检查缺口。CI 策略为本地验证。既有 v3/v4 增量表达来源与截止时间。这次 2.0 格式由 Lark provider 消费,沿用原有 wire 和权限逻辑。 同主干静态修复
我的整体评价 / Verdict
请求修改。领取提交和原卡回执恢复已达到本地验收。可见 Agent 标识要与实际接手者一致,才能靠同一张卡确认领取。通过标准 Markdown 解析实际发送的 payload,核对可见标识与 canonical 归属。 真实飞书客户端和已安装 App 的显示效果仍待验证。 保留 2.0 结构,在结果构造器保留标识字面义。独立主机、daemon 续接与 PostgreSQL 仍待验证。
English verdict: REQUEST_CHANGES at 59f2ca9. Both stores pass Card JSON 2.0 callback and recovery, with the same receipt on the original message. The new Markdown result renders a valid registered Agent ID differently from the committed owner. Escape dynamic identifiers while preserving the 2.0 schema, then rerun the literal-ID and recovery checks.
| and the recovery patch, so an update always matches its original card.""" | ||
| return {"schema": "2.0", "config": {"update_multi": True}, | ||
| "header": {"title": {"tag": "plain_text", "content": title}}, | ||
| "body": {"elements": [{"tag": "markdown", "content": body}]}} |
There was a problem hiding this comment.
[P2] 领取回执把合法 Agent 标识渲染成另一个字符串。 登记的 Agent 标识含有合法下划线,例如 agent-ops,领取已提交并生成房间回执。 在两种本地后端,任务均交给 agent-_ops_。按飞书支持的 CommonMark 渲染规则,当前回执显示为 agent-ops,上一提交的纯文本保留原标识。使用既有 _card_text 的转义对照保留同一原串。保留 2.0 结构,并在两种后端同时核对原卡回执和渲染标识。 飞书 2.0 富文本说明
Card 2.0 markdown elements parse CommonMark, so the raw interpolation of a legal Agent id such as agent-_ops_ rendered as agent-ops: the underscores were consumed as emphasis markers and the readable card could no longer name the claiming agent (the pre-2.0 plain-text card and the escaped offer card both preserved the literal string). Every dynamic identifier interpolated into the shared result card's Markdown body — Goal id, Agent id, Todo id, receipt id and source revision, in both the committed-confirmation and the orientation branch — is now escaped with the existing _card_text rules (numeric character references), reusing the same owner the offer card already uses. The Card JSON stays 2.0; only the interpolated values change form. The unconfirmed hint carries fixed prose and needs no escaping. Regression (File and SQLite): a registered agent-_ops_ claims through the scoped callback; both the recovery patch (after a lost first update) and the direct first update are checked at the rendering layer, not just payload equality — a minimal CommonMark oracle consumes raw emphasis runs and then decodes character references, and the rendered text must contain the exact original identifier (and receipt id) on the original message. Neutralizing only the escaping fails both backends exactly as the reviewer described; restoring it passes. Legal identifier charsets admit '_' but not '*', so the star case is covered by an escape-to-render roundtrip assertion on the shared rules. The 2.0 version gate and all prior regressions stay green. Signed-off-by: Lihua <[email protected]>
|
Fixed on a new head Root cause, exactly your rendering counterexample. Card 2.0 markdown elements parse CommonMark, so the raw interpolation of a legal Agent id such as Fix — reuse the existing
The Card JSON stays 2.0 — only the interpolated values change form. The unconfirmed hint carries fixed prose and needs no escaping. One card-text escaping seam, both callback result branches and the CLI orientation/confirmation, matching the shared-builder decision from the last round. Rendering-level assertions, not payload equality. The new regression uses a minimal CommonMark oracle: consume emphasis runs on raw delimiter characters only, then decode numeric character references (which CommonMark treats as literal characters, never delimiters). For a registered
On the The 2.0 version gate from the last round stays active in the transport, and all prior regressions remain green (identifier, schema-match, dual-scope rotation, dead-prefix rotation, revoked starvation, committed receipt, restart recovery). The room-work reference (EN + 中文边界) now documents the literal-identifier rule. Validation on |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Reviewed head e8e674252a776084985b1149d9f779faed1e654e
动机 / Motivation
使用受控领取的房间成员需要在发起领取的原消息核对实际归属和回执。 上一评审头的合法 agent-_ops_ 在 Card 2.0 正文变成了 agent-ops。这次在实际发送的 Markdown 中保留了字面值。 只读预览、CLI 新卡和原卡回调均显示登记标识,丢响应恢复读回同一已接受回执。 本次覆盖 Agent CLI、受控回调和私有续接,Steward 自动委派沿用既有入口。 真实飞书客户端、独立鉴权跨主机续接及常规 Agent 发现和回传仍待验收。 维护者确认的范围 上一轮评审
改动思路 / Approach
build_work_card 复用 offer 卡的 _card_text,将 Goal、Agent、Todo、receipt 和 source revision 按字面交给 Markdown 渲染。回调从 canonical 领取的已接受事实构造结果,把同一 Card 2.0 正文写回原消息。恢复复用原回执和投递范围。结果卡和只读预览共享现有 provider 2.0 结构和字面转义。 卡片构造 既有转义 原消息更新 恢复
具体改动 / Changes
基点 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25。32 个文件 +3722/-33。GitHub 文件列表与同基点的全量差分一致。本轮改动限 3 个路径 +101/-9,其他 29 处的 blob 与模式相同。当前 main 静态合并预演无冲突。 当前 main 8e9a28a866da06cc6fd63e78709910fe35dad564 的静态预演核对了合并树。 本轮差分 RFC 验收
| 验收项 | 当前提交证据 |
|---|---|
| canonical-ownership | 两个 source CLI 进程对同 revision 竞争,File 和 SQLite 均只接受一次。 |
| uncertain-send-retry | CLI 丢响应后按原领取和原投递键读回同一回执。 |
| callback-committed-receipt | POST 和恢复 PATCH 匹配原 Card 2.0,原 Agent、Todo 和 receipt 字面值可见。 |
| current-scope | 领取或续接前复核当前 Agent、期限、来源及房间。 |
| bounded-result-recovery | 已接受的同一结果回到原消息,恢复期间的 canonical 快照相同,读回后无需再投递。 |
| live-reconnect | 此项在接受范围中后置,仍需真实飞书与独立鉴权主机验收。 |
handle_room_claim_callback 复用既有 Todo CAS 并保存发送正文。 recover_room_claim_results 从原记录重试投递。 run_room_resume 在有效 scope 中沿用 Quota 和 Turn Recall。 回调 恢复 续接
对主干的风险 / Risks
真实 File 和 SQLite 领取后,独立 CommonMark 解析器从 CLI 新卡、首次回调、丢响应恢复的原卡及只读预览读到原样标识。回调和恢复使用相同的 2.0 正文、原消息和原回执,恢复前后 canonical 快照一致。 错误范围或过期的领取请求被拒绝,File 与 SQLite 的原 Todo 状态保持一致。未启用 collector 时,原直接 Todo CLI 与默认 Steward 路由沿既有规则可用。 回归用例
语义与 CI 对齐
当前提案在真实 File/SQLite 与合成 Lark transport 上通过 255 个选定 Python 用例(含独立渲染对照)、22 个 TS 用例及控制面 typecheck;quick 预合并 6 个直接门、4 个选定检查通过;变更范围 Ruff 和 RFC 成对差分通过。 首轮批测遇到本机 ENOSPC,清理本轮测试目录后通过完整选定范围。与同一主干的历史全局静态检查缺口继续由 #9082 跟踪。本轮按本地证据评审。 静态检查修复 飞书 Card 2.0 契约
我的整体评价 / Verdict
批准此提交。上一处显示回归已解决,独立测试同时验证了原卡恢复及可见归属。在本地 CommonMark 渲染页目视核对了长 Agent ID 的只读预览和原消息恢复回执。下划线保留,Goal、归属、Todo 和回执号均可见。 实际飞书客户端排版、已安装 App、跨主机 daemon 续接和 PostgreSQL 未验证。 这次交付覆盖约定的受控领取和回复,常规 Agent 自动发现及结果回传另行验收。
English verdict: APPROVE at e8e6742. Real local File and SQLite checks preserve literal identifiers in the scoped Card 2.0 paths and recover the same accepted receipt on the original message without another work transition. The render check covered the actual payload in a local CommonMark browser view. Live Feishu clients and cross-host qualification remain unverified.
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. 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 HEADFor a same-repository clone whose Keep the DCO |
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-6 · OpenAI · self_reported
REQUEST_CHANGES · e8e674252a776084985b1149d9f779faed1e654e — 请先收缩新增 CLI 和渠道领取流程,再证明必要增量。
这是维护者本轮明确要求的范围与设计调整。10 月 18 日的评审 允许最小后端/CLI 组合;本次进一步审视这组公共入口是否必要,不声称旧 RFC 禁止新增 CLI,也不重新提出此前已修复的卡片问题。
动机 / Motivation
受影响的是把工作交给管家的用户,以及在日常工作回合中承接任务的 Agent。
当前管家已经能够委派、启动受控执行、接收接收方结论并回复原对话;对于无人领取的任务,也已有候选选择和普通领取机制。5248 增加渠道展示、领取回执和私有上下文续接,但没有在通用入口补齐从发现候选到主动承接的行为。
希望得到的可观察增量是:合适的 Agent 沿既有入口承接授权范围内的任务,继续执行并返回结果;确有房间交互需要时,只增加必要的渠道适配。
本轮不要求完成整个多 Agent 路线图、真实多主机或 OpenViking 集成,也不要求重新增加前端。
这里需要纠正基线:已有能力不等于所有默认入口的发现、唤醒和选择都已充分验收,但也不能把尚未完整验收写成“缺少委派/回收能力”。当前还没有对照证据证明普通 Agent 会因缺少这五个新命令而无法承接任务,因此应先定位真实缺口,避免让新配置、命令和恢复生命周期成为通用协作的使用成本。
改动思路 / Approach
共享底层 Todo authority 是正确方向,但不能单独证明五个新的公共命令及其渠道生命周期都有必要。
本 PR 应收缩到有明确调用需求的最小渠道适配;通用领取和续接复用现有 owner,无已证明需求的 offer/revoke 生命周期暂缓。
当前实现确实没有第二套 Todo 数据库:CLI 仍把领取交给 canonical owner,TypeScript 保留原子比较、归属和回执,Python 负责渠道和 provider IO。问题在公共工作流的增量:work claim 执行前要求 exact enabled Agent channel 并验证投递;work resume 在原 Recall 外增加房间、quota 和状态复核。这些约束对受控房间操作可以合理,却不能成为普通 unclaimed task 承接的必要前提。不要机械拆成几条 shell 命令而丢失事务约束;应在同一个 typed owner 上合并入口,明确哪些是领取的必要条件,哪些只属于渠道操作。
| 已有能力 | 当前 PR 的实际增量 | 修改方向 |
|---|---|---|
| 管家 handoff、Delegations.start、接收方 adoption、manager-inbox report 和原对话返回 | 此链路没有由 5248 新建 | 明确保留默认路线 |
| quota 候选、Agent 显式选择、todo claim、执行前准备 | 房间筛选投影、带渠道校验的领取及回执发布 | 先复用既有选择/领取 owner,逐项证明新增入口 |
| scoped Turn Recall | quota/房间状态复核与私有上下文返回 | 明确它是 context refresh,不是执行或会话重启 |
| 已有 Goal Channel 投递和 callback 基础设施 | 限定 principal 的 offer、撤销、过期、私有记录与恢复游标 | 有具体外部领取需求才保留完整生命周期 |
对通用主动领取的改进,应由现有 selection、wake、claim、execution preparation 和 result-return owner 承担。当前 action_portfolio 的 explicit choice 是 Agent 的选择,不是新增用户审批;不应为了“自动”取消这一承诺边界,也不应加入第二套 scheduler 或高频轮询。
具体改动 / Changes
相对 merge-base 6a0f8bc17b439f1e5fa1d389ad5a87faf7d73b25,完整差异为 32 个文件、+3722/-33。这个数字描述维护表面,不是行数否决线。生产改动包括五个 CLI 入口、TS 房间投影/claim request/resume 校验、canonical source/deadline/归属约束、Lark callback 和恢复、Recall 与 heartbeat identity 兼容;其余包含测试、参考文档、RFC checkpoint 和 TS 构建入口。新增 UI 已从当前提案撤回,不再要求重复删除。
关键代码讲解
- CLI 注册 一次暴露
project|claim|offer|revoke|resume。请逐一给出真实调用者、既有入口无法满足的差异和最小保留边界;命令能运行和有测试不等于这组产品表面必要。 - run_goal_channel_work 先校验身份/渠道和投递,再调用既有
claim_canonical_todo_if_promoted;领取与投递失败分别保留事实,同一 key 恢复原回执。保留这些不变量,但不要把渠道前置条件推广到普通 Agent 工作。 - 房间投影 复用领取判定筛选候选,
selected_todo取available[0]。这是房间只读摘要,不能证明已完成通用优先级选择、唤醒或自主承接。 - run_room_resume 在 retrieval 前后复核 scope、projection、quota,最终调用已有 Turn Recall;不启动执行、不领取 lease、不返回私有上下文到房间。请证明为何需要独立公共
resume,或收敛到原 Recall 的渠道适配。 - offer/callback/recovery 增加私有 offer 记录、principal 授权、撤销/过期和结果重试。它表达不能从 Todo 推导的外部授权意图,不能用派生投影替代;但如果本轮没有这类真实调用需求,应整体暂缓,而非留下孤立记录或删掉安全校验。
依据是上述维护者范围评审(spec_revision=5563545930)以及变更前 Agent IM / LoopX / OpenViking RFC。下列是对既有要求的对应标签,不冒充 RFC 原有编号:default-delegation 已保留;no-new-frontend 已落实;reuse-existing-owners 底层有复用,但公共入口必要性仍待本轮收缩;autonomous-adoption 仍是既有工作选择 owner 的验收缺口;live-multi-host 不在本轮要求内。本次“重新论证并收缩五个入口”是维护者当前方向,不从 PR 新写的文档反推旧验收。
对主干的风险 / Risks
[P1] 新公共领取工作流的范围与当前需要解决的问题不成比例。 定位:loopx/cli_commands/goal_channel.py:234–258。触发场景是 Agent 要在正常回合承接一个未领取任务:已有通用候选/选择/claim 路径,而当前新增入口把房间连接、provider 验证、回执展示和可选外部授权组织成另一组操作,未建立普通回合发现与承接的新增行为。即使全部专用测试通过,也不能证明这组入口能改善该场景;长期需维护命令、版本、回执及失败恢复,而用户关心的默认承接路径仍可能没有改善。
最低修改:先用当前 main 列明基线和真实缺口;合并或移除重复的 work project|claim|resume,仅对有明确渠道语义差异的部分保留薄适配;offer/revoke 只有在明确限定 principal 的领取交互确有需求时保留,否则连同专用记录/恢复整体后置。保留的路径应展示实际调用与独立验收,避免仅用手工 CLI 或 fixture 证明需求。通用主动承接若需后续补齐,明确现有 owner 和可观察验收,不把整个路线图压进本 PR。
回归验证应覆盖:正常 Agent 入口在既有授权内发现/选择/独占领取并沿原链路执行返回;无 Lark 时普通领取仍可用;多个 Agent 竞争、错误或撤销身份、bound Agent、陈旧 revision、期限在 IO 中失效、lease/quota/gate 拒绝、丢响应后同 key 恢复,均保留原约束。渠道产物继续只含公开安全摘要;不能为减量删掉 source witness、事务期限、权限、幂等和私有上下文隔离,也不能把现有人工确认型 operation card 强套到普通领取上。
语义与 CI 对齐
当前 main f80e6c4412783a9d5c157e0769cebc872eef5bf7 的 reviewed managed claim v3,与本 PR guarded claim v3 使用同一个 wire schema 字符串,却承载不同请求语义。静态合并预演在 local_authority.py、local_authority_runtime.ts 和 heartbeat_receipt_identity.ts 冲突。请在收缩范围后统一协议 owner/版本,保留已有 managed claim 和历史回执语义,重新验证所有受影响 caller;这属于当前集成问题,不是已部署回归,也不是本条范围 finding 的替代。
本轮 PASS:exact-head 文档/关键源码和既有 owner 对照、完整差异清单、静态合并预演(确认冲突)。本轮 UNVERIFIED:运行时正负例、feature-off 全表面行为对照、File/SQLite/PostgreSQL 实跑及真实飞书渲染;未重跑测试。同 head 的此前批准 中的测试属于原评审证据,不计作本轮执行。远端 CI 同时有通过、失败及跳过,本轮未做失败因果归因,也不以红 CI 作为本条设计要求的依据。修订后至少重跑相关 Python/TS 用例、真实受影响存储路径和 uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main,保留失败与未验证的区别。
我的整体评价 / Verdict
请求修改。底层复用和安全修复有价值,但无法代替对整组新 CLI/生命周期必要性的证明。当前结论是 simplify_now:先交付有真实调用者、可独立验证的最小适配,再讨论可选范围。长期效果与效率目前 not_yet_proven;通用主动承接、命令/模型成本和人工介入是否改善,都需要沿实际入口验证。现有默认管家委派应继续保留,不能把领取回执或 recalled context 等同于执行完成和结果回收。
本轮只审阅卡片构造源码,未重新检查实际渲染。未验证范围包括真实飞书客户端、默认/恢复卡片的长内容布局,以及已安装产品旅程。这些是本轮技术资格的边界,不把此前已修复的卡片错误重新列为当前缺陷。
协议层既复用现有 authority,也扩展了 claim wire 和本地渠道记录;当前主干出现的同名 v3 必须按语义解决,不能仅靠文本合并或为减行数删除历史恢复支持。本次发布的是维护者明确授权的范围调整及静态证据,不是新一轮全量运行时资格结论。完成收缩和集成后,应以新的完整 exact head 重新评审。
English verdict: REQUEST_CHANGES at e8e6742. Narrow and justify the five new CLI entrypoints against the existing delegation, claim, execution and recall owners; retain only evidenced channel-specific workflows and preserve authority, privacy and recovery invariants. Resolve the current-main claim-v3 collision. This is maintainer-directed scope feedback supported by source analysis, not a fresh runtime qualification; tests were not rerun.
|
Baseline/gap analysis for the maintainer-requested scope revision (review of 2026-11-20T07:12:49Z), prepared against current main Baseline on current main (verified by reading main, not assumed)
Entry-by-entry disposition
Recommendation on the borderline item (offer/revoke): defer. I found no current-main caller or accepted-contract slot for principal-limited in-room claiming, so per the review's own rule the whole lifecycle (records, callback, recovery, wires) is deferred rather than left as an orphaned record store. If a concrete in-room claim interaction is scheduled, reviving is a checkout of the branch-history commits plus re-derivation onto main's reviewed-claim basis — noted below. claim-v3 collision — semantic resolution (not a text merge)Main's Retained delta after the shrink (preview)Production: |
…facade Merge upstream/main ddc2f68. The three textual conflicts (local_authority.py, local_authority_runtime.ts, heartbeat_receipt_identity.ts) are semantic: main's todo_claim_request_v3 is the reviewed managed claim (caller-bound provider revision + registry digest, single chat task-start caller), while this branch's v3/v4 were the room facade's guarded/timed wires. Resolution keeps main's owner and wire semantics exactly and withdraws the branch's claim-wire extensions together with their only caller. Per the maintainer scope revision (2026-11-20 review, simplify_now), the room facade is deferred in full, recoverable in branch history: the five 'goal-channel work' CLI entries, the Lark room offer/callback/recovery lifecycle and its cursors, the room TS modules (projection/claim request/resume), the admit_before deadline machinery, the multi-registry-source guard, the recall read-only ingest flag and the resume heartbeat helper, the room suites and the room-work reference doc. Shared files touched only by the deferred surface are restored to main's shape. Retained for this PR: the canonical claim owner's two disclosed guards (bound_agent mismatch, unqualified goal_ref wire rejection) with owner-level regressions to follow. Signed-off-by: Lihua <[email protected]>
The retained production surface of this proposal is the canonical Todo claim transaction's two disclosed guards, now covered by direct owner-level File/SQLite regressions instead of room-facade suites: - a Todo bound to another Agent rejects a foreign claim (bound_agent_mismatch) with zero canonical, receipt or projection effects, while the bound Agent claims normally; - an explicit goal_ref on any claim wire is a protocol failure decided before provider IO (decision_read_from_provider=false), rather than being silently dropped by the runtime adapter's field whitelist — the guard therefore lives at the wire entry in claimLocalCoordinationTodo, reusing the owner's typed failure; - parity: an ordinary unclaimed self-claim applies once and the same key replays the historical receipt without advancing the revision. Red/green: neutralizing both guards fails the four guard cases on both backends; restoring passes all six. The RFC checkpoint now records the maintainer scope decision: the room workflow is deferred (recoverable in branch history, to be re-derived onto main's reviewed managed-claim basis), and this proposal ships only the owner hardening. Signed-off-by: Lihua <[email protected]>
|
Implementation complete on a new head Commits.
Final delta vs main: 5 files, +171/−0.
Validation on
Unverified this round: PostgreSQL (not available locally — the guards' suites and main's reviewed-claim suites above ran on File/SQLite only), real Lark rendering (moot for the deferred surface; no Lark code remains in the diff), installed-App journeys, and independent hosts. The CLI output-budget smoke passed within premerge as before. A fresh full exact-head review is expected per the review's own closing note; merge authority remains with the maintainers. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
[P2] SQLite 回归实际运行在 File。 标记为 sqlite 的三个测试实际均返回 file_v0。authority 没有传出 request.param,_seed 也没有向初始化器传 provider,因此默认选 File。请把实际参数传给初始化器,并在权威读回断言 provider。按此修正的隔离副本已通过三项真实 SQLite 用例和三项 File 用例。 定位到初始化调用
动机 / Motivation
通过普通 Todo 领取入口接续任务的 Agent,依赖任务已记录的绑定和原回执。 旧版本接收了与任务绑定不一致的领取输入,也会忽略旧领取请求中显式写入的 GoalRef。 本提交在真实 File 与 SQLite 上返回对应的拒绝,合法领取与原操作重放都能读回。随 PR 提交的 SQLite 用例实际仍使用 File。 本次交付限于共享领取入口的两项输入检查。房间领取、撤回和重连已从当前差异移除。
验收依据是 Agent IM / LoopX / OpenViking RFC,固定版本 ddc2f687d1ea2cb1e4a7cac1fadee548aca54c80。direct-agent-claim 保留普通领取,scoped-transition 在现有事务执行范围检查,withdraw-room-facade 的房间交互仍留在后续。
改动思路 / Approach
保留普通领取入口,在现有 claim owner 检查绑定,在 wire 入口拒绝该协议尚未支持的 GoalRef。 本 PR 只增加共享领取校验,并复用现有回执和状态所有者。 不匹配的绑定已经在生命周期 owner 有对应拒绝词汇。当前领取入口复用规范化逻辑并补齐读取权威后的检查。 原有 UI、offer 生命周期和同名 v3 扩展已从当前差异撤回。可用真实 provider 读回来保证测试覆盖这两个后端。
具体改动 / Changes
- 净差异 5 个文件、+171 行。原始 local wire 在抽取字段前检查
goal_ref是否存在。已有 v0–v3 格式和回执结构保留。 本地入口 - 共享事务使用当前权威 Todo 的
bound_agent判定新领取,合法绑定与无绑定两条路径继续按当前操作身份提交或读回。 共享判定 - 保留现有成功、拒绝和重放用例。测试夹具必须携带真实 provider 和机器可读的来源断言。当前 PR 描述仍大段描述已撤回的房间 CLI 与 v4 期限处理,可同步为本次实际差异。 当前交付说明
对主干的风险 / Risks
用相同的对照夹具分别初始化 File 与 SQLite。主干四个拒绝断言得到 applied,当前头六项通过。两版普通 CLI 各 17 项通过,覆盖领取、受管执行和回执。提交的 SQLite 参数均实际使用 File,缺少持久的 SQLite 防回归检查。TypeScript 类型检查和标准预合并的 5 项直接检查、14 项选定检查均通过。 验证范围是隔离源码环境的 File/SQLite、普通 CLI 和类型检查。PostgreSQL、安装版和远端 CI 本轮未验证。
我的整体评价 / Verdict
请求修改。两项生产检查在真实 File 和 SQLite 上通过。请让仓库中的回归测试选中实际 SQLite,并断言读回来源,再复核准确提交。本 PR 只增加共享领取校验,并复用现有回执和状态所有者。
English verdict: REQUEST_CHANGES at 7b40f5d. The two claim guards work in independently verified File and SQLite runs. The committed SQLite-labelled cases currently open File; pass the selected provider and assert the native provider readback.
|
|
||
| def _seed(runtime: Path, todos: list[dict], state: Path) -> None: | ||
| projection = build_todo_runtime_shadow_projection(goal_id=GOAL, todos=todos, handoff_mode="soft_claim") | ||
| initialize_canonical_authority(runtime, GOAL, projection, state_path=state) |
There was a problem hiding this comment.
[P2] SQLite 回归实际运行在 File。 标记为 sqlite 的三个测试实际均返回 file_v0。authority 没有传出 request.param,_seed 也没有向初始化器传 provider,因此默认选 File。请把实际参数传给初始化器,并在权威读回断言 provider。按此修正的隔离副本已通过三项真实 SQLite 用例和三项 File 用例。
Clean auto-merge; the five retained files are untouched on the new main (94 commits: research date-range, runtime freshness/queue qualification, chat ingress re-ratchet, admission fixes). No conflict resolution was required. Signed-off-by: Lihua <[email protected]>
The authority fixture never passed request.param to the initializer and _seed omitted the provider, so the three sqlite-labelled cases silently initialized File stores (the reviewer's P2: every case reported file_v0). The selected provider now reaches initialize_canonical_authority, and every authoritative readback asserts its machine-readable source: claim results and the canonical snapshot must report file_v0/sqlite_v0 matching the parametrization, so a future provider-selection regression fails the assertion instead of relabelling File coverage. Evidence: replaying the dropped-provider bug fails exactly the three sqlite-labelled cases on the source assertion (2.3s File-speed run); the fixed suite passes 6/6 in 82s with the sqlite cases on the real SQLite store. Signed-off-by: Lihua <[email protected]>
|
Fixed on a new head Fixture fix, exactly your P2. The File/SQLite evidence:
The guard semantics are unchanged from the head you verified (the two production checks were independently confirmed by you on real File and SQLite; the red/green proof from the previous round still holds — neutralizing both guards fails the four guard cases on both backends). Main refresh. Fetched current main PR description is rewritten to the actual delta (5 files, +182/−0: the two claim-owner guards, their File/SQLite owner-level regressions with source assertions, the TS goal_ref compatibility case, and the RFC checkpoint recording the deferral decision); the stale room-CLI/v4-deadline prose is gone. Validation on |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
Agent 或调用方在已登记的 Goal 下领取任务,尤其是准备接续一个已有负责范围的任务时。 原领取入口可能接受与已有绑定不符的申请,或者丢弃自己无法验证的生命周期字段,给调用方留下不可靠的领取结果。 原来输入的边界与实际领取结果可能不一致。新版从权威 Todo 核对接收者,并在访问存储前拒绝这个旧入口无法承认的生命周期要求。 成功领取只来自已有权威规则,拒绝可读回且没有额外写入,同一普通请求重试保持原回执。 本次仅交付现有 canonical Todo 领取路径的两项加固和明确的范围记录。房间工作流、按钮、回调、记忆接续均仍待后续验证。 完整的房间接续、跨宿主取得并验证投影及飞书用户旅程留在 #5198。 任务来源
改动思路 / Approach
沿用 canonical 领取事务与现有块级拒绝。字段完整性先在请求入口处理,实际 Todo 的现任绑定在共享决策层判断。两个入口复用同一个生命周期拒绝构造器。 本次仅交付现有 canonical Todo 领取路径的两项加固和明确的范围记录。房间工作流、按钮、回调、记忆接续均仍待后续验证。 不再为房间新建第二套领取命令。维护者要求保留的部分直接保护现有多个调用方。 原领取合同
具体改动 / Changes
准确头 756e35df82a3524ec0fd08dd858a99b58c209095,合并基线 e116109c532ae5cf9e6d64bab77c6a07bd690e84。完整 diff 为五个文件、增加 182 行。按基线 RFC,CLAIM_AUTHORITY 与 FRESHNESS_AND_REPLAY 得到验证,ROOM_JOURNEY 保留在当前任务的后续验收。前次指出的 SQLite 用例误走 File 已修。测试使用实际 provider 参数并断言权威结果来源。 基线 RFC
关键代码讲解
- claimLocalCoordinationTodo。在解析其余字段和打开 provider 之前判断输入完整性。 准确提交
- unqualifiedGoalRefClaimFailure。本地 wire 与共享 owner 使用同一生命周期拒绝。 准确提交
- rejectIneligibleTodo。根据当前 Todo 自身的角色和绑定核对接收者。 准确提交
- remote claim 调用端。真实远程服务仍调用相同的 canonical 事务。 准确提交
- File/SQLite 初始化和读回。把 provider 参数传到初始化器,并比较权威读回的来源。 准确提交
对主干的风险 / Risks
真实 File 和 SQLite 中,绑定 Agent 正常领取,无绑定 Agent 正常领取并按原键读回。旧键重试的权威版本保持。 已绑定其他 Agent 的请求返回既有错误形状,Todo 保持无领取人并且没有新增回执。未获支持的生命周期要求在读取 provider 或历史回执之前返回明确拒绝。 变更有意收紧旧入口不具备资格的输入。拒绝保持 typed,用户无需把提示误读为已领取或得到执行权限。两项判断位于共有边界,Lark 房间未参与执行。此 PR 继续依赖主干原来的 CAS、租约、registry 验证和回执重放。
语义与 CI 对齐
准确头 6 项 File/SQLite 实存储回归全部通过,SQLite 三项逐一断言真实来源。Node 线协议 1 项通过。相同现有调用端基线与准确头均通过 146 项。隔离 PostgreSQL 16.15 权威存储 401 项、服务 11 项和认证远程命令 53 项通过。TypeScript 类型检查、定向 Ruff、RFC 配对检查和标准 premerge 通过。 提供的是隔离真实 provider 与本地调用端的验证。已安装 App、真实飞书房间和跨宿主完整旅程尚未执行。
我的整体评价 / Verdict
本次修复把两条已接受的领取约束放回共有 owner。实际 File、SQLite 和隔离 PostgreSQL 的结果覆盖了新入口行为与现有领取恢复。当前准确头可批准。共享领取约束经原有调用端已有独立价值,房间交互需要单独验证外部交互和原路回执。 提供的是隔离真实 provider 与本地调用端的验证。已安装 App、真实飞书房间和跨宿主完整旅程尚未执行。
English verdict: APPROVE at 756e35d. The retained claim guards preserve supported claims and replay. The SQLite scenarios now use the actual SQLite provider, and the existing PostgreSQL authority and remote command suites passed in a disposable environment.
Related to #5198. Scope per the maintainer reviews (2026-11-20 simplify_now, confirmed 2026-11-24): the room-work channel workflow (five
goal-channel workCLI entries, Lark offer/callback/recovery lifecycle, private resume composition, guarded/timed claim wires) is deferred — fully recoverable in branch history, no rebase; revival must re-derive onto main's reviewed managed-claim basis instead of re-aliasing the v3 wire. The merge commits resolve the claim-v3 collision semantically: main's v0–v3 wire semantics are kept exactly.Current delta vs main: 5 files, +182/−0
Two disclosed hardenings of the canonical Todo claim transaction, active for every caller with the Lark room surface absent:
todo_claim.ts): a Todo explicitly bound to another Agent rejects a foreign claim withbound_agent_mismatchand zero canonical/receipt/projection effects; the bound Agent claims normally.goal_refwire rejection (local_authority_runtime.tsentry, typed failure from the owner): an explicitgoal_refon any claim wire version is a protocol failure decided before provider IO (decision_read_from_provider=false) — with main's runtime it was previously silently dropped by the field whitelist, which could make a fresh claim or same-key replay look lifetime-bound without any instance check.Regression coverage:
tests/control_plane/test_claim_owner_guards.py(File and SQLite, the selected provider passed to the initializer with machine-readablesource_authorityassertions on every readback) andtests/control_plane_ts/goal_ref_claim_compatibility.test.ts(rejects before provider or historical-receipt access). The RFC checkpoint records the deferral decision and this retained surface.Validation
loopx canary premerge --from-git-diff --git-diff-base e116109c5(current merge-base)Unverified: PostgreSQL (not available locally; File/SQLite only), installed-App journeys, independent hosts. A fresh full exact-head review and maintainer merge authority remain required.