Skip to content

fix(change-quality): qualify independently attributed optional baseline failures - #6032

Merged
huangruiteng merged 4 commits into
mainfrom
codex/change-quality-baseline-attribution-r143
Oct 9, 2026
Merged

huangruiteng merged 4 commits into
mainfrom
codex/change-quality-baseline-attribution-r143

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Optional baseline failures currently block CQR even after independent attribution; simply marking a check optional must still fail closed. This change adds one typed qualification owner that permits only exact, independently matched base/head evidence, retains the failed observation as a risk, and keeps required checks blocking. Requalification archives the original receipt bytes before replacing the current pointer.

Python remains the Git/JSON/privacy/receipt adapter. The change reuses the Effect runtime and digest owner, retains v2/default-off compatibility, and documents the CQR-local attribution contract and its independent-review boundary.

Validation: 56 focused Python tests, 4,293 passing TS tests (34 skipped), focused Python and full TS typechecks, semantic vocabulary and source canary validation. Real source and installed-wheel CLI runs exercised File/SQLite record, verification, required-failure holds, stale evidence, recovery and disabled behavior. The final source premerge passes all 19 selected checks with a valid CQR receipt. Complete disabled prepare packets match the independently installed baseline. Full wheel premerge remains unqualified: its existing catalog path resolves into an installation directory without the repository catalog; the source premerge path is covered. This PR does not claim complete installed-canary delivery or SQLite rollout acceptance.

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>

@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=xhigh

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

English verdict: APPROVE - 9251b2e. The exact-head CQR slice is justified: optional baseline failures require matched independent evidence, required failures still block, off packets match the baseline, and previous receipt bytes survive. Source premerge passes; the independently reproduced installed-canary catalog failure remains a separate hold. This is no merge or SQLite rollout authorization.

动机

为启用最终差异质量检查的维护者和 Agent 修复既有失败归因后的交付阻塞。
以前,可选检查即使被独立证明为旧问题也会卡住质量回执;现在,只有精确范围内证据完整的归因才允许继续,失败事实仍然保留。
已实测:File/SQLite 的源码和安装包均可记录、验证这种回执,并继续拒绝必需失败、错误证据和过期范围。
本 PR 不改变必需检查、冻结验收、SQLite 发布资格或合并权限。
安装包 canary 的源码目录/catalog 传输仍未验收,需要现有 canary owner 修复;原完整安装包验收保持开放。

这里的质量回执是对当前 Git 差异的审查记录,不是测试执行证明。仅把检查标为 optional 并不安全;本次只给已经有完整独立归因的旧失败提供继续路径,保持没有归因、引入或恶化的失败阻塞。原源码目录问题没有被改成绿色,也没有用归因关闭它的安装包验收。

改动思路

归因资格由现有 Effect runtime 内的单一 TypeScript 规则裁定,Python 只保留 Git、隐私编码和回执 IO,避免两个决策源。
本 PR 交付 CQR 的归因、原始回执保留和关闭隔离;安装包 canary 路径修复是单独的运行入口缺口。

入口沿现有 prepare → Agent 执行并审阅仓库原生检查 → record → verify → premerge。资格规则接收当前完整 Git 范围,检查已提交且干净的 head、同一命令、独立 base/head 运行、完整失败/环境/fixture 摘要与通过的必需验证覆盖。它不运行命令,也不能证明摘要背后的事实。JSON 和 Git/文件操作继续留在 Python;历史写入使用现有独占锁和原子替换,先保存原字节再更新当前指针。已有 Dashboard 的 CQR 策略编辑器与激活范围保持,未增加新配置或交互步骤。

具体改动

基于改动前的 accepted contract:loopx/capabilities/change_quality/README.md,spec_revision=ab64c5d1c36a88c587a54ac26cb1cda195d5f965。下述 Protocol-5/6/7 分别指该文档既有编号步骤,Provider-Boundary 指既有章节,避免把本 PR 更新后的文档当作独立验收证明。

  • Protocol-5:保留未归因失败、必需失败/跳过、未解决 blocker 的阻塞;按本次明确要求扩展可选且独立归因的失败,失败观察仍为 failed,guardrail 为 risk。
  • Protocol-6:保留 v2 与精确差异验证;新的嵌套归因只在当前完整范围成立,篡改摘要、脏工作树或后来创建的提交使原归因不能复用。没有恢复已退役 v1。
  • Protocol-7:现有严格回执 consumer 不变;当前源码 premerge 全部通过且回执有效。安装包在此前的 catalog 解析路径失败,其入口缺口另行保持开放。
  • Provider-Boundary:仓库仍负责执行检查与必需条件;Shape/freshness 检查与独立因果评审分开,不能把 required 或冻结门槛改成 optional 来绕行。

关键代码讲解

  1. qualifyChangeQualityValidation 是单一资格 owner。输入缺失、未知字段、非完整失败摘要、相同运行引用、覆盖不足或范围不一致均拒绝;即使归因完整,required 失败仍产生 blocker。
  2. derive_change_quality_guardrails 删除原 Python 失败/跳过决策,消费 typed 结果形成既有 guardrail。失败观察没有改写成 passed,当前 verify 也重新推导,不能信任存储中的手填 all-clear。
  3. _write_receipt 在现有锁内先归档旧回执原字节,包括损坏字节,再原子写入新指针。dry-run 不写历史;返回的历史路径属于本地隐私证据。
  4. build_change_quality_prepare_packet 只在启用时追加归因说明。自评审发现中间版本对关闭状态泄露说明,现提交已经修复,并用真实安装包完整输出对照,而非只比较状态码。

全差异 9 个路径、496 additions / 34 deletions:生产代码 205/29,测试 237/0,文档 53/4,生成清单 1/1。Effect 注册只新增现有 capability handler;清单只改既有读取点行号,digest 测试登记新实际消费者。测试覆盖资格、保留旧事实、关闭、篡改和过期,未添加临时运行器或公开诊断日志。

对主干的风险

最大风险是有人填入一致但虚假的摘要:机器只能验证格式、相等、范围和独立覆盖声明,不能代替读取完整原始证据及因果评审。本次实际检查独立构建/安装的 base/head wheel,使用相同 Python、Node、依赖和 fixture;完整 stdout/stderr 仅替换安装与 fixture 定位前缀,失败摘要一致(sha256:f257873240e370370f7026727c1545d88e26bacf8596c0120b2837db117747cb)。失败发生在未改动的 canary catalog 解析入口,早于 CQR。并没有按错误数量或尾部判断“相同”。原安装包验收与修复责任保留。

当前验证包括 56 个 Python focused tests、4,293 个 TS tests 通过(34 个无关可选环境跳过)、Python focused mypy 和完整 TS typecheck、语义 smoke、源码 premerge 的 19 个检查。真实源码和 wheel 在 canonical File/SQLite 上完成失败→资格→验证、必需失败→恢复以及关闭读取;原始失败字节仍可读。独立 base/head 原生 CLI 验证:未归因可选失败和必需失败的 guardrail 完全相同,只有合法归因的可选行产生有意变化。新增后续提交、同 Goal 内另一个未归因失败,以及把行改成 required 都不能逃逸;重新 prepare 并补全真实验证后能恢复进展。

新增历史存储按录入累积,未做容量或长期 soak 声称;没有对归档 IO 故障/并发写入新增 fault injection,复用了现有锁并检查先归档后替换顺序。此 PR 不触及 PostgreSQL authority store,未把真实 PG 集成要求改成 mock。已按当前评审策略不读取、不轮询 GitHub CI;CI 状态不作为本结论的证据。

语义与 CI 对齐

复用既有 passed/failed/skipped、pre_existing_unrelated 与 SHA-256 vocabulary,新归因版本是 CQR capability 内的有界证据契约,不是新的 actor/权限模型。开发期 advisory 有语法覆盖限制,不能证明没有新语义;完整 semantic smoke 与 TS digest consumer 检查已通过。未提高预算、缩小扫描范围或放松冻结接受条件。

我的整体评价

判定为 justified_increment。long_horizon 与 user_experience 在这个 CQR 切片上 improved:同一真实执行链能从有证据的旧失败继续,并保留原事实;新范围必须重验证,关闭时完整 packet 与旧版一致。原安装包入口缺口使父验收仍未完成,不能据此宣布 Goal 或 SQLite 默认资格完成。

最有价值的相关重构已一并完成:资格规则归单一 typed owner,删除 Python 重复判断,复用 Effect、digest、锁和现有 policy;保留有实际持久化消费者的 v2,而不是增加平行兼容层。该差异可独立评审和回滚,未知执行事实仍须人工审阅。运行时/control-plane PR 按仓库规则交维护者合并,本评审不自合并。

@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=xhigh

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

动机

启用改动质量评审的操作者,在宽检查遇到与改动无关的既有失败时,需要保留失败证据并继续验收已独立验证的改动。 旧版即使基线与改动版的可选检查出现相同完整诊断也一律阻塞,重记还会覆盖旧记录;新版只接受独立、同条件且覆盖全部改动的归因,失败仍显示为风险,旧记录先按原始字节归档。 真实 CLI 的同条件反例在基线阻塞,在改动版及独立 wheel 安装中通过;required 失败、无归因失败、过期归因和未覆盖改动仍被拒绝,原始失败及损坏字节可读回。 本 PR 不把同总数当因果证据,不把 failed 改成 passed,不替评审者证明检查真实执行,不授予合并权限,也不声称已修复全局安装或长期性能。

改动思路

扩展既有 CQR 的 TypeScript 决策 owner:Python 只负责输入隐私、Git scope 和文件锁下的归档写入;归因是否合法、失败是否阻塞都由一个 typed validation gate 决定。无需新的 capability、授权开关或第二个 Python 资格规则。 当前 PR 交付 exact scope 的 optional failure 归因、保留 failed/risk 的读回与原始 receipt 字节归档;不减弱 required checks,也不关闭 installed canary catalog 或整个存储迁移的验收。 最强反对理由是:Optional label erases actual regression, stale matching total misqualifies failure, or overwritten bad bytes destroy evidence。因此验收必须经过当前真实入口、独立基线及负例,不能由作者完成声明、review template 或 green CI 定义。既有 owner 足以承载该结果;另建 lifecycle、权限开关或第二套规则会增加重复权威。

具体改动

准确 head 9251b2ede84b9a7943f0bb9b12897ac650c9e1d1;不可变 merge base ab64c5d1c36a88c587a54ac26cb1cda195d5f965;完整 9 files +496/-34。公开规范先从该基线读取:accepted specification;spec_ref=loopx/capabilities/change_quality/README.md,spec_revision=ab64c5d1c36a88c587a54ac26cb1cda195d5f965。实际未编号段落标题用于映射,未将本 PR 修改后的 README 当独立验收来源:

  • Protocol:implemented;Keep exact scope and current v2 receipt/verify, required failed/skipped checks fail closed, preserve full failed observations. The optional baseline exception is an intentional change to prior all-failed blocking.;Paired real CLI, independent wheel, 37 Python and 32 TS tests; required/unattributed/stale/uncovered negatives
  • Provider Boundary:implemented;Do not execute commands or grant permission from reviewer attestation; native checks and guardrail qualification have distinct authority.;No execution in typed qualifier; actual B/H workload run separately; reviewer causal judgment explicitly required
  • Initial Scope:out_of_scope;CQR internal workflow does not settle all frontend, install and production adoption acceptance.;Bounded existing CQR qualification repair, no new caller operation or UI control. Installed canary catalog repair remains independently owned; model shadow adoption is untested.

关键代码讲解

qualifyChangeQualityValidation(change_quality_validation.ts:93)是唯一 failed/skipped 资格 owner,先检验全量 rows,再核对不可变 B/H、同命令、独立证据、完整诊断/环境/fixture 和全部 changed paths。normalize_change_quality_result(result.py:345)仅保留 public-safe shape/路径和原始 failed 观察,通过 effect bridge 使用该 TS owner;derive_change_quality_guardrails(:431)复用同一 gate,不另建 Python 判断。_write_receipt(receipt.py:157)在现有文件锁中先读取原始 bytes,按内容哈希写 history,再原子替换 current;损坏字节也保存,不能从旧 receipt 推断成功。

对主干的风险

H37/B20 Python 项、H32 TS 项、TS typecheck、5 direct+19 selected premerge 全通过。独立 fixture 真正分别执行同一 dependency failure 并比较完整 stdout/stderr 哈希,另运行 changed assignment invariant。B 无法通过新 qualification/archive oracle(exit1),H及独立 wheel site-packages CLI(exit0)通过。required失败有同样归因仍阻塞;无归因 optional失败阻塞;过期 head、缺 coverage、dirty scope 拒绝或 stale;重记、恢复和 malformed original byte hash 均读回。disabled prepare、legacy 无新字段的 first record/verify 完整输出在 B/H 相等,只规范化临时根、时间和由 registry locator 导出的 receipt 前缀。带新 covers_paths/attribution/history 的全输出确有差异,已逐字段核对为公开协议扩展,未为假 parity 删除这些字段。

初次 CLI harness 用不存在的 loopx.main,两侧都失败;改为真实 entrypoint 后原 oracle 完整执行。初次 TS/premerge 缺 npm dev dependency,补齐后原检查通过。原失败日志保留,不把消失的日志或绿色 size check 当语义证明。

归因 shape/freshness 是必要条件,不能证明命令真实运行或因果无关;评审者必须独立执行并审查完整诊断,不能将 required/frozen criterion 改成 optional。无新 globally loaded skill,enabled prepare 才提供归因建议;off guidance 全量对照相等。原结果/receipt v2与无归因合法 caller 保留,没有新增请求版本兼容框架。

全树 semantic 和公开边界检查通过;advisory 静态空结果不证明动态构造等价。CQR 新证据 schema 复用 canonical digest vocabulary 和 typed effect owner,未用 substring/prose 识别状态。 没有查询、轮询或等待 CI。完整仓库 suite、生产 rollout/long soak、真实模型采纳和效果未测;独立 wheel实际 CLI已验证,但 installed canary catalog修复与整个存储迁移不是本 PR 的关闭项。没有新增 UI operation、第一屏展示或用户配置旅程。

我的整体评价

APPROVE。long_horizon 和 user_experience 在本 slice improved:从独立资格、失败保留、归档、恢复到重复 verify 有完整证据,不需重复人工配置或虚构passed;真实执行/因果判断仍由评审负责。 bounded future-facing pass:Future-facing pass examined repeated typed bridge calls during normalize/derive. Same decision owner prevents divergence; consolidating later is a bounded efficiency opportunity, not required to make current qualification safe. No new framework. GitHub当前登录与作者同为 loopx-agent,本文是 COMMENTED exact-head review 的明确批准结论,平台正式 APPROVED 不可自授。premerge已通过但不授予control-plane自合并。 合并留给维护者;源码/合成原生核验不结算其它安装、业务或研究验收。

English verdict: APPROVE — 9251b2e; only independently qualified optional baseline failures become non-blocking risks, with required checks and exact scope enforced and original bytes archived; real source and built-wheel CLI paths pass the independent oracle. CI was not consulted; reviewer causal attestation and production adoption remain separate.

@huangruiteng
huangruiteng merged commit c33e1f3 into main Oct 9, 2026
22 of 29 checks passed
@huangruiteng
huangruiteng deleted the codex/change-quality-baseline-attribution-r143 branch October 9, 2026 16:12
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