Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/queue/processors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
20 changes: 8 additions & 12 deletions test/unit/queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<string, unknown>);
Expand All @@ -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",
Expand All @@ -9419,17 +9416,16 @@ 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.",
},
},
});

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 () => {
Expand Down