Skip to content

refactor(goals): converge Vision wait projection in TypeScript - #7298

Merged
huangruiteng merged 2 commits into
mainfrom
codex/control-plane-semantics-ts-20261025
Oct 27, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/control-plane-semantics-ts-20261025

Conversation

@hhyykk

@hhyykk hhyykk commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Move Goal Vision wait-state assembly, blocker eligibility, causal Todo lineage, and resume-planning composition into one TypeScript effect: goal.vision_wait.project.
  • Keep Python as the source-snapshot codec, effect transport, result validator, and historical wait-state decoder.
  • Remove reason text from blocker eligibility. Typed task class, status, claim, exclusion, and causal lineage determine the wait state; reason text only appears in display output.
  • Update the TypeScript migration RFC in English and Chinese.

Measured results

  • Controlled build_quota_should_run path, 200 runs per arm: median 67.39 → 65.80 ms; P95 94.66 → 87.61 ms. Runtime crossings: 4 → 3.
  • Canonical File-backed CLI fixture, five repetitions: final quota should-run median 275.87 → 270.19 ms. The whole fixture flow held crossings at 4 → 4; the eligible wait projection uses one combined effect.
  • Final CLI JSON size: 25,729 bytes in both arms, about 6,433 estimated tokens. No payload growth.
  • Production loopx/ diff: +224 / −289 lines, net −65.

Validation

  • Exact-head npm run test:control-plane: 5,559 tests; 5,483 passed, 0 failed, 76 skipped because they require an isolated PostgreSQL server.
  • Vision wait and resume-planning TypeScript tests: 16 passed.
  • Vision wait and blocked-successor Python tests, including File-backed CLI cases: 82 passed.
  • Semantic architecture tests: 674 passed; semantic-vocabulary drift smoke passed.
  • npm run typecheck:control-plane, targeted ruff check, and the RFC bilingual diff check passed.
  • Diff scan found no secrets, tokens, or local absolute paths.

An earlier exact-head full run hit one Host heartbeat timing assertion. The isolated test passed on retry, and the subsequent full exact-head run passed with zero failures.

No PostgreSQL authority-store code changed. The 76 PostgreSQL-dependent cases remain skipped under their existing isolation requirement.

Review follow-up (2026-10-27)

Rebased onto 17b2a0f9b818dc6e6fe77ccc567b20ff91b3bc40 and fixed at fa972cb84719813e01c62b2017e36fc23f3b585b.

The Python fact codec now preserves priority; TypeScript remains the single owner of wait selection. Added a public quota should-run regression over actual canonical File and SQLite stores for P0/P2 blockers without reason text. The P0/File case reproduced the missing selected_todo_priority on the unfixed code and passes after the codec correction. No scheduler, receipt, provider or wait-eligibility rule was weakened.

Validation: 86 focused Python tests and 6 TS coverage tests pass; changed-file Ruff, bilingual diff and whitespace checks pass. Final standard premerge passes all 4 direct checks, compile and 15 selected checks after installing the required npm dev dependencies. The initial premerge attempt lacked TypeScript dev dependencies and failed the semantic scan; it is not counted as a pass. No installed-package or full-CI claim is made for this follow-up.

Please re-review the updated head. / 请复审新 head;优先级丢失已由真实 CLI 回归覆盖。

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

结论:REQUEST_CHANGES。发现一个 P2:合法 blocker 的 selected_todo_priority 在新传输边界丢失;真实 CLI、wheel 和 sdist 均复现。

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

审查版本:d8daa76e604f856efccdaf7b7887edc97ec8178d;完整 PR 基线:af68b0ff180ca8309b5d63d7ee326c77848521bb。以下结论来自本次独立本地验证,未查询、轮询或等待 GitHub CI。

动机

使用 Goal 持续推进任务的 Agent 和维护者,需要从等待状态判断当前阻塞项及其优先级。

同一名 Agent 的 P0 阻塞任务解释了当前目标缺口时,旧版等待投影保留 P0;新版仍识别该阻塞,却丢失输出中的优先级。

合并决策所有者的方向成立,但本次迁移尚未保住调用方可见字段,不能按语义等价交付。

本 PR 不负责重写存储后端、完成整体 TypeScript 迁移,或证明长期任务效率提升。

剩余缺口是把 blocker 的 priority 传过 Python→TypeScript 边界,并用真实 CLI 及安装包回归固定该字段。

原来 Python 决定哪些任务可以构成等待,再分别调用 TypeScript 的恢复规划和因果覆盖。后续改规则需要同时维护两处判断,重复读取也需要两次传输。这是一个真实维护边界,值得收敛;但迁移的价值需要保住原有输出,不能只用删除代码或测试数量证明。

改动思路

等待资格、因果覆盖和 payload 组装应复用现有 TypeScript 决策所有者;Python 只保留数据编解码和历史收据读取。

保留本次合并决策路径的边界;先修复 priority 丢失,不扩展到无关存储迁移或新增配置界面。

最强的反对理由是:旧实现已经携带完整优先级,换所有者会引入字段遗漏,而减少一次内部调用并不自动带来实际提速。更小的 Python 辅助函数仍保留分裂的决策所有者;新增服务或状态表则没有必要。当前设计复用 projectTodoResumePlanning 和 projectVisionWaitCoverage,生产代码净减 65 行,方向和规模相称。这里要求修正传输遗漏,不要求扩大重构。

真实入口的输入 基线 本 head
本 Agent 的 P0 blocker,带 reason 等待投影保留 P0 blocker 仍被识别,优先级键消失
同一合法 blocker,不写 reason 不形成 blocker 等待 按 canonical typed state 识别,属已披露修正
未来时间恢复的 deferred Todo 自动等待,保留恢复条件 相同
其他 Agent、无关因果 ID、独立可执行任务 不应继承当前等待 对照保持

表格说明的是已执行的输入对照。没有使用未渲染的图作为证据,也没有从一条等待收据推断长期效率提升。

具体改动

build_goal_vision_wait_state 现在只准备完整事实并发出 goal.vision_wait.project;handler 把它交给 projectGoalVisionWaitState。后者先检查缺口都是普通 Vision gap、没有独立可执行推进,再复用恢复规划、因果图和 witness 选择,最终在 waitStatePayload 中构造原有 schema。历史 exact-wait 解码器仍供收据读回使用,不构成第二个决策所有者。

[P2] 保留 blocker 的 priority。 loopx/control_plane/goals/goal_vision_wait.py:15 的字段白名单包含 id/class/status/claim/exclusion/reason,却没有 priority。下游 waitStatePayload 仍读取 selectedTodo.priority;读到 undefined 后转换成 null,再被输出过滤掉。因此同一 canonical P0 blocker 在基线有 selected_todo_priority: "P0",head 中该键不存在。最小修复是在白名单传递 priority,并添加真正经过 quota/status CLI 的字段存在性和值断言。不要只在 TS helper 中手填 priority 测试。

接受依据是 docs/architecture/rfcs/typescript-control-plane-migration-v0.md,固定于 af68b0ff180ca8309b5d63d7ee326c77848521bb,在阅读实现前检查。逐项判断:2.1 One TypeScript kernel、2.4 Replacement, not production dual-running、2.7 Legal domain values and deterministic decisions、2.8 Change locality as migration payoff 的本次边界有代码及调用证据;Caller-observable semantic parity is a promotion gate 未满足,缺口就是 priority 丢失。PR 自己修改的 ledger 不能替代旧合同。

语义与 CI:这是现有 effect vocabulary 的内部方法扩展,沿用既有 Todo/Goal 等待 schema;新增字段名白名单属于模块内 codec。没有用 reason 子串识别状态,也没有新增领域特定硬义务。默认行为确实改变:缺少 reason 的合法 blocker 现在按 typed state 生效,测试和双语 ledger 已披露。priority 丢失则不是这项修正的必要代价。must_attempt_work 等强制结果仍是机器语义,不能把它们称为可忽略建议。

对主干的风险

本次在不可变 base/head 上用同一 synthetic fixture 运行真实 canonical File、SQLite 和真实 effect runtime,七类输入共 14 个观察。除 evaluated_at 时钟外不归一化业务字段。带 reason 的 blocker 仍在两边得到 normal_run、must_attempt_work=true;因此这里只报告输出丢失,没有证明调度优先级改变或饥饿。未来 deferred 等待仍是 agent_scope_wait、不要求尝试执行;peer、无关因果和 runnable 对照未出现误覆盖。

两个焦点 Python 文件 82 项通过;完整 TS 套件 5559 项中 5484 通过、75 跳过、0 失败,不能把跳过算作执行通过。类型检查通过。标准 native premerge 的 6 项直接检查和 15 项选择检查全部通过,包含双语 RFC、语义 vocabulary 和公共边界。工作流范围 Ruff 有 5 个 E701/E702,逐条与基线核对均位于未修改的 tests/presentation/test_codex_attached_conversation.py;更宽的可选根扫描有 114 条相同诊断,二者范围不同,不混为一个结果。

正常构建最初因缺少生成的 Chat 资源失败;尝试复用资源时完整 source-input 校验正确拒绝了已变更的 TS kernel。我随后为精确 head 重新构建 Chat,再构建并隔离安装 wheel、sdist;没有改 manifest 或绕过校验。安装后的真实 CLI 在两种后端仍丢 priority,未来等待和 completed-reference 对照保持。所有测试都使用 disposable synthetic 状态,未改活动 Goal。

有限成本样本里,真实调用轨迹由两个传输方法变成一个,100 次 warm pure-call 中位数约 0.366→0.207ms;12 组交替的完整 SQLite CLI 中位数为 364.35→370.83ms、p95 为 594.42→548.31ms。共享主机样本没有显示明确端到端提速,也不证明冷启动、内存、File 性能、安装后的长期收益或模型采用。当前修复不改变存储权威,未据此声称 PostgreSQL 写路径资格。

我的整体评价

同意复用现有 TypeScript 所有者并删除 Python 重复决策,边界清楚、回退也可控。当前公开输出发生确定回归,所以需要先完成上面的最小修复再批准;不要求为这个修复新建框架、改存储或补齐整个路线图。typed-state 的 reason 修正可以保留,但应与意外 priority 丢失分开验收。

已检查 quota/status 的投影调用和本次全部 diff;没有修改渲染页面、布局或可见组件,视觉截图不适用。

未验证范围:Live installed host rendering was not exercised; this PR changes no rendered presentation. 未运行 live 模型、多主机长期任务或持续成本实验。没有新增用户确认轮次;真实可见读回仍需保持完整。评审、premerge 和字段修复都不构成合并授权。

English verdict: REQUEST_CHANGES for d8daa76e604f856efccdaf7b7887edc97ec8178d. The new Python blocker-row codec drops priority, so the existing selected_todo_priority field disappears from real File/SQLite CLI output and installed wheel/sdist builds. Preserve the field and add a public-entrypoint regression. The typed-state reason correction and consolidation into the existing TypeScript owner are otherwise justified; no scheduling starvation or sustained performance benefit is claimed.

Comment thread loopx/control_plane/goals/goal_vision_wait.py Outdated
@huangruiteng
huangruiteng force-pushed the codex/control-plane-semantics-ts-20261025 branch from d8daa76 to e1a83c4 Compare October 27, 2026 08:45
hhyykk and others added 2 commits October 27, 2026 17:25
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
@huangruiteng
huangruiteng force-pushed the codex/control-plane-semantics-ts-20261025 branch from e1a83c4 to fa972cb Compare October 27, 2026 09:32

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

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

动机

尚未证明完整 CLI 冷暖/RSS/总成本、共享安装与自然 Host 采用或长期模型净收益;五项原相邻夹具仍失败。

Current exact-head ordinary CLI and isolated wheel preserve priority and scoped waits, reject peer/unrelated/runnable suppression and consume one TS composition owner.

本次只交付 Goal Vision wait 的源码和隔离 wheel 投影;原 Todo/claim/lease、正常准入、结算与历史精确读取仍归原 owner,不宣称全局安装、R3/D2/D3 性能资格或长期模型收益。

把已有 Goal Vision 暂时等待判断收敛到现有 TypeScript owner,保留原公开字段、因果覆盖及独立可执行工作。

既有 status、frontier、quota should-run 与消费相同投影的 Agent;用户继续从原工作台查看等待。

此前 Python 先组合 resume planning、blocker 资格、谱系及输出,再调用 TS 覆盖判断;现在一次 TS effect 组合原 owner。先前头遗漏 blocker priority;本头公开 File/SQLite 及安装 wheel 均保留 P0。

等待是否覆盖原义务会直接影响 Agent 能否继续有价值的工作。这里要避免两种失真:遗漏真实 blocker 的公开优先级,以及把同一容器内的无关任务都算成等待证据。当前头修复了前次实际反例,并将决策放回已有 typed owner;没有以新记录或文件数代替结果。

改动思路

等待资格和因果覆盖属于现有 typed correctness owner;Python 只负责原来源 IO 和运输。该切片删除重复决策且有真实公开消费者,不需要新 capability、设置页或另一调度器。

本次只交付 Goal Vision wait 的源码和隔离 wheel 投影;原 Todo/claim/lease、正常准入、结算与历史精确读取仍归原 owner,不宣称全局安装、R3/D2/D3 性能资格或长期模型收益。

普通入口仍读取规范 Todo、resume 条件、claim/exclusion 和完整谱系。Python 运输这些事实,goal.vision_wait.project 在既有 Goal 模块组合 projectTodoResumePlanning 和 projectVisionWaitCoverage,输出原 wait read model;不会写任务状态、变更 lease 或扣额。历史精确 wait decoder 继续供 quota/原 frontier identity 使用,它有独立兼容用途,不能为了删行把它当重复决策一起删除。

具体改动

本次完整审阅 fa972cb84719813e01c62b2017e36fc23f3b585b 的七文件净差异 +322/-304:三个生产文件、两个 owning tests、中英文迁移 RFC。实际分叉基点 17b2a0f9b818dc6e6fe77ccc567b20ff91b3bc40 用于识别 PR 内容,当前 target 8acdb88d32b6cad5b43670c99647341545f435cd 用于原生质量和 premerge;没有继承旧 d8 头的结论。

接受依据固定为 target 8acdb88d32b6cad5b43670c99647341545f435cd 的 docs/architecture/rfcs/typescript-control-plane-migration-v0.md,而非本 PR 自增的 ledger。2.1 One TypeScript kernel、2.4 Replacement, not production dual-running、2.7 Legal domain values and deterministic decisions、2.8 Change locality as migration payoff、Caller-observable semantic parity is a promotion gate 均在本有界切片映射为 implemented。完整 R3/D2/D3 或已安装全局推广与性能资格另列,未借局部通过关闭。

关键代码讲解

  1. build_goal_vision_wait_state 把原 source/summary 分支编码成请求;blocker 行现在携带 priority。本头真实公开 File/SQLite 及隔离 wheel 都保留 selected_todo_priority=P0,前次 codec 遗漏已修复。
  2. projectGoalVisionWaitState 只处理普通 Vision gap 且 selectable_advancement_count=0 的情况;完整 causal IDs 才进入原 planner 和覆盖判断。独立合法工作不因同容器存在 blocker 被压住。
  3. currentAgentBlockers 依据 class/status/claim/exclusions 判断;reason 仅为可选说明。这是明确的行为修正:相同无 reason 输入在 target 不产生 wait,本头产生当前 actor 的 P0 blocker wait;它仍需准确因果关系,不从文字猜权限。
  4. projectVisionWaitCoverage 为每个 causal obligation 寻找自己的 witness,seen 限制循环;共有前置不能覆盖未关联的 sibling。原任务不被此投影自动完成,条件恢复仍由原 resume/admission owner 决定。

公开输入对照覆盖七情形×File/SQLite:P0、有/无 reason、peer blocker、无关 causal ID、独立 runnable、deferred 前置与未来时间。除已披露的无 reason 修正,完整 wait 字段在去掉真实时钟 evaluated_at 后一致;未声称带独立 source/path/incarnation 的整份外层 packet 逐字节相同。完成引用、循环、缺少 ID、非 Vision gap、cached/历史读取由完整 owning suites 覆盖;wheel 另跑 P0、未来等待、completed reference 六项实际公开入口。

对主干的风险

最强风险是运输漏字段或扩大等待作用域。前次固定公开探针确实击穿旧头,当前相同探针在两后端通过;peer/无关/独立 runnable 都不产生 wait。86 个完整 owning Python 用例、16 个既有 typed wait/resume 用例、根 typecheck 和 standard premerge 6直接+15选中全部通过,无 hold。隔离 wheel 六例通过,1159 个实际加载产品模块均来自该 wheel,三个变更产品成员在源码、wheel 和安装位置逐字节一致;fixture helper 独立来自精确源码,不冒称所有 fixture 都随 wheel 发布。

扩大相邻五模块的原310秒运行中断,不能报完整通过;五项当前失败已独立在不可变 target 与本 head 复验。它们在未初始化规范 authority 的 provider=None/legacy 夹具入口先失败,尚未进入改变的 wait owner。对齐 Python3.14.8、pytest9.1.1 和全部依赖后,用完全相同 argv 复跑;五项 identity、完整错误类型/消息/正文、相关 fixture 字节和环境摘要均相同。仅规范化 checkout 前缀、pytest 临时根和对象地址,未删错误事实。归因为 pre_existing_unrelated,原检查依然是失败,后续应迁移这些夹具;当前变更不制造该错误,独立 owning/public/package 验证覆盖七个改动路径。

首次错误测试路径的退出、扩大运行超时、旧 frontend bundle 导致的首次 wheel 构建失败及环境差异均保留。随后正常重建原 frontend 再构建 wheel 成功,没有改变产品代码或放宽断言。首评前 CQR cqr_f71d2d90bc24fa51bdfe = PASS,物理收据、实际 record response 与提交 result 逐字段相等;其中相邻检查仍标 failed,按原能力的严格可选归因处理,没有豁免必需验证。

语义与 CI 对齐

本次使用既有 typed 值与 owner,新增的是内部组合 effect 注册,不是新的生命周期状态或 authority。reason 是诊断,因果与身份是机器资格;两者没有互换。当前不是新 optional feature 的 feature-off 声明,无 gap、其他 gap、无覆盖和有独立 runnable 的原路径仍返回 no wait。等待分支减少跨 runtime 组合并不自动证明整条 CLI 更快;早退路径可能增加运输,完整冷/暖延迟、RSS、模型与人工总成本仍未知,不以净行数或一次 RPC 推算收益。按当前策略未查询或等待 CI。

我的整体评价

long_horizon=preserved;user_experience=preserved。保留的是本次有界投影与原独立工作路径,未推断整体理解或匹配长期净收益。

APPROVE — fa972cb84719813e01c62b2017e36fc23f3b585b。 当前七文件完整切片完成真实 owner 替换,前次 P0 字段反例在 source 与隔离 package 已消除,负例保持独立工作不被等待吞掉。这里是源码/包资格,当前测试数量和 CQR 不是安装采用、用户理解或长期净收益证明。

等待资格和因果覆盖属于现有 typed correctness owner;Python 只负责原来源 IO 和运输。该切片删除重复决策且有真实公开消费者,不需要新 capability、设置页或另一调度器。

本次只交付 Goal Vision wait 的源码和隔离 wheel 投影;原 Todo/claim/lease、正常准入、结算与历史精确读取仍归原 owner,不宣称全局安装、R3/D2/D3 性能资格或长期模型收益。

五项相邻夹具失败及原中断/构建失败保持可见;完整性能、自然 Host 后继与安装 App 未验。此次未修改作者源码、合并、dismiss 历史 review、改变共享安装或启动模型/benchmark。下一步由维护者结合当前原生 merge-readiness 决定集成;本评审不授予合并权限。

English verdict: APPROVE — fa972cb. The existing typed owner now performs the complete scoped wait composition; public File/SQLite and isolated-wheel checks preserve P0 and reject unrelated or runnable suppression. Five adjacent legacy-fixture failures are independently reproduced with identical full signatures, fixtures and aligned environments, and remain failed. Full-CLI performance, installed host adoption and long-horizon net benefit are unqualified; merge authority is separate.

@huangruiteng
huangruiteng merged commit a115458 into main Oct 27, 2026
22 of 37 checks passed
@huangruiteng
huangruiteng deleted the codex/control-plane-semantics-ts-20261025 branch October 27, 2026 11:25
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.

3 participants