Skip to content

refactor(todos): share typed route and handoff visibility - #5832

Merged
loopx-agent merged 4 commits into
mainfrom
codex/todo-route-claim-projection
Oct 7, 2026
Merged

loopx-agent merged 4 commits into
mainfrom
codex/todo-route-claim-projection

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Route and handoff hints used separate Python lane rules after ordinary quota work had already used the typed claim/scope owner. This PR moves both visibility projections into the existing todo.quota_planning.project batch, removes both sets of Python lane-builder callers, and feeds route/handoff facts from one gate snapshot. Counts precede display caps; route claim/exclusion and handoff review addressing retain their distinct semantics. A hint never grants execution or clears a gate.

Python keeps supported legacy decoding, gate rendering and downstream execution checks. Existing v0/v1 planning requests and legacy/File/SQLite records retain their behavior; the co-deployed v2 carrier validates current facts. Projected handoff order, duplicates, unknown historical display states and explicitly empty projections are preserved. Provider defaults, persisted records, writers, backups and upgrade behavior remain unchanged. This is a bounded T4 caller-retirement step; new-Goal-default SQLite and complete writer/settlement/recovery acceptance remain open.

Validation: 79 focused Python and 44 TypeScript tests, full typecheck, configured mypy and focused Ruff pass. Main-identical baseline and candidate CPython 3.12 wheels each pass the same 25-case harness from an isolated working directory, including real legacy/File/SQLite quota reads with absent canonical Markdown and unchanged provider records. Thirty-four complete summary observations are byte-identical without normalization. A deliberate loss of handoff addressing in the disposable candidate fails all three real provider cases; exact restoration passes. Five production files match their source and the retired Python functions are absent. Raw legacy consumer tracing reduces gate-summary reconstruction from three calls to two; the remaining deadline consumer is live. This is call-count evidence, not a measured latency claim.

Exact-head native premerge passes 5 direct, 10 catalog, 8 risk-profile and 1 public-boundary checks, including full-tree semantic validation. Strict change-quality receipt cqr_33b44e2a2850d9638bd0 passes. Initial test-path/import-mode assumptions and a stale generated Chat bundle were corrected at the supported harness/build boundaries; final qualification did not relax product rules.

The related refactor shares the existing typed boundary without an additional RPC or capability/configuration surface. Existing frontend/Lark consumers read the unchanged Core projection; no new user operation or editor is introduced. Packaged interactive App/model journeys, sustained resource/quality comparison and latency improvement are untested here. Maintainer merge is required for this control-plane change.

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=xhigh.

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

English verdict: APPROVE - 0697702. No blocking finding. Existing route visibility now shares typed quota planning and claim rules; independent installed baseline/head CLI parity, complete summary comparisons and deliberate claim-filter mutation confirm scope preservation. Maintainer merge required.

动机

操作者在查看自己的重规划候选时,需要正确保留归属、排除身份和完整计数。
例如来源中有自己的、未认领的、其他人的和被排除的候选,旧版另走一套 Python 判断;本次由同一个类型化规则分组,保留原来的可见结果。
已验证三个真实来源的安装态 quota 读取保持结果和数据不变,Python 的独立候选决策及两个调用方已删除。
本批只统一读取规则,不改变执行权限、provider 默认、旧 writer 或备份恢复。
新 Goal 默认 SQLite 的发布资格、完整 writer 退役及长期运行验收仍未完成。

这次价值是删除一个仍被真实 quota 调用的重复判断源,让后续修改归属规则时不必维护两套知识;未把正常读取的成功包装成已完成默认 SQLite 或性能提升。

改动思路

复用同一个批处理里的既有归属规则,并删除真实 Python 调用方,比新增 RPC 或并行规则更小且容易回滚。
当前 PR 完成候选展示规则的统一与最后两个旧 builder 调用方退役,旧写入、迁移和整体默认发布条件继续保留。

从完整来源收集旧字段和展示事实,交给同一次既有 TS planning 请求进行资格、身份去重、排序、claim/exclusion 分组及计数,最后才裁剪展示。ordinary quota 与 route 当前分组共用 claimAllowsAgent;历史 unclaimed 分组仍可显示被排除记录,执行方继续独立校验。没有新 RPC、配置开关或自动迁移。旧格式解析、展示和原有执行检查仍有实际调用价值,予以保留。

具体改动

规格依据为 docs/reference/todo-work-counts.md,修订 bff46dc。按修改前已接受条款映射:counts-before-display implemented,完整计数先于展示上限;visibility-without-authority implemented,候选不能变成可执行任务;legacy-canonical-read-parity implemented,三个真实来源及缺失 Markdown 读取保持兼容。新增文档段落说明这些边界,不能反过来替实现创造验收条件。

关键代码讲解

  • route_continuation.py:13 build_todo_route_continuation_facts 保留旧输入规范化、身份回退与展示坐标,删除资格、去重、排序、分组和计数的 Python 决策。
  • quota_selection.ts:194 routeContinuationLanes 对显式 false、gate 来源及既有 task class 做类型化判断;先找到首个有效身份,再按原 code-point 顺序排序,完整计数先于 slice。当前分组共用普通 claim/exclusion owner。
  • quota_selection.ts:247 projectTodoQuotaPlanning 在原批处理内接入 route;当前 v2 缺失或畸形 carrier 明确拒绝,原 v0/v1 的输入与响应保持,旧 v0 缺少 available 的兼容案例已执行。
  • quota_summary.py 的两个实际生产调用方直接消费 route_lanes,旧 builder 的定义、导入与调用全部删除。下游 agents/agent_scope.py 的执行资格复核仍被调用,未宣称全部 Python 路由逻辑已经退役。

四个生产文件 +95/-185,三个测试文件 +113/-4,文档 +16。测试覆盖零展示、超过展示上限、关闭副本、无明确 class、真实 caller 及旧请求;不是新增未使用的模块、抽象或框架。

对主干的风险

无阻塞发现。最强反例是普通单元测试通过,但安装态 CLI 忽略排除身份或用了错误来源。我在隔离 wheel 中只删除当前 route 归属过滤,同一公共 CLI fixture 的 legacy/File/SQLite 三例均在独立断言失败;精确恢复文件后,三例全部通过。实验没有改动活跃 Goal 或任何用户数据。

独立 CPython3.12 基线与候选 wheel 使用同一不可变 fixture,各19项通过;三个 provider 返回 total4/current2/unclaimed2/other2,canonical 来源缺少 Markdown 仍可读取,前后数据不变。另有15个完整摘要观察按字节相等,未归一化任何决策、文本、顺序或诊断字段,包含历史输入、Unicode、空来源与超过裁剪上限的候选。源码79项相关 Python、TS27项、typecheck/mypy/Ruff 及 exact-head 原生 canary 的5项直接、10项目录、8项风险和1项公开边界检查通过,严格 CQR 通过。

初期合成 fixture、registry、compact 查询假设、遗漏旧测试 import 和旧生成 bundle 校验失败均保留;最终在两个独立安装环境和正确真实入口重新资格化,产品拒绝规则没有放宽。永久 Markdown、旧 writer、格式迁移和原回执保留。旧 transient request 与 wheel 一起部署,不由历史回执要求其永远存在;本批用同一实现保留已有 v0/v1,未增加平行规则。

语义与 CI 对齐

本批复用现有 task/route vocabulary 和 typed claim owner,v2 仅扩展既有内部请求判别值;差分 advisory 与全树 semantic canary 通过。建议是诊断展示,不能称为执行权限;类型校验与排除身份分组是明确约束。没有 optional capability 或 reward-memory prompt 变化,无需虚构 feature-off 门控。

当前 review packet 要求不查询、不等待 GitHub CI;决定性证据是本地仓库及安装态验证。#5831 仍开放,处理来源建议的新鲜度,当前批次消费原有已求值 gate,两者不被设为整项互相等待。共享 owner 有后续合并时需复核集成。完整 App/model、Windows、PostgreSQL store/service、持续负载、延迟改善和默认发布资格均未在本批验证。

我的整体评价

justified_increment,long_horizon=preserved、user_experience=preserved:同一入口保持可见结果、计数和无副作用,没有新增用户设置、重复确认、迁移步骤或调度循环。architecture=retain,范围 proportionate;统一真实决策边界并移除旧调用方,比再加一个桥接层更容易定位、测试和回滚。兼容性保留有明确 co-deployed 边界,不把旧数据恢复义务混同为所有旧请求版本永久保留。审查覆盖整个 0697702,公开 exact-head 自评后仍交由 maintainer 合并;新 Goal 默认 SQLite 与剩余 writer/持续运行验收继续由原任务推进。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title refactor(todos): share typed route visibility in quota planning refactor(todos): share typed route and handoff visibility Oct 7, 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=xhigh.

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

English verdict: APPROVE - 88090fe. No blocking finding. Route and handoff visibility share one existing typed quota boundary while preserving distinct review addressing and execution scopes; installed baseline/head parity and deliberate real-CLI filter-loss qualification pass. Maintainer merge required.

动机

操作者查看自己的后继复核与重规划候选时,需要保留完整计数、归属和历史来源。
例如一个复核项交给其他人执行,但排除了当前执行者,需要当前人看到复核阻塞;这与普通工作的执行资格不同。旧版另走 Python 分组,本次在同一类型化读取边界保留该区别。
安装态三个真实来源保持相同读回与数据,两个 Python 分组 builder 及其实际调用方已删除;同一旧来源的 gate 汇总调用从三次减为两次,未宣称延迟改善。
本批统一读取决策,不改变 provider 默认、执行权限、旧 writer 或备份恢复。
新 Goal 默认 SQLite 的发布资格、完整 writer 退役、App 与长期运行验收仍未完成。

价值在于减少仍被真实调用的独立规则源,后续改动能在相应 owner 定位。它没有把删代码数量、测试数量或提案存在包装成已完成用户迁移,也没有依据调用数推断命令变快。

改动思路

同一读取批次拥有分组规则,Python 只传递旧来源与展示事实;review 定向与执行资格必须分开,不能为了复用错误地合并它们。
本 PR 只退役两个可达的 Python 展示决策源,并用真实入口核验;保留仍被调用的 writer、恢复、deadline 和执行资格,默认迁移与完整 App 验收另行推进。

完整来源先生成 gate 快照,再把原 route 事实与 handoff 展示交给同一次既有 TS quota planning 请求。普通工作与 route 当前分组复用 claimAllowsAgent;handoff 用 excluded_agents 定向复核分组,不能用普通 claim predicate 替代。gate 状态由原 succession owner 求值,本次只消费它,不另建状态来源或增加一次 RPC。输入、计数和展示限制均有现有真实 caller。

具体改动

规格依据为 docs/reference/todo-work-counts.md,固定修订 bff46dc。按修改前已接受条款映射:counts-before-display implemented,完整计数先于裁剪;visibility-without-authority implemented,展示不授予 claim、lease 或执行权限;legacy-canonical-read-parity implemented,三个真实来源和缺失 canonical Markdown 仍可读取而不改变数据。新增参考段落是行为披露,不能反过来充当实现自己的规格。

关键代码讲解

  • route_continuation.py:12 build_todo_route_continuation_facts 只解码旧字段与展示坐标,删除资格/去重/排序/claim 规则;现在消费外部传入的同一 gate 快照,唯一生产调用方同步修改,不留失去真实 caller 的 wrapper。
  • quota_selection.ts:195 routeContinuationLanes 保留显式 false、首个有效身份、原 Unicode 顺序、旧无 class 兼容及完整计数;当前分组继续排除 peer claim 和执行者 exclusion。
  • quota_selection.ts:249 handoffGateLanes 保留来源顺序、重复行和未知历史展示状态;只把已排除当前执行者的项放进其复核分组,且仅 cleared_without_successor 计入对应后继缺口。零展示不抹掉数量,no-follow-up、superseded、deferred 不被混同。
  • quota_selection.ts:272 projectTodoQuotaPlanning 在现有批次返回两类 lanes;同包部署的当前 v2 carrier 明确拒绝畸形结构,旧 v0/v1 输出保留。它没有添加用户配置、provider 或持久字段。
  • quota_summary.py:458/843 的两个实际生产分支直接消费结果;handoff_gate.py 的 lane builder、导入与调用删除。旧格式 renderer、handoff_ready_successor_todo_ids、deadline 与下游执行复核仍有 caller,继续保留。

当前整个 PR 是五个生产、三个测试、一个参考文档路径;新增测试验证实际消费语义,没有新增未使用的 provider/framework。相对前次已评审069770 head,本轮把同一调用族的 handoff companion 收进现有 PR,重新判断全部范围和 exact head,不继承前次 APPROVE。

对主干的风险

无阻塞发现。最强反例是把“不能由当前人执行”误等同于“不该让当前人看见复核阻塞”,或者 source 单测通过但安装态 CLI 用了错误来源。我只在隔离候选 wheel 中删除 handoff 当前定向过滤,同一真实 CLI fixture 的 legacy/File/SQLite 三例均在独立数量/身份断言失败;精确恢复 TS 文件后3例通过,并再跑完整25例。未触碰活跃 Goal、真实 lease、用户数据或 provider 配置。

CPython3.12 基线五个生产文件与最新 main 的 bff46dc 逐文件相同,候选五文件与提交源逐文件相同。两个独立安装环境使用同一不可变25例 fixture 各通过;canonical Markdown 不存在,读回仍保持 route4/current2/free2/other2、handoff4/current1/gap0,来源数据不变。34个完整摘要观察按字节相等,没有归一化文本、顺序、状态或诊断,涵盖两个 caller、空来源、旧原始来源、未知状态、重复项、Unicode 和超过展示上限。源码79项 Python、TS44项、typecheck/mypy/Ruff 及 exact-head 原生 canary 的5直接/10目录/8风险/1公开边界检查通过;严格 CQR cqr_33b44e2a2850d9638bd0 通过。

初期测试路径和 importlib 导入假设错误导致没有收集测试;旧 Chat bundle 被正式构建校验拒绝,按支持的 npm ci/build 流程重建后重新打包。最终证据来自正确入口的完整独立 runs,没有放宽产品拒绝、移除断言或降低预算。原始失败保留。

语义与 CI 对齐

复用 succession.HandoffState、既有 claim owner 和已注册内部 request vocabulary;差分 advisory 与全树语义 canary 通过,advisory 有限语法分析不等于语义证明。未知历史 gate 状态保留为展示,不能被猜成 obligation。可见 hint 是建议,类型/作用域/计数是明确读取约束,不称作执行授权。没有 reward-memory prompt、optional hook 或默认开关变动,feature-off 判断据实际共享路径,无需新增伪门控。

当前 review packet 明确不查询、不等待 GitHub CI,遵守了此约束;决定性证据是仓库和安装态的当前验证。相关5831/35b0f33ce 与5825/0c478b8f仍开放,分别拥有来源新鲜度与 closure 契约;后续先合并者要做集成复核,不把所有 PR 设置成退役的整项前置。当前未验证 live App/model、Windows、PostgreSQL store/service、持续负载及延迟改善,也不宣称新 Goal 默认发布已经合格。

我的整体评价

justified_increment,long_horizon=preserved、user_experience=preserved:同一既有入口保留读回、失败边界与无副作用,没有新增设置、导航、重填信息、迁移或调度循环。architecture=retain,整体范围 proportionate;两个可达的展示规则进入对应 typed owner,复核定向与执行资格保持不同责任。最有价值的相关简化已应用:删除旧 builder/最后调用方,并共享 gate 快照;剩余 deadline/IO/执行消费者有真实作用,不能仅因 Python 语言而删除。

旧 transient 请求与同包部署有明确边界,保留单一实现和已存在 v0/v1 测试,不以旧回执为理由永久保留所有 RPC 版本;历史格式、备份和原回执恢复义务保持独立。回滚匹配 Python/TS 包即可,数据无需迁移。公开精确 head 自评后交给维护者合并;完整 SQLite 默认、升级、writer、App 与持续运行资格由原规划推进。

…m-projection

Keep both quota-planning crossings: main's typed source-closure validation and
this branch's route/handoff hint lanes share the same request and projection.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Main's closure validation and this branch's route/handoff lanes share the v2
request, so each fixture now carries both inputs and the closure case drops the
two v2-only lanes before comparing with v1.

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 · xhigh

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

精确 head:b18d358b0d6596ef930aa0eb7ebe1da6a895445b;上一被批准 head:88090fe623d012302ddf54a5d32fbee03a9647e5;当前 base:main(7046f1904 已并入)。

动机

配额规划读取此前在 Python 里各自求值「route 续跑建议」与「handoff 可见性」,同一份事实被两个 owner 解释。本 head 把这两条展示规则一起交回既有 TS quota planning 入口;同时主干已先合入 #5825(closure 来源校验)与 #5831(route-replan 事实绑定),它们与本次落在同一个请求与投影上,因此上一轮评审明确要求「后合并者做集成复核」,本轮按此重新核验被改写过的 head。

改动思路

先并入当前主干,再按「两侧都是同一 v2 请求/投影的增量」合并:Python 请求字典同时携带 route_items、handoff_items(本分支)与 source_contract(#5825);TS 入口同时保留 validateTodoClosureSource 与本分支的 routeContinuationLanes/handoffGateLanes,投影结果把 closure 与两组 lanes 一起展开。冲突只出现在同一处请求键与同一处入口返回,没有改动任一方的既有语义。

具体改动

9 文件、+368/−249。quota_selection.ts 新增 route 与 handoff 两组 typed lanes(claim/排除复用既有 owner,只做读取可见性、从不授予执行),route_continuation.py 与 handoff_gate.py/quota_summary.py 删除重复判断、改由同一 TS 结果驱动,quota_selection.py 同时传三组事实,参考文档补充读取规则。集成修复:三个 v2 回归用例的请求补上缺失的一侧输入(route/handoff 用例补 source_contract,closure 用例补空 route_items/handoff_items),closure 用例比较 v1 前先剥离两个 v2 专属 lanes。验证:Python test_quota_selection.py、test_compact_todo_projection.py、test_succession_provider_readback.py、test_todo_succession_read_model.py、test_todo_closure_source_contract.py 合计 85 passed;TS quota_selection.test.ts、todo_succession.test.ts、todo_summary_projection.test.ts 41 passed;typecheck:control-plane、改动文件 ruff、配置 19 文件 mypy、语义 vocabulary smoke 与公共边界扫描(67 文件)通过,git diff --check 干净。

对主干的风险

最强反例是把「不能由当前人执行」误当作「不该让当前人看见复核阻塞」,或让安装态 CLI 用错来源。route/handoff lanes 只做读取可见性:当前 lane 只唤醒 claim 归属该 agent 或未认领的候选,其它 agent 的候选项保持诊断可见;gate 的 exclusion 只描述复核通道,不等同执行资格;source_contract 仍由 #5825 的 typed owner 校验,非法计数不会变成证明。集成后 5831 的 route-replan 事实与 5825 的 closure 校验都仍在各自路径上生效(同一次运行中两方的既有测试均通过)。未验证部分与上一轮一致:live App/模型、Windows、PostgreSQL store/service、持续负载与延迟改善;控制面合并资格仍由维护者决定。

我的整体评价

APPROVE:两条展示规则回到唯一 TS quota planning owner,Python 重复决策退役;与已合入的 #5825/#5831 在同一请求上共存,合并后的 Python 85 项与 TS 41 项、类型检查、语义与边界检查全部通过。

English verdict: APPROVE - b18d358. Current main (#5825 closure validation and #5831 route-replan facts) is integrated: the v2 request now carries route items, handoff items and the source contract together, the closure result and both hint lanes share one projection, and the fixtures send complete v2 requests. 85 Python tests, 41 TypeScript tests, control-plane typecheck, ruff, the configured mypy set, the semantic smoke and the boundary scan pass.

@loopx-agent
loopx-agent merged commit 780c4a7 into main Oct 7, 2026
5 of 6 checks passed
@loopx-agent
loopx-agent deleted the codex/todo-route-claim-projection branch October 7, 2026 05:20
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.

1 participant