Repository navigation
test(control-plane): separate canonical readback from execution admission - #6945
Conversation
…mission 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=max.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
维护者在验证 Goal 文档丢失或任务受阻后的恢复路径时,会遇到回归套件对既有安全规则的错误期待。原测试把同一 Goal 的首条健康告警当成数据视图,并在删除目标文档后要求准入;现在分别验证可回读、拒绝执行和恢复后重新准入。此次交付修正现有回归验证,保护原有只读状态、阻塞和结算边界。本 PR 不修改生产实现、默认行为、模型载荷、发布候选或已安装运行时。
改动思路
先区分“能查看已有状态”和“允许执行工作”。目标文档缺失时,健康告警与权威数据投影可同时存在,读取者不能仅按 Goal 取第一行。另一路是已准入任务转为阻塞:guard 可以要求原尝试收尾,但这不允许继续执行或轮询旁路任务。因此保留现有生产 owner,仅改测试取数与完整断言,比放宽生产门更小也更安全。
| 情况 | 保留的观察 | 保留的限制 |
|---|---|---|
| Goal 文档缺失 | 当前 canonical Todo、lease、验收 | 不授予自动执行,不重建文档 |
| primary 转 blocked | 原 Turn 身份及 no-spend 收尾 | 旧 monitor 命令仍拒绝,Task 仍 blocked |
具体改动
关键内容讲解
接受依据为 docs/status-data-contract.md 与 docs/quota-allocation.md#receipt-backed-settlement-progress,固定修订 f72b67113ff42ccf385519222a530a11ce22659c;评审 head 为 714c7d1fef4ac388169594baf10b06555c3a7e92。
state_file_missing:test_canonical_goal_channel_coordination.py::channel 与 test_goal_acceptance_runtime.py 显式选择带相应投影的唯一数据行,同时断言缺失告警、验收 hold 和执行拒绝。test_capability_gate_cli.py 先验证原有 capability 语义,再删除文档验证拒绝及 canonical 可读,恢复原字节后重核同一候选。provider 不可用时不读旧显示数据的负例仍在。
typed_blocked_writeback_no_spend:test_auxiliary_scoped_gate.py 保留旧 monitor 命令的 identity-conflict 拒绝,新增同一原尝试的收尾与 replay,核对零扣额且 primary 仍 blocked。双语文档只说明已有多行读模型;没有新增协议、字段或默认规则。四个现有测试族复用原 fixture,未增加独立框架。
对主干的风险
没有 P0/P1 或其它阻塞发现。最危险的替代方案是为满足旧断言而放宽准入,本 PR 没有改生产代码。四个完整模块 48 项通过,邻近 canonical/health/scope/lease 202 项通过;原生 premerge 的 5 项直接检查和 18 项选中检查全部通过。真实 File/SQLite CLI 覆盖源缺失、恢复、受阻后的旧命令拒绝和收尾重放;打包 Chat 的 SQLite 合成只读验收覆盖 provider 失败后清除旧状态及重试恢复。未运行整仓全量套件,不把历史失败、中止记录或浏览器回读当成整版发布通过。按当前配置未查询远程 CI。
我的整体评价
APPROVE。命名的回归修复范围已完成,交付判断为 goal_achieved;long_horizon=preserved、user_experience=preserved:原承诺、阻塞和恢复规则保持,用户没有新增准备或确认步骤。该结论仅覆盖此测试/说明 PR;无安装、模型调用或发布资格推断。相同作者最近 12 个 PR 与既有覆盖检查未发现重复铺设,本次扩展现有回归有直接维护价值。现有状态词汇全部复用;更宽的完整资格由原有工作继续,不为本 PR 新增仪式性后继。
English verdict: APPROVE — 714c7d1fef4ac388169594baf10b06555c3a7e92. Corrects obsolete regression assumptions while preserving missing-intent refusal, canonical readback, monitor rejection and original no-spend replay. 250 focused tests and native premerge passed; production behavior is unchanged. Full-suite and release qualification are not claimed.
Goal And Delivered Outcome
Three existing regression families treated readable canonical state as execution permission, or selected a health finding as the Goal's data projection. A fourth expected an admitted Turn to become unrecoverable after its primary Task was blocked. On
f72b67113, these assumptions produce 11 failures across four complete test modules.This change corrects those test oracles against the already shipped owners: canonical observation survives a missing Goal document, automatic delivery remains refused, and a blocked primary permits only its original idempotent no-spend closeout. The previously emitted auxiliary-monitor command remains rejected. No production implementation or execution gate changes.
loopx-project/loopx:main. Related fix(quota): close blocked advancement attempts without a retry clock #6936; fix(status): fail closed on truncated legacy Todo sections #6921 owns the separate legacy-section truncation case and is not copied here.Author Declaration
Implemented against
docs/status-data-contract.md,docs/quota-allocation.md#receipt-backed-settlement-progress, and the missing-Goal health rule at basef72b67113ff42ccf385519222a530a11ce22659c.test_canonical_goal_channel_coordination.pytest_capability_gate_cli.pytest_goal_acceptance_runtime.pytest_auxiliary_scoped_gate.pydocs/status-data-contract.mdSelf-check: read the existing production rules before changing assertions. The seven source-loss failures do not establish lost canonical data: the health row preceded the full read model, and missing-document admission was deliberately refused. The four primary-blocked failures reflect the accepted #6936 recovery change; the monitor command's rejection is preserved. Historical failed/incomplete runs remain failed/incomplete.
Scope And Continuation
Complete within the regression/contract scope. Production code, typed authority, provider routing, defaults, release candidates and installed runtimes are unchanged. This does not qualify an entire release or finish unrelated outcome validation.
Bounded refactoring: clarified the existing multi-row read-model boundary and extended the current test families instead of adding a new fixture framework or parallel owner. No new semantic vocabulary. Real PostgreSQL-store integration is not applicable because no store/provider or production behavior changed.
Validation
714c7d1fef4ac388169594baf10b06555c3a7e92.Frontend / Visual Evidence
Boundary Checklist
Signed-off-bytrailer included.