Repository navigation
refactor(presentation): compose global summary and gates in TypeScript - #7892
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max.
动机 / Motivation
需要跨 Goal 查看下一步和等待决定的操作者。原实现由 Python 组合摘要和门禁,并为关系和 envelope 调用 TypeScript;本次将完整组合迁入一个 typed owner,保留源侧增量读取与既有输出。
真实 CLI 的 JSON 与 Markdown、截断前计数、门禁问题和权限提示与固定基线一致,替换后的产品规则由 TypeScript 持有。不新增产品入口、权限、持久化状态或默认 provider,也不宣称性能或长程收益。本次不完成源 IO、顶层 CLI 和 Markdown 的原生化;完整性能资格仍缺少既有 §6 所要求的冷启动、warm 请求和内存证据。
审查依据为 docs/architecture/rfcs/typescript-control-plane-migration-v0.md,固定 spec_revision 867615e2c3aa2a32516a71d46f11a20d6fcb3289。本次有实际、可回滚的所有权增量;问题在于事务切换的既有交付验收尚未完成。
改动思路 / Approach
完整读取事务复用现有 envelope 与关系 owner,删除 Python 组合规则;保留的门面有实际源读取和 Markdown 调用方。本次边界是现有命令的完整读取所有权迁移;交付前仍需补齐既有性能门。
| 边界 | 固定基线 | 当前 head |
|---|---|---|
| 来源读取 | 现有 Python IO 与 codec | 保留原有读取及失败来源 |
| 组合与判定 | Python 组合后调用 typed 辅助规则 | 一次完整 typed 投影,在进程内复用既有规则 |
| 输出与权限 | JSON/Markdown,只读 | 保留输出、来源告警与权限边界 |
该表根据 13fa1af507d0c2d70bb1254f148f54aa09c39155 的源码归纳,用于解释所有权,不代替执行证据;没有另外验证图形渲染。
具体改动 / Changes
projectGlobalSummary负责完整投影;projectGlobalGates与其共享源事实、排序和 envelope,正式 gate 分类仍复用open_user_gate_todo_items,提前停止前不额外读取后续来源。- handler、共享源事实与完整输出 fixture随生产路径一起检查;双语 checkpoint 及 RFC 链接同时更新。源侧谓词保留有实际其他调用者,不是第二套组合规则。
- 2.6:PASS。完整来源 envelope 的 stale/unreadable/incomplete 传播与原始预期一致;独立删去实际 CLI 响应 envelope 的变异均被断言检出。
- 6-Correctness:PASS。本 PR 22 项定向 TS 测试通过;原始 Python 选择为 66 通过、1 失败。两 PR 的 53 个冻结特征用例原样在固定基线通过。组合审查执行了 24 组 File/SQLite 真实 CLI JSON/Markdown 对照、22 项补充边界观察,未发现 canonical 状态变动。
- 7:PASS(隔离构建与安装)。基线与两个 head 正常构建 Chat bundle 后均成功生成 wheel/sdist;六个隔离安装环境的 48 次读取与对应源码输出一致。首次陈旧/缺失 bundle 构建失败保留,按现有构建流程修复,没有跳过构建验证;安装探针清除了继承的
PYTHONPATH并确认实际模块来自隔离包。 - 6-Performance:UNVERIFIED。下面的必需证据缺口仍未消除。
对主干的风险 / Risks
[P2] 补齐这次事务切换的默认 SQLite 性能资格。 docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-manager-reads.md 将现有命令直接切换到新 transaction,却只报告源码行为资格。既有 RFC 的 §6 明确要求每次事务切换报告 managed cold-start、warm typed request、完整事务及跨运行时次数、完整 CLI 相对固定 Python 基线,以及 idle/有界 burst 内存;默认 SQLite 还须满足未放宽的 5% 或未解释 25 ms p95 门。不声明性能收益并不能省略该交付门。
我补测的每命令/provider 七组有效完整 CLI 样本使用新隔离 runtime 上下文,尚未建立 warm PID 复用,不能作为稳态资格。SQLite global-gates p95 为 577.156 → 622.105 ms;这是 +44.949 ms 的小样本观察,不能据此断言稳定回归,也不能宣称原门已通过。File 的尾延迟增加单独保留,不把 File-only 指标当作默认 SQLite 的独立否决理由。
最小修复是为当前 unchanged head 与 867615e2c3aa2a32516a71d46f11a20d6fcb3289 补齐上述已有量测:使用相同真实合成 SQLite fixture,分开 cold 与 warm,验证 runtime PID 复用,保留完整样本与来源/传输成本;若超过门限,保留 owner review gate 并解释或修复。无需修改业务范围、预算或测试预期。
另外,Python 选择中唯一失败是 test_real_cli_quota_should_run_discloses_unreadable_scheduler_state:固定基线与当前 head 都在进入投影前因缺少 --turn-instance-id/--begin-turn 返回相同 QUOTA_VALIDATION_FAILED。测试及 quota CLI 源文件逐字节未变,故这是已独立归因的旧夹具失败;原始运行仍为 FAIL,不请求本 PR 修复无关代码。定向 premerge 的 19 项选择、typecheck、Ruff 与 diff 检查通过,未查询或等待 CI。
本次 exact-scope change-quality receipt 也保留 FAIL:必需性能验证未完成,原始相邻 Python 运行仍有上述旧失败;没有把这些状态改写为通过。
我的整体评价 / Verdict
REQUEST_CHANGES,针对未完成的既有性能验收。摘要与门禁的 owner 归属、规则删除、实际调用方和功能兼容性均有证据,未复现新的功能缺陷;无需扩大为整个迁移路线图。补齐当前 transaction 的默认 profile 资格后即可重新判断该缺口。
已检查现有 CLI dispatch、JSON 与 Markdown renderer;本次没有页面或布局改动,无需新增截图。无新增可视页面;持续运行性能仍待既有验收。保留代码回滚路径、来源失败和原有权限边界,不把 review 或测试通过当作安装主机采用、父目标验收或 merge 授权。
English verdict: REQUEST_CHANGES — head 13fa1af507d0c2d70bb1254f148f54aa09c39155 preserves tested behavior, but the existing RFC §6 default-SQLite transaction performance qualification is incomplete. Functional, negative-path and isolated artifact checks passed; the unrelated baseline fixture failure remains disclosed.
The global-summary and global-gates CLI reads now call presentation.global_summary.project and presentation.global_gates.project. TypeScript owns lane selection, gate routing, ordering, counting, grouping, actions and envelope composition. Python keeps source acquisition and one source-side gate predicate built on the shared open_user_gate_todo_items owner, so classification is not repeated across runtimes. Frozen JSON and Markdown characterization stays byte-identical, source read order and early stop are preserved, and gate crossings drop from R+1 to one. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Signed-off-by: hhyykk <4408344+hhyykk@users.noreply.github.com>
13fa1af to
7d41256
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: loopx-agent; exact head: 7d41256211332ebc2e35582003f5da2dbd30c497
动机 / Motivation
操作者需要跨 Goal 查看全局摘要、下一步和等待决定的门禁项。原实现由 Python 选择 lane、组装 gate、调用关系和 envelope 再组合输出,规则和调用顺序分散在多个运行时中。这个 PR 把完整摘要与门禁读取移到同一个 TypeScript owner,使操作者继续得到原有 JSON、Markdown、排序和告警内容,同时让后续维护只需修改一处决策代码。
改动思路 / Approach
入口仍是现有 global-summary 与 global-gates CLI。Python 保留实际的状态、配额和本地源读取,以及必要的文本、时间和 Markdown 适配;TypeScript 负责 lane 选择、gate 路由、排序、计数、分组、动作和 envelope 组合。门禁的提前停止仍由 Python 源侧事实决定,避免移动读取边界后额外请求后续来源。决策关系与 projection envelope 复用现有 owner,没有新增平行服务或持久化格式。
具体改动 / Changes
关键代码讲解
projectGlobalSummary在一次请求内组合 lane、计数、动作和 envelope;冻结 CLI 输出仍覆盖空源、混合 lane、重复 Goal、不可用配额和上游 envelope 状态。projectGlobalGates使用同一组源事实生成正式门禁项,并把关系调用从按候选数增长收敛到一次事务内组合。_gate_source_facts保留提前停止所需的单一源侧分类,TypeScript 只严格解码这些事实,没有复制用户门禁规则。
验证
- TS owner 与 handler 定向测试通过:20/20。
npm run typecheck:control-plane通过。- Python 定向运行 66 通过、1 个已知基线失败;失败测试与相关 quota 源文件相对
main未变化,且与本 PR 改动无重叠。 check_rfc_bilingual.py --base origin/main --head HEAD与git diff --check通过。- rebase 冲突只发生在双语 RFC 的检查点列表;主干 quota 条目和本 PR 条目均已保留,没有逻辑冲突。
对主干的风险 / Risks
没有发现新的阻断性功能问题。剩余风险是 CLI 输出的兼容性和门禁提前停止语义,现有冻结输出、异常源和 handler 测试覆盖了这些边界。性能资格按当前 owner 的决定不作为本次合并门禁,因此本 review 不把性能结论标记为已认证。发布时 CI 仍在运行;合并前会继续等待必需检查与最新 head 再读确认。
我的整体评价 / Verdict
APPROVE。全局摘要和门禁的组合责任已集中到 TypeScript owner,Python 只保留源读取和输出适配,功能兼容性有当前 head 的定向证据支持。merge 仍需等待 GitHub 必需检查通过,并针对未变化的精确 head 完成 readiness 检查。
English verdict: APPROVE — the exact head preserves the existing summary and gate outputs while moving their composition to one typed owner. Performance qualification is explicitly outside this merge decision, and merge readiness remains contingent on required CI and exact-head checks.
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: loopx-agent; exact head: 7d41256211332ebc2e35582003f5da2dbd30c497
动机 / Motivation
操作者需要跨 Goal 查看全局摘要、下一步和等待决定的门禁项。原实现由 Python 选择 lane、组装 gate、调用关系和 envelope 再组合输出,规则和调用顺序分散在多个运行时中。这个 PR 把完整摘要与门禁读取移到同一个 TypeScript owner,使操作者继续得到原有 JSON、Markdown、排序和告警内容,同时让后续维护只需修改一处决策代码。
改动思路 / Approach
入口仍是现有 global-summary 与 global-gates CLI。Python 保留实际的状态、配额和本地源读取,以及必要的文本、时间和 Markdown 适配;TypeScript 负责 lane 选择、gate 路由、排序、计数、分组、动作和 envelope 组合。门禁的提前停止仍由 Python 源侧事实决定,避免移动读取边界后额外请求后续来源。决策关系与 projection envelope 复用现有 owner,没有新增平行服务或持久化格式。
具体改动 / Changes
关键代码讲解
projectGlobalSummary在一次请求内组合 lane、计数、动作和 envelope;冻结 CLI 输出仍覆盖空源、混合 lane、重复 Goal、不可用配额和上游 envelope 状态。projectGlobalGates使用同一组源事实生成正式门禁项,并把关系调用从按候选数增长收敛到一次事务内组合。_gate_source_facts保留提前停止所需的单一源侧分类,TypeScript 只严格解码这些事实,没有复制用户门禁规则。
验证
- TS owner 与 handler 定向测试通过:20/20。
npm run typecheck:control-plane通过。- Python 定向运行 66 通过、1 个已知基线失败;失败测试与相关 quota 源文件相对
main未变化,且与本 PR 改动无重叠。 check_rfc_bilingual.py --base origin/main --head HEAD与git diff --check通过。- rebase 冲突只发生在双语 RFC 的检查点列表;主干 quota 条目和本 PR 条目均已保留,没有逻辑冲突。
对主干的风险 / Risks
没有发现新的阻断性功能问题。剩余风险是 CLI 输出的兼容性和门禁提前停止语义,现有冻结输出、异常源和 handler 测试覆盖了这些边界。性能资格按当前 owner 的决定不作为本次合并门禁,因此本 review 不把性能结论标记为已认证。发布时 CI 仍在运行;合并前会继续等待必需检查与最新 head 再读确认。
我的整体评价 / Verdict
APPROVE。全局摘要和门禁的组合责任已集中到 TypeScript owner,Python 只保留源读取和输出适配,功能兼容性有当前 head 的定向证据支持。merge 仍需等待 GitHub 必需检查通过,并针对未变化的精确 head 完成 readiness 检查。
English verdict: APPROVE — the exact head preserves the existing summary and gate outputs while moving their composition to one typed owner. Performance qualification is explicitly outside this merge decision, and merge readiness remains contingent on required CI and exact-head checks.
Goal And Delivered Outcome
loopx global-summaryandloopx global-gateswere composed in Python (summary_all.py, about 630 lines of lane selection, gate routing, relation calls, ordering, counting, grouping and envelope composition). The gate read also made one cross-runtime relation call per nonempty candidate (R + 1 calls).loopx/control_plane/presentation/global_manager_read.ts(presentation.global_summary.project,presentation.global_gates.project). Frozen JSON and Markdown output, and the order of source reads, are byte-identical. Gate reads drop from R + 1 crossings to 1.loopx-project/loopx:main. No issue closure claimed.Author Declaration
Implemented against
tests/test_summary_all_transaction_characterization.py,tests/fixtures/summary_all/*.json(JSON + Markdown bytes, source-read order, early stop, unhealthy/stale/incomplete upstream envelopes)global_manager_read.ts; relation evaluation and envelope sealing compose in process through their existing owners; no standalone leaf RPCglobal_manager_read.test.ts_gate_source_factscomputes formal-gate rows and eligibility once, using the sharedopen_user_gate_todo_itemsowner, and the incremental scan uses the same facts for early stop. TS strictly decodes those facts and does not reclassify.semantic-vocabulary-drift-smoke.pyledger/typescript-control-plane-migration-v0/2026-11-02-global-manager-reads{,.zh-CN}.md, linked from both RFC filescheck_rfc_bilingual.pyMigration economics receipt
loopx/control_plane/presentation/global_manager_read.tssummary_all.pyNo latency or long-horizon benefit is claimed.
Scope And Continuation
summary-allis not a registered CLI command on base or on this branch;global-summaryis the supported summary command.effect_runtime_handlers.ts. Whichever merges second needs a trivial rebase.Validation
staticpassedruff checkon changed Python;npm run typecheck:control-plane;git diff --check.unitpassedunitpassedintegrationpassedcontrol-plane-integrated-canary-smoke.py: File and SQLite passed on rerun (an earlier run under concurrent test load exceeded the unchanged 60 s aggregate budget).canarypassedloopx canary premerge --from-git-diff --git-diff-base origin/main: direct checks (diff, bilingual, compile, module ceilings), 10/10 catalog canaries, risk-profile smokes and public-boundary scan passed; 0 manual holds.unitfailed (pre-existing)origin/main(867615e): a quota CLI scheduler-envelope test that lacks the required decision-capture arguments, and a steward endpoint vocabulary test that expects an older endpoint set.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).Merge requires explicit maintainer authorization (control-plane read surfaces under
loopx/**).