From 06467f1203dcd38fe47b48a3fbc7ded2fa950523 Mon Sep 17 00:00:00 2001 From: ghost <49853598+JSONbored@users.noreply.github.com> Date: Thu, 9 Jul 2026 04:02:24 -0700 Subject: [PATCH] fix(review): enforce manifest test gate for ignored authors --- src/queue/processors.ts | 12 +++--------- test/unit/queue.test.ts | 20 ++++++++------------ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/queue/processors.ts b/src/queue/processors.ts index f9b8a59fd3..bbff57a613 100644 --- a/src/queue/processors.ts +++ b/src/queue/processors.ts @@ -9213,15 +9213,9 @@ async function maybePublishPrPublicSurface( "manifest_linked_issue_required", "manifest_missing_tests", ]); - // Bot-author exemption (gate-review finding, #4719): mirrors review.auto_review.ignore_authors, - // already resolved above as `reviewEligibility` for the AI-review skip -- a fully-automated bot PR - // (e.g. a scheduled README/docs regen) should not be held to "did you demonstrate test evidence" - // scrutiny meant for human contributors, the same way it's already exempted from AI review. Filtered - // out of `guidance.findings` itself, not just the push loop below, so the e2e-test-generation - // auto-trigger further down -- which reads the SAME findings -- is exempted too. - const policyFindings = reviewEligibility.eligible - ? guidance.findings - : guidance.findings.filter((finding) => finding.code !== "manifest_missing_tests"); + // Keep deterministic manifest policy findings independent from AI-review eligibility: ignored authors + // suppress review/public output only, never maintainer-configured gate blockers or their downstream triggers. + const policyFindings = guidance.findings; for (const finding of policyFindings) { if (!policyCodes.has(finding.code)) continue; advisory.findings.push(publicSafeManifestPolicyFinding(finding)); diff --git a/test/unit/queue.test.ts b/test/unit/queue.test.ts index bb0710f4c1..cc1e0caf34 100644 --- a/test/unit/queue.test.ts +++ b/test/unit/queue.test.ts @@ -9338,12 +9338,9 @@ describe("queue processors", () => { expect(JSON.stringify(gatePatches[0])).not.toContain("Configured validation evidence missing"); }); - // REGRESSION (#4719): a fully-automated bot PR (e.g. a scheduled README/docs regen opened by - // github-actions[bot]) must not be held to "did you demonstrate test evidence" scrutiny -- mirrors the - // existing review.auto_review.ignore_authors exemption already applied to AI review. CI is deliberately - // NOT green here (empty check-runs, same as the "still flags" tests above) so this exercises the - // author-exemption path specifically, independent of the live-CI-evidence fix covered above. - it("exempts a bot author's PR from manifest_missing_tests even without CI or body validation evidence (#4719)", async () => { + // REGRESSION: review.auto_review.ignore_authors is only an AI/public-output skip. It must not + // suppress deterministic manifest policy blockers or the e2e-test-generation trigger that reads them. + it("still flags manifest_missing_tests for an ignored bot author without validation evidence", async () => { const env = createTestEnv({ GITHUB_APP_PRIVATE_KEY: await generatePrivateKeyPem() }); await persistRegistrySnapshot( env, @@ -9397,7 +9394,7 @@ describe("queue processors", () => { const method = init?.method ?? "GET"; if (url === "https://api.gittensor.io/miners") return Response.json([]); if (url.includes("/access_tokens")) return Response.json({ token: "installation-token" }); - if (url.includes("/commits/gate-bot-exempt/check-runs")) return Response.json({ total_count: 0, check_runs: [] }); + if (url.includes("/commits/gate-ignored-bot-blocked/check-runs")) return Response.json({ total_count: 0, check_runs: [] }); if (url.includes("/check-runs") && method === "POST") return Response.json({ id: 905 }, { status: 201 }); if (url.includes("/check-runs/905") && method === "PATCH") { gatePatches.push(JSON.parse(String(init?.body ?? "{}")) as Record); @@ -9408,7 +9405,7 @@ describe("queue processors", () => { await processJob(env, { type: "github-webhook", - deliveryId: "gate-bot-exempt-evidence", + deliveryId: "gate-ignored-bot-blocked-evidence", eventName: "pull_request", payload: { action: "opened", @@ -9419,7 +9416,7 @@ describe("queue processors", () => { title: "Update README", state: "open", user: { login: "github-actions[bot]" }, - head: { sha: "gate-bot-exempt" }, + head: { sha: "gate-ignored-bot-blocked" }, labels: [], body: "Auto-generated by a workflow.", }, @@ -9427,9 +9424,8 @@ describe("queue processors", () => { }); expect(gatePatches).toHaveLength(1); - expect(gatePatches[0]).toMatchObject({ status: "completed", conclusion: "success" }); - expect(JSON.stringify(gatePatches[0])).not.toContain("manifest_missing_tests"); - expect(JSON.stringify(gatePatches[0])).not.toContain("Configured validation evidence missing"); + expect(gatePatches[0]).toMatchObject({ status: "completed", conclusion: "failure" }); + expect(JSON.stringify(gatePatches[0])).toContain("Configured validation evidence missing"); }); it("stamps a gate-only surface even when local Gate check-summary persistence fails", async () => {