Repository navigation
fix(heartbeat): retain registry through live contract rebuilds - #5826
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>
…tion Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
APPROVE — exact head 0e82476bf6f1fa6df5ba7684a8793b29aaa92130; immutable merge-base a8b759d03e976646aaec6126112b8407cd2a8272.
动机
Operators and host agents executing generated heartbeat commands after retained Todo selection or required capability reads. An admitted Turn retains its Todo, but live contract reconstruction loses the selected registry; from a conflicting working directory, generated refresh/spend resolve another roster and refuse settlement. The candidate carries the original registry/runtime through all three live rebuild paths. Same frozen actual CLI/File/SQLite probe: B generated refresh fails unregistered actor after registry loss; H executes unchanged generated refresh/spend at the selected authority, retains identity, and repeats spend without a second durable effect. No live Bot or provider call, image/permission journey, PG/store migration, packaged App UI, latency, soak, fleet-scale or output-budget qualification. 这消除已知原始authority仍需用户手工补路由的负担,不据此完成整个host/Goal验收。
改动思路
Python live_decision remains a host/IO projection adapter: pass existing registry/runtime inputs into the existing interaction-contract builder. TypeScript keeps selection/receipt/settlement authority; no new config, runner, schema or decision owner. This batch qualifies generated command routing through existing live rebuilds and isolated durable settlement; output budgets, live Bot latency, fleet scale and general installed adoption remain separate. 最小修复是在原adapter逐处转交已知事实。把三次build统一成新factory或新配置,会为12行IO修复增加owner;按现有边界保留更容易验证和回滚。intent自己的执行命令/receipt仍由既有provider决定,不由路由传参授权。
具体改动
最终6路径+93/-8:live_decision仅+12行,在retained selection、turn-start required reads、pending capability intent三处重建传registry/runtime;两项既有测试扩展;install smoke用shlex检查实际registry/format/cli_bin及已生成compact命令,而不依赖旧的HOME字符串或参数顺序;两份既有文档披露routing边界和原预算失败。旧e20ac76的预算扩容/spec/test阈值已由作者撤回,本review只覆盖0e82476最终完整版本,所有commit DCO记录已读取。
Accepted spec: roadmap selected-route checkpoint;spec_ref docs/architecture/rfcs/loopx-overall-roadmap-v0.md,spec_revision a8b759d03e976646aaec6126112b8407cd2a8272。Criteria Selected authority survives command rebuild、Budget failures retain independent attribution: implemented。另读同B的 Budget Failure Decisions,未用候选新文档反向放宽契约。
冻结相同脚本在B/H各跑真实File/SQLite、实际CLI子进程与生产TS/持久化journal:先存真实preference,让agent_preferences成为pre-work read;原source选择Todo,再无参数reentry,cwd中的冲突registry只注册另一个worker。B生成refresh丢--registry、实际exit1/unregisteredactor且没有spend;H带正确source并原样执行refresh/spend成功,全部identity不变,spend重放无append,总数1,最后durablephase=settled/heartbeat_settled_skip,冲突registry hash不变。B显式指定原source的恢复对照也能结算原Turn;H无需补旗标。这是实际业务入口反例,不是仅检查字符串或mock builder。
Python3.12.15 B114/H115 pass across six routing/read-hook/replan/intent/provider suites. Same two-provider production CLI probe qualifies generated commands, real preference/read, retained choice, durable settlement and single-spend replay. Ruff,mypy19,changed advisory then full-tree semantic pass. Current final-head risk-based premerge19selected+5direct pass, including isolated install/canary/packaged-CLI smokes and six-file clean public boundary. Six suites分别为heartbeat_registry_route、prompt_upgrade_hook、effect_turn_live_quota_decision、selection_replan_reentry、settled_replay_construction、quota_authority_settlement_journey;H多1项来自File/SQLite参数化,不能将数量差当same-suiteparity。错误selectedregistry不能fallback到本地有效roster、不存在Todo拒绝,以及paused/exhausted/operator/read-off/pending/settled组合都保留。Hookproducer单测不是实际外部provider投递;installedCLI smoke是隔离安装,不是已在用户App安装采用。
对主干的风险
Original 128-character-root budget test remains failed on both B/H: JSON12107>10500, no growth; budget owner, test, differential and runner bytes unchanged. Current risk-selected premerge omits this budget script, so its passing19 checks do not qualify output budgets. Author-reported thin/crowded/growth/96-row and first-bad historical measurements were not independently rerun. 所以这里可以批准窄routing修复,不能把预算资格标绿、重新命名旧失败或改promotion/SLO。作者96row、thin/crowded/growth和first-bad详细测量保留作者出处;本角色独立证明的是相同128字符根两侧12107及四budgetownerfile字节相同。预算判断的consumerfield/scale总体结论未借用作者证据当实测。此次current native premerge的19项与5direct确实全过、无manualhold;selector没有选择budget脚本,额外budgettest仍failed。
No live Bot or provider call, image/permission journey, PG/store migration, packaged App UI, latency, soak, fleet-scale or output-budget qualification. 私有probe初稿将macOS /var与/private/var同一路径当不同,误报routefalse;在fixture创建前resolve原root后用同一冻结脚本重新跑B/H,H才在不补route的情况下实际settle,两侧原始结果保留。没有修改产品、删负例或normalize失败诊断。临时state全隔离,不对活动Goal/claim/lease做故障注入。
我的整体评价
APPROVE,仅指已证实的窄routing结果。This batch qualifies generated command routing through existing live rebuilds and isolated durable settlement; output budgets, live Bot latency, fleet scale and general installed adoption remain separate. Future-facing pass复用原builder、保持TSauthority和PythonIOprojection,无需增加routefactory/runner;更大的budgetcompaction由既有owner继续,不新造与routing重复的Goal。默认三处重建只是保留已选authority,未增grant或新optionalfeature;emptyadvisory不是语义证明,后续fulltreesemantic已过。作者和本角色GitHub账户都为loopx-agent,正式self-APPROVE不可用,故这是精确head的COMMENTED approval conclusion,原始GitHubbadge仍可能REVIEW_REQUIRED。Closeout/readiness与合并授权另外读取;本角色不merge、不升级、不向任何聊天回信,不查询/轮询/等待CI。
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=xhigh.
English verdict: APPROVE - All three existing live interaction rebuilds now carry the original registry/runtime into the same contract builder. A frozen real File/SQLite CLI base-head probe reproduces baseline command failure and confirms unchanged generated head commands settle the original Turn exactly once with durable replay. Routing, hook, replan, intent, isolated install and risk-selected checks pass. The independent long-path budget still fails identically on base and head; its thresholds and owners are unchanged, and the selected premerge does not cover it. No live Bot, broader output-budget, App adoption, latency or scale qualification is claimed. This author-owned COMMENTED conclusion grants no merge or messaging authority; no CI was consulted.
Generated heartbeat settlement commands can lose the selected registry when a live decision rebuilds its interaction contract for a retained choice or a required capability read. From another working directory, those commands can then resolve a different authority. Pass the existing registry/runtime inputs through all three live rebuild paths; keep typed selection, admission and settlement ownership unchanged.
The regression stores a real preference, selects work, reenters the same Turn, and executes generated refresh/spend commands unchanged from a conflicting-registry directory. File and SQLite cases cover spaces/quotes, rejected selection, stable identity, durable settlement and one-spend replay. Conditional prompt-upgrade reads also retain the route. Installed/canary heartbeat smoke assertions now expect the actual selected registry and complete command instead of the old shell-HOME/prefix layout.
Validation: 75 related routing/hook/replan/intent tests and 14 long-path/bootstrap tests passed before the attempted budget adjustment was removed; the long-path test under the original threshold remains an explicitly retained baseline failure. Ruff, configured mypy (19 files), unchanged registry-IO manifest and diff checks pass. Corrected installed-heartbeat smoke passes in the source standard gate. An immutable base/head measurement-only comparison covers 96 rows on each revision with no changed default structural or semantic contract; measurement-only is not budget qualification.
The original standard premerge failed install assertions (also reproduced on clean base) and output budget checks. The installation assertion is corrected. Output qualification remains failed: the unchanged 128-character-root brief emits JSON 12,107 > 10,500, first introduced by #5818 commit
fb20c153(its immediate parentbe923270emitted 10,417). Further measurement found unchanged thin Markdown 5,438 > 5,100, crowded quota/Turn-plan JSON 34,371 / 15,023 > 34,000 / 15,000, and Turn-plan growth 6,544 > 4,200. These are kept as existing-budget failures, not hidden by raising thresholds. A separate budget/compaction qualification remains open. No CI query or wait under the configured review policy.This qualifies generated command routing and preserves original settlement identity. It does not qualify live Bot latency, image/permission handling, fleet scale or the unresolved output budgets. Independent exact-head review and native merge readiness are required before installation.