From e5d1e7d9b6d0d8641bbbdae673e3cb3b39f90c91 Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 02:19:16 +0100 Subject: [PATCH 1/3] Isolate fake reviewer tests from host credentials Co-Authored-By: Codex --- tests/test_runners.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_runners.py b/tests/test_runners.py index 9e07d096..95774b05 100644 --- a/tests/test_runners.py +++ b/tests/test_runners.py @@ -17,7 +17,7 @@ import pytest -from loopzero import sandbox +from loopzero import runners, sandbox from loopzero.runners import ( REVIEW_SCHEMA, RunnerAuthFailed, @@ -113,8 +113,17 @@ def _bwrap_argv(log: Path) -> list[str]: @pytest.fixture(autouse=True) -def fake_bwrap(fake_tool, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: - for name in ("ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN", "OPENAI_API_KEY"): +def fake_bwrap(fake_tool, tmp_path: Path, tmp_path_factory, monkeypatch: pytest.MonkeyPatch) -> Path: + # Keep reviewer state outside tmp_path, which many tests mount as the checkout. + home = tmp_path_factory.mktemp("reviewer-home") + monkeypatch.setenv("HOME", str(home)) + for name in ( + "CODEX_HOME", + "CLAUDE_CONFIG_DIR", + "CLAUDE_SECURESTORAGE_CONFIG_DIR", + *runners.CLAUDE_AUTH_ENV, + *runners.CODEX_AUTH_ENV, + ): monkeypatch.delenv(name, raising=False) log = tmp_path / "review-bwrap.argv" fake_tool("bwrap", FAKE_BWRAP.format(log=log)) 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 2/3] 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"] From 80e11c308b678a54f15867d3f71cbcda3f2e23f6 Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 02:55:36 +0100 Subject: [PATCH 3/3] Preserve review rounds for verified changes Architecture-Review: unchanged; the skills reinforce existing review, receipt, and readiness behavior. Co-Authored-By: Codex --- core/skills/implement/SKILL.md | 6 ++++-- core/skills/resolve-findings/SKILL.md | 14 +++++++------- core/skills/work-issue/SKILL.md | 6 ++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/core/skills/implement/SKILL.md b/core/skills/implement/SKILL.md index b26bd52a..70e37ee1 100644 --- a/core/skills/implement/SKILL.md +++ b/core/skills/implement/SKILL.md @@ -28,8 +28,10 @@ and map each to a test or recorded evidence. Observe required UI/runtime behavio proof for UI changes per [Reporting](../../CONTRACT.md#reporting). Required acceptance that remains unobserved stays open with a next-action owner. Record the tested revision, observations, trade-offs -and limits in Notes or human Validation. Follow the contract's -[gate receipt fields and reuse rules](../../CONTRACT.md#gate-execution-and-delivery-priority). +and limits in Notes or human Validation. Start primary review only with a +completed passing `loopzero check` receipt for the exact pushed head. Focused +tests and running checks are intermediate evidence. Reuse a passing same-head +receipt under the [contract's reuse rules](../../CONTRACT.md#gate-execution-and-delivery-priority). Run commands expected to take more than about two minutes detached as in [Long-running jobs](../../../docs/DELEGATION.md#long-running-jobs). diff --git a/core/skills/resolve-findings/SKILL.md b/core/skills/resolve-findings/SKILL.md index d9a96d68..f5ac745c 100644 --- a/core/skills/resolve-findings/SKILL.md +++ b/core/skills/resolve-findings/SKILL.md @@ -22,10 +22,10 @@ security-path downgrades need requester authority. For conflicting findings, reconcile their acceptance and impact. New critical evidence requires a separate authorized PR review thread rather than silently expanding this batch. -After the delta, follow the contract's [round-two rule](../../CONTRACT.md#review-budget). -Return accepted repairs to delivery: fixing findings does not finish the task -until the fixed head is delivered. - -Then continue the task you were given as far as it authorizes, or hand over -what is left of its acceptance. If two repairs have failed, the route is -probably wrong, so reconsider it before a third. +Before requesting the delta, compare the full repair with the primary-reviewed +head. Identify affected callers and guarantees for each repaired behavior. Use +existing test seams to exercise the failing case and any success, failure or +timing behavior the repair can change. Apply [security-review](../security-review/SKILL.md) +to changed trust boundaries. Record the evidence with the repair, run the +existing checks and follow the contract's [review budget](../../CONTRACT.md#review-budget) +through delivery or handoff of remaining acceptance. diff --git a/core/skills/work-issue/SKILL.md b/core/skills/work-issue/SKILL.md index c4e97513..005823c0 100644 --- a/core/skills/work-issue/SKILL.md +++ b/core/skills/work-issue/SKILL.md @@ -30,8 +30,10 @@ blueprint. Include required completion in the closing delivery. A child issue does not own its parent's blueprint. Recheck collisions before publication and again before merge, rereading live acceptance, prior delivery and ownership. Reconcile changed state before proceeding. -Review, CI and observable post-merge acceptance waits remain this task; -neither bypass them nor start another issue. +On approval, run readiness at the approved head and defer suggestions and cleanup. +Before making a source edit for the [delta](../../CONTRACT.md#review-budget), name +the unmet acceptance criterion or newly verified defect that requires it. +Review, CI and post-merge acceptance waits remain this task. Before using [CI or observation-based acceptance](reference.md#acceptance-evidence) or [resuming after interruption or context loss](reference.md#re-entry), follow the linked safeguards.