Repository navigation
test(todos): repair promoted create registry fixtures - #5821
Conversation
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: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=xhigh.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
维护者验证晋级后的 Todo 创建时,需要可靠的测试来区分产品回归与夹具错误。 以前两项测试在进入原生创建之前就因注册路径缺失失败;现在提供隔离路径并走现有 writer fence,原有创建、去重和私有验证断言能够执行。 完整 local-authority 测试恢复通过,并保留无旧格式回退和命令私有性检查。 本次只修复测试夹具,不改变用户默认存储、产品准入、写入权限或安装行为。
改动思路
复用已有的隔离 writer fence 夹具,并为注册信息补齐 project/state/runtime 路径。只补路径会继续留着失效的 promotion mock;改产品解析规则则会扩大风险。因此删除旧读取 mock,让现有路由真正执行,创建结果仍仅在 effect 传输边界模拟。实际 File/SQLite 测试负责证明 provider 行为,避免将 mock 成功当成落盘或展示交付。
具体改动
全 PR 只有现有测试文件的 +25/-21。test_promoted_add_invokes_native_create_without_markdown_state 保留原生方法、声明摘要、公有 metadata 无命令和私有 argv 读回;test_promoted_add_delegates_semantic_duplicate_to_typescript 保留原生去重返回。两者都使用隔离 runtime、既有 fence,并增加 provider attribution、无 legacy fallback 和 Markdown 文件不存在的检查。
规范:docs/project-agent-todo-contract.md#bind-the-first-completion-validator--首次绑定完成验证,spec_revision a6f5ceb9d8a80d808f0d3eabaa9bbd2a0fdbc225。criterion validator-command-privacy:implemented;私有命令仍在声明存储,公共记录仅带摘要,完整 local-authority suite 保留独立断言。测试没有修改原生 witness、CAS、writer 或历史恢复协议,也没有新增状态词汇。
对主干的风险
没有发现阻塞性问题。最强反例是 effect mock 能返回伪成功,所以两项 mock 不能证明 provider commit 或 projection delivery;当前完整 suite 和真实隔离 File/SQLite、CLI 结算覆盖了这一边界。原主干 2 失败/36 通过保留,修复 head 为 38 通过,另有 36 项写入隔离/quota-refresh-spend 通过。Ruff、DCO、diff 私有边界扫描、原生 CQR 和 premerge 的 3 项 smoke/4 项 direct checks 全部通过。按照本次原生契约未轮询远端 CI,合并资格另行读取。
我的整体评价
APPROVE,精确 head eb36d3cbc9aebecc0fe27344653d0f2c1674cda2。long_horizon improved:测试可以再次甄别后续 canonical 生命周期回归;user_experience preserved:产品入口、默认值和安装指令完全未改。future-facing pass 已应用到最近边界:复用 fence、退掉旧 preflight mock,没有新抽象或兼容分支。此测试修复完成它的有用结果;后续 #5820 仍须采用修复后重新做完整精确 head 质量验证,SQLite 默认、升级及整批 Python 退役仍有各自验收,未被本 review 结算。
English verdict: APPROVE for this exact tests-only head. The current routing and validator assertions are restored without changing production behavior. Mocked effects do not certify provider persistence; real File/SQLite tests supply that evidence. No release/default-rollout qualification is claimed. Merge readiness remains a separate gate.
Two promoted Todo-create adapter tests fail before native routing because their registries omit resolvable project/state paths and still mock a retired promotion preflight.
Register isolated repo/state/runtime paths and use the existing synthetic writer fence. Remove stale read mocks, retain native create/duplicate and private validator assertions, and explicitly check provider attribution, no legacy fallback and no Markdown-state creation. Production resolution, admission and writers are unchanged.
Validation: immutable main reproduces 2 failures / 36 passes; the repaired full local-authority suite passes all 38 tests. Real File/SQLite writer-isolation and quota/refresh/spend suites pass 36 tests. Changed-file Ruff and the exact-scope native quality receipt/premerge canary pass (3 selected smokes plus 4 direct checks). The two effect mocks characterize transport; real-store tests supply provider evidence. Earlier installed-wheel results remain historical evidence; this PR does not qualify a release or the SQLite-default rollout.
Future-facing review: reuse the existing fence helper and remove obsolete preflight mocking; no new fixture layer or decision owner.
修复两项因注册路径缺失和旧 promotion mock 导致的测试失败,复用现有 writer fence。保留原生创建、去重、私有 validator 和无 legacy fallback 断言;产品规则不变。完整 local-authority 38 项及 File/SQLite 写入隔离、结算 36 项通过,原生质量与 premerge 门通过。此次是测试基础设施修复,未宣称 SQLite 默认切换或发布验收完成。