Repository navigation
refactor(scheduler): project complete hints in one native request - #6939
Conversation
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
|
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 |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max
Exact head: 52e09dae7fc58081d9422b3f090f69a7febd6906; immutable merge base: 1388ddb8d3409971a72dff5f9891832f7769c1d2.
动机
需要在原有宿主、等待、重试和恢复路径上获得完整调度提示的 CLI/App 调用方。同一次公开 build_scheduler_hint 调用原先跨 Python 与原生规则反复请求;当前把完整提示组合迁到既有 TypeScript runtime,一次返回原输出。正常 runtime 的 50 组完整输出与基础版本一致、重启后相同,所测 active 路径请求数由 Codex 4/Trae 3/generic 4 次降为各 1 次;这仍不等于完整 CLI 延迟或安装态资格。本切片不新增调度/额度/执行授权,不声称安装包、已安装 App、真实 PostgreSQL 服务、全量测试或长期总成本收益。
既有迁移目标要求保留完整输出、普通失败/重试/恢复和原宿主生命周期,而不能只比较缩减 projection 或请求计数。本次已独立验证正常 managed runtime 的 source facade;安装分发和完整 CLI 性能的原验收尚未完成。整体 delivery verdict 为 not_yet_proven,当前结论为 REQUEST_CHANGES。
改动思路
把现有提示组合放进最近的原生 scheduler owner,复用原状态转换与 cadence 规则,并保留 Python 的来源读取、标量与线协议边界,符合单一决策 owner 的迁移方向。本次只审完整 scheduler hint 的规则归属、公开 source facade 与原生请求边界;promotion 前的正式分发和整段 CLI 性能验收仍须原契约证据。Python 先加载既有事实,把有边界的输入交给原生组合;新四个 TypeScript 模块调用原有 transition/cadence 函数,避免另一套决策权威。Python 保留整数/float/Unicode JSON identity、时间解析及 follow-up wire 编码,元数据中的 cli_args 仍不等于执行授权。
当前是既有入口内的默认迁移,没有新增 opt-in 或配置页。paused、无效 host、自动 cadence wait 的旧快速返回从 0 次变成 1 次 runtime 请求;这是明确的依赖/成本变化,不能声称每条分支都减少请求。新私有 RPC 不新增 caller-facing capability。
具体改动
独立规范是变更前的 TypeScript 迁移 RFC §5–§6,spec_revision 1388ddb8d3409971a72dff5f9891832f7769c1d2。complete_hint_parity、single_native_owner 的 source 部分已实现;package_and_complete_cli_qualification 仍未验证。这些是原条款的评审映射名称。当前中英 checkpoint 保留安装和完整性能 hold,不以新文档自证验收完成。
关键代码讲解
- build_scheduler_hint / _projection_facts 读取既有事实并形成有边界请求;公开 facade 一次交给
scheduler.hint.project,保留返回协议和编码边界,不传递整份 quota 大输出。 - projectSchedulerHint 在最近的原生 scheduler owner 组合宿主、backoff、monitor、retry、frontier、follow-up 与 reset identity;复用既有 typed rules。runtime handler、local-snapshot allowlist 和 Python 调用三端匹配。
- boundedMonitorProfile / monitor selection 对完整 monitor 来源做选择,保留 Python Unicode codepoint 顺序。独立公开入口 oracle 在当前提交通过;仅把该 comparator 改成 JavaScript UTF-16 排序的隔离变体会失败。
- cadence-wait 的 action 比较 引入下述唯一具体 P2:迁移时用了裸
blocked_wait,丢失了原 Python 对已注册 EffectiveAction owner 的引用。
全 17 路径 +1421/-2113 已审读,包含旧 owner 的删除部分;生产 +1114/-2083、测试 +269/-28、成对 RFC +38/-2。移动代码同时计入增删,净减行不证明行为或成本收益。旧 execution-context/app compatibility 组合已移到原生,仍有调用的公开 Python facade 和 legacy wire 兼容保留;未发现生产 caller 继续调用已删除组合函数。
[P2] 先复用已注册 EffectiveAction owner,恢复必需检查。 在上述第 437 行用 payload.effective_action !== "blocked_wait" 时,完整 semantic-vocabulary-drift-smoke 报出 effective_action 的 bare action literal。不可变基础版本使用其准确 tracked tree 的同一检查通过;当前标准 premerge 的 6 项直接检查通过、19 项选中检查中 18 通过,仅此项失败。最小修复是从 ../quota/effective_action.generated.ts 导入 EffectiveAction,改用 EffectiveAction.BLOCKED_WAIT,再跑 semantic 检查、TypeScript typecheck 和标准 premerge;无需白名单、重复定义或放宽检查。这是实际已执行的必需检查,不是把 diff advisory 自行升级为新 gate。
对主干的风险
本轮独立执行 346 项 Python 调度检查通过,不可变 base 的同 335 项原公开行为 oracle 通过;额外 11 项检查新单请求边界。TypeScript scheduler/cadence 121 通过,control-plane typecheck、完整声明范围 Ruff、配置 17 文件 mypy 通过。正例、retry/floor、host-update failure、ACK、decision table、cached failure 和 backoff 都在现有公开调用链执行;没有查询、等待远端 CI。
用相同冻结 clock 和合成事实在两头运行实际公开 build_scheduler_hint,保留原 managed runtime,50 个完整 hint JSON 相等,零归一化;覆盖十种 host profile 的 active/human gate/monitor wait/settled replay,以及 paused、stopped、无效 host、Unicode 空白、retry、floor、失败、cadence wait 和 frontier。两头 runtime 均报告 Node v24.21.0/SQLite 3.53.4 且 SQLite authority qualified;仅重启隔离 runtime 后同输入输出仍相同。所测 monitor wait 请求数 Codex 12/Trae 9/generic 12 → 各 1;这些仅是该 source fixture 的请求计数。
另有三项独立反事实:无关显示注释不改变完整 hint;添加 1001 个更晚 monitor 后只有两处真实 candidate_count 从 2 变成 1003,所选 cadence/identity 保留;反转同期限 monitor 时,cadence 选择保持,而 cold frontier 的同期限 identity 按原输入顺序变化,base/head 完全同样变化。因此没有把“任意重排的全输出都相等”误写成通过;初始过强重排断言的失败已保留,并由准确差异和原语义界定。新 large-local-snapshot 路径的 1001 条原生公开测试也通过。
校验 archive baseline 时,一次 harness 没有其自己的 tracked index,误用了外层 inventory;随后用私有临时 index 证明其 write-tree 等于不可变 base tree,并完成同一 gate,真实仓库 index 未变化。这个初始 harness 失败不归因于 PR。作者历史 normal-runtime 受限结果也不冒称本轮失败:本轮上述正常传输及重启已完成。fresh wheel/sdist 的深层调用者、正式安装及匹配 SQLite 整段 CLI 的 p50/p95、冷暖与 RSS 仍未运行;既有 promotion hold 保留,不能由 mock、请求减少或测试数替代。
语义与 CI 对齐
hint 是从原始事实推导的读模型,不能成为 Goal/Todo/lease/额度/scheduler ACK 的新权威。来源完整性和已完成/失效引用仍由未改动的上游 source owner 负责,当前组合不得把空投影解释为已证明无工作。monitor 排序、Unicode strip、Python JSON identity、legacy reset aliases 和 follow-up 传输均在本轮对照/反例范围内核验。提示内的下一步、停止及再准入文本仍是原义务;没有新增“已执行/已读取”的效果回执。
我的整体评价
保留单 owner 的设计方向,当前请求修改这一个可定位的 required-check 回归,并继续保留原安装与完整 CLI 验收边界。50 组完整提示对照支持 source-facade 的 long_horizon/user_experience preserved;它不证明长期决策改善、实际宿主采用或总成本下降。把现有提示组合放进最近的原生 scheduler owner,复用原状态转换与 cadence 规则,并保留 Python 的来源读取、标量与线协议边界,符合单一决策 owner 的迁移方向。本次只审完整 scheduler hint 的规则归属、公开 source facade 与原生请求边界;promotion 前的正式分发和整段 CLI 性能验收仍须原契约证据。修复并更新 head 后再审该变化与准确的必需验证结果。
English verdict: REQUEST_CHANGES — 52e09da. Reuse canonical EffectiveAction.BLOCKED_WAIT at hint.ts:437: the existing required semantic-vocabulary check fails only at the new bare literal, while the immutable tracked base passes. 346 Python and 121 native TypeScript checks passed; 50 full normal-runtime hint pairs match without normalization and survive private runtime restart, with an independently detected UTF-16 mutation. Static checks pass; premerge has one failed selected check. Package/installed and complete SQLite CLI performance qualification remain open; no CI or merge authority claimed.
|
|
||
| function automaticCadenceWait(payload: JsonObject, arbitration: JsonObject, context: JsonObject): JsonObject | null { | ||
| const eligibility = jsonObject(jsonObject(payload.automation_cadence_readback)?.eligibility); | ||
| if (payload.decision !== "wait" || payload.effective_action !== "blocked_wait" || arbitration.disposition !== "quiet_wait" |
There was a problem hiding this comment.
[P2] Reuse the registered EffectiveAction owner
This new bare effective_action literal makes the existing required semantic-vocabulary-drift-smoke fail at this exact head; standard premerge passes all 6 direct checks and 18 of 19 selected checks, with this sole selected failure. The identical full-tree check passes on the immutable base with its verified tracked inventory. Import EffectiveAction from ../quota/effective_action.generated.ts and use EffectiveAction.BLOCKED_WAIT here, then rerun the semantic smoke, native typecheck and standard premerge. Keep the check intact. The 50 full normal-runtime output pairs match, so this finding concerns the registered owner and required validation, not an observed runtime misclassification.
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
…nt-20261020 Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max
APPROVE:旧 required-check 问题已修复;本轮重新验证了完整提示、正常安装调用及有界默认成本,没有当前阻断发现。
Exact head: a1d96376893dfd79bca3f107879c6a852438e534;不可变 merge base/spec_revision: 6e8688d8d90f1c5a99fadf81def8e4ca2e79c925。
动机
通过 CLI、App 调度器读取下一步提示的用户和 Agent,需要在等待、重试与恢复时得到同一份完整结果。
例如一次 monitor 等待原先反复跨运行时组合;现在同一公开入口一次返回完整提示,继续保留原期限、停止条件和 ACK 权限。
本轮 275 组完整结果逐字段相等,重启后 25 组相等;真实安装 CLI 可用,固定 SQLite 完整命令成本保持在原门槛内。
本 PR 不增加调度、扣额或执行权限,也不声称正式 App 激活、模型采用或长期效果收益。
正式宿主长期采用、跨平台安装与长期成本仍需各自原验收;它们不是本次内部完整提示组合已经完成的证据。
这是完整提示组合的一个独立可回滚切片。旧评审 5584541338 的结论不继承:原先裸 blocked_wait 已改用注册 owner 的 EffectiveAction.BLOCKED_WAIT,新增主干的待依赖重查语义也纳入本轮核验。作者所说末次同步只改文档/测试,不代表整个 PR 没有运行时变化。
改动思路
完整提示在最近的 scheduler owner 中组合,复用原 cadence、transition 和 quota wire owner,删除替代的 Python 组合;保留的 Python 只承担时间、来源与现有线协议边界。
当前可审边界是公开 scheduler hint 到原生完整结果的切换,以及相关等待、重试、安装分发和匹配的默认 SQLite 命令成本。
| 阶段 | 之前 | 当前与边界 |
|---|---|---|
| Python 入口 | 组合多个原生规则调用 | 读取原事实、时间及 Python JSON identity,传完整有界请求 |
| 原生 owner | 接受细粒度规则调用 | 同一个 scheduler owner 组合既有 transition/cadence/quota codec |
| 宿主后继 | 输出 apply/ACK/失败恢复建议 | 输出保持原样;实际执行和回执仍归原 host owner |
此表解释当前 exact head 的源码关系,不是执行证明。没有新增用户配置、确认或服务管理工作;可用性不授予自动启用或执行权限。默认实现变化也有代价:paused、invalid context、minimum-interval wait 的旧快速返回从 0→1 次 hint 请求,不能把“单请求”写成所有分支都减少请求。
具体改动
独立依据是改动前的 docs/architecture/rfcs/typescript-control-plane-migration-v0.md,固定 spec_revision 6e8688d8d90f1c5a99fadf81def8e4ca2e79c925:接受的规范。逐项判定:§2.1 最近的单一 typed owner;§2.5 当前 decoder/非法上下文边界;§3.2 完整事务与旧组合退役;§5 最终 diff、真实 caller 与 crossing;§6 输出、反例、恢复、打包与默认成本;§7 自动运行时发现及包内源一致性。本轮这些项在本切片范围内有实证,不由新 RFC checkpoint 自证,也不关闭整个迁移路线。
关键代码讲解
build_scheduler_hint收集原来源、deadline、明确 clock 和原 Python identity 编码,通过_project_hint一次返回完整提示;大输入走既有 private snapshot 通道,follow-up 保留原 zlib/base64 边界。projectSchedulerHint解码并分发完整 hint、ACK、failure、fallback 与 continuation,复用原生 state transition 和 cadence owner。selectedProfile将 pending-dependency 的无限重查传入 reset profile,没有在 reset 时重新变回三次后停止。boundedMonitorProfile保留 monitor 窗口、过期、同期限 Unicode codepoint 排序和原 frontier tie 行为;独立 UTF-16 变体选择 U+1F600,当前头正确选择 U+E000,证明 oracle 能检出实际排序变化。schedulerAckHint只构建既有后继意图。原 Python 时间/序列化及 public compatibility exports 保留实际消费者;共享 monitor recommendation 解码集中在 quota 的现有 wire owner,没有另建 receipt 或额度权威。
全 19 路径 +1455/-2138:生产 14 路径 +1148/-2108,测试 3 路径 +269/-28,成对 RFC +38/-2。已包括旧 builder、execution/app compatibility 和 monitor-wait 组合的删除;移动同时计入增删,净减 960 行生产代码不是收益证明。原公开 Python consumer 和持久 wire 兼容有实际调用方;TS CLI/App 收敛时才可退出剩余 facade,不需要平行版本框架。
对主干的风险
本轮 390 Python、72 native 检查通过,零跳过;control-plane tsc 通过,原生 premerge 6 direct +19 selected 全过,包括原 semantic owner 门、双语 RFC、预算和 public/private 检查。初始误用不存在的 Python module CLI 是评审命令错误,改用该 checkout 的正常入口后完整 gate 通过;没有改产品、断言或门槛。
相同冻结输入通过真实公开 build_scheduler_hint、正常 managed Node 传输,在 11 类 context(含非法 profile)×25 场景,共 275 对完整 JSON 上逐字段相等,零归一化;私有 runtime 重启后每头再验 25 场景相等。包括 active、human/quiet/peer waits、monitor、dependency、scheduled retry、owner floor、stop/pause、失败宿主、frontier、无关 annotation 和多 1001 个晚期限 monitor。原 frontier 同期限顺序差异仍按原语义保留;没有拿“任意重排必定完全相等”当规范。所测 Codex active 4→1、monitor 8→1 是真实调用计数,不是总延迟收益。
当前源码重新构建其官方 Chat 资源,再正常构建 wheel/sdist;分别装入全新隔离环境,逐字节校验相关 Python/TS 模块来自本头,正常 File/SQLite quota should-run 执行成功,没有借用 checkout 包或替换 stdio。首次构建因本地旧生成资源过期被正确拒绝,补齐当前资源后才完成正常安装资格;未替换共享 CLI 或正式 App。
固定 32 组交替 AB/BA 的完整 SQLite CLI(每头先两次 warmup)测得 p50/p95 521.63/595.58 →505.55/605.37 ms,p95 +9.80 ms/+1.64%,在原 5%/未解释 25 ms 门内。没有无干预重复选绿样本。另测 16 次 cold start p50/p95 117.62/140.17 ms,256 次完整 typed hint 暖请求 0.289/0.666 ms;后者包括本地传输,但不等于完整 CLI。RSS idle 84.05 MiB、256 请求后 104.97 MiB,是一组有界观察,不是长期无泄漏结论。实际 Node v24.21.0/SQLite 3.53.4 的 authority qualification 为真。
语义与 CI 对齐
所有完整建议、停止、再准入、失败恢复和生成命令的 actor/ordering/scope/authority/settlement 条款保持等价。hint 是派生读模型,不能成为 Goal、Todo、lease、扣额或 scheduler ACK 的新权威。普通重试/重启和已测等待分支的长期连续性获得保留证据,未把记录/测试数当模型采用或长期净益。遵循当前配置,没有查询、轮询或等待远端 CI;作者提到的历史 CI 不被当作本轮独立观测。
我的整体评价
当前完整切片可批准;架构 retain、reuse、proportionality 与完整输出/普通旅程一致。保留这个单 owner 的实现和已经发生的删除,不要求无关重写或再加框架。正式 App 激活、跨平台安装、长期宿主/模型采用与总效果成本仍归原验收,不从这份 bounded qualification 推出。APPROVE 不授予 merge、dismissal 或 resolve 权限;随后按原生 closeout/readiness 独立读回。
English verdict: APPROVE — a1d9637. The registered enum and pending-dependency reset semantics are repaired.390 Python/72 native tests, typecheck and6+19premerge pass;275 full normal-runtime pairs and25 restart cases match without normalization, with a detected Unicode mutation. Fresh wheel/sdist File/SQLite CLI probes pass.32 matched default SQLite CLI pairs show p95+9.80ms/+1.64%, inside the unchanged5%/25ms gates; warm hint RPC p95 is0.666ms. Formal App activation, sustained adoption and long-run benefit remain separate; no CI observation or merge authority is claimed.
Author revision
a1d96376893dfd79bca3f107879c6a852438e534includes target main6e8688d8d90f1c5a99fadf81def8e4ca2e79c925. The final upstream delta changes documentation and tests only; product bytes and the focused test sources behind the validation below are unchanged.Scheduler hints must preserve the complete existing result while composing their native rules in one request.
This revision resolves the Python-owner conflict and addresses the required source findings:
EffectiveAction.BLOCKED_WAITfrom its registered owner.Validation on the unchanged product sources: 28 targeted public source checks pass through the private stdio transport; 9 selected native monitor admission/receipt cases pass. Full control-plane typecheck, configured 17-file mypy, selected Ruff and bilingual RFC checks pass. The semantic vocabulary check passes with 43/43 maintained twins and unchanged legacy-field budgets. The maintainability ratchet passes.
Limits: the complete native monitor suite cannot finish its Python fingerprint oracle here; isolated base and head oracle cases both time out under the same 15-second bound. Earlier premerge failures remain recorded; full premerge is not declared green. Local normal-runtime IPC/HTTP permissions also block installed callers and matched complete SQLite CLI performance qualification. Focused checks, fewer requests and net deletion do not certify those gates. No merge approval is claimed.
Current CI triage: build job fails at
Personal workspace prefers the registered Goal display name. The same assertion reproduces on target main6e8688d8d90f1c5a99fadf81def8e4ca2e79c925; the complete dashboard tree is identical between this PR and main. This is a confirmed baseline failure and remains a CI/merge blocker. Other checks are still running.