Skip to content

锁定 publish verification quarantine 不写 repo-root marker#1032

Merged
ElonSG merged 1 commit into
auto-refact-devfrom
refactor/iter1031-issue-1031
Jun 21, 2026
Merged

锁定 publish verification quarantine 不写 repo-root marker#1032
ElonSG merged 1 commit into
auto-refact-devfrom
refactor/iter1031-issue-1031

Conversation

@ElonSG

@ElonSG ElonSG commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Changed files

  • skills/consensus-loop/scripts/test_publish_verification.py: 在既有 failed receipt retry/quarantine 测试中加入 repo-root QUARANTINED 不存在断言,锁定 quarantine 只通过 per-job retry.json 表达。
  • QUARANTINED: 实施前后均 absent,没有 untracked evidence file 需要删除。

Test results

  • python3 -m unittest skills/consensus-loop/scripts/test_publish_verification.py: PASS, 17 tests.
  • PATH="/opt/homebrew/bin:$PATH" /opt/homebrew/bin/python3 skills/consensus-loop/scripts/consensus-rnd-cli check-degradation --static: PASS.
  • PATH="/opt/homebrew/bin:$PATH" /opt/homebrew/bin/python3 -m unittest discover -s skills/consensus-loop/scripts -p "test_*.py": PASS, 2562 tests, skipped=1.

Deviations

⟦AI:AUTO-LOOP⟧

@ElonSG ElonSG added crnd:lifecycle:managed loop-managed item crnd:phase:reviewing review-gate reviewers in flight crnd:human:auto auto-advancing, no human needed labels Jun 21, 2026
@ElonSG

ElonSG commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

🤖 tests review: approve

TL;DR

  • What this is: 这是 PR 1032 的 tests 角度独立 review。
  • Current state or conclusion: 结论是 approve;新增断言覆盖了 publish verification quarantine 不写 repo-root QUARANTINED marker 的回归目标。
  • What the maintainer should do OR what the controller does next: controller 可以把这个 tests 角色结果计入当前 review gate。

测试证据

我按 PR head aad62da123f8d604c57ddc1efa34ca705bbf9f94 检查了三点:PR diff、PR-head 测试内容、以及生产实现中的实际写入位置。

  • skills/consensus-loop/scripts/test_publish_verification.py:385 的测试名描述的是业务行为:失败的 publish verification receipt 先按 job-local retry schedule 走,最后进入 quarantine。
  • skills/consensus-loop/scripts/test_publish_verification.py:388skills/consensus-loop/scripts/test_publish_verification.py:412 分别在 quarantine 流程前后断言 ${repo_root}/QUARANTINED 不存在;这直接覆盖了本 PR 要锁住的 repo-root marker 禁止写入行为。
  • skills/consensus-loop/scripts/test_publish_verification.py:393skills/consensus-loop/scripts/test_publish_verification.py:410 仍然验证 3 次 retry wait 和第 4 次 QUARANTINED 的真实状态转换,所以新增断言不是单纯行数填充。
  • skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:345skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:360 显示 quarantine 只写 job 目录内的 retry.json;测试断言的边界和实现的持久化边界一致。
  • 我运行了 python3 -m unittest skills.consensus-loop.scripts.test_publish_verification.PublishVerificationTests.test_failed_receipts_use_per_job_retry_schedule_then_quarantine,结果通过。

未发现新增固定 sleep/poll pacing、skip/manual-test marker、断言放宽、或只验证 mock 调用的伪覆盖。

Reasoning-discipline note: reference frame 是文件系统副作用回归测试;known-good shape 是驱动公开行为、验证应写入的 durable state,并在关键边界断言 forbidden side effect 不存在。Candidate reject as bump-only: Ugly defect: 会把具体 forbidden-path assertion 误判成 tautology。Beautiful form: 一个真实状态转换加 forbidden side-effect absence check;当前测试满足。Candidate comment for missing source-regression: Ugly defect: 在没有新增 production no-regression rule 或 forbidden-token surface 的 diff 上强加 source-regression。Beautiful form: 只有规则面新增时才要求 source-regression。Chosen approve: Ugly defect: 这个回归点挂在已有 aggregate retry/quarantine test 上,不是独立单目的测试。Beautiful form: 单个行为测试同时覆盖状态转换和 forbidden root marker,且不复制 setup;当前写法已经达到这个形态。所有判定前提均来自实际 diff、PR-head 测试、生产实现行和本地 focused test run,没有使用 ASSUMED-UNVERIFIED 前提。

📎 Full raw codex output (archival)
---
pr: 1032
role: tests
head_sha: aad62da123f8d604c57ddc1efa34ca705bbf9f94
verdict: approve
---

## Verdict
Approve: test coverage and quality are adequate for this test-only diff.

## Evidence
- `skills/consensus-loop/scripts/test_publish_verification.py:385` names the scenario and outcome: failed publish-verification receipts use the per-job retry schedule and then quarantine.
- `skills/consensus-loop/scripts/test_publish_verification.py:388` and `:412` add a concrete side-effect assertion that `${repo_root}/QUARANTINED` is absent before and after quarantine, which directly covers the PR goal instead of only bumping line count.
- `skills/consensus-loop/scripts/test_publish_verification.py:393` through `:410` still asserts the full retry behavior and terminal `QUARANTINED` state, so the new absence check is anchored to the real business transition.
- `skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:345` through `:360` shows quarantine is recorded by writing `retry.json` under the job directory, matching the test's expected side-effect boundary.
- Ran `python3 -m unittest skills.consensus-loop.scripts.test_publish_verification.PublishVerificationTests.test_failed_receipts_use_per_job_retry_schedule_then_quarantine`: pass.
- No fixed-duration sleeps, polling/stability allowlist changes, skip/manual-test markers, assertion loosening, or mock-only pseudo-coverage were added in the diff.

Reasoning-discipline note: Reference frame is regression testing for file-system side effects: the known-good shape is to drive the public behavior, assert the intended durable state, and assert the forbidden side effect is absent at the boundary that matters. Candidate reject as bump-only: Ugly defect: it would treat a concrete forbidden-path assertion as a tautology. Beautiful form: require a real transition plus absence check, which this test has. Candidate comment for missing broader source-regression: Ugly defect: it would add a source-regression demand without a new production no-regression rule or forbidden-token surface in this diff. Beautiful form: ask for source-regression only when the work unit adds such a rule. Chosen approve: Ugly defect: the remaining imperfection is that the regression is asserted in an existing aggregate retry/quarantine test rather than a separate single-purpose test. Beautiful form: a single behavior test should cover the state transition and the forbidden root marker together without duplicating setup; the current test does that with minimal churn. Premises were verified against the PR diff, PR-head test contents, implementation lines, and focused test run; no ASSUMED-UNVERIFIED premise is used for the verdict.

## What would change your verdict (only if comment or reject)
N/A

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:1032:tests:approve

review_round: 1
head_sha: aad62da
REVIEW_DONE:1032:tests:approve
⟦AI:AUTO-LOOP⟧

@ElonSG

ElonSG commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

🤖 质量审查通过

TL;DR

  • What this is: PR 1032 的 quality 角度独立审查,重点看可读性、命名、复杂度、死代码和 scope。
  • Current state or conclusion: approve;这次只在既有测试里加 repo-root QUARANTINED 不存在断言,没有引入新抽象或无关改动。
  • What the maintainer should do OR what the controller does next: controller 可把该 quality 审查结果纳入同 head 的 reviewer gate。

审查证据

结论:approve。该 diff 是 test-only 变更,目标很窄:锁定 publish verification 的 quarantine 状态只通过 per-job retry.json 表达,而不是写 repo-root marker。

  • skills/consensus-loop/scripts/test_publish_verification.py:385:改动留在既有 failed receipt retry/quarantine 行为测试内,没有为了一个负向断言新增重复 setup 的单用途测试。
  • skills/consensus-loop/scripts/test_publish_verification.py:388root_quarantine_marker 这个局部变量直接表达被锁定的业务意图,即 repo root 不应出现 QUARANTINED marker。
  • skills/consensus-loop/scripts/test_publish_verification.py:392skills/consensus-loop/scripts/test_publish_verification.py:412:分别在 retry/quarantine 序列前后验证 marker 不存在;同一测试现有的 statuses 断言仍证明 per-job 状态进入 QUARANTINED
  • skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:345:实现侧 retry/quarantine 写入路径是 job_dir / "retry.json",与测试锁定的 single-source-of-truth 形状一致。
  • Fresh verification:python3 -m unittest skills/consensus-loop/scripts/test_publish_verification.py 通过,17 tests,OK

Reasoning discipline note:参考框架是 regression-test minimalism 和状态 marker 的 single source of truth。已知好形状是一条行为测试同时验证正向 per-job 状态和负向 legacy/global 状态不存在。候选方案:新增独立 root-marker 测试。Ugly defect: setup 重复,并把负向断言从 quarantine 转换点拆开。Beautiful form: 把负向断言放在既有转换序列的边界。采用方案:在既有测试中加入 before/after 断言。Ugly defect: 负向断言若命名不清会像偶然检查。Beautiful form: 用 root_quarantine_marker 表达意图,并在转换边界检查。已验证前提:已读三点 diff、完整 touched file、实现函数 record_job_retry,且 PR head SHA 为 aad62da123f8d604c57ddc1efa34ca705bbf9f94


📎 Full raw codex output (archival)
---
pr: 1032
role: quality
head_sha: aad62da123f8d604c57ddc1efa34ca705bbf9f94
verdict: approve
---

## Verdict
Approve: the diff is a focused test-only guard for per-job quarantine state, with readable naming, no new abstraction, no dead code, no comments, and no unrelated cleanup.

## Evidence
- `skills/consensus-loop/scripts/test_publish_verification.py:385` keeps the change inside the existing failed-receipt retry/quarantine behavior test, so the added assertions do not create a separate single-purpose test or expand scope.
- `skills/consensus-loop/scripts/test_publish_verification.py:388` names the checked path `root_quarantine_marker`, which states the business invariant being locked: root-level quarantine marker absence.
- `skills/consensus-loop/scripts/test_publish_verification.py:392` and `skills/consensus-loop/scripts/test_publish_verification.py:412` assert the marker is absent before and after the retry/quarantine sequence, while the existing `statuses` assertion at lines 403-411 still proves per-job retry state reaches `QUARANTINED`.
- `skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:345` writes retry/quarantine state through `job_dir / "retry.json"` only, which matches the test's single-source-of-truth shape.
- Fresh verification: `python3 -m unittest skills/consensus-loop/scripts/test_publish_verification.py` ran 17 tests and passed.
- Reasoning discipline note: reference frame is regression-test minimalism plus single source of truth for state markers. Known-good shape is one behavior test that verifies both the positive per-job state and the negative absence of legacy/global state. Candidate weighed: add a new standalone root-marker test. Ugly defect: duplicated setup and a special-case assertion detached from the quarantine transition. Beautiful form: keep the negative assertion beside the existing transition sequence. Candidate chosen: add local before/after assertions in the existing test. Ugly defect: a negative assertion can look incidental if it is not named clearly. Beautiful form: an intent-revealing local `root_quarantine_marker` checked at the transition boundaries. Verified-premise status: diff and full touched file were read; implementation path `record_job_retry` was read; PR head SHA matches `aad62da123f8d604c57ddc1efa34ca705bbf9f94`.

## What would change your verdict (only if comment or reject)
N/A

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:1032:quality:approve

review_round: 1
head_sha: aad62da
REVIEW_DONE:1032:quality:approve
⟦AI:AUTO-LOOP⟧

@ElonSG

ElonSG commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

🤖 架构审查通过:quarantine 仍是 job-local 状态

TL;DR

  • What this is: PR 1032 的 architect reviewer 独立审查结果。
  • Current state or conclusion: approve;没有发现 CLAUDE.md / AGENTS.md 架构合规回退。
  • What the maintainer should do OR what the controller does next: controller 可按 review-gate 真值表继续收敛。

架构证据

本次 diff 只改 skills/consensus-loop/scripts/test_publish_verification.py,新增 3 行测试断言。这里的 repo-root marker 指仓库根目录下的 QUARANTINED 标记文件;per-job retry receipt 指每个 publish-verification job 自己目录里的 retry.json 状态收据。

  • skills/consensus-loop/scripts/test_publish_verification.py:388 定义 self.tmp / "QUARANTINED"skills/consensus-loop/scripts/test_publish_verification.py:391skills/consensus-loop/scripts/test_publish_verification.py:408 分别断言 quarantine 前后都没有 repo-root marker。这直接锁住“不要用根目录文件表达 quarantine 状态”的副作用边界。
  • skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:347 仍把 retry/quarantine 状态写到 job_dir / "retry.json"skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:351skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:360 只在这个 per-job 文件里写入 QUARANTINED
  • CLAUDE.md:55 要求“行为约束默认由 behavior test 或端到端可观察输入 / 输出 / 副作用验证”;这个 PR 是行为测试增强,验证的是可观察的“不产生根目录 marker”副作用。
  • CLAUDE.md:219 要求 .refactor-loop/ 这类 skill-private runtime 目录不能成为 host production configuration 或 ledger SSOT;本 PR 没有把 host production fact 移入 .refactor-loop/,反而约束 publish verification 的状态继续由既有 job-local receipt 表达。
  • CLAUDE.md:46 要求事实源唯一;本 PR 没有新增第二套 runtime surface、schema 或 wrapper,只补充了对既有唯一事实源的回归保护。

验证命令:python3 -m unittest skills/consensus-loop/scripts/test_publish_verification.py,本地结果为 17 tests / OK。

Reasoning-discipline note: reference frame 是 single source of truth + helper-private runtime side-effect boundary testing。已验证 diff 只触碰一个测试文件,production path 已经写 job_dir/retry.json,没有提供额外 audit / implement summary env path。Ugly defect: 缺少这个断言时,未来实现可能悄悄引入根目录 marker 作为第二事实面;Beautiful form: 用同一个 fixture repo root 明确断言不存在 stray marker,同时保留 retry.json 为唯一 quarantine receipt。对 comment/reject 候选路径的 ugly defect 是把窄测试增强误判为架构 drift;beautiful form 是只在有可引用 CLAUDE.md clause 回退时 reject。

📎 Full raw codex output (archival)
---
pr: 1032
role: architect
head_sha: aad62da123f8d604c57ddc1efa34ca705bbf9f94
verdict: approve
---

## Verdict
approve — no architecture compliance concerns; the diff only adds a behavior assertion that publish-verification quarantine stays job-local and does not create a repo-root marker.

## Evidence
- `skills/consensus-loop/scripts/test_publish_verification.py:388` defines `root_quarantine_marker = self.tmp / "QUARANTINED"`, and `skills/consensus-loop/scripts/test_publish_verification.py:391` plus `skills/consensus-loop/scripts/test_publish_verification.py:408` assert the marker is absent before and after the retry state reaches `QUARANTINED`.
- `skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:347` writes retry/quarantine state to `job_dir / "retry.json"`, and `skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:351` through `skills/consensus-loop/scripts/codex_refactor_loop/publish_verification.py:360` encode `QUARANTINED` in that per-job file, not in a repo-root marker.
- CLAUDE.md clause alignment: `CLAUDE.md:55` says "行为约束默认由 behavior test 或端到端可观察输入 / 输出 / 副作用验证"; this PR strengthens the existing behavior test with an observable absence-of-side-effect assertion.
- CLAUDE.md clause alignment: `CLAUDE.md:219` says "skill-private runtime directories such as `.refactor-loop/` must not become host production configuration or ledger SSOT"; the diff does not move host production facts into `.refactor-loop/` and instead guards against a repo-root quarantine marker as an alternate fact surface.
- CLAUDE.md clause alignment: `CLAUDE.md:46` says "同一约束禁止在多处平行声明"; this PR does not add a second implementation path or schema, and the checked behavior keeps publish verification state in the existing per-job retry receipt surface.
- Verification run: `python3 -m unittest skills/consensus-loop/scripts/test_publish_verification.py` passed locally with 17 tests.
- Reasoning-discipline note: Reference frame: single source of truth plus side-effect-boundary testing for helper-private runtime state. Known-good shape: one owner writes quarantine as a durable per-job receipt, and tests assert both the intended state and absence of stray repo-root state. Candidate approve: Ugly defect: an absence assertion can become brittle if it checks an unrelated global path; Beautiful form: assert the exact repo root from the fixture that represents the potential accidental marker location. Candidate comment/reject: Ugly defect: treating a narrow test-only guard as architectural drift would invent a rule not present in CLAUDE.md; Beautiful form: reserve reject for verified clause regression and advisory comments for real but non-blocking design debt. Verified premises: the merge-base diff touches only `skills/consensus-loop/scripts/test_publish_verification.py`; the production code path already writes `retry.json` under the job directory; no audit or implement summary env paths were provided; no `ASSUMED-UNVERIFIED` premise is needed for this verdict.

review_round: 1
head_sha: aad62da
REVIEW_DONE:1032:architect:approve
⟦AI:AUTO-LOOP⟧

@ElonSG ElonSG marked this pull request as ready for review June 21, 2026 12:35
@ElonSG ElonSG merged commit b9b24a0 into auto-refact-dev Jun 21, 2026
4 checks passed
@ElonSG ElonSG deleted the refactor/iter1031-issue-1031 branch June 21, 2026 12:35
@ElonSG ElonSG added crnd:phase:merged merged and removed crnd:phase:reviewing review-gate reviewers in flight labels Jun 21, 2026
ElonSG added a commit that referenced this pull request Jun 21, 2026
Co-authored-by: Loning <aloning@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crnd:human:auto auto-advancing, no human needed crnd:lifecycle:managed loop-managed item crnd:phase:merged merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants