Repository navigation
test(quota): preserve Goal sources in canonical recovery fixtures - #7001
huangruiteng merged 2 commits into
Conversation
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 | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max
APPROVE — 修正了真实的夹具来源错误,保留原恢复断言和健康门禁;已有 147/145 架构预算失败作为独立集成阻塞保留。
动机
维护 canonical Todo 恢复行为及配额准入测试的开发者。
旧夹具为了移除旧 Todo 展示,删掉了仍被注册表声明的整个 Goal 文件,导致三个恢复用例先被来源健康检查拒绝,根本没有走到要验证的恢复分支;新夹具保留同一 Goal 正文,只移除已捕获的 Todo 展示。
现在真实 File、SQLite 和旧 Markdown 调用能分别验证 monitor 修复、generation 等待与 capacity 恢复,同时另有用例确认 Goal 文件真的缺失时仍拒绝执行。
本 PR 修正测试与双语规范说明,不改产品默认、来源健康门禁或权限,也不宣称完整 Goal 迁移、安装发行资格或长期收益。
改动思路
Keep Goal source ownership in one fixture and preserve real production health/resume owners. Source prose and canonical Todo authority are distinct; no fake alternative parser, rule owner or runtime bypass is introduced.
Complete fixture correction and bilingual explanation; bounded recovery qualification only. Full Goal-source migration, packaged promotion, model adoption and complete-cost/performance acceptance remain with existing owners.
这里有两个不同来源:Goal 正文仍由原声明文件提供,Todo 已由 canonical store 提供。修复把前者保留,把后者的旧展示移除;没有用多余正文复制 Todo 来替代真实后端,也没有绕过源文件缺失检查。共享部分只是夹具构造,业务期望仍各自写在原用例里。
具体改动
评审依据在读 diff 前固定为基线 typescript-control-plane-migration-v0.md §6 及原有 test_contract_health.py 的来源拒绝规则。C6-caller-semantic-oracle、C6-missing-source-refusal、C6-canonical-provider-parity 均 implemented;C6-production-promotion 明确 out_of_scope。新增中英文段落语义一致:capture 后只移除 Todo 展示,Goal 真缺失仍拒绝,完整来源迁移另行验收。
关键代码讲解
_quota_goal用既有 factory 初始化真实 File/SQLite canonical authority,再将同一文件写回原 Goal 正文;旧 Markdown 分支保留原 Todo 区段。它只统一重复 setup。test_public_quota_distinguishes_monitor_repair_from_generation_wait保留原判断:等待常驻 monitor 完成需要修复依赖;等待其 generation 变化在相同 generation 时继续 quiet。capacity 用例也保留 compiler 未提供/已提供时的两次真实 CLI 检查。test_canonical_todos_do_not_replace_a_missing_declared_goal_source刻意删除 Goal 来源,核state_file_missing、不允许执行且 canonical Todo 仍有 1 条,再恢复完全相同正文,确认健康恢复且不重建 Todo 展示。
对主干的风险
此类测试修复的主要风险是“变绿但失去 oracle”。独立复现原基线模块是 18 过、3 项来源缺失失败;新头相关恢复、健康、协作用例 53 项通过。同一个未修改的新夹具分别对不可变基线和新头产品执行,各 11 项通过、保留 16 份完整真实 CLI 观察。两种 canonical provider 的缺失来源都退出 1 并拒绝 normal delivery,恢复后仍读原有 Todo;所有读取前后 Goal 文件字节一致。另在私有副本只去掉 canonical 初始化,六个 canonical 恢复变体全失败,三个旧格式正例仍过;相同私有执行环境里的原样控制则全过,说明没有借保留正文冒充 canonical 数据。
标准 premerge 的 4 项直接检查和 15 项选中检查、编译、Ruff、双语 RFC 与公开边界检查通过。不过独立补跑根架构门禁,基线和新头都为同一 test_top_level_module_count_stays_at_the_pinned_budget 失败、5 项通过:147 对 145。两份完整失败签名一致,预算测试、pin 和整个产品模块集合逐字节未改;这是已有集成阻塞,未算作通过,也未要求本夹具 PR 修改预算。#7000 是该失败的独立修复提案。未查 CI、未重建发行包;这里不声称产品安装或完整迁移资格。
我的整体评价
本头 goal_achieved 仅指完整夹具纠正和相应规范说明。long_horizon=preserved,user_experience=improved:维护者能够用正确来源验证真实恢复,原健康拒绝和权限保留。不是从测试数推导模型收益、性能提升或迁移 payoff。全仓库既有健康、恢复和 canonical factory 已复用;同作者当前 10 个 open PR 的完整文件清单只有本 PR 改这个测试模块,其余共享 RFC 的运行时改动不重复这些断言。局部 setup 合并有维护价值,未见一次性 scaffold 或重复 smoke 批量制造;没有贡献限制升级依据。没有新产品状态或并行 owner,现有架构预算红灯和其它 PR 的原 hold 均保留。
English verdict: APPROVE — head 6db21f5e3839cc8a8cf715de7c8d86404326d482 repairs canonical recovery fixtures while preserving the declared Goal health guard and original resume assertions.53 focused tests and standard local premerge pass; identical corrected fixtures qualify real File/SQLite CLI behavior on base/head, with a discriminating6-fail/3-pass canonical-capture mutation. The unchanged147/145 architecture failure remains a separate integration hold. No merge or installed-release claim.
Goal And Delivered Outcome
Three canonical Todo recovery cases failed with
state_file_missing: their setup deleted the entire registry-declared Goal file while trying to remove legacy Todo display. The shipped Goal health guard correctly refused the input, so these cases never qualified the intended resume behavior.A shared fixture now preserves the same Goal definition and removes only Todo display after canonical capture. The original monitor-repair, generation-wait and capacity-recovery assertions remain. The matrix includes legacy Markdown, File and SQLite. A separate File/SQLite check proves that missing Goal source still denies work, canonical Todos remain readable, and restoring Goal prose restores healthy readback without recreating Todo display.
mainat973914e8cb713ee176737c95750aedb3072b9ea8.Author Declaration
Implemented against
quota should-runsubprocesses reach resume/capacity checks after Todo display removal.Scope And Continuation
Complete within this fixture correction.
_quota_goalowns source construction, canonical capture and Todo-display removal for three scenario families. Its callers keep their independent behavioral assertions. This makes source ownership local to one fixture interface with real File/SQLite adapters.The migration economics are production LOC 0, bridge LOC 0, new RPCs 0. Duplicated fixture setup is retired; this does not claim product-code deletion or another domain migration.
48 open PR file inventories were checked. No other PR modifies
test_resume_planning_projection.py. Shared RFC edits are in the correctness section, separate from the caller/scope payoff checkpoints in #6989/#6990/#6992/#6993/#6995 and the canonical readback work in #6874. No dependent product change is bundled.Validation
6db21f5e3839cc8a8cf715de7c8d86404326d482; test source is identical to the tested working tree.Reproduce:
The missing-Goal scenario remains as explicit refusal/recovery coverage; the original resume assertions are retained. File-only promoted variants become explicit File/SQLite variants; the legacy variants remain. Runtime transport and privacy-audit candidates had no sufficient demonstrated payoff and were left unchanged. No performance, model-backed outcome, production promotion, or full asynchronous lifecycle qualification is claimed. CI and maintainer review remain separate.
Frontend / Visual Evidence
UI impact: none. No product interface or screen changes. Before/after, viewport, preview and craft review: N/A. Input data: synthetic/public fixtures.
Shared-authority RFC Fixture Impact
tests/fixtures/control_plane/coordination_production_scale_v0.json, schemaloopx_coordination_production_scale_fixture_v0: unchanged.Type Of Change / Area
Test fixture refactoring, integration coverage and bilingual RFC clarification. Area: control-plane qualification. The runtime source model and health guard are retained.
Boundary Checklist