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
1 change: 1 addition & 0 deletions src/mcp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ const predictGateOutputSchema = {
readinessScore: z.number().nullable().optional(),
blockers: z.unknown().optional(),
warnings: z.unknown().optional(),
funnel: z.unknown().optional(),
note: z.string().optional(),
};

Expand Down
12 changes: 12 additions & 0 deletions src/rules/predicted-gate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ import {
} from "../signals/engine";
import type { FocusManifest } from "../signals/focus-manifest";
import { sanitizePublicComment } from "../github/commands";
import { GITTENSOR_HOME_URL } from "../github/footer";
import type { BountyRecord, GatePolicyPack, IssueRecord, PullRequestRecord, RepositoryRecord } from "../types";

// Opt-in funnel (#694): a non-Gittensor adopter running the `oss-anti-slop` pack learns that Gittensor pays
// contributors for OSS work like this. Public-safe "earn" wording only (never reward/payout/score).
const OSS_ANTI_SLOP_FUNNEL = {
message: "This repo runs the Gittensor anti-slop gate. Gittensor lets GitHub contributors earn for open-source work like this — register to start earning.",
registerUrl: GITTENSOR_HOME_URL,
} as const;
import { buildPullRequestAdvisory, evaluateGateCheck, type GateCheckConclusion } from "./advisory";

/**
Expand Down Expand Up @@ -38,6 +46,9 @@ export type PredictedGateVerdict = {
confirmedContributor: boolean | undefined;
blockers: Array<{ code: string; title: string; detail: string; action?: string | undefined }>;
warnings: Array<{ code: string; title: string; detail: string; action?: string | undefined }>;
/** Opt-in conversion funnel (#694): present only under the `oss-anti-slop` pack — a non-Gittensor
* adopter's path to "earn on Gittensor". `null` under `gittensor` (the contributor is already there). */
funnel: { message: string; registerUrl: string } | null;
note: string;
};

Expand Down Expand Up @@ -149,6 +160,7 @@ export function buildPredictedGateVerdict(args: {
confirmedContributor: effectiveConfirmedContributor,
blockers: evaluation.blockers.map(publicSafeFinding),
warnings: evaluation.warnings.map(publicSafeFinding),
funnel: pack === "oss-anti-slop" ? { ...OSS_ANTI_SLOP_FUNNEL } : null,
note: PREDICTED_GATE_NOTE,
};
}
9 changes: 9 additions & 0 deletions test/unit/predicted-gate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ describe("pack-aware prediction (#693)", () => {
expect(verdict({ gate: { duplicates: "block" } }).pack).toBe("gittensor");
});

it("surfaces the earn funnel only under oss-anti-slop (#694), public-safe", () => {
expect(verdict({ gate: { duplicates: "block" } }).funnel).toBeNull();
const oss = verdict({ gate: { pack: "oss-anti-slop", duplicates: "block" } });
expect(oss.funnel).not.toBeNull();
expect(oss.funnel?.registerUrl).toBe("https://gittensor.io");
expect(oss.funnel?.message.toLowerCase()).toContain("earn");
expect(JSON.stringify(oss.funnel)).not.toMatch(/reward|payout|trust score|wallet/i);
});

it("under oss-anti-slop, blocks ANY author — even a self-declared non-confirmed contributor", () => {
const result = buildPredictedGateVerdict({
input: { ...BASE_INPUT, body: "no issue", linkedIssues: [] },
Expand Down