diff --git a/.github/workflows/openrouter-code-review.yml b/.github/workflows/openrouter-code-review.yml index 5e0b2cb..4e30ee5 100644 --- a/.github/workflows/openrouter-code-review.yml +++ b/.github/workflows/openrouter-code-review.yml @@ -382,7 +382,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: FlyOverCoderKY/openrouter-pr-review-action - ref: 5bb16c7a5ba87a802d7884ccbfa5e99d10978a49 + ref: 212775ffea22e806cddcb706c73a3df26fbcb6d0 path: .trusted-review-action persist-credentials: false - name: Resolve pending review request @@ -401,7 +401,7 @@ jobs: - name: Prepare shared review snapshot id: profile_setup if: inputs.review_profiles_enabled - uses: FlyOverCoderKY/openrouter-pr-review-action@5bb16c7a5ba87a802d7884ccbfa5e99d10978a49 # action#40 settled-dispute receipt validation + uses: FlyOverCoderKY/openrouter-pr-review-action@212775ffea22e806cddcb706c73a3df26fbcb6d0 # action#41 rebase scope and review history with: role: setup github_token: ${{ github.token }} @@ -449,7 +449,7 @@ jobs: id: openrouter_first if: steps.profile_request.outputs.skip_review != 'true' timeout-minutes: 25 - uses: FlyOverCoderKY/openrouter-pr-review-action@5bb16c7a5ba87a802d7884ccbfa5e99d10978a49 # action#40 settled-dispute receipt validation + uses: FlyOverCoderKY/openrouter-pr-review-action@212775ffea22e806cddcb706c73a3df26fbcb6d0 # action#41 rebase scope and review history env: OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} with: @@ -544,8 +544,8 @@ jobs: # never masks a failed or stale fresh first pass. # - synchronize: a prior bot-authored initial review may carry only when its # explicit reviewed commit is the current head or an ancestor of it. - # - force-push/divergence: historical carry is rejected; a fresh initial - # OpenRouter review on the new lineage is required. + # - force-push/divergence: historical carry is rejected; a fresh full-PR + # initial, full-PR verification, or rebase review on the new lineage is required. openrouter-first-pass-gate: name: openrouter-first-pass-gate needs: [openrouter-first-pass] @@ -604,7 +604,7 @@ jobs: exit 1 fi - # A carry candidate must be a real bot-authored initial or full-PR verify + # A carry candidate must be a real bot-authored initial, full-PR verify, or rebase # review. Verification requires a ledger. Initial partials # are ledgerless by design. Both must expose the explicit Commit line, # and that SHA must be identical to or an ancestor of the current @@ -648,7 +648,8 @@ jobs: (.body | contains("## OpenRouter pull-request review")) and ((.body | contains("**Mode:** `initial`")) or ((.body | contains("**Mode:** `verify`")) and - (.body | contains("**Scope:** `full-pr`")) and + ((.body | contains("**Scope:** `full-pr` (full-pr)")) or + (.body | contains("**Scope:** `rebase` (full-pr)"))) and (.body | contains("`, '**Profile:** satisfied', @@ -314,6 +314,14 @@ function authorizeContext(store, overrides = {}) { } describe('authorizeProfileReceipt', () => { + it('authorizes rebase verification with current proof and rejects an initial rebase', async () => { + for (const mode of ['verify', 'initial']) { + const { github, store } = buildStore({ receiptOverrides: { scope: 'rebase', mode } }); + const result = await authorizeProfileReceipt(github, authorizeContext(store)); + assert.equal(result.authorized, mode === 'verify'); + } + }); + it('authorizes a current valid proof', async () => { const { github, store } = buildStore(); const result = await authorizeProfileReceipt(github, authorizeContext(store)); diff --git a/tests/test_profile_completion.py b/tests/test_profile_completion.py index f37fa1c..b9d744a 100644 --- a/tests/test_profile_completion.py +++ b/tests/test_profile_completion.py @@ -184,7 +184,7 @@ def bundle_for( "topic", DiffPlan( scope, - "full-pr" if scope == "full-pr" else "commit-range", + "full-pr" if scope in {"full-pr", "rebase"} else "commit-range", BASE if scope != "full-pr" else BASE, head_sha, None, @@ -473,6 +473,9 @@ def test_collect_initial_standard_and_verify_deep(self): ("standard", "baseline", "initial", "full-pr", JOB_INITIAL), ("deep", "manual", "initial", "full-pr", JOB_INITIAL), ("standard", "baseline", "verify", "latest-commit", JOB_VERIFY), + ("standard", "baseline", "verify", "full-pr", JOB_VERIFY), + ("standard", "baseline", "verify", "rebase", JOB_VERIFY), + ("deep", "manual", "verify", "rebase", JOB_VERIFY), ): with self.subTest(level=level, mode=mode): store = self.make_store() diff --git a/tests/test_profile_workflow.py b/tests/test_profile_workflow.py index a024323..fdb2677 100644 --- a/tests/test_profile_workflow.py +++ b/tests/test_profile_workflow.py @@ -14,7 +14,7 @@ (ROOT / '.github/workflows/openrouter-profile-completion.yml').read_text(encoding='utf-8'), Loader=yaml.BaseLoader, ) -ACTION_PIN = '5bb16c7a5ba87a802d7884ccbfa5e99d10978a49' +ACTION_PIN = '212775ffea22e806cddcb706c73a3df26fbcb6d0' def job_steps(workflow, job_id): diff --git a/tests/test_review_configuration.py b/tests/test_review_configuration.py index 0becfdf..183e40b 100644 --- a/tests/test_review_configuration.py +++ b/tests/test_review_configuration.py @@ -17,7 +17,7 @@ ) JOBS = WORKFLOW['jobs'] CONFIG = JOBS['review-config'] -ACTION_PIN = '5bb16c7a5ba87a802d7884ccbfa5e99d10978a49' +ACTION_PIN = '212775ffea22e806cddcb706c73a3df26fbcb6d0' SCRIPT = next(step['run'] for step in CONFIG['steps'] if step.get('id') == 'config') REGISTRY = json.dumps( json.loads((ROOT / 'review-profiles.json').read_text(encoding='utf-8')), diff --git a/tests/test_review_contract.py b/tests/test_review_contract.py index 6585ba9..5a0a54d 100644 --- a/tests/test_review_contract.py +++ b/tests/test_review_contract.py @@ -28,10 +28,11 @@ def selected( ledger=True, author="github-actions[bot]", verdict="clean", + kind="full-pr", ): body = ( "## OpenRouter pull-request review\n" - f"**Mode:** `{mode}`\n**Scope:** `{scope}` (full-pr)\n" + f"**Mode:** `{mode}`\n**Scope:** `{scope}` ({kind})\n" f"**Verdict:** `{verdict}`\n**Commit:** `{'a' * 40}`\n" ) if ledger: @@ -53,6 +54,11 @@ def selected( def test_full_pr_verify_is_completion_evidence(self): self.assertTrue(self.selected()) + def test_rebase_verify_requires_full_diff_and_ledger(self): + self.assertTrue(self.selected(scope="rebase")) + self.assertFalse(self.selected(scope="rebase", ledger=False)) + self.assertFalse(self.selected(scope="rebase", kind="single-commit")) + def test_initial_completion_still_works(self): for verdict in ("clean", "issues", "partial"): self.assertTrue(