Skip to content

test(projects): assert canonical refusal after rejected registration - #7441

Merged
huangruiteng merged 1 commit into
mainfrom
codex/project-registration-failure-acceptance-20261027
Oct 27, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/project-registration-failure-acceptance-20261027

Conversation

@BigDataDZ

Copy link
Copy Markdown
Contributor

When project registration rejects a source changed during validation, the Goal has no initialized canonical authority. The regression still expected the retired pre-cutover None read fallback, causing both File and SQLite cases to fail after the canonical-read cutoff.

Assert the existing CanonicalAuthorityRequired result instead, including the exact reason code, Goal identity and legacy_fallback_used=false. This preserves rejection of the changed source and proves that an ordinary read cannot hide the failed initialization. No production rule or compatibility fallback is changed.

Fixes #7436.

Validation at signed head 413f655d2, based on target main be1dc37a0:

  • Before: both focused cases fail with the unexpected canonical-authority exception. After: 2 passed / 71 deselected, using real File/SQLite authority paths and disposable synthetic state.
  • Full project-registry module: 71 passed / 2 failed. Both remaining failures reproduce on unchanged main: Unicode-separator identical-request replay and the strict-registry rebinding error assertion (2 failed / 7 passed in that baseline cohort). They remain unresolved; this is not a full-suite pass.
  • Changed-file Ruff and git diff --check pass. Only one existing test file changed; no shared vocabulary, UI/CLI contract, active Goal, model/benchmark job or system setting was changed.

Author declaration: authored with OpenAI Codex under contributor direction. Boundary: regression acceptance for the shipped canonical-read contract. The adjacent-owner refactor pass found no production refactor needed: reuse the existing typed rejection owner. Independent review and current-head CI remain pending; maintainer merge required.

Signed-off-by: BigDataDZ <76271875+BigDataDZ@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机

Motivation

维护项目注册失败恢复逻辑和运行回归测试的贡献者。 注册因来源在验证中变化而被拒后,旧断言仍期待返回空值;当前权威读取本应明确拒绝,因此测试一直误报失败。 本次在原有 File/SQLite 用例中检查准确异常、目标身份和禁止旧来源回退;独立 CLI 也返回明确拒绝,恢复原来源后可按原流程重试成功。 本次仅校正已有回归断言,不修改生产行为、存储格式或迁移权限,也不掩盖其它已报告失败。

APPROVE — 413f655d21ddec2139147adad8b0e75f1eb75eed,未发现阻断项。 这不是让异常“消失”,而是让测试保护已交付的安全拒绝:没有完成权威初始化时,读取必须报清楚原因,不能伪装成没有任务。

改动思路

Approach

复用原参数化测试和原异常类型,不新增 smoke 或兼容入口。原来的“来源变化导致注册失败”断言完整保留;随后必须得到 CanonicalAuthorityRequired,并且错误码、目标 Goal 和不使用旧回退均准确。直接把读取恢复为 None 虽能迎合旧测试,却会违反当前普通读取契约。

具体改动

Changes

关键代码讲解

规范为 docs/reference/coordination-observation.md,固定修订 be1dc37a008be7017b64b622f653b6707df5c544,已读普通读取切换与无回退要求。REG-1:implemented,未初始化 Goal 的普通读取明确拒绝;REG-2:implemented,精确错误与禁止旧来源回退有断言,独立 probe 另证明观察不创建空权威。

对主干的风险

Risks

PASS: 不可变 be1 的本模块 71 passed / 2 failed,两个失败均来自旧 None 预期;准确 head 的完整模块 73 passed。Ruff 和标准 premerge 5 direct 全过,catalog 此次选择 0 额外 smoke,不能将其说成运行了完整 runtime fleet。

独立探针通过真实注册、File/SQLite 和普通 todo list:来源变化后两种读取都报准确拒绝,CLI exit1;读取前后 runtime 文件字节不变,也没有 promotion。恢复本次绑定的原始来源并正常重试后,两种 provider 都初始化成功并可读。再将读取分别改成返回 None、错误码错误、Goal 错误或 legacy_fallback_used=true,两后端的 8 个控制均被当前测试捕获。

作者报告的 Unicode-separator/rebinding 两项额外失败在本机 macOS 的 base 和 head 都未出现,原因仍未核,不宣称本 PR 修了它们。未新验原生 Windows、PostgreSQL 或正式安装 Host;此差异仅测试,生产树与基线相同。按当前 wait_for_ci=false,没有查询或等待远端 CI。

我的整体评价

Verdict

限定回归修复 goal_achieved;长程行为和用户体验均 preserved,不增加用户操作或改变恢复权限。已有 defaults 测试保护“创建前配置拒绝”,本例保护“注册验证中来源变化后的读取”,两者不是重复覆盖。同作者相邻 PR 修复其它 fixture/导航问题;本项强化已有测试,未新增一次性脚手架,无需额外合并文件或重构生产 owner。

视觉检查不适用:唯一变更是既有 Python 测试,没有页面或用户控件改变。未验证范围:本项以外的原生平台、provider 和正式 Host 旅程。这里批准测试的准确性,不把回归检查通过当作新的迁移能力或长期收益;仓库合并资格和权限仍独立。

英文简短结论

English verdict: APPROVE 413f655d21ddec2139147adad8b0e75f1eb75eed. The existing two-provider regression now asserts the shipped canonical refusal precisely. Immutable-base failures, 73 passing module tests, real File/SQLite CLI refusal and recovery, and eight mutation controls support the complete test-only repair; historical unreplicated failures remain disclosed.

@cocolord cocolord left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; GPT-family; OpenAI; self_reported

结论:APPROVE。这个测试修复有明确的维护收益:恢复已失效的注册回归,同时继续验证源校验拒绝和无降级读取;并非仅把当前输出抄成新的期望。未发现阻断性代码缺陷,当前 CI/合并条件另行保留。

动机

维护项目注册流程的贡献者,在验证“创建过程中源文件被改动”时会遇到这项回归。
之前注册正确拒绝了改动,但测试仍要求随后读取返回空值,因而把已交付的安全拒绝误判成失败。
修复后,回归既要求注册拒绝源漂移,也要求未初始化的 Goal 明确报告无法读取权威状态。
这里的权威状态指唯一可供任务决策使用的已初始化存储,而非 Markdown 展示文件。
本 PR 只修正现有测试,不改变注册、存储、迁移或用户操作规则。
这正是 #7436 的具体问题;不处理会继续留下两个失效的 File/SQLite 回归,删除测试则丢失源校验后的读边界保障。

改动思路

沿用现有 recoverable_registration 参数化 fixture,不新增 smoke 或第二套权限判断。真实注册入口先固定 registry 中的原始目标和操作,再由 initialize_goal_storage_target 检查已验证源字节;注入源变更后,摘要不一致在原生初始化提交前拒绝。随后 read_canonical_todos_if_promoted 经 Python → TypeScript snapshot → 实际 File/SQLite 路径读取,缺少 canonical authority 时由已有 CanonicalAuthorityRequired 类型传递原因,不能返回 None 让上层改读展示文件。

这不是“拒绝越严格越好”:独立对照还实际完成初始化,读取合法空集合、追加任务并重放原注册,证明有效 authority 不会被错误拒绝。源漂移必须先明确纠正,再重试同一冻结操作;只记录拒绝不等于恢复了有用工作。

具体改动

全 PR 只有 tests/cli_commands/test_project_registry.py,+9/-3,未修改产品代码、文档、锁文件、fixture 默认值或 CI。

关键代码讲解

  • 第 104 行复用已有异常类型,未添加新 vocabulary。第 115–116 行仍先断言注册抛出 source changed during validation,没有把初始化失败吞掉。
  • 第 117–124 行将退休的 is None 期望改为精确异常,并核对 canonical_authority_required、目标 goal_id 和 legacy_fallback_used=false。这些断言区分错误原因、错误主体和是否发生展示文件降级,而不是只检查“发生了任意异常”。
  • 未改动的 initialize_goal_storage_target 第 54–69 行拥有源校验;read_canonical_todos_if_promoted 第 271–288 行调用 canonical snapshot 并映射缺权威原因。测试不重建这些生产决策。

规范依据:docs/reference/local-authority-provider-selection.md,spec_revision be1dc37a008be7017b64b622f653b6707df5c544。对应不可变文本:创建与恢复合同。另核对同一提交的 accepted RFC docs/architecture/rfcs/typescript-control-plane-migration-v0.md 第 257–258 行:普通读取要求 canonical authority,未迁移 Goal 返回原迁移原因而非 Markdown fallback。下列 criterion_id 是无编号规范段落的评审标签,不新增义务:

  • SOURCE-VALIDATION — implemented:初始化验证原始已注册源字节;两种 provider 的源漂移注册均在提交前拒绝。
  • NO-FALLBACK — implemented:未初始化或 provider 不可用不得读 Markdown 降级;当前两例核对精确拒绝与 fallback 标记。
  • INITIALIZED-READ — implemented:成功须实际初始化、fence 和 canonical 读回;独立原生对照验证有效空库可读、后续任务保留及原操作重放。注册记录存在本身不算创建完成。

对主干的风险

最强风险是把“真实初始化失败”或“所有读取都拒绝”误当成正确安全边界。已用实际 File/SQLite 证明两个方向:不存在/被拒绝的注册明确拒绝;纠正源后真实初始化成功、空集合可读,写入任务后原注册重放保留完整任务记录。过程内变异仍先穿过实际存储:恢复 None 降级让新增断言两例均报 DID NOT RAISE;对已真实 loaded 的 snapshot 错报缺权威,使合法读取 oracle 两例均失败。变异失败是预期检测结果,非生产缺陷。

验证环境为隔离 macOS、CPython 3.13.5 / Node 26.0.0;依赖通过各 exact-head/base 工作树中的 npm ci --ignore-scripts 固定,Python 加载来源均核对。结果:

  • 当前 focused cohort(pending、completed、interrupted registration):7 passed;不可变 base:5 passed / 2 failed,失败身份正是 #7436 的 File/SQLite 退休空值断言。
  • 共同独立原生 oracle:head 4 passed;base 合法初始化/拒绝/纠正/后续工作对照 2 passed。两种变异各 2 个预期失败。
  • 作者提及的 identical-request/strict-registry 小 cohort:本机 base/head 均 9 passed。没有重现作者环境的两个旧失败,也不宣称它们已经修好或全部平台合格。
  • 变更文件 Ruff、git diff --check、bits 合法数组校验通过。初始审查 harness 有源未纠正及过严优先级展示文本断言的失败尝试;保留记录,修正后重跑,未将其算作产品 bug 或通过证据。

已观察远端当前 CI:chat/dashboard shard 1 在 chat-recovery 寻找旧按钮超时,shard 2 在 research-worker-readback 断言失败,聚合 checks 因 dashboard-acceptance 非成功失败;Python shards 仍 pending。没有把这些红灯认定为已修复、平台故障或基线已复现,也没有启动无界浏览器重跑。这些场景不执行本次变更测试,产品/browser/workflow owning paths 未变;本 PR 变更的 authority 不变量已有独立原生通过证据。它们仍是明确的 CI/合并 hold,非要求本测试 PR 修复其他 UI 的理由。main ruleset 另要求 Sign-off、merge-gate 和最新批准;APPROVE 不是可合并证明。

我的整体评价

交付判断为 goal_achieved:关闭 #7436 所指的具体测试失效,不关闭全部存储迁移、跨平台或长期资格。long_horizon=preserved:唯一权威、原操作恢复及后续任务保留规则未改;user_experience=preserved:用户仍走既有注册/纠正/迁移路径,不新增确认步骤或干预。维护反馈改善,但不宣称提高已测长期性能。

Doing nothing 保留坏回归;删除或只断言宽泛异常更小但失去错误主体及无降级约束。当前修复在既有 owner 内完成,成本与价值相称。同作者近期 #7442 是不同调度 fixture 的重复初始化修复,相关但非同形重复测试;没有证据支持 PR farming 指控,也无必要强制合并两个独立缺陷。

bounded future-facing pass:unnecessary,具体考虑的是 registry/source-validation 与 typed snapshot rejection 的归属;现有 fixture 和生产异常 owner 已足够,不应为 12 行变更引入新框架或生产重构。公开边界扫描未见私有数据;测试保留机器强制拒绝语义,没有 substring denylist、领域专用 obligation 或“guidance”冒充义务。推荐批准此精确 head;保留上述远端 CI、分支落后及平台资格限制,未合并、未 dismiss 任何评审。

English verdict: APPROVE - 413f655 Restores the existing source-rejection regression without weakening canonical authority; native File/SQLite positive, recovery and mutation counterexamples pass qualification, while unrelated CI and merge holds remain explicit.

@huangruiteng
huangruiteng merged commit fbae42f into main Oct 27, 2026
23 of 34 checks passed
@huangruiteng
huangruiteng deleted the codex/project-registration-failure-acceptance-20261027 branch October 27, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project registry pending-registration tests raise CanonicalAuthorityRequired on main

4 participants