Skip to content

test: align release fixtures with canonical authority and replan contracts - #7459

Merged
huangruiteng merged 11 commits into
mainfrom
codex/release220-canonical-fixtures-20261027
Oct 27, 2026
Merged

huangruiteng merged 11 commits into
mainfrom
codex/release220-canonical-fixtures-20261027

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Release validation was still constructing Markdown-only Goals, reading them before canonical initialization, or reconstructing historical signatures through the current writer. Those fixtures contradicted the current canonical-only read contract and the lossless execution-contract projection, so they failed before exercising the intended consumer behavior.

Initialize disposable canonical authority once after source authoring, reuse the existing saved-import helper for model tool fixtures, and create the empty entry Goal through the first-party owner. Later synthetic execution/frontier changes use the real provider CAS without resetting lineage or re-importing source. Unsupported Markdown authority cases now assert the explicit no-write migration refusal; File/SQLite positive,negative,settlement,replay and recovery assertions remain. Required replanning must execute its Host route without ordinary delivery authority: the contrast and actor observations now check that stricter distinction. Frozen historical packets are unchanged; their captured digests are verified independently from current-writer output.

Validation so far:

  • Complete selected consumer/actor suite: 486 passed. This includes real File/SQLite CLI paths and scripted transport over the real tool fixtures,not paid model execution.
  • After removing redundant fixture branches and formatting, 34 passed again; the added canonical frontier regression passes with its full module (17 passed).
  • Configured Ruff and mypy (17 source files) pass; TypeScript control-plane typecheck passes. Backlog smoke passes in the source-checkout environment.
  • Whole TypeScript runs are retained as failed observations: reusing an intentionally rotated PostgreSQL incarnation correctly caused two refusals; a fresh database run then passed 5,995 tests with one90-second Python-consumer timeout. A clean source-bound run with an isolated HOME/temp namespace and a fresh database pair is in progress. This is not reported as a passing full suite.

No frozen receipt,input packet,budget threshold,production admission or permission rule is relaxed. Full release pytest/public smokes/packaged Workspace/live model/artifact qualification and exact-head review/CQR/premerge remain separate required work. This PR does not publish a release or certify that the entire candidate is ready.

…racts

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

维护发行验证和自动化夹具的开发者,需要验证真实任务选择、恢复与结算,而不是在旧存储初始化阶段提前失败。旧夹具把 Markdown 当成可直接读写的 authority,或在 canonical 初始化后只改展示文本,导致有效用例提前拒绝、或继续读到旧任务。当前先完成源输入,再初始化一次;后续前沿变化走真实 provider CAS,消费者才能检验原来的任务与重放不变量。已验证当前消费者套件完整通过,并在不可变基线复现了初始化、前沿和历史 carrier 的旧断言故障。本 PR 不修改生产准入或权限,不宣称完整发行、全量 TS、正式 App、真实模型或长期收益已经合格。

审阅完整 head 2161ea4376909bbb923f8f7df695e8994064e6e7、实际 base 71057d44f0d50a3636fcd8796f7c98717ce41742,未发现阻塞问题。这里交付的是恢复现有验证的可信输入与断言,不把测试通过当成发行完成。

改动思路 / Approach

复用已存在的创建、saved-import 和 provider CAS owner,避免让每个夹具重建一套存储或重新接管已初始化的 writer fence。当前边界是修复既有验证消费者的输入与 oracle;真实业务决策、存储实现、历史冻结包和预算阈值均未修改。

新建空 Goal、导入已写好的源材料,以及更新已经初始化的测试前沿,是三个不同阶段:前两者分别走已有创建 owner 或 saved-import;第三者读取实际 provider revision 后做 CAS(按已读版本提交,防止覆盖另一版本),不重建 store、不重新接管 fence。File 与 SQLite 继续使用既有共同规则。

所用历史评审经验提醒先找有用消费者,而非只验证传输;本次通过真实 quota/Turn、工具 actor 和原结算/重放断言应用了这一方法。它不要求为内部测试修复新增产品界面,也不证明历史经验提高了模型质量。

具体改动 / Changes

全 diff 为 28 路径 +263/-133:6 个既有 testing helper +43/-37,22 个测试/smoke 路径 +220/-96;生产 canonical store、准入、interaction 和 Turn 决策实现未改。

规范按修改前 71057d44f0d50a3636fcd8796f7c98717ce41742 固定:docs/reference/protocols/active-state-structured-projection-v0.md 的 Reader Contract 与 Markdown Ownership Boundary 要求只读 projection 不成为 authority,未迁移源只能检查或显式导入,正常消费者读取 canonical store。另按 turn-loop-controller-v0.md 的 Replan Continuation Boundary,replan 不得成为重跑旧任务或普通交付的许可;这些要求均在当前相关消费者中验证。

关键代码讲解

  • _write_scenario_project 用原创建入口准备空 synthetic Goal;selected/scoped/capability 工具夹具则复用已有 saved-import,完成源输入后只初始化一次。
  • advance_canonical_fixture_authority 先 load 实际 File/SQLite head,再以其 revision 提交后续 synthetic projection。frontier、lease 和 deferred 原轮恢复用例因此不再只改 Markdown,也不重置原 lineage。
  • _quota_behavior_observation 仍要求 Host 执行规划、禁止 quiet no-op,同时明确 delivery_allowed=False。portfolio contrast 与 actor 观察同步,未把必须执行规划解释成普通业务权限。
  • capturedDigest 先核对原冻结 decision/envelope 的摘要,再用当前 writer 构建新 envelope 比较完整 execution contract。原历史包逐字未改,退役协议拒绝和输入不变断言保留。

其余修改把 memory/preferences、日期等待、causal/terminal/in-flight/interrupted settlement、contract health 等原消费者放回正确初始化阶段;Markdown 旧路径改为明确的 no-write migration refusal,File/SQLite 正负例和一次结算/重放仍执行。context 测试保留原 detail_ref 与签名,偏好隔离比较仅排除已验证的来源观测摘要,不删除签名动作维度。

对主干的风险 / Risks

最强风险是“修改期望让红灯消失,却丢掉 authority 或旧回执保障”。本次在实际不可变 base 独立运行代表性 6 个消费者:4 FAIL、2 PASS,分别复现缺少 canonical 初始化、仅改展示后的 stale frontier,以及两项错误的 carrier 缺失断言;当前完整选择覆盖对应修复及权限、provider 故障、错误 actor、原 Turn、重放与一次扣额。

当前 486 项 Python 消费者测试全部 PASS、0 SKIP,耗时约 24 分钟;另 49 项 TypeScript PASS,覆盖冻结历史包、完整执行义务、签名篡改与当前 envelope。配置的全量 Ruff、mypy(17 源文件)、TS typecheck 和 diff hygiene 均 PASS;standard premerge 6 项直接检查、19 项选中检查全部 PASS,无人工留置,包括 28 个变更文件的公开边界检查。

相同物理 canonical fixture 上,File/SQLite 的 todo list、quota should-run、turn plan 六组 base/head 均 exit 0。五组完整归一化结果一致;SQLite plan 初次仅原始来源摘要不同。保留该差异后,用只记录输入、不替换返回的 tap 取得两边完整来源,独立验证摘要匹配,逐字段差异仅为观测时钟与 staleness;签名动作摘要和所有动作维度一致。没有把权限、原文、canonical 字段或动作 hash 归一化掉。

语义与 CI 对齐

这是对既有 canonical/replan vocabulary 的复用。must_attempt_work 强制规划与 delivery_allowed=False 禁止普通交付必须同时成立;fixture 可用不授予执行权。未查询或等待 CI。作者先前完整 TS 运行的失败和后续运行状态保持为作者历史证据;本轮未把它们改记 PASS,也没有重跑整个发行资格集。完整 release pytest、全部 public smokes、真实模型、正式 App/打包 Workspace 仍是原发行 owner 的独立验收。

我的整体评价 / Verdict

APPROVE。本次完成既有验证夹具的有用维护边界,复用了创建、导入和 CAS owner,没有增加生产权限或平行存储规则。long_horizon 的恢复/原轮结算验证覆盖得到改善,普通 user_experience 与默认 CLI 契约保持。完整 diff 没有渲染页面、交互或样式变化;testing helper 和 CLI 测试不需要新增界面截图。未验证范围是完整发行、真实模型和正式安装,不把 scripted actor 当作自然模型采用。

无需增加独立框架或仪式性后继任务;进一步重构本轮无必要。批准仅绑定 2161ea4376909bbb923f8f7df695e8994064e6e7,保留所有历史失败与发行门槛,不是发布或合并授权。

English verdict: APPROVE 2161ea4;486 Python and49 typed tests pass, with real File/SQLite parity and preserved history/refusal checks. Full release and live-model qualification remain separate.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…umers

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>
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>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…nical-fixtures-20261027

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@huangruiteng
huangruiteng merged commit 60dc26e into main Oct 27, 2026
4 of 6 checks passed
@huangruiteng
huangruiteng deleted the codex/release220-canonical-fixtures-20261027 branch October 27, 2026 08:34

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

这是合并后的完整 exact-head audit,绑定 bcdee35235aa36db23394541963fcf5661bd9518,不补写或冒充合并前批准。原 review 只覆盖 2161ea4;本次重新检查完整最终 diff。

动机 / Motivation

维护 canonical-only 切换后的回归和发布资格的开发者。 旧测试在初始化权威存储前读取 Markdown,或在 cutover 后重新初始化存储,因而未能执行原本要保护的结算、回放和恢复断言。 大部分消费者已能通过真实 File/SQLite 与 CLI 完成原有旅程,replan 明确要求 Host 执行且不授予普通交付权;显式 native 补跑仍暴露一条旧诊断匹配失败。 不修改生产读写权限、scoring、重试上限或模型策略,不把脚本化 actor、静态本地模型流或初始化成功视为真实模型和长程效果通过。 精确合入 head 的 native 模块为 56 通过、1 失败、0 跳过;其余消费者 692 通过、11 个 native 环境跳过。后继 #7506 已修复诊断 oracle,并在自己的 head 取得 57 通过、0 跳过;旧 head 的失败保持不变。

改动思路 / Approach

复用现有 first-party 创建、saved backup/import 和 provider CAS;fixture 初始化一次,后续变化沿同一权威 owner 推进,历史签名按原始捕获字节独立验证。 本 PR 限于 43 个现有测试、smoke 和 qualification helper 文件;不新建产品状态或兼容 fallback。 新的空 Goal 通过 first-party creation owner 建立,既有 authored source 经原 saved backup/import 一次切换到 canonical authority;后续 fixture 状态变化读取当前 revision 后使用真实 CAS,避免重复初始化或重置 fence。原结算、回放、stale context 和无副作用负例继续由原产品入口判断。不同阶段和 backend 有独立集成语义,无须把它们收拢为新测试框架;两条 source/authority 路径用此段文字即可说明。

具体改动 / Changes

按 2236b1473c56dab2a8670922dcb27e1fb140c757 的 docs/development/good-smokes.md,以及 docs/reference/local-authority-provider-selection.md 和 docs/reference/research-checkpoint.md 映射 CANONICAL-FIXTURE(implemented)与 INDEPENDENT-ORACLE(此 head 的 native diagnostic not_met)。43 文件包括一次性 fixture source parser、真实 provider CAS、File/SQLite consumer、quota settlement/checkpoint recovery、actor tool fixture 与原始协议回执验证。legacy 普通读不再作为成功路径,仍拒绝且不写入;没有恢复 fallback。重新规划必须执行自己的 Host action,delivery_allowed=false,不等于普通交付授权。历史 JSON 未修改,捕获 digest 从原字节排序计算;当前 writer 另行核对完整 execution contract 与签名一致性,不能用当前 writer 重造历史 expected。

关键代码讲解

_write_scenario_project 使用原创建 owner 初始化空 SQLite Goal。advance_canonical_fixture_authority 先 load head,再以实际 revision commit;不重新 import。_quota_behavior_observation 同时要求 must_attempt 与无普通交付权。capturedDigest 验证不可变历史 bytes,而当前 buildTurnEnvelope 的完整 obligation 和 signature 仍独立检查。test_real_native_cursor_must_match_sealed_store_basis 保留 reader 关闭、source candidate 原文、native 调用数、captured=false、destination 不存在等断言。

[P2] native probe-binding 负例仍匹配旧诊断。 在显式 native binary 的完整模块中,生产正确返回“source session binding or profile moved before sealing”,但第327行仍要求 profile changed,因此 56 通过、1 失败、0 跳过。旧 substring 在 base 已存在;本 PR 的 canonical fixture 修复使该真实路径可到达,并没有引入生产错误。这里记录该不可变 head 未完成的测试资格,不要求扩大产品改造。后继 #7506 已只修正诊断语义,保留全部无副作用断言,并取得 57 通过、0 跳过;此后继结果不改写本 head 的失败。

对主干的风险 / Risks

主要风险是 fixture setup 隐藏数据缺失、重置谱系或把 replan 当成普通工作授权。完整检查保留 source 全量、真实 File/SQLite、CAS revision、原 settlement journal、replay 零重复 effect、stale read context 与 source movement 拒绝。没有增加权限、scoring、调用预算或 frozen 条件。本 head 消费者 692 passed/11 skipped,显式 native supplement 56 passed/1 failed/0 skipped;历史协议 Node 5 passed/0 skipped;premerge、规定 Ruff、17 文件 mypy 和 43 路径隔离公开边界均通过。 11 个原 native skip 未当作通过;显式 supplement 的失败单独保留。源码身份与 cleanup 均读回一致。历史 lock 无法 locked sync 的观察保留,使用已验证属于此 checkout 的兼容 venv,未更改 lock。CI 依 wait_for_ci=false 未查询。

我的整体评价 / Verdict

本次为 justified_increment:一次 canonical 初始化、后续 CAS 和独立历史协议验证是可单独评审、回滚的有效修复;但此 exact head 的 native assertion 未全通过,结论为 REQUEST_CHANGES 的历史审计记录。long_horizon 与 user_experience 的语义 preserved,无 UI 变化;未证明真实模型服从、真实 Lark 发送、完整发布或长程收益。复用现有 first-party 创建、saved backup/import 和 provider CAS;fixture 初始化一次,后续变化沿同一权威 owner 推进,历史签名按原始捕获字节独立验证。 本 PR 限于 43 个现有测试、smoke 和 qualification helper 文件;不新建产品状态或兼容 fallback。 没有新 shared vocabulary、兼容 facade 或产品默认变化。当前主线已由 #7506 关闭唯一已观察的 native oracle 缺口,下一步是对最终固定发布源码重新完成所有资格;不是要求重开或重新合并本 PR。

English verdict: REQUEST_CHANGES at bcdee35235aa36db23394541963fcf5661bd9518 in this post-merge audit. Canonical setup, CAS, replan authority and immutable history checks are retained; the explicit native supplement exposed one stale diagnostic oracle (56 passed,1 failed,0 skipped). Successor #7506 fixes it with57passed0skip on its own head; no historical failure or pre-merge authorization is rewritten.

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.

2 participants