Skip to content

fix(pr-to-green): accept budgeted queue snapshots - #524

Merged
thewrz merged 2 commits into
mainfrom
feat/issue-508
Aug 27, 2026
Merged

fix(pr-to-green): accept budgeted queue snapshots#524
thewrz merged 2 commits into
mainfrom
feat/issue-508

Conversation

@thewrz

@thewrz thewrz commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

This was written agentically; verify its assertions:

Why

Queue authorization rejected the exact budget-bearing snapshot produced by the queue writer and hid the actual mismatch behind a generic drift error.

What

  • Accept the writer's four-key snapshot schema while treating budget metadata as non-consent data.
  • Report the first differing field and snapshot/live values.
  • Add writer-to-authorizer round-trip and mismatch regression tests.

Decisions

Keep budget in the canonical snapshot schema but exclude its leaf values from authorization comparison.

Diff facts:
base=7d04a5e
files=3
total.insertions=128
total.deletions=4
total.lines=132
operational.files=3
operational.insertions=128
operational.deletions=4
operational.lines=132
generated.files=0
generated.insertions=0
generated.deletions=0
generated.lines=0
lockfile.files=0
lockfile.insertions=0
lockfile.deletions=0
lockfile.lines=0
fixture.files=0
fixture.insertions=0
fixture.deletions=0
fixture.lines=0
non_operational.files=0
non_operational.insertions=0
non_operational.deletions=0
non_operational.lines=0

Testing

  • Full declared test suite via agent-run.sh --cmd test
  • Root diff review and git diff --check

🤖 Co-authored by Codex gpt-5.6-sol orchestrator; implementation by gpt-5.6-luna high.

Closes #508

Summary by CodeRabbit

  • New Features
    • Confirmation snapshots now include required budget information.
    • Added detailed mismatch reporting that identifies the first differing queue or provider field.
  • Bug Fixes
    • Improved rejection messages for invalid, outdated, or changed queue snapshots.
    • Detects queue state, repository, provider, and supported-change mismatches more reliably.
    • Budget metadata is handled consistently without obscuring meaningful queue or provider differences.
  • Tests
    • Expanded coverage for budget metadata, snapshot drift, provider ordering, and queue authorization workflows.

Keep the confirmed queue schema aligned with pr-queue output, ignore informational budget drift, and identify the first differing authorization field. Add writer-to-authorizer round-trip coverage.

Co-Authored-By: Codex gpt-5.6-luna <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c465f2e3-1a56-427f-9e70-dd505d221b5c

📥 Commits

Reviewing files that changed from the base of the PR and between 7d04a5e and 48233ea.

📒 Files selected for processing (3)
  • agentkit/skills/pr-to-green/scripts/authorize-queue.sh
  • tests/test-pr-queue.sh
  • tests/test-pr-to-green-authorize-queue.sh

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

authorize-queue.sh now accepts snapshots containing budget, ignores budget changes during comparison, and reports the first differing field. Tests cover round-trip authorization and queue or provider drift diagnostics.

Changes

Queue authorization

Layer / File(s) Summary
Snapshot schema and comparison
agentkit/skills/pr-to-green/scripts/authorize-queue.sh
The confirmed snapshot schema now requires budget. Snapshot comparison ignores budget and identifies the first type, key, or value mismatch.
Authorization rejection diagnostics
agentkit/skills/pr-to-green/scripts/authorize-queue.sh
Mechanical-advance rejection messages now include mismatch details for invalid snapshots, added or vanished PRs, and unsupported changes.
Round-trip and mismatch validation
tests/test-pr-queue.sh, tests/test-pr-to-green-authorize-queue.sh
Tests cover budget-aware round trips, budget drift, schema and repository changes, provider changes, queue state changes, and reordered providers.

Merge Risk: ⚪ Minimal · up to 48233

This localized change updates queue snapshot authorization and its regression coverage; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: allowing authorize-queue.sh to consume queue snapshots that include budget metadata.
Linked Issues check ✅ Passed The changes satisfy Issue #508. The authorizer accepts the four-key snapshot including budget, excludes budget values from consent comparisons, reports the first differing field with snapshot and li…
Out of Scope Changes check ✅ Passed The changes remain within the linked issue scope. The script updates, authorization regression tests, and contract test all support queue snapshot compatibility and mismatch diagnostics.
Full details: Linked Issues check

Explanation

The changes satisfy Issue #508. The authorizer accepts the four-key snapshot including budget, excludes budget values from consent comparisons, reports the first differing field with snapshot and live values, and adds writer-to-authorizer round-trip and provider-source mismatch tests.

  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Codex <noreply@openai.com>
@thewrz

thewrz commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

This was written agentically; verify its assertions:

Adversarial review receipt

  • Reviewer: provider=anthropic; model=claude-opus-5; effort=xhigh; mode=cross-provider (reason: explicit session consent)
  • Counts: P1=0; P2=1; total=1
  • Reviewed head: 48233ea
  • Diff payload: wrzonance/agent-kit:524:44597c4b9ce96e05d0b2b92587be686ec0b1ad882695789478309957964bce8b
  • Confirmed finding: Canonicalize provider order in snapshot mismatch diagnostics — verdict=fixed; fix commit SHA(s)=48233ead9dcbaa0f1d3453facd878c3b5c1cc372

🤖 Co-authored by Codex.

@thewrz

thewrz commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

This was written agentically; verify its assertions:

Review ledger

Machine-readable record of every review already performed on this PR.

{
  "version": 1,
  "pr": 524,
  "repo": "wrzonance/agent-kit",
  "reviews": [
    {
      "kind": "adversarial",
      "provider": "anthropic",
      "model": "claude-opus-5",
      "effort": "xhigh",
      "mode": "cross-provider",
      "harness": "codex",
      "head_sha": "48233ead9dcbaa0f1d3453facd878c3b5c1cc372",
      "diff_payload": "wrzonance/agent-kit:524:44597c4b9ce96e05d0b2b92587be686ec0b1ad882695789478309957964bce8b",
      "counts": {
        "p1": 0,
        "p2": 1
      },
      "reviewed_at": "2026-08-27T07:13:49Z"
    },
    {
      "kind": "bot",
      "provider": "coderabbit",
      "head_sha": "48233ead9dcbaa0f1d3453facd878c3b5c1cc372",
      "state": "APPROVED",
      "review_id": 5038206255,
      "submitted_at": "2026-08-27T07:20:36Z"
    }
  ]
}

🤖 Co-authored by pr-to-green/review-transition.sh.

@thewrz
thewrz marked this pull request as ready for review August 27, 2026 07:15
@thewrz

thewrz commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

This was written agentically; verify its assertions:

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

@thewrz I will perform a full review of pull request #524.

✅ Action performed

Full review finished.

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.

fix(pr-to-green): authorize-queue.sh rejects every snapshot pr-queue.sh writes (budget key) and never names the differing field

1 participant