Skip to content

refactor(quota): share inbox admission construction - #4786

Merged
huangruiteng merged 6 commits into
loopx-project:mainfrom
songoow:codex/share-inbox-admission
Sep 21, 2026
Merged

huangruiteng merged 6 commits into
loopx-project:mainfrom
songoow:codex/share-inbox-admission

Conversation

@songoow

@songoow songoow commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Implements PR-10 from discussion #4738: direct-reply and material-review admission duplicated the same six run-permission assignments. Both now use one construction block; source selection retains its distinct action/reason and reply-first ordering.

The existing quota decision owner remains responsible. Terminal/automation-upgrade precedence, repair clearing, replan suppression and the normal-run-only task-orchestration boundary are preserved. No new helper, vocabulary, provider, schema or permission is introduced. This removes one duplicate construction block; it does not claim that downstream inbox semantics have been unified.

Validation at baseline 361347713:

  • Added 12 source/terminal/upgrade characterization cases; all 20 decision tests passed before the runtime edit.
  • Decision, live quota, facade parity and material-review suites: 46 passed after the edit.
  • 2,048 complete base/head decision comparisons match, including both inbox sources absent, repair/replan guards and orchestration.
  • Real temporary-file inbox priority smoke and inbox CLI smoke pass; no live Lark send or active Goal mutation was used.
  • Semantic vocabulary drift smoke passes after installing the fresh worktree’s TypeScript dependencies (the first attempt could not run its parser).
  • Ruff and diff/public-boundary checks pass. Full repository tests and packaged frontend browser tests were not run for this local behavior-preserving branch consolidation.

The CLI quota decision and Lark inbox consumers keep their existing outputs; no settings, frontend payload or packaged frontend changes are needed. Existing live-packet tests cover source-specific work-lane preemption and required reads. A bounded future-facing pass chose the local branch consolidation over an extra abstraction. Maintainer review and merge required.

Current-head CI repair

Head 272cd8f6faeff24416a75108f704d1a4919a29c3 includes the verified repair for date-dependent manager-context fixtures. Shared module-budget repair from #4793 is included as dependency ancestry, with current main incorporated; once #4793 lands its shared diff disappears from this PR. The PR-specific implementation is unchanged by this update.

Focused current-head validation: 79 passed, no skips or failures in that run. Diff checks pass. This is local evidence; the newly triggered remote CI remains authoritative for readiness. No PR was merged and no new unrelated feature PR was opened.

Signed-off-by: song <22676124+songoow@users.noreply.github.com>
…odes

Signed-off-by: song <22676124+songoow@users.noreply.github.com>
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
…get-dedup

Signed-off-by: song <22676124+songoow@users.noreply.github.com>
…pair-pr4786-ci

Signed-off-by: song <22676124+songoow@users.noreply.github.com>
@songoow
songoow requested a review from steven-kid as a code owner September 20, 2026 08:26

@songoow songoow left a comment

Copy link
Copy Markdown
Contributor 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)

动机

Discussion #4738 PR-10 要求把 lark_inbox_reply_dueoperator_inbox_material_review_due 的重复六项许可构造合并,同时保留 source action/reason、工作对象和 reply-first 优先级。exact head 272cd8f6faeff24416a75108f704d1a4919a29c3 完成这一局部减法,没有扩大为 inbox 领域重构。

改动思路

resolve_quota_run_decision 仍是唯一 owner。它先派生 inbox_priority_due,一次性关闭 recovery/repair/replan 并开启 normal delivery,再按 reply 优先选择已有 EffectiveAction 与 reason。

具体改动

  • reply/material/both、terminal 与 automation upgrade 的 12 组 characterization 固定优先级。
  • task orchestration 仍只覆盖 normal_run,不会把 inbox 动作提升为 coordinator work。
  • 没有新 helper、schema、持久状态或 wire value;现有 typed enum 继续拥有分类。
  • 2,048 组完整 base/head decision 相等,其中 1,536 个 inbox-active case 通过独立 oracle。

对主干的风险

最强反例是同时 due 时优先级漂移,或统一分支误开 repair/replan/coordinator 权限。完整 parity 与独立 oracle 覆盖 reply-first、terminal/upgrade 顺序、五项 repair 清零和 orchestration isolation;关联 suite、semantic smoke、Ruff 和最终 CI 均通过。共享 #4793 ancestry 也已独立审查。

我的整体评价

APPROVE。 生产改动净减少,位于原 owner 内,完成“一份共同授权构造”而不制造新抽象。

English verdict: APPROVE — exact head 272cd8f preserves all 2,048 decisions and independent inbox priority/permission invariants while deleting duplicate construction.

huangruiteng
huangruiteng previously approved these changes Sep 20, 2026

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

动机

这次评审按 272cd8f6faeff24416a75108f704d1a4919a29c3 精确 head 展开。PR 的实际目标是消除 quota decision 中两个相邻 inbox 分支的重复构造:reply due 与 material-review due 除 source action/reason 外,delivery scope、effect flags、continuation 与 admission 语义完全一致。保留两份会让未来修改容易只更新其中一边,从而无意改变 repair、replan 或 normal-run 权限。

我以当前主干 merge-base b28af169f271eb9997b07730c1f034d58cccb827 为基线判断本 PR 的唯一增量。GitHub/packet 里较早的 base snapshot 还显示了 #4793 的祖先文件,但该依赖已经进入 main;它们不应被误算为 #4786 当前独有范围。

改动思路

实现没有抽新 helper 或增加第二套决策源,而是继续让 resolve_quota_run_decision 做唯一 admission owner:先计算 inbox_priority_due,然后在同一个分支里保持 reply-first 的 source action/reason 选择,复用原来的 flags 与返回结构。

周围的优先级不动:terminal no-followup 的处理仍在前;非 terminal 的 automation-prompt upgrade 仍可先命中;inbox admission 仍然压过 replan/self-repair fallback。也就是说这是控制流去重,不是新的调度策略。

具体改动

  • decision_summary.py 将两个等价的 elif 块合并成一个 inbox priority 分支,净减少生产重复代码。
  • focused quota test 扩展 reply/material 的组合以及 terminal、prompt-upgrade、replan、repair 的交叉条件。
  • 当前主干相对精确 head 的唯一 diff 只有上述两个文件;没有 schema、CLI、持久化 state、action vocabulary 或默认行为变化。

关键代码讲解

关键不只是两个 happy path 返回相同,而是重叠条件时的 branch ordering 必须完全保持。新的本地布尔只表示 reply_due || material_review_due;当两者同时为真时仍显式选择 reply action。这个共享分支仍位于 terminal / 非 terminal prompt-upgrade 之后、replan 与 repair 之前,所以 inbox 工作继续抑制 replan/repair,并保留 allow_normal_run=trueEffectiveActionAdmissionDecision 仍是 typed contract,没有 substring/prose 分类或新的 authority 含义。

对主干的风险

这类小重构最大的风险是“现有测试都绿,但某个重叠布尔组合的优先级悄悄漂移”。因此我没有只看新增参数化 case,而是另外用同一 harness 在 merge-base 与精确 head 上枚举了 11 个相关布尔量的全部 2,048 种组合,其中 1,536 种包含 inbox due,并用独立 oracle 检查 reply-first、terminal/prompt-upgrade 顺序、replan suppression 与所有 repair/normal flags。

结果:

  • base/head 规范化输出均为 1,003,179 bytes,SHA-256 完全一致:de73aea2f6fb41076250b9ee741fdbc40f36e1d8aa08a5f133580a3da2f4db5f
  • 1,536 个 inbox-active 组合的独立语义 oracle 全部通过;
  • quota、chat/Lark 相关 focused suites 共 219 passed;补跑 effect-turn/material-review 两组为 23 passed
  • examples/control_plane/lark-inbox-priority-smoke.py 公共入口 smoke 通过;
  • Ruff、git diff --check 与两个唯一改动路径的 loopx check 通过;后者只有两个无关的既有 Goal-state warning;
  • remote CI 按本轮 capability 的 wait_for_ci=false 未被查询。

改动不涉及状态迁移或外部副作用,若需要回滚只需还原局部分支。残余风险仅是未来输入 schema 新增字段后,等价性矩阵也要相应扩展;本次现有输入空间已经完整覆盖。

我的整体评价

我批准这个精确 head。它在正确的 quota owner 内删除重复知识,没有把一个局部去重升级成新的抽象或公共协议;更重要的是,behavior-preserving 的声明得到了全组合 base/head 对照和真实 consumer smoke 支持,而不是只依赖代码相似或作者自审。未来向 pass 的结论也是保持 inline 最合适:目前抽 helper 反而会把关键 precedence 藏起来,维护收益更低。

English verdict: APPROVE - head 272cd8f

@songoow
songoow dismissed huangruiteng’s stale review September 20, 2026 18:33

The merge-base changed after approval.

huangruiteng
huangruiteng previously approved these changes Sep 20, 2026

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

动机

这次评审按 272cd8f6faeff24416a75108f704d1a4919a29c3 精确 head 展开。PR 的实际目标是消除 quota decision 中两个相邻 inbox 分支的重复构造:reply due 与 material-review due 除 source action/reason 外,delivery scope、effect flags、continuation 与 admission 语义完全一致。保留两份会让未来修改容易只更新其中一边,从而无意改变 repair、replan 或 normal-run 权限。

我以当前主干 merge-base b28af169f271eb9997b07730c1f034d58cccb827 为基线判断本 PR 的唯一增量。GitHub/packet 里较早的 base snapshot 还显示了 #4793 的祖先文件,但该依赖已经进入 main;它们不应被误算为 #4786 当前独有范围。

改动思路

实现没有抽新 helper 或增加第二套决策源,而是继续让 resolve_quota_run_decision 做唯一 admission owner:先计算 inbox_priority_due,然后在同一个分支里保持 reply-first 的 source action/reason 选择,复用原来的 flags 与返回结构。

周围的优先级不动:terminal no-followup 的处理仍在前;非 terminal 的 automation-prompt upgrade 仍可先命中;inbox admission 仍然压过 replan/self-repair fallback。也就是说这是控制流去重,不是新的调度策略。

具体改动

  • decision_summary.py 将两个等价的 elif 块合并成一个 inbox priority 分支,净减少生产重复代码。
  • focused quota test 扩展 reply/material 的组合以及 terminal、prompt-upgrade、replan、repair 的交叉条件。
  • 当前主干相对精确 head 的唯一 diff 只有上述两个文件;没有 schema、CLI、持久化 state、action vocabulary 或默认行为变化。

关键代码讲解

关键不只是两个 happy path 返回相同,而是重叠条件时的 branch ordering 必须完全保持。新的本地布尔只表示 reply_due || material_review_due;当两者同时为真时仍显式选择 reply action。这个共享分支仍位于 terminal / 非 terminal prompt-upgrade 之后、replan 与 repair 之前,所以 inbox 工作继续抑制 replan/repair,并保留 allow_normal_run=trueEffectiveActionAdmissionDecision 仍是 typed contract,没有 substring/prose 分类或新的 authority 含义。

对主干的风险

这类小重构最大的风险是“现有测试都绿,但某个重叠布尔组合的优先级悄悄漂移”。因此我没有只看新增参数化 case,而是另外用同一 harness 在 merge-base 与精确 head 上枚举了 11 个相关布尔量的全部 2,048 种组合,其中 1,536 种包含 inbox due,并用独立 oracle 检查 reply-first、terminal/prompt-upgrade 顺序、replan suppression 与所有 repair/normal flags。

结果:

  • base/head 规范化输出均为 1,003,179 bytes,SHA-256 完全一致:de73aea2f6fb41076250b9ee741fdbc40f36e1d8aa08a5f133580a3da2f4db5f
  • 1,536 个 inbox-active 组合的独立语义 oracle 全部通过;
  • quota、chat/Lark 相关 focused suites 共 219 passed;补跑 effect-turn/material-review 两组为 23 passed
  • examples/control_plane/lark-inbox-priority-smoke.py 公共入口 smoke 通过;
  • Ruff、git diff --check 与两个唯一改动路径的 loopx check 通过;后者只有两个无关的既有 Goal-state warning;
  • remote CI 按本轮 capability 的 wait_for_ci=false 未被查询。

改动不涉及状态迁移或外部副作用,若需要回滚只需还原局部分支。残余风险仅是未来输入 schema 新增字段后,等价性矩阵也要相应扩展;本次现有输入空间已经完整覆盖。

我的整体评价

我批准这个精确 head。它在正确的 quota owner 内删除重复知识,没有把一个局部去重升级成新的抽象或公共协议;更重要的是,behavior-preserving 的声明得到了全组合 base/head 对照和真实 consumer smoke 支持,而不是只依赖代码相似或作者自审。未来向 pass 的结论也是保持 inline 最合适:目前抽 helper 反而会把关键 precedence 藏起来,维护收益更低。

发布首个 approval 的同时,main 推进到 0ef7ebd749ec97a698a8fc7f2a29844dd368689b,仓库规则以 “merge-base changed after approval” 自动撤销了该记录。我重新 fetch 并核验:精确 head 未变,merge-base 仍为 b28af169f271eb9997b07730c1f034d58cccb827,唯一 diff 仍是上述两个文件且内容未变;因此这条新 review 是基线推进后的重新确认,不继承已撤销结论。

English verdict: APPROVE - head 272cd8f

@songoow
songoow dismissed huangruiteng’s stale review September 20, 2026 18:41

The merge-base changed after approval.

huangruiteng
huangruiteng previously approved these changes Sep 20, 2026

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

动机

这次评审按 272cd8f6faeff24416a75108f704d1a4919a29c3 精确 head 展开。PR 的实际目标是消除 quota decision 中两个相邻 inbox 分支的重复构造:reply due 与 material-review due 除 source action/reason 外,delivery scope、effect flags、continuation 与 admission 语义完全一致。保留两份会让未来修改容易只更新其中一边,从而无意改变 repair、replan 或 normal-run 权限。

我以当前主干 merge-base b28af169f271eb9997b07730c1f034d58cccb827 为基线判断本 PR 的唯一增量。GitHub/packet 里较早的 base snapshot 还显示了 #4793 的祖先文件,但该依赖已经进入 main;它们不应被误算为 #4786 当前独有范围。

改动思路

实现没有抽新 helper 或增加第二套决策源,而是继续让 resolve_quota_run_decision 做唯一 admission owner:先计算 inbox_priority_due,然后在同一个分支里保持 reply-first 的 source action/reason 选择,复用原来的 flags 与返回结构。

周围的优先级不动:terminal no-followup 的处理仍在前;非 terminal 的 automation-prompt upgrade 仍可先命中;inbox admission 仍然压过 replan/self-repair fallback。也就是说这是控制流去重,不是新的调度策略。

具体改动

  • decision_summary.py 将两个等价的 elif 块合并成一个 inbox priority 分支,净减少生产重复代码。
  • focused quota test 扩展 reply/material 的组合以及 terminal、prompt-upgrade、replan、repair 的交叉条件。
  • 当前主干相对精确 head 的唯一 diff 只有上述两个文件;没有 schema、CLI、持久化 state、action vocabulary 或默认行为变化。

关键代码讲解

关键不只是两个 happy path 返回相同,而是重叠条件时的 branch ordering 必须完全保持。新的本地布尔只表示 reply_due || material_review_due;当两者同时为真时仍显式选择 reply action。这个共享分支仍位于 terminal / 非 terminal prompt-upgrade 之后、replan 与 repair 之前,所以 inbox 工作继续抑制 replan/repair,并保留 allow_normal_run=trueEffectiveActionAdmissionDecision 仍是 typed contract,没有 substring/prose 分类或新的 authority 含义。

对主干的风险

这类小重构最大的风险是“现有测试都绿,但某个重叠布尔组合的优先级悄悄漂移”。因此我没有只看新增参数化 case,而是另外用同一 harness 在 merge-base 与精确 head 上枚举了 11 个相关布尔量的全部 2,048 种组合,其中 1,536 种包含 inbox due,并用独立 oracle 检查 reply-first、terminal/prompt-upgrade 顺序、replan suppression 与所有 repair/normal flags。

结果:

  • base/head 规范化输出均为 1,003,179 bytes,SHA-256 完全一致:de73aea2f6fb41076250b9ee741fdbc40f36e1d8aa08a5f133580a3da2f4db5f
  • 1,536 个 inbox-active 组合的独立语义 oracle 全部通过;
  • quota、chat/Lark 相关 focused suites 共 219 passed;补跑 effect-turn/material-review 两组为 23 passed
  • examples/control_plane/lark-inbox-priority-smoke.py 公共入口 smoke 通过;
  • Ruff、git diff --check 与两个唯一改动路径的 loopx check 通过;后者只有两个无关的既有 Goal-state warning;
  • remote CI 按本轮 capability 的 wait_for_ci=false 未被查询。

改动不涉及状态迁移或外部副作用,若需要回滚只需还原局部分支。残余风险仅是未来输入 schema 新增字段后,等价性矩阵也要相应扩展;本次现有输入空间已经完整覆盖。

我的整体评价

我批准这个精确 head。它在正确的 quota owner 内删除重复知识,没有把一个局部去重升级成新的抽象或公共协议;更重要的是,behavior-preserving 的声明得到了全组合 base/head 对照和真实 consumer smoke 支持,而不是只依赖代码相似或作者自审。未来向 pass 的结论也是保持 inline 最合适:目前抽 helper 反而会把关键 precedence 藏起来,维护收益更低。

此前的 approval 因 main 推进而被仓库规则自动撤销。本次重新 fetch 到 09f10c4e37b89c6ed25f2f2354f89d641662e83c 后,我重新做了失效检查:精确 head 与 merge-base b28af169f271eb9997b07730c1f034d58cccb827 均未变化;主干自上次证据基线以来只改动 tests/test_steward_team_plan_apply.py,没有触及 quota owner、输入 schema、消费者或本 PR 的两个独有文件;当前三方 merge tree 063e0a2ba511a97c4e7edba80fffb832ef9c52b1 无冲突,git diff --check 也通过。因此本结论是对当前基线的独立重新确认,不继承已撤销的 formal state。

English verdict: APPROVE - head 272cd8f

@songoow
songoow dismissed huangruiteng’s stale review September 20, 2026 19:55

The merge-base changed after approval.

huangruiteng
huangruiteng previously approved these changes Sep 20, 2026

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

动机

本次按 exact head 272cd8f6faeff24416a75108f704d1a4919a29c3 复核 #4786。目标来自 discussion #4738 PR-10:lark_inbox_reply_dueoperator_inbox_material_review_due 原本各自重复构造同一组六项 run permission,长期风险不是当前输出错误,而是未来只改一边后让 repair、replan 或 normal-delivery 权限悄然分叉。

当前 origin/main09f10c4e37b89c6ed25f2f2354f89d641662e83c,三方 merge 结果相对主干只改 decision_summary.py 与 focused quota test;PR 历史中的 chat/Lark 祖先改动不属于当前独有增量。这个范围与“在既有 owner 内删除重复知识”的目标一致。

改动思路

实现继续让 resolve_quota_run_decision 做唯一 admission owner。它先用已有两个 typed boolean 派生私有的 inbox_priority_due,在一个共享分支内统一设置 should_run、normal delivery 与四类 repair permission;随后仅用一个显式 if inbox_reply_due 保留 reply-first 的 action/reason 选择。

我重点核对了几个容易在“小重构”里漏掉的顺序:terminal no-followup 的 inbox 例外仍存在;nonterminal automation-prompt upgrade 仍优先;任一 inbox source 仍抑制 autonomous replan;_task_orchestration_effective_action 只改写 normal_run,不会把 typed inbox action 扩张成 coordinator authority。没有新增 helper、schema、state、provider 或公共 vocabulary,这比抽一个只有单一 caller 的新层更合适。

具体改动

关键代码讲解

  • loopx/control_plane/quota/decision_summary.py:333 的共享 admission branch 删除第二份相同权限赋值;当两个 source 同时 due 时仍先选 LARK_INBOX_REPLY_DUE,否则选 OPERATOR_INBOX_MATERIAL_REVIEW_DUE,两条原 reason 文本保持不变。
  • tests/control_plane/test_quota_run_decision.py:166 的 12 组参数矩阵把 reply-only、material-only、both-due 与 terminal/upgrade 交叉起来,并故意预置 recovery、self/capability/workspace repair、replan 和 adaptive orchestration,验证共享分支会关闭所有竞争 lane 且不会被重标为 coordinator work。

正向路径中,material-only 进入共享权限构造后仍返回 material-review action/reason;both-due 仍返回 direct-reply。负向/竞争路径中,nonterminal upgrade 阻止 inbox 执行,terminal inbox work 保留原例外,replan 与 repair lanes 被明确清零。

对主干的风险

最强反例是“单独 reply/material case 都通过,但 both-due 或 terminal+upgrade 时优先级/权限漂移”。这一点不能只靠代码相似判断。本 exact head 先前已经用独立 oracle 枚举 11 个相关 boolean 的全部 2,048 组 base/head 输出,其中 1,536 组 inbox-active;当前 head、merge-base 与 origin/main 均与最近证据基线一致,因此该证据没有被代码或基线变化失效。

我又在当前 exact head 重新执行:

  • tests/control_plane/test_quota_run_decision.py20 passed
  • examples/control_plane/lark-inbox-priority-smoke.py:通过;
  • focused Ruff 与 git diff --check:通过;
  • 当前三方 merge tree 063e0a2ba511a97c4e7edba80fffb832ef9c52b1 无冲突,合入结果仅上述两个文件;
  • exact-head required checks 当前均成功,deploy/publish/presentation 为预期 skip。Goal 配置为 wait_for_ci=false,因此我没有等待或轮询 CI,只把已完成 rollup 作为旁证。

没有 live Lark send;但这里改的是纯 decision owner,public inbox smoke 已覆盖真实 consumer boundary,外部发送不会增加对 permission vector 的证明。分支当前 BEHIND,更新分支会产生新 head,必须重新按 exact head 审阅,不能继承这条批准。

语义与 CI 对齐

本 PR 复用既有 EffectiveActionQuotaRunDecision,没有 substring/prose 分类、默认行为变化或新的 authority 名称。测试断言的是 action、reason、全部 permission、replan flag、state 与 quota,而不是只看一个 decision code,因此能捕捉细微语义漂移。

我的整体评价

APPROVE。 这是位于正确 owner 内的局部减法:删除重复权限构造,但把 source precedence 明确留在眼前;当前 focused 运行、public smoke 与未失效的全组合 parity/oracle 共同支持 behavior-preserving 结论。未来向检查也不建议再抽象一层,inline 分支更容易看清 guard precedence。

此前的 maintainer approval 因目标分支推进被自动撤销;本次不继承结论,而是核验了 head、main、merge-base、merge tree、完整当前增量与证据前提后重新批准。

English verdict: APPROVE - Exact head 272cd8f preserves reply-first inbox admission, all repair/replan/upgrade/terminal invariants, and the existing typed authority boundary; focused tests, public smoke, static checks, and still-valid exhaustive parity evidence pass.

@songoow
songoow dismissed huangruiteng’s stale review September 20, 2026 21:26

The merge-base changed after approval.

huangruiteng
huangruiteng previously approved these changes Sep 21, 2026

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

动机

本次按 exact head 272cd8f6faeff24416a75108f704d1a4919a29c3 复核 #4786。目标来自 discussion #4738 PR-10:lark_inbox_reply_dueoperator_inbox_material_review_due 原本各自重复构造同一组六项 run permission,长期风险不是当前输出错误,而是未来只改一边后让 repair、replan 或 normal-delivery 权限悄然分叉。

当前 origin/main09f10c4e37b89c6ed25f2f2354f89d641662e83c,三方 merge 结果相对主干只改 decision_summary.py 与 focused quota test;PR 历史中的 chat/Lark 祖先改动不属于当前独有增量。这个范围与“在既有 owner 内删除重复知识”的目标一致。

改动思路

实现继续让 resolve_quota_run_decision 做唯一 admission owner。它先用已有两个 typed boolean 派生私有的 inbox_priority_due,在一个共享分支内统一设置 should_run、normal delivery 与四类 repair permission;随后仅用一个显式 if inbox_reply_due 保留 reply-first 的 action/reason 选择。

我重点核对了几个容易在“小重构”里漏掉的顺序:terminal no-followup 的 inbox 例外仍存在;nonterminal automation-prompt upgrade 仍优先;任一 inbox source 仍抑制 autonomous replan;_task_orchestration_effective_action 只改写 normal_run,不会把 typed inbox action 扩张成 coordinator authority。没有新增 helper、schema、state、provider 或公共 vocabulary,这比抽一个只有单一 caller 的新层更合适。

具体改动

关键代码讲解

  • loopx/control_plane/quota/decision_summary.py:333 的共享 admission branch 删除第二份相同权限赋值;当两个 source 同时 due 时仍先选 LARK_INBOX_REPLY_DUE,否则选 OPERATOR_INBOX_MATERIAL_REVIEW_DUE,两条原 reason 文本保持不变。
  • tests/control_plane/test_quota_run_decision.py:166 的 12 组参数矩阵把 reply-only、material-only、both-due 与 terminal/upgrade 交叉起来,并故意预置 recovery、self/capability/workspace repair、replan 和 adaptive orchestration,验证共享分支会关闭所有竞争 lane 且不会被重标为 coordinator work。

正向路径中,material-only 进入共享权限构造后仍返回 material-review action/reason;both-due 仍返回 direct-reply。负向/竞争路径中,nonterminal upgrade 阻止 inbox 执行,terminal inbox work 保留原例外,replan 与 repair lanes 被明确清零。

对主干的风险

最强反例是“单独 reply/material case 都通过,但 both-due 或 terminal+upgrade 时优先级/权限漂移”。这一点不能只靠代码相似判断。本 exact head 先前已经用独立 oracle 枚举 11 个相关 boolean 的全部 2,048 组 base/head 输出,其中 1,536 组 inbox-active;当前 head、merge-base 与 origin/main 均与最近证据基线一致,因此该证据没有被代码或基线变化失效。

我又在当前 exact head 重新执行:

  • tests/control_plane/test_quota_run_decision.py20 passed
  • examples/control_plane/lark-inbox-priority-smoke.py:通过;
  • focused Ruff 与 git diff --check:通过;
  • 当前三方 merge tree 063e0a2ba511a97c4e7edba80fffb832ef9c52b1 无冲突,合入结果仅上述两个文件;
  • exact-head required checks 当前均成功,deploy/publish/presentation 为预期 skip。Goal 配置为 wait_for_ci=false,因此我没有等待或轮询 CI,只把已完成 rollup 作为旁证。

没有 live Lark send;但这里改的是纯 decision owner,public inbox smoke 已覆盖真实 consumer boundary,外部发送不会增加对 permission vector 的证明。分支当前 BEHIND,更新分支会产生新 head,必须重新按 exact head 审阅,不能继承这条批准。

语义与 CI 对齐

本 PR 复用既有 EffectiveActionQuotaRunDecision,没有 substring/prose 分类、默认行为变化或新的 authority 名称。测试断言的是 action、reason、全部 permission、replan flag、state 与 quota,而不是只看一个 decision code,因此能捕捉细微语义漂移。

我的整体评价

APPROVE。 这是位于正确 owner 内的局部减法:删除重复权限构造,但把 source precedence 明确留在眼前;当前 focused 运行、public smoke 与未失效的全组合 parity/oracle 共同支持 behavior-preserving 结论。未来向检查也不建议再抽象一层,inline 分支更容易看清 guard precedence。

此前的 maintainer approval 因目标分支推进被自动撤销;本次不继承结论,而是核验了 head、main、merge-base、merge tree、完整当前增量与证据前提后重新批准。

English verdict: APPROVE - Exact head 272cd8f preserves reply-first inbox admission, all repair/replan/upgrade/terminal invariants, and the existing typed authority boundary; focused tests, public smoke, static checks, and still-valid exhaustive parity evidence pass.

@songoow
songoow dismissed huangruiteng’s stale review September 21, 2026 02:05

The merge-base changed after approval.

huangruiteng
huangruiteng previously approved these changes Sep 21, 2026

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

动机

本次按 exact head 272cd8f6faeff24416a75108f704d1a4919a29c3 复核 #4786。目标来自 discussion #4738 PR-10:lark_inbox_reply_dueoperator_inbox_material_review_due 原本各自重复构造同一组六项 run permission,长期风险不是当前输出错误,而是未来只改一边后让 repair、replan 或 normal-delivery 权限悄然分叉。

当前 origin/main09f10c4e37b89c6ed25f2f2354f89d641662e83c,三方 merge 结果相对主干只改 decision_summary.py 与 focused quota test;PR 历史中的 chat/Lark 祖先改动不属于当前独有增量。这个范围与“在既有 owner 内删除重复知识”的目标一致。

改动思路

实现继续让 resolve_quota_run_decision 做唯一 admission owner。它先用已有两个 typed boolean 派生私有的 inbox_priority_due,在一个共享分支内统一设置 should_run、normal delivery 与四类 repair permission;随后仅用一个显式 if inbox_reply_due 保留 reply-first 的 action/reason 选择。

我重点核对了几个容易在“小重构”里漏掉的顺序:terminal no-followup 的 inbox 例外仍存在;nonterminal automation-prompt upgrade 仍优先;任一 inbox source 仍抑制 autonomous replan;_task_orchestration_effective_action 只改写 normal_run,不会把 typed inbox action 扩张成 coordinator authority。没有新增 helper、schema、state、provider 或公共 vocabulary,这比抽一个只有单一 caller 的新层更合适。

具体改动

关键代码讲解

  • loopx/control_plane/quota/decision_summary.py:333 的共享 admission branch 删除第二份相同权限赋值;当两个 source 同时 due 时仍先选 LARK_INBOX_REPLY_DUE,否则选 OPERATOR_INBOX_MATERIAL_REVIEW_DUE,两条原 reason 文本保持不变。
  • tests/control_plane/test_quota_run_decision.py:166 的 12 组参数矩阵把 reply-only、material-only、both-due 与 terminal/upgrade 交叉起来,并故意预置 recovery、self/capability/workspace repair、replan 和 adaptive orchestration,验证共享分支会关闭所有竞争 lane 且不会被重标为 coordinator work。

正向路径中,material-only 进入共享权限构造后仍返回 material-review action/reason;both-due 仍返回 direct-reply。负向/竞争路径中,nonterminal upgrade 阻止 inbox 执行,terminal inbox work 保留原例外,replan 与 repair lanes 被明确清零。

对主干的风险

最强反例是“单独 reply/material case 都通过,但 both-due 或 terminal+upgrade 时优先级/权限漂移”。这一点不能只靠代码相似判断。本 exact head 先前已经用独立 oracle 枚举 11 个相关 boolean 的全部 2,048 组 base/head 输出,其中 1,536 组 inbox-active;当前 head、merge-base 与 origin/main 均与最近证据基线一致,因此该证据没有被代码或基线变化失效。

我又在当前 exact head 重新执行:

  • tests/control_plane/test_quota_run_decision.py20 passed
  • examples/control_plane/lark-inbox-priority-smoke.py:通过;
  • focused Ruff 与 git diff --check:通过;
  • 当前三方 merge tree 063e0a2ba511a97c4e7edba80fffb832ef9c52b1 无冲突,合入结果仅上述两个文件;
  • exact-head required checks 当前均成功,deploy/publish/presentation 为预期 skip。Goal 配置为 wait_for_ci=false,因此我没有等待或轮询 CI,只把已完成 rollup 作为旁证。

没有 live Lark send;但这里改的是纯 decision owner,public inbox smoke 已覆盖真实 consumer boundary,外部发送不会增加对 permission vector 的证明。分支当前 BEHIND,更新分支会产生新 head,必须重新按 exact head 审阅,不能继承这条批准。

语义与 CI 对齐

本 PR 复用既有 EffectiveActionQuotaRunDecision,没有 substring/prose 分类、默认行为变化或新的 authority 名称。测试断言的是 action、reason、全部 permission、replan flag、state 与 quota,而不是只看一个 decision code,因此能捕捉细微语义漂移。

我的整体评价

APPROVE。 这是位于正确 owner 内的局部减法:删除重复权限构造,但把 source precedence 明确留在眼前;当前 focused 运行、public smoke 与未失效的全组合 parity/oracle 共同支持 behavior-preserving 结论。未来向检查也不建议再抽象一层,inline 分支更容易看清 guard precedence。

此前的 maintainer approval 因目标分支推进被自动撤销;本次不继承结论,而是核验了 head、main、merge-base、merge tree、完整当前增量与证据前提后重新批准。

English verdict: APPROVE - Exact head 272cd8f preserves reply-first inbox admission, all repair/replan/upgrade/terminal invariants, and the existing typed authority boundary; focused tests, public smoke, static checks, and still-valid exhaustive parity evidence pass.

@songoow
songoow dismissed huangruiteng’s stale review September 21, 2026 03:05

The merge-base changed after approval.

huangruiteng
huangruiteng previously approved these changes Sep 21, 2026

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

动机

本次按 exact head 272cd8f6faeff24416a75108f704d1a4919a29c3 复核 #4786。目标来自 discussion #4738 PR-10:lark_inbox_reply_dueoperator_inbox_material_review_due 原本各自重复构造同一组六项 run permission,长期风险不是当前输出错误,而是未来只改一边后让 repair、replan 或 normal-delivery 权限悄然分叉。

当前 origin/main62d18677c689325066bc406638d15319582f7a1a,我重新生成的三方 merge tree e9f1167495c0c95e0f8a83bc61231b68b0797c0b 无冲突,且相对主干只改 decision_summary.py 与 focused quota test;PR 历史中的 chat/Lark 祖先改动不属于当前独有增量。这个范围与“在既有 owner 内删除重复知识”的目标一致。

改动思路

实现继续让 resolve_quota_run_decision 做唯一 admission owner。它先用已有两个 typed boolean 派生私有的 inbox_priority_due,在一个共享分支内统一设置 should_run、normal delivery 与四类 repair permission;随后仅用一个显式 if inbox_reply_due 保留 reply-first 的 action/reason 选择。

我重点核对了几个容易在“小重构”里漏掉的顺序:terminal no-followup 的 inbox 例外仍存在;nonterminal automation-prompt upgrade 仍优先;任一 inbox source 仍抑制 autonomous replan;_task_orchestration_effective_action 只改写 normal_run,不会把 typed inbox action 扩张成 coordinator authority。没有新增 helper、schema、state、provider 或公共 vocabulary,这比抽一个只有单一 caller 的新层更合适。

具体改动

关键代码讲解

  • loopx/control_plane/quota/decision_summary.py:333 的共享 admission branch 删除第二份相同权限赋值;当两个 source 同时 due 时仍先选 LARK_INBOX_REPLY_DUE,否则选 OPERATOR_INBOX_MATERIAL_REVIEW_DUE,两条原 reason 文本保持不变。
  • tests/control_plane/test_quota_run_decision.py:166 的 12 组参数矩阵把 reply-only、material-only、both-due 与 terminal/upgrade 交叉起来,并故意预置 recovery、self/capability/workspace repair、replan 和 adaptive orchestration,验证共享分支会关闭所有竞争 lane 且不会被重标为 coordinator work。

正向路径中,material-only 进入共享权限构造后仍返回 material-review action/reason;both-due 仍返回 direct-reply。负向/竞争路径中,nonterminal upgrade 阻止 inbox 执行,terminal inbox work 保留原例外,replan 与 repair lanes 被明确清零。

对主干的风险

最强反例是“单独 reply/material case 都通过,但 both-due 或 terminal+upgrade 时优先级/权限漂移”。这一点不能只靠代码相似判断。本 exact head 先前已经用独立 oracle 枚举 11 个相关 boolean 的全部 2,048 组 base/head 输出,其中 1,536 组 inbox-active。虽然 main 已推进,但 exact head、merge-base、decision owner 及其签名都未变化;我没有直接继承旧结论,而是为当前主干生成新的无冲突 merge tree,并在该集成结果上重跑 owner 与真实 consumer 测试,所以原全组合 oracle 的前提仍成立。

我又在当前 exact head 重新执行:

  • tests/control_plane/test_quota_run_decision.pytest_effect_turn_live_quota_decision.pytest_operator_inbox_material_review.py55 passed in 13.39s
  • examples/control_plane/lark-inbox-priority-smoke.py:通过;
  • focused Ruff 与 git diff --check:通过;
  • 当前三方 merge tree e9f1167495c0c95e0f8a83bc61231b68b0797c0b 无冲突,合入结果仅上述两个文件;
  • exact-head required checks 当前均成功,deploy/publish/presentation 为预期 skip。Goal 配置为 wait_for_ci=false,因此我没有等待或轮询 CI,只把已完成 rollup 作为旁证。

没有 live Lark send;但这里改的是纯 decision owner,public inbox smoke 已覆盖真实 consumer boundary,外部发送不会增加对 permission vector 的证明。分支当前 BEHIND,更新分支会产生新 head,必须重新按 exact head 审阅,不能继承这条批准。

语义与 CI 对齐

本 PR 复用既有 EffectiveActionQuotaRunDecision,没有 substring/prose 分类、默认行为变化或新的 authority 名称。测试断言的是 action、reason、全部 permission、replan flag、state 与 quota,而不是只看一个 decision code,因此能捕捉细微语义漂移。

我的整体评价

APPROVE。 这是位于正确 owner 内的局部减法:删除重复权限构造,但把 source precedence 明确留在眼前;当前 focused 运行、public smoke 与未失效的全组合 parity/oracle 共同支持 behavior-preserving 结论。未来向检查也不建议再抽象一层,inline 分支更容易看清 guard precedence。

此前的 maintainer approval 因目标分支推进被自动撤销;本次不继承结论,而是核验了 head、main、merge-base、merge tree、完整当前增量与证据前提后重新批准。

English verdict: APPROVE - Exact head 272cd8f preserves reply-first inbox admission, all repair/replan/upgrade/terminal invariants, and the existing typed authority boundary; focused tests, public smoke, static checks, and still-valid exhaustive parity evidence pass.

@songoow
songoow dismissed huangruiteng’s stale review September 21, 2026 08:27

The merge-base changed after approval.

huangruiteng
huangruiteng previously approved these changes Sep 21, 2026

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

Exact head: 272cd8f6faeff24416a75108f704d1a4919a29c3

动机

这个 PR 完成 discussion #4738 的 PR-10:两个 inbox 来源此前各自复制同一组 run-permission 赋值,后续修改容易造成 direct-reply 与 material-review 语义漂移。当前实现把公共构造收敛到既有 inbox_priority_due,没有扩大为新的 inbox 协议,也没有新增状态或权限。

改动思路

权威边界仍是 resolve_quota_run_decision。terminal / automation-upgrade 等高优先级判断先执行;进入 inbox 分支后,公共权限只构造一次,而 action/reason 继续按来源选择,两个来源同时到达时仍由 reply 优先。这样删除的是重复知识,而不是来源差异。

正向路径是 reply 或 material 任一 due 后允许 normal delivery;负向路径覆盖 terminal、非 terminal upgrade、两来源同时到达,以及同时存在 repair/replan/orchestration 条件,确保 inbox 工作不会意外获得这些权限。

具体改动

当前 main 的真实合并增量只有 2 个文件(GitHub 页面中的其他 ancestry 文件已在 main):86 additions / 20 deletions。

关键代码讲解

  • loopx/control_plane/quota/decision_summary.py:331:用 inbox_priority_due 进入一次公共权限构造;inbox_reply_due 只负责选择 reply action/reason,否则选择 material-review。这里保持 reply-first,不把两个来源的业务身份抹平。
  • tests/control_plane/test_quota_run_decision.py:176:12 组 source × terminal × upgrade 参数覆盖,逐项断言 normal/recovery/self-repair/capability-repair/workspace-repair/replan 与 action/reason。

对主干的风险

最强回归场景是合并分支时漏掉某个权限清零,或两来源同时到达时反转 reply-first;这会让 automation 进入 repair/replan/coordinator 路径。为避免只验证 PR 旧基线,我构造了 exact head 与当前 origin/main 的无冲突 merge tree 并在该树上执行:

  • tests/control_plane/test_quota_run_decision.py: 20 passed
  • examples/control_plane/lark-inbox-priority-smoke.py: passed
  • Ruff: passed
  • git diff --check: passed

未轮询远端 CI(当前 capability 明确 wait_for_ci=false)。没有新 schema、typed state、默认行为、authority 或 guidance/obligation 语义;非 inbox 路径不进入该分支。

语义与 CI 对齐

这是现有 vocabulary 的本地复用,不新增或扩展 semantic registry 项;测试直接约束机器执行的 permission flags,而不是用 prose 替代 obligation。

我的整体评价

没有 blocking finding。这个改动以最小生产改动收敛重复 authority,并用组合矩阵覆盖最容易漏掉的细微语义差异;当前 main 合并态的真实路径验证通过。剩余风险是未跑全仓测试及远端 CI,且 PR 当前显示 behind main,但 synthetic merge 已证明无冲突并通过聚焦验证。

English verdict: APPROVE

@songoow
songoow dismissed huangruiteng’s stale review September 21, 2026 12:51

The merge-base changed after approval.

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

Exact head: 272cd8f6faeff24416a75108f704d1a4919a29c3

Approval conclusion (independent maintainer review; the formal APPROVE on this exact head was immediately auto-dismissed because its merge-base changed, so this COMMENTED record preserves the reviewed conclusion without pretending merge readiness).

动机

这个 PR 完成 discussion #4738 的 PR-10:两个 inbox 来源此前各自复制同一组 run-permission 赋值,后续修改容易造成 direct-reply 与 material-review 语义漂移。当前实现把公共构造收敛到既有 inbox_priority_due,没有扩大为新的 inbox 协议,也没有新增状态或权限。

改动思路

权威边界仍是 resolve_quota_run_decision。terminal / automation-upgrade 等高优先级判断先执行;进入 inbox 分支后,公共权限只构造一次,而 action/reason 继续按来源选择,两个来源同时到达时仍由 reply 优先。这样删除的是重复知识,而不是来源差异。

正向路径是 reply 或 material 任一 due 后允许 normal delivery;负向路径覆盖 terminal、非 terminal upgrade、两来源同时到达,以及同时存在 repair/replan/orchestration 条件,确保 inbox 工作不会意外获得这些权限。

具体改动

当前 main 的真实合并增量只有 2 个文件(GitHub 页面中的其他 ancestry 文件已在 main):86 additions / 20 deletions。

关键代码讲解

  • loopx/control_plane/quota/decision_summary.py:331:用 inbox_priority_due 进入一次公共权限构造;inbox_reply_due 只负责选择 reply action/reason,否则选择 material-review。这里保持 reply-first,不把两个来源的业务身份抹平。
  • tests/control_plane/test_quota_run_decision.py:176:12 组 source × terminal × upgrade 参数覆盖,逐项断言 normal/recovery/self-repair/capability-repair/workspace-repair/replan 与 action/reason。

对主干的风险

最强回归场景是合并分支时漏掉某个权限清零,或两来源同时到达时反转 reply-first;这会让 automation 进入 repair/replan/coordinator 路径。为避免只验证 PR 旧基线,我构造了 exact head 与当前 origin/main 的无冲突 merge tree 并在该树上执行:

  • tests/control_plane/test_quota_run_decision.py: 20 passed
  • examples/control_plane/lark-inbox-priority-smoke.py: passed
  • Ruff: passed
  • git diff --check: passed

未轮询远端 CI(当前 capability 明确 wait_for_ci=false)。没有新 schema、typed state、默认行为、authority 或 guidance/obligation 语义;非 inbox 路径不进入该分支。

语义与 CI 对齐

这是现有 vocabulary 的本地复用,不新增或扩展 semantic registry 项;测试直接约束机器执行的 permission flags,而不是用 prose 替代 obligation。

我的整体评价

没有 blocking finding。这个改动以最小生产改动收敛重复 authority,并用组合矩阵覆盖最容易漏掉的细微语义差异;当前 main 合并态的真实路径验证通过。剩余风险是未跑全仓测试及远端 CI,且 PR 当前显示 behind main,但 synthetic merge 已证明无冲突并通过聚焦验证。

English verdict: APPROVE

@huangruiteng
huangruiteng merged commit de3325c into loopx-project:main Sep 21, 2026
26 checks passed
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