Repository navigation
fix(scheduler): preserve current Host readback in installed launchers - #6276
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
精确 head:1b636bc2063a266d987dbbbb16ff697a0dab619e。没有发现阻断这份修复 PR 的问题;这是可独立验收的入口修复,正式安装采用和时间调度仍有边界。
动机
Codex App 用户通过已安装的 LoopX 命令确认定时配置时,会遇到这个问题。 App 定时器已改为30分钟时,旧启动器仍因没有重新读取实际配置而拒绝确认;修复后重新回读并接受一次,重复确认不会再次写入。 真实60分钟配置拒绝声明30分钟的确认;真实30分钟配置确认成功,原回执重放保持单次效果。 这份 PR 不宣称实际时间唤醒、模型启动前准入或新 Goal 默认 SQLite 已完成。 当前正式安装尚未采用此修复,实际 Windows 系统执行、时间唤醒和后续退避仍需原验收。
这里的 ACK 是对实际定时配置的确认,原回执绑定本次执行。旧入口绕过读取或权限守卫,会让后续调度无法取得可信确认;只验证 console 无法证明安装启动器具有相同语义。
改动思路
实际 Host 读取留在已有 Python IO,状态与效果判断留在既有 TypeScript owner;启动器只选择已有入口,避免增加第二份 Host 解析与决策。 本 PR 完整交付启动器到实际回读、拒绝和单次持久化的调用链;合并后的正式安装采用和时间唤醒继续归原验收。
Unix/PowerShell 在已有生成命令中识别绑定的 Codex 确认与 outer-controller 环境,交回已有 entrypoint。它重新读取实际 App 配置,再把观测交给同一 TS commit;其他原生 failure、Trae 和无绑定兼容路径保留。提示生产者生成的 flag 与捕获事实必须一致,读取、决策和效果没有新增平行 owner。相比复制 Node TOML 解析或把所有命令送回 Python,这个边界更小且保留未受影响路径的成本。
具体改动
依据 docs/architecture/rfcs/automatic-execution-admission-v0.md,验收文本固定在 fb5273002fae9d652a0c21c579bb65ee07755f18;先读改动前 §5 Host contracts,而非用本次文档修改证明自身。
- §5 Host contracts: actual schedule:implemented。实际 App60分钟拒绝声明30分钟,实际更新/readback30分钟后接受一次。
- §5 Host contracts: reject before effects:implemented。错、缺、歧义 Host 与明确空观测在迁移/写入前拒绝;丢弃 flag 也不能绕过读取路由。
- §5 Host contracts: failure pair:implemented。失败命令保留原 target/observation,并用无效 Python 路径证明原生路由仍可执行。
- §5 Host contracts: separate qualification:deferred。源代码和独立候选安装已验;正式安装采用、实际 Windows OS、时间唤醒/退避和模型前准入保持原验收。
关键代码讲解
scripts/loopx:59的 native dispatch gate 把 matched Codex ACK 和 outer-controlled 调用留给现有 Python entrypoint,其他绑定 followup 继续exec node。条件使用现有明确 flag;并不在 shell 决定状态迁移。scripts/loopx.ps1:57的needsCodexHostRead与isNativeSchedulerFollowup执行相同选择,保留已有$LASTEXITCODE传播。实际 PowerShell7.6.6 进程在 macOS 上验证,不以源码字符串断言替代运行。heartbeat_followup_cli.ts:191的requestFromArgs校验捕获事实与--host-match-observed,复用原 identity mismatch 错误。显式 neutral current RRULE 也对其他 App生效;Object.hasOwn区分参数缺席与明确空值,缺席继续保留其绑定观测,空值不拿旧值冒充新读回。
其余三份测试覆盖真实 File/SQLite、原回执重放、控制范围及已有 source fixture 的 post-update读取。RFC只补当前调用链和已有接受规则的适配边界,没有把未测 timer/hook 写成已完成。七个文件整体审查,没有新模块或持久化协议。
对主干的风险
最强反例是 console 已成功但安装脚本仍跳过 Host读取,或 controlled Goal换 actor 就绕过权限。相同最终 oracle 在不可变主干的 launcher矩阵出现10失败/17通过,在 head全部27通过;TS相同新 oracle 主干10通过/5失败,修复后整个相关 TS套件49通过。source scope测试还覆盖同容器其他 Goal、激活后新增独立 Goal、scope escape以及 owner释放后真实恢复写入,避免修成全注册表误拦截。
最终132项 Python与49项TS验证零失败/跳过;typecheck、mypy、ruff、语义 smoke和风险选择 canary15项加4个direct检查通过。首次 canary 的 missing quality receipt是独立执行门,随后经精确范围质量评审补回执再通过,未改预算消除失败。早期 fixtures没有实际读回的失败独立复现后修正,相关原断言保留。按本 Goal当前政策没有读取或等待远端 CI。
正常构建 bundled前端后完成 wheel、独立 wheel install及 archive-layout启动器,并用实际 App API在隔离 File/SQLite验证错误拒绝→匹配写入→原回执幂等重放→后续 guard稳定和 stale原回执拒绝;quota为0。八对相同 stale拒绝负载的 archive/console全输出相同,median约File172/167ms、SQLite162/155ms,仅是有界启动/读取观察,不能替代正式p95或容量资格。正式安装未切换,实际 Windows OS与timer仍未验证;测试没有修改活跃 Goal或正式automation。
语义与 CI 对齐
复用既有 Host surface、flag、neutral参数和错误码;临时路由布尔值仅留在 launcher。状态/效果继续由typed owner执行。当前新错误是硬拒绝,不是可忽略guidance;没有新权限、peer生命周期或默认 SQLite推广。无 packet指令压缩、冻结门放宽或语义登记绕过。文档及重命名原生Trae测试公开披露调用默认变化。
我的整体评价
结论为 APPROVE,交付判断是 justified_increment:long_horizon improved(后续稳定、原回执单次效果和旧回执失效),user_experience improved(原命令自动完成必要回读,无新手工同步步骤)。本 PR 完整交付启动器到实际回读、拒绝和单次持久化的调用链;合并后的正式安装采用和时间唤醒继续归原验收。
有意改变的是原入口缺陷、丢弃绑定flag以及非Codex显式观测被忽略的行为;native失败、无绑定与非Codex无覆盖观测仍保留。已落实面向未来的复用重构,避免第二份 Host解析/决策;保留真实receipt/独立adapter兼容,不把代码减少等同验收。剩余风险是实际Windows与正式采用/时间资格,runtime合并交maintainer。
English verdict: APPROVE - head 1b636bc2063a266d987dbbbb16ff697a0dab619e; real launchers now reuse actual Host readback and scoped guard before the existing typed commit. 132 Python/49 TS tests, native quality/canary and isolated actual App File/SQLite candidate-install validation pass; Windows OS/global adoption and elapsed/pre-model remain separate.
Goal And Delivered Outcome
After #6259, installed Unix and PowerShell launchers still dispatched bound scheduler follow-ups directly to Node. A Codex ACK could bypass the entrypoint's actual Host readback, and an outer-controlled follow-up could bypass its existing write guard.
This change routes matched Codex ACKs and outer-controlled calls through the established entrypoint before the same typed scheduler commit. An actual 60-minute Host rejects a declared 30-minute ACK; after actual Host update/readback to 30 minutes, the original bound ACK writes once and replays without another write. Other generated follow-ups retain their native fast path.
main, related to fix(scheduler): require current App host readback before ACK #6259.Author Declaration
Implemented against
fb5273002fae9d652a0c21c579bb65ee07755f18; the accompanying update makes the installed-launcher boundary explicit.requestFromArgs; existing commitScope And Continuation
Validation
1b636bc2063a266d987dbbbb16ff697a0dab619e.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist