From 05515b0a92661993c702435a646977523a20466c Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 02:44:24 +0100 Subject: [PATCH] Cover and document the PR Validation writer rollout Co-Authored-By: Codex --- SETUP.md | 8 ++++++++ tests/test_cli.py | 19 ++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/SETUP.md b/SETUP.md index d2153ef9..f474554c 100644 --- a/SETUP.md +++ b/SETUP.md @@ -74,6 +74,14 @@ symlinked skill directory and resolve its relative links from the real files, so the contract and references stay reachable. Do not also keep copies of these skills in a repository: both would load. +Before resuming automated PR check refreshes or explicit PR resyncs after an +upgrade, advance every PR-body writer to the selected CLI revision. For +unverified receipt warnings, use a revision containing +[3ff80bd9 (#1160)](https://github.com/feder-positronics/loop-zero/commit/3ff80bd91c92f12d557cead31776df40d4328097). +Once the writers are updated, run `loopzero check` for the current head to +replace old receipts. If you roll back across that fix, pause those writes before +switching the CLI and resume them once the writers support the warning again. + If you roll back across [#732](https://github.com/feder-positronics/loop-zero/pull/732) after GitHub may have accepted a Claude review, run `loopzero review --repost` with the publishing CLI revision or a newer compatible revision. The rollback diff --git a/tests/test_cli.py b/tests/test_cli.py index 5e14f8c1..1b6383ab 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -4715,19 +4715,28 @@ def test_generated_pr_body_limit(wt, gh, capsys, monkeypatch, create, extra): assert json.loads(writes[0]["--input"])["body"] == prose + suffix -def test_pr_marks_legacy_same_head_check_unverified(wt, gh, capsys): +@pytest.mark.parametrize("refresh", ["resync", "automatic"]) +def test_pr_marks_legacy_same_head_check_unverified(wt, gh, capsys, refresh): head = head_of(wt) - live = "# PR\n\n## Validation\nManual validation evidence.\n" + config = cli._load_config(SimpleNamespace(command="check", config=None), wt, pin_checks=True) + live = ("# PR\n\n## Validation\nManual validation evidence.\n\n" + "\n" + f"Recorded for `{head[:12]}`\n- `echo ok`: exit 0\n" + "\n") gh.respond_pr_list([pr_json(headRefOid=head, body=live)]) gh.respond(f"api repos/{REPO}/pulls/7 --method PATCH", {}) - cli._save_report(wt, CheckReport(head, False, (CheckResult("echo ok", 0, 0.0, ""),))) + stages = tuple(CheckResult(command, 0, 0.0, "") for command in config.checks) + cli._save_report(wt, CheckReport(head, False, stages)) + git(wt, "push", "-q", "-u", "origin", "lz/t1") - assert run(capsys, "pr")[0] == 0 + if refresh == "resync": + assert run(capsys, "pr")[0] == 0 + else: + cli._refresh_pr_checks(wt, config) draft = json.loads(gh.calls[-1]["--input"])["body"] assert "unverified" in draft and "run `loopzero check`" in draft assert "Manual validation evidence." in draft - git(wt, "push", "-q", "-u", "origin", "lz/t1") gh.respond_pr_list([pr_json(headRefOid=head, body=draft)]) assert run(capsys, "check")[0] == 0 draft = json.loads(gh.calls[-1]["--input"])["body"]