From 126cbedc5115800edd217b1693e82cb4d24e1766 Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 12:23:43 +0200 Subject: [PATCH 1/4] feat(app): add weekly report exports --- apps/gittensory-ui/public/openapi.json | 51 ++++++++++- .../gittensory-ui/src/routes/app.operator.tsx | 91 ++++++++++++++++++- src/api/routes.ts | 18 +++- src/openapi/spec.ts | 40 +++++++- src/services/weekly-value-report.ts | 80 +++++++++++++++- test/integration/api.test.ts | 19 ++++ test/unit/weekly-value-report.test.ts | 48 +++++++++- 7 files changed, 334 insertions(+), 13 deletions(-) diff --git a/apps/gittensory-ui/public/openapi.json b/apps/gittensory-ui/public/openapi.json index 867e3ced1d..bef4cbed43 100644 --- a/apps/gittensory-ui/public/openapi.json +++ b/apps/gittensory-ui/public/openapi.json @@ -11614,9 +11614,49 @@ }, "/v1/app/analytics/weekly-value-report": { "get": { + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "public", + "operator" + ], + "example": "public" + }, + "required": false, + "description": "Report variant. Operator reports require the operator app role.", + "name": "variant", + "in": "query" + }, + { + "schema": { + "type": "string", + "example": "7" + }, + "required": false, + "description": "Report window in days, clamped from 1 to 31.", + "name": "days", + "in": "query" + }, + { + "schema": { + "type": "string", + "enum": [ + "json", + "markdown" + ], + "example": "markdown" + }, + "required": false, + "description": "Response format. Omit or use json for the structured report; use markdown for copy-ready text.", + "name": "format", + "in": "query" + } + ], "responses": { "200": { - "description": "Live app API response", + "description": "Weekly value report as structured JSON or copy-ready Markdown", "content": { "application/json": { "schema": { @@ -11625,11 +11665,20 @@ "nullable": true } } + }, + "text/markdown": { + "schema": { + "type": "string", + "example": "# Weekly Gittensory value report\n\n## Adoption metrics\n- Active users: 4\n" + } } } }, "401": { "description": "Unauthorized" + }, + "403": { + "description": "Insufficient app role for requested report variant" } }, "security": [ diff --git a/apps/gittensory-ui/src/routes/app.operator.tsx b/apps/gittensory-ui/src/routes/app.operator.tsx index abe31018ab..514e9a0362 100644 --- a/apps/gittensory-ui/src/routes/app.operator.tsx +++ b/apps/gittensory-ui/src/routes/app.operator.tsx @@ -1,4 +1,7 @@ +import { useState } from "react"; import { createFileRoute } from "@tanstack/react-router"; +import { Check, Copy, FileJson } from "lucide-react"; +import { toast } from "sonner"; import { BoundaryBadge, @@ -8,6 +11,8 @@ import { } from "@/components/site/control-primitives"; import { NotificationReadinessCard } from "@/components/site/notification-readiness-card"; import { StateBoundary } from "@/components/site/state-views"; +import { getApiOrigin } from "@/lib/api/origin"; +import { apiFetch } from "@/lib/api/request"; import { useApiResource } from "@/lib/api/use-api-resource"; export const Route = createFileRoute("/app/operator")({ @@ -26,12 +31,40 @@ type OperatorDashboardResponse = { upstreamDrift?: { status?: string } | null; }; +type ReportExportFormat = "markdown" | "json"; + function OperatorDashboard() { const dashboard = useApiResource( "/v1/app/operator-dashboard", "Operator dashboard", ); + const [copiedExport, setCopiedExport] = useState(null); const data = dashboard.status === "ready" ? dashboard.data : null; + const copyWeeklyReport = async (format: ReportExportFormat) => { + if (!data?.weeklyValueReport) return; + try { + const text = + format === "json" + ? JSON.stringify(data.weeklyValueReport, null, 2) + : await loadWeeklyReportMarkdown(); + if (typeof navigator === "undefined" || !navigator.clipboard?.writeText) { + throw new Error("Clipboard API unavailable"); + } + await navigator.clipboard.writeText(text); + setCopiedExport(format); + toast.success("Weekly report copied", { + description: `${format === "json" ? "JSON" : "Markdown"} export copied.`, + }); + window.setTimeout(() => setCopiedExport(null), 1400); + } catch (error) { + toast.error("Copy failed", { + description: + error instanceof Error && error.message + ? `${error.message}. Select the report text and copy manually.` + : "Select the report text and copy manually.", + }); + } + }; return (
-

Weekly value report

-

- Rollup-backed summary across usage, maintenance, and drift signals. -

+
+
+

Weekly value report

+

+ Rollup-backed summary across usage, maintenance, and drift signals. +

+
+ {data.weeklyValueReport ? ( +
+ + +
+ ) : null} +
{data.weeklyValueReport ? (
); } + +async function loadWeeklyReportMarkdown(): Promise { + const result = await apiFetch( + `${getApiOrigin().replace(/\/$/, "")}/v1/app/analytics/weekly-value-report?variant=operator&format=markdown`, + { + label: "Weekly report export", + credentials: "include", + headers: { Accept: "text/markdown" }, + parse: (res) => res.text(), + }, + ); + if (!result.ok) throw new Error(result.message); + return result.data; +} diff --git a/src/api/routes.ts b/src/api/routes.ts index 44b7f71c9f..04125936c6 100644 --- a/src/api/routes.ts +++ b/src/api/routes.ts @@ -128,7 +128,12 @@ import { LATEST_RECOMMENDED_MCP_VERSION, MINIMUM_SUPPORTED_MCP_VERSION, } from "../services/mcp-compatibility"; -import { buildWeeklyValueReport, generateWeeklyValueReport, loadWeeklyValueReport } from "../services/weekly-value-report"; +import { + buildWeeklyValueReport, + formatWeeklyValueReportMarkdown, + generateWeeklyValueReport, + loadWeeklyValueReport, +} from "../services/weekly-value-report"; import { loadOrComputeIssueQualityResponse } from "../services/issue-quality"; import { loadOrComputeBurdenForecastResponse } from "../services/burden-forecast"; import { loadOrComputeRepoOutcomePatternsResponse } from "../services/repo-outcome-patterns"; @@ -944,11 +949,18 @@ export function createApp() { app.get("/v1/app/analytics/weekly-value-report", async (c) => { const variant = c.req.query("variant") === "operator" ? "operator" : "public"; - const allowedRoles: ControlPanelRoleName[] = variant === "operator" ? ["operator"] : ["miner", "maintainer", "owner", "operator"]; + const allowedRoles: ControlPanelRoleName[] = + variant === "operator" ? ["operator"] : ["miner", "maintainer", "owner", "operator"]; const forbidden = await requireAppRole(c, allowedRoles); if (forbidden) return forbidden; const days = Math.max(1, Math.min(31, Number(c.req.query("days") ?? 7) || 7)); - return c.json(await loadWeeklyValueReport(c.env, { variant, days })); + const report = await loadWeeklyValueReport(c.env, { variant, days }); + if (c.req.query("format") === "markdown") { + return c.text(formatWeeklyValueReportMarkdown(report), 200, { + "Content-Type": "text/markdown; charset=utf-8", + }); + } + return c.json(report); }); app.get("/v1/app/commands", async (c) => diff --git a/src/openapi/spec.ts b/src/openapi/spec.ts index ff0929ad38..e163e5b447 100644 --- a/src/openapi/spec.ts +++ b/src/openapi/spec.ts @@ -583,7 +583,6 @@ export function buildOpenApiSpec() { "/v1/app/digest", "/v1/app/analytics/daily-rollups", "/v1/app/analytics/mcp-compatibility", - "/v1/app/analytics/weekly-value-report", ]) { registry.registerPath({ method: "get", @@ -594,6 +593,45 @@ export function buildOpenApiSpec() { }, }); } + registry.registerPath({ + method: "get", + path: "/v1/app/analytics/weekly-value-report", + request: { + query: z.object({ + variant: z.enum(["public", "operator"]).optional().openapi({ + param: { + description: "Report variant. Operator reports require the operator app role.", + }, + example: "public", + }), + days: z.string().optional().openapi({ + param: { description: "Report window in days, clamped from 1 to 31." }, + example: "7", + }), + format: z.enum(["json", "markdown"]).optional().openapi({ + param: { + description: "Response format. Omit or use json for the structured report; use markdown for copy-ready text.", + }, + example: "markdown", + }), + }), + }, + responses: { + 200: { + description: "Weekly value report as structured JSON or copy-ready Markdown", + content: { + "application/json": { schema: z.record(z.unknown()) }, + "text/markdown": { + schema: z.string().openapi({ + example: "# Weekly Gittensory value report\n\n## Adoption metrics\n- Active users: 4\n", + }), + }, + }, + }, + 401: { description: "Unauthorized" }, + 403: { description: "Insufficient app role for requested report variant" }, + }, + }); for (const path of ["/v1/app/commands/preview", "/v1/app/commands/feedback", "/v1/app/digest/subscriptions"]) { registry.registerPath({ method: "post", diff --git a/src/services/weekly-value-report.ts b/src/services/weekly-value-report.ts index d63db85c29..ed39b43296 100644 --- a/src/services/weekly-value-report.ts +++ b/src/services/weekly-value-report.ts @@ -203,6 +203,37 @@ export function buildWeeklyValueReport(args: WeeklyValueReportInputs): WeeklyVal }; } +export function formatWeeklyValueReportMarkdown(report: WeeklyValueReport): string { + const lines = [ + "# Weekly Gittensory value report", + "", + `- Generated: ${markdownText(report.generatedAt)}`, + `- Variant: ${markdownText(report.variant)}`, + `- Window: ${report.period.days} day(s)${report.period.startDay && report.period.endDay ? `, ${markdownText(report.period.startDay)} to ${markdownText(report.period.endDay)}` : ""}`, + `- Public-safe: ${report.publicSafe ? "yes" : "operator-only"}`, + "", + "## Summary", + ...listLines(report.summary), + "", + "## Adoption metrics", + ...metricLines(report, ["active_users", "active_repos", "product_events", "active_sessions", "digest_subscriptions"]), + "", + "## Miner utility", + ...metricLines(report, ["mcp_usage", "pr_preflights", "pr_packets"]), + "", + "## Maintainer trust", + ...metricLines(report, ["github_commands", "quiet_skips", "maintainer_signals", "drift_reports"]), + "", + "## Repo-owner readiness", + ...metricLines(report, ["registered_repos", "installed_repos", "installations", "install_issues", "active_repos"]), + "", + "## Known blockers", + ...knownBlockerLines(report), + ...operatorDetailLines(report), + ]; + return `${lines.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd()}\n`; +} + function buildWeeklyMetrics(args: { activeActors: number; aggregate: WeeklyAggregate; @@ -322,6 +353,48 @@ function countDimensions(entries: ProductUsageDimensionCount[], limit = 10): Pro .slice(0, limit); } +function metricLines(report: WeeklyValueReport, ids: string[]): string[] { + const metrics = new Map(report.metrics.map((metric) => [metric.id, metric])); + const lines = ids.flatMap((id) => { + const metric = metrics.get(id); + if (!metric) return []; + const detail = markdownText(metric.detail); + return [`- ${markdownText(metric.label)}: ${metric.value}${detail ? ` (${detail})` : ""}`]; + }); + return lines.length > 0 ? lines : ["- No rollup-backed metric is available for this section."]; +} + +function knownBlockerLines(report: WeeklyValueReport): string[] { + const blockers = [...report.warnings, ...report.freshness.warnings]; + return blockers.length > 0 ? listLines([...new Set(blockers)]) : ["- No known blocker surfaced by the current report window."]; +} + +function operatorDetailLines(report: WeeklyValueReport): string[] { + if (!report.operatorDetails) return []; + return [ + "", + "## Operator detail", + `- Activation: ${report.operatorDetails.activation.fullyActivatedActors} fully activated actor(s), ${report.operatorDetails.activation.githubActivatedRepos} GitHub activated repo(s).`, + ...dimensionLines("Top repos", report.operatorDetails.topRepos), + ...dimensionLines("Top commands", report.operatorDetails.topCommands), + ...dimensionLines("Top tools", report.operatorDetails.topTools), + ...dimensionLines("Top route classes", report.operatorDetails.topRouteClasses), + ]; +} + +function dimensionLines(title: string, entries: ProductUsageDimensionCount[]): string[] { + if (entries.length === 0) return []; + return [`- ${title}: ${entries.slice(0, 5).map((entry) => `${markdownText(entry.key)} (${entry.count})`).join(", ")}`]; +} + +function listLines(items: string[]): string[] { + return items.length > 0 ? items.map((item) => `- ${markdownText(item)}`) : ["- No report data available."]; +} + +function markdownText(value: string): string { + return sanitizeReportText(value).replace(/\s+/g, " ").trim(); +} + function sum(values: number[]): number { return values.reduce((total, value) => total + value, 0); } @@ -339,6 +412,11 @@ function sanitizeReportText(value: string): string { .replace(/(?:\/Users|\/home|\/tmp)\/[^\s"',;)]*|[A-Za-z]:\\Users\\[^\s"',;)]*/g, "") .replace(/\b(?:ghp_|github_pat_|gts_|glpat-|sk-)[A-Za-z0-9_=-]{8,}/g, "") .replace(/\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, "Bearer "); - if (/\b(seed phrase|mnemonic|private key|raw trust|trust score|wallet|hotkey|coldkey|payout|reward estimate|farming|private reviewability|public score estimate)\b/i.test(redacted)) return ""; + if ( + /\b(seed phrase|mnemonic|private key|raw[-\s]?trust|trust[-\s]?score|wallet|hotkey|coldkey|payout|reward(?:[-\s]?(?:estimate|prediction|claim|score|payout|risk))?|farming|private[-\s]?reviewability|private[-\s]?scoreability|scoreability|public[-\s]?score[-\s]?(?:estimate|prediction|claim)|score[-\s]?(?:estimate|prediction|preview))\b/i.test( + redacted, + ) + ) + return ""; return redacted.slice(0, 240); } diff --git a/test/integration/api.test.ts b/test/integration/api.test.ts index 18a2075676..80f3c616db 100644 --- a/test/integration/api.test.ts +++ b/test/integration/api.test.ts @@ -36,6 +36,9 @@ import { persistRegistrySnapshot } from "../../src/registry/sync"; import { createTestEnv } from "../helpers/d1"; import type { JsonValue } from "../../src/types"; +const FORBIDDEN_PUBLIC_REPORT_TERMS = + /wallet|hotkey|raw trust|trust[-\s]?score|payout|reward[-\s]?estimate|farming|private[-\s]?reviewability|public[-\s]?score[-\s]?(?:estimate|prediction)|private[-\s]?scoreability|scoreability/i; + describe("api routes", () => { // Freshness/readiness fixtures are dated relative to late May 2026; pin the clock so freshness SLO // windows stay deterministic regardless of when CI runs (fixtures otherwise tip "stale" after 7 days). @@ -1351,6 +1354,14 @@ describe("api routes", () => { const ownerWeeklyReportBody = await ownerWeeklyReport.json(); expect(ownerWeeklyReportBody).toMatchObject({ variant: "public", publicSafe: true }); expect(ownerWeeklyReportBody).not.toHaveProperty("operatorDetails"); + const ownerWeeklyReportMarkdown = await app.request("/v1/app/analytics/weekly-value-report?format=markdown", { headers: ownerHeaders }, ownerEnv); + expect(ownerWeeklyReportMarkdown.status).toBe(200); + expect(ownerWeeklyReportMarkdown.headers.get("content-type")).toContain("text/markdown"); + const ownerWeeklyReportMarkdownText = await ownerWeeklyReportMarkdown.text(); + expect(ownerWeeklyReportMarkdownText).toContain("# Weekly Gittensory value report"); + expect(ownerWeeklyReportMarkdownText).toContain("## Maintainer trust"); + expect(ownerWeeklyReportMarkdownText).not.toContain("## Operator detail"); + expect(ownerWeeklyReportMarkdownText).not.toMatch(FORBIDDEN_PUBLIC_REPORT_TERMS); expect((await app.request("/v1/app/analytics/weekly-value-report?variant=operator", { headers: ownerHeaders }, ownerEnv)).status).toBe(403); const ownerExtensionSession = await app.request("/v1/auth/extension/session", { method: "POST", headers: ownerHeaders }, ownerEnv); expect(ownerExtensionSession.status).toBe(201); @@ -2205,6 +2216,14 @@ describe("api routes", () => { period: expect.objectContaining({ days: 7 }), operatorDetails: expect.any(Object), }); + const operatorWeeklyReportMarkdown = await app.request("/v1/app/analytics/weekly-value-report?variant=operator&format=markdown", { headers: apiHeaders(env) }, env); + expect(operatorWeeklyReportMarkdown.status).toBe(200); + expect(operatorWeeklyReportMarkdown.headers.get("content-type")).toContain("text/markdown"); + const operatorWeeklyReportMarkdownText = await operatorWeeklyReportMarkdown.text(); + expect(operatorWeeklyReportMarkdownText).toContain("## Adoption metrics"); + expect(operatorWeeklyReportMarkdownText).toContain("## Operator detail"); + expect(operatorWeeklyReportMarkdownText).toContain("- Product events:"); + expect(operatorWeeklyReportMarkdownText).not.toMatch(FORBIDDEN_PUBLIC_REPORT_TERMS); }); it("covers live app auth, validation, and internal job queue edge routes", async () => { diff --git a/test/unit/weekly-value-report.test.ts b/test/unit/weekly-value-report.test.ts index 310b56dded..19d44c63fb 100644 --- a/test/unit/weekly-value-report.test.ts +++ b/test/unit/weekly-value-report.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { buildWeeklyValueReport, generateWeeklyValueReport } from "../../src/services/weekly-value-report"; +import { buildWeeklyValueReport, formatWeeklyValueReportMarkdown, generateWeeklyValueReport } from "../../src/services/weekly-value-report"; import type { InstallationHealthRecord, InstallationRecord, @@ -13,6 +13,9 @@ import type { import type { UpstreamStatus } from "../../src/upstream/ruleset"; import { createTestEnv } from "../helpers/d1"; +const FORBIDDEN_EXPORT_TERMS = + /wallet|hotkey|raw trust|trust[-\s]?score|payout|reward[-\s]?estimate|farming|private[-\s]?reviewability|public[-\s]?score[-\s]?(?:estimate|prediction)|private[-\s]?scoreability|scoreability/i; + describe("weekly value reports", () => { it("builds public-safe adoption and maintainer-value summaries from daily rollups", () => { const report = buildWeeklyValueReport({ @@ -87,6 +90,18 @@ describe("weekly value reports", () => { ); expect(report.freshness.warnings).toEqual(["Product usage rollups have 1 freshness warning(s)."]); expect(JSON.stringify(report)).not.toMatch(/wallet|hotkey|raw trust|payout|reward estimate|farming|private reviewability|public score estimate|\/Users|github_pat/i); + + const markdown = formatWeeklyValueReportMarkdown(report); + expect(markdown).toContain("# Weekly Gittensory value report"); + expect(markdown).toContain("## Adoption metrics"); + expect(markdown).toContain("## Miner utility"); + expect(markdown).toContain("## Maintainer trust"); + expect(markdown).toContain("## Repo-owner readiness"); + expect(markdown).toContain("## Known blockers"); + expect(markdown).toContain("- Active users: 4"); + expect(markdown).toContain("- PR packets: 3"); + expect(markdown).not.toContain("## Operator detail"); + expect(markdown).not.toMatch(FORBIDDEN_EXPORT_TERMS); }); it("adds operator details, freshness warnings, and redacts unsafe rollup dimensions", () => { @@ -97,8 +112,8 @@ describe("weekly value reports", () => { repositories: [repo("JSONbored/gittensory", true, true)], installations: [installation(1)], health: [health(1, "needs_attention")], - registry: registry(["source mirror stale"]), - scoring: scoring(["fallback model"]), + registry: registry(["source mirror stale", "wallet hotkey reward-estimate trust-score public score prediction private scoreability farming"]), + scoring: scoring(["fallback model", "private reviewability signal"]), upstreamDrift: upstream({ status: "drift_detected", openReportCount: 2 }), usageSummary: usageSummary({ totalEvents: 2, activeActors: 1 }), usageRollups: [ @@ -150,6 +165,14 @@ describe("weekly value reports", () => { ]), ); expect(JSON.stringify(report)).not.toMatch(/\/Users|github_pat|wallet|raw trust|abcdef/i); + + const markdown = formatWeeklyValueReportMarkdown(report); + expect(markdown).toContain("## Operator detail"); + expect(markdown).toContain("## Known blockers"); + expect(markdown).toContain("- Product events: 2"); + expect(markdown).toContain("Top repos: (2)"); + expect(markdown).toContain(""); + expect(markdown).not.toMatch(FORBIDDEN_EXPORT_TERMS); }); it("keeps clean complete windows marked ready", () => { @@ -169,6 +192,25 @@ describe("weekly value reports", () => { expect(report.period.days).toBe(1); expect(report.dataQuality).toEqual({ status: "ready", warnings: [] }); + + const markdown = formatWeeklyValueReportMarkdown({ + ...report, + summary: [], + metrics: [], + warnings: [], + freshness: { ...report.freshness, warnings: [] }, + operatorDetails: { + ...report.operatorDetails!, + topRepos: [], + topCommands: [], + topTools: [], + topRouteClasses: [], + }, + }); + expect(markdown).toContain("- No report data available."); + expect(markdown).toContain("- No rollup-backed metric is available for this section."); + expect(markdown).toContain("- No known blocker surfaced by the current report window."); + expect(markdown).toContain("## Operator detail"); }); it("normalizes report windows and records public scheduled generations without operator details", async () => { From 394565d5990d7aa343046016edf1482dbd07fd9d Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 14:02:18 +0200 Subject: [PATCH 2/4] fix(ci): restore validation checks --- apps/gittensory-ui/public/openapi.json | 7095 ++++++++++----------- apps/gittensory-ui/src/lib/mcp-package.ts | 2 +- src/openapi/spec.ts | 2 +- 3 files changed, 3548 insertions(+), 3551 deletions(-) diff --git a/apps/gittensory-ui/public/openapi.json b/apps/gittensory-ui/public/openapi.json index 2beae1ab1e..bef4cbed43 100644 --- a/apps/gittensory-ui/public/openapi.json +++ b/apps/gittensory-ui/public/openapi.json @@ -146,6 +146,59 @@ "generatedAt" ] }, + "RegistryRepo": { + "type": "object", + "properties": { + "repo": { + "type": "string" + }, + "emissionShare": { + "type": "number" + }, + "issueDiscoveryShare": { + "type": "number" + }, + "labelMultipliers": { + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "trustedLabelPipeline": { + "type": "boolean", + "nullable": true + }, + "maintainerCut": { + "type": "number" + }, + "defaultLabelMultiplier": { + "type": "number", + "nullable": true + }, + "fixedBaseScore": { + "type": "number", + "nullable": true + }, + "eligibilityMode": { + "type": "string", + "nullable": true + }, + "raw": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "required": [ + "repo", + "emissionShare", + "issueDiscoveryShare", + "labelMultipliers", + "maintainerCut", + "raw" + ] + }, "RegistrySnapshot": { "type": "object", "properties": { @@ -207,59 +260,6 @@ "repositories" ] }, - "RegistryRepo": { - "type": "object", - "properties": { - "repo": { - "type": "string" - }, - "emissionShare": { - "type": "number" - }, - "issueDiscoveryShare": { - "type": "number" - }, - "labelMultipliers": { - "type": "object", - "additionalProperties": { - "type": "number" - } - }, - "trustedLabelPipeline": { - "type": "boolean", - "nullable": true - }, - "maintainerCut": { - "type": "number" - }, - "defaultLabelMultiplier": { - "type": "number", - "nullable": true - }, - "fixedBaseScore": { - "type": "number", - "nullable": true - }, - "eligibilityMode": { - "type": "string", - "nullable": true - }, - "raw": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "required": [ - "repo", - "emissionShare", - "issueDiscoveryShare", - "labelMultipliers", - "maintainerCut", - "raw" - ] - }, "Repository": { "type": "object", "properties": { @@ -313,6 +313,40 @@ "isPrivate" ] }, + "Finding": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "title": { + "type": "string" + }, + "severity": { + "type": "string", + "enum": [ + "info", + "warning", + "critical" + ] + }, + "detail": { + "type": "string" + }, + "action": { + "type": "string" + }, + "publicText": { + "type": "string" + } + }, + "required": [ + "code", + "title", + "severity", + "detail" + ] + }, "Advisory": { "type": "object", "properties": { @@ -387,40 +421,6 @@ "generatedAt" ] }, - "Finding": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "title": { - "type": "string" - }, - "severity": { - "type": "string", - "enum": [ - "info", - "warning", - "critical" - ] - }, - "detail": { - "type": "string" - }, - "action": { - "type": "string" - }, - "publicText": { - "type": "string" - } - }, - "required": [ - "code", - "title", - "severity", - "detail" - ] - }, "WorkboardItem": { "type": "object", "properties": { @@ -560,6 +560,68 @@ "findings" ] }, + "CollisionItem": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "issue", + "pull_request" + ] + }, + "number": { + "type": "number" + }, + "title": { + "type": "string" + }, + "authorLogin": { + "type": "string", + "nullable": true + }, + "htmlUrl": { + "type": "string", + "nullable": true + } + }, + "required": [ + "type", + "number", + "title" + ] + }, + "CollisionCluster": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "risk": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "reason": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollisionItem" + } + } + }, + "required": [ + "id", + "risk", + "reason", + "items" + ] + }, "CollisionReport": { "type": "object", "properties": { @@ -602,66 +664,44 @@ "clusters" ] }, - "CollisionCluster": { + "LaneAdvice": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "risk": { + "lane": { "type": "string", "enum": [ - "low", - "medium", - "high" + "direct_pr", + "issue_discovery", + "split", + "inactive", + "unknown" ] }, - "reason": { + "repoFullName": { "type": "string" }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CollisionItem" - } - } - }, - "required": [ - "id", - "risk", - "reason", - "items" - ] - }, - "CollisionItem": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "issue", - "pull_request" - ] + "issueDiscoveryShare": { + "type": "number" }, - "number": { + "directPrShare": { "type": "number" }, - "title": { + "summary": { "type": "string" }, - "authorLogin": { - "type": "string", - "nullable": true + "contributorGuidance": { + "type": "string" }, - "htmlUrl": { - "type": "string", - "nullable": true + "maintainerGuidance": { + "type": "string" } }, "required": [ - "type", - "number", - "title" + "lane", + "repoFullName", + "summary", + "contributorGuidance", + "maintainerGuidance" ] }, "ConfigQuality": { @@ -725,46 +765,6 @@ "findings" ] }, - "LaneAdvice": { - "type": "object", - "properties": { - "lane": { - "type": "string", - "enum": [ - "direct_pr", - "issue_discovery", - "split", - "inactive", - "unknown" - ] - }, - "repoFullName": { - "type": "string" - }, - "issueDiscoveryShare": { - "type": "number" - }, - "directPrShare": { - "type": "number" - }, - "summary": { - "type": "string" - }, - "contributorGuidance": { - "type": "string" - }, - "maintainerGuidance": { - "type": "string" - } - }, - "required": [ - "lane", - "repoFullName", - "summary", - "contributorGuidance", - "maintainerGuidance" - ] - }, "LabelAudit": { "type": "object", "properties": { @@ -1901,208 +1901,91 @@ "summary" ] }, - "ContributorDecisionPack": { + "DecisionPackFreshness": { + "type": "string", + "enum": [ + "fresh", + "stale", + "rebuilding", + "missing" + ] + }, + "ContributorOpenPrNextStepPacket": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "ready" - ] - }, - "source": { - "type": "string", - "enum": [ - "computed", - "snapshot" - ] - }, - "login": { - "type": "string" - }, - "generatedAt": { + "repoFullName": { "type": "string" }, - "snapshotAgeSeconds": { + "number": { "type": "number" }, - "stale": { - "type": "boolean" - }, - "freshness": { - "$ref": "#/components/schemas/DecisionPackFreshness" - }, - "rebuildEnqueued": { - "type": "boolean" - }, - "scoringModelSnapshotId": { + "title": { "type": "string" }, - "profile": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "outcomeHistory": { - "$ref": "#/components/schemas/ContributorOutcomeHistory" - }, - "roleContexts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RoleContext" - } - }, - "opportunities": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ContributorOpportunity" - } - }, - "repoDecisions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "topActions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } + "classification": { + "type": "string", + "enum": [ + "approved", + "blocked", + "stale", + "needs_author", + "failing_checks", + "missing_tests", + "duplicate_prone", + "reviewable", + "should_close_or_withdraw", + "maintainer_lane", + "draft" + ] }, - "cleanupFirst": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } + "summary": { + "type": "string" }, - "pursueRepos": { + "reasons": { "type": "array", "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "type": "string" } }, - "avoidRepos": { + "nextSteps": { "type": "array", "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "type": "string" } + } + }, + "required": [ + "repoFullName", + "number", + "title", + "classification", + "summary", + "reasons", + "nextSteps" + ] + }, + "ContributorOpenPrMonitor": { + "type": "object", + "properties": { + "login": { + "type": "string" }, - "maintainerLaneRepos": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } + "generatedAt": { + "type": "string" }, - "scoreBlockers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } + "openPrCount": { + "type": "number" }, - "evidenceGraph": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "registeredRepoCount": { + "type": "number" }, - "dataQuality": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "cleanupFirst": { + "type": "boolean" }, "summary": { "type": "string" }, - "nextActions": { - "type": "array", - "items": { - "type": "string" - } - }, - "openPrMonitor": { - "$ref": "#/components/schemas/ContributorOpenPrMonitor" - } - }, - "required": [ - "status", - "source", - "login", - "generatedAt", - "stale", - "freshness", - "rebuildEnqueued", - "scoringModelSnapshotId", - "profile", - "outcomeHistory", - "roleContexts", - "opportunities", - "repoDecisions", - "topActions", - "cleanupFirst", - "pursueRepos", - "avoidRepos", - "maintainerLaneRepos", - "scoreBlockers", - "dataQuality", - "summary", - "nextActions" - ] - }, - "DecisionPackFreshness": { - "type": "string", - "enum": [ - "fresh", - "stale", - "rebuilding", - "missing" - ] - }, - "ContributorOpenPrMonitor": { - "type": "object", - "properties": { - "login": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "openPrCount": { - "type": "number" - }, - "registeredRepoCount": { - "type": "number" - }, - "cleanupFirst": { - "type": "boolean" - }, - "summary": { - "type": "string" - }, - "guidance": { + "guidance": { "type": "array", "items": { "type": "string" @@ -2213,58 +2096,175 @@ "pullRequests" ] }, - "ContributorOpenPrNextStepPacket": { + "ContributorDecisionPack": { "type": "object", "properties": { - "repoFullName": { + "status": { + "type": "string", + "enum": [ + "ready" + ] + }, + "source": { + "type": "string", + "enum": [ + "computed", + "snapshot" + ] + }, + "login": { "type": "string" }, - "number": { + "generatedAt": { + "type": "string" + }, + "snapshotAgeSeconds": { "type": "number" }, - "title": { - "type": "string" + "stale": { + "type": "boolean" }, - "classification": { - "type": "string", - "enum": [ - "approved", - "blocked", - "stale", - "needs_author", - "failing_checks", - "missing_tests", - "duplicate_prone", - "reviewable", - "should_close_or_withdraw", - "maintainer_lane", - "draft" - ] + "freshness": { + "$ref": "#/components/schemas/DecisionPackFreshness" }, - "summary": { + "rebuildEnqueued": { + "type": "boolean" + }, + "scoringModelSnapshotId": { "type": "string" }, - "reasons": { + "profile": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "outcomeHistory": { + "$ref": "#/components/schemas/ContributorOutcomeHistory" + }, + "roleContexts": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/RoleContext" } }, - "nextSteps": { + "opportunities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContributorOpportunity" + } + }, + "repoDecisions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "topActions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "cleanupFirst": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "pursueRepos": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "avoidRepos": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "maintainerLaneRepos": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "scoreBlockers": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "evidenceGraph": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "dataQuality": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "summary": { + "type": "string" + }, + "nextActions": { "type": "array", "items": { "type": "string" } + }, + "openPrMonitor": { + "$ref": "#/components/schemas/ContributorOpenPrMonitor" } }, "required": [ - "repoFullName", - "number", - "title", - "classification", + "status", + "source", + "login", + "generatedAt", + "stale", + "freshness", + "rebuildEnqueued", + "scoringModelSnapshotId", + "profile", + "outcomeHistory", + "roleContexts", + "opportunities", + "repoDecisions", + "topActions", + "cleanupFirst", + "pursueRepos", + "avoidRepos", + "maintainerLaneRepos", + "scoreBlockers", + "dataQuality", "summary", - "reasons", - "nextSteps" + "nextActions" ] }, "DecisionPackRefreshNeeded": { @@ -2366,20 +2366,80 @@ "dataQuality" ] }, - "RepoIntelligence": { + "BurdenForecast": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "ready" - ] + "repoFullName": { + "type": "string" }, - "source": { - "type": "string", - "enum": [ - "computed", - "snapshot" + "generatedAt": { + "type": "string" + }, + "horizonDays": { + "anyOf": [ + { + "type": "number", + "enum": [ + 7 + ] + }, + { + "type": "number", + "enum": [ + 30 + ] + } + ] + }, + "level": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "forecast": { + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "findings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Finding" + } + }, + "summary": { + "type": "string" + } + }, + "required": [ + "repoFullName", + "generatedAt", + "horizonDays", + "level", + "forecast", + "findings", + "summary" + ] + }, + "RepoIntelligence": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "ready" + ] + }, + "source": { + "type": "string", + "enum": [ + "computed", + "snapshot" ] }, "repoFullName": { @@ -2500,64 +2560,52 @@ "dataQuality" ] }, - "BurdenForecast": { + "RepoOutcomeEvidenceCompleteness": { "type": "object", "properties": { - "repoFullName": { - "type": "string" + "pullRequestsAnalyzed": { + "type": "number" }, - "generatedAt": { - "type": "string" + "withFileDetail": { + "type": "number" }, - "horizonDays": { - "anyOf": [ - { - "type": "number", - "enum": [ - 7 - ] - }, - { - "type": "number", - "enum": [ - 30 - ] - } - ] + "withReviewDetail": { + "type": "number" }, - "level": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "critical" - ] + "withCheckDetail": { + "type": "number" }, - "forecast": { - "type": "object", - "additionalProperties": { - "type": "number" - } + "filesCompletenessRatio": { + "type": "number" }, - "findings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Finding" - } + "reviewsCompletenessRatio": { + "type": "number" }, - "summary": { - "type": "string" + "checksCompletenessRatio": { + "type": "number" + }, + "fullyDecidedWithDetail": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "complete", + "partial", + "missing" + ] } }, "required": [ - "repoFullName", - "generatedAt", - "horizonDays", - "level", - "forecast", - "findings", - "summary" + "pullRequestsAnalyzed", + "withFileDetail", + "withReviewDetail", + "withCheckDetail", + "filesCompletenessRatio", + "reviewsCompletenessRatio", + "checksCompletenessRatio", + "fullyDecidedWithDetail", + "status" ] }, "RepoOutcomePatterns": { @@ -2655,54 +2703,6 @@ "summary" ] }, - "RepoOutcomeEvidenceCompleteness": { - "type": "object", - "properties": { - "pullRequestsAnalyzed": { - "type": "number" - }, - "withFileDetail": { - "type": "number" - }, - "withReviewDetail": { - "type": "number" - }, - "withCheckDetail": { - "type": "number" - }, - "filesCompletenessRatio": { - "type": "number" - }, - "reviewsCompletenessRatio": { - "type": "number" - }, - "checksCompletenessRatio": { - "type": "number" - }, - "fullyDecidedWithDetail": { - "type": "number" - }, - "status": { - "type": "string", - "enum": [ - "complete", - "partial", - "missing" - ] - } - }, - "required": [ - "pullRequestsAnalyzed", - "withFileDetail", - "withReviewDetail", - "withCheckDetail", - "filesCompletenessRatio", - "reviewsCompletenessRatio", - "checksCompletenessRatio", - "fullyDecidedWithDetail", - "status" - ] - }, "RepoOutcomePatternsResponse": { "type": "object", "properties": { @@ -3274,1489 +3274,613 @@ } ] }, - "LocalBranchAnalysis": { + "ScorePreviewResult": { "type": "object", "properties": { - "login": { - "type": "string" - }, "repoFullName": { "type": "string" }, "generatedAt": { "type": "string" }, - "baseRef": { + "scoringModelSnapshotId": { "type": "string" }, - "headRef": { - "type": "string" + "activeModel": { + "type": "string", + "enum": [ + "current_density_model", + "pending_saturation_model", + "exponential_saturation_model", + "unknown" + ] }, - "branchName": { - "type": "string" + "privateOnly": { + "type": "boolean", + "enum": [ + true + ] }, - "baseFreshness": { + "laneMath": { + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "scoreEstimate": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "fresh", - "stale", - "possibly_stale", - "unknown" - ] + "baseScore": { + "type": "number" }, - "baseRef": { - "type": "string" + "densityMultiplier": { + "type": "number" }, - "baseSha": { - "type": "string" + "contributionBonus": { + "type": "number" }, - "headSha": { - "type": "string" + "labelMultiplier": { + "type": "number" }, - "mergeBaseSha": { - "type": "string" + "issueMultiplier": { + "type": "number" }, - "remoteTrackingSha": { - "type": "string" + "credibilityMultiplier": { + "type": "number" }, - "changedFileCount": { + "reviewPenaltyMultiplier": { "type": "number" }, - "testFileCount": { + "openPrMultiplier": { "type": "number" }, - "passedValidationCount": { + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } + }, + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { "type": "number" }, + "reason": { + "type": "string" + }, "warnings": { "type": "array", "items": { "type": "string" } + } + }, + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" }, - "recommendation": { + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } + }, + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "branchEligibility": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + }, + "status": { + "type": "string", + "enum": [ + "eligible", + "ineligible", + "unknown", + "not_required" + ] + }, + "evidence": { + "type": "string", + "enum": [ + "provided", + "missing" + ] + }, + "source": { + "type": "string", + "enum": [ + "github_metadata", + "local_metadata", + "registry", + "user_supplied", + "missing" + ] + }, + "reason": { + "type": "string" + }, + "checkedAt": { "type": "string" + }, + "stale": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ + "required", "status", - "changedFileCount", - "testFileCount", - "passedValidationCount", + "evidence", + "source", + "stale", "warnings" ] }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "roleContext": { - "$ref": "#/components/schemas/RoleContext" + "effectiveEstimatedScore": { + "type": "number" }, - "preflight": { - "$ref": "#/components/schemas/LocalDiffPreflightResult" + "underlyingPotentialScore": { + "type": "number" }, - "scorePreview": { - "$ref": "#/components/schemas/ScorePreviewResult" + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } }, - "scenarioScorePreview": { - "type": "object", - "properties": { - "current": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" + "gateDeltas": { + "type": "array", + "items": { + "type": "object", + "properties": { + "gate": { + "type": "string", + "enum": [ + "open_pr_threshold", + "credibility_floor", + "linked_issue_multiplier" + ] + }, + "current": { + "type": "string" + }, + "projected": { + "type": "string" + }, + "explanation": { + "type": "string" + } + }, + "required": [ + "gate", + "current", + "projected", + "explanation" + ] + } + }, + "scenarioPreviews": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" } }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } }, - "gates": { + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { "type": "object", "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] }, - "credibilityFloor": { - "type": "number" + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] }, - "credibilityObserved": { - "type": "number" + "detail": { + "type": "string" } }, "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" + "code", + "severity", + "detail" ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" + } + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" ] - } - }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { "type": "number" - }, - "appliedMultiplier": { + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } } }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } }, - "deltaExplanation": { - "type": "string" - } + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" + "deltaExplanation": { + "type": "string" + } + }, + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" + ] + } + }, + "scoreabilityStatus": { + "type": "string", + "enum": [ + "blocked", + "conditionally_scoreable", + "scoreable", + "hold" + ] + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "recommendation": { + "type": "object", + "properties": { + "level": { + "type": "string", + "enum": [ + "strong_fit", + "reasonable_fit", + "needs_work", + "hold" ] }, - "bestReasonableCase": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } - }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" - } - }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } - }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] - }, - "deltaExplanation": { - "type": "string" - } - }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" - ] - }, - "afterPendingMerges": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } - }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" - } - }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } - }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] - }, - "deltaExplanation": { - "type": "string" - } - }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" - ] - }, - "afterApprovedPrsMerge": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } - }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" - } - }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } - }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] - }, - "deltaExplanation": { - "type": "string" - } - }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" - ] - }, - "afterStalePrsClose": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } - }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" - } - }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } - }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] - }, - "deltaExplanation": { - "type": "string" - } - }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" - ] - }, - "gateDeltas": { - "type": "array", - "items": { - "type": "object", - "properties": { - "gate": { - "type": "string", - "enum": [ - "open_pr_threshold", - "credibility_floor", - "linked_issue_multiplier" - ] - }, - "current": { - "type": "string" - }, - "projected": { - "type": "string" - }, - "explanation": { - "type": "string" - } - }, - "required": [ - "gate", - "current", - "projected", - "explanation" - ] - } - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } - } - }, - "required": [ - "current", - "bestReasonableCase", - "gateDeltas", - "blockedBy" - ] - }, - "observedPullRequestScenarios": { - "type": "object", - "properties": { - "approvedOrMergeable": { - "type": "number" - }, - "stale": { - "type": "number" - }, - "closed": { - "type": "number" - }, - "draft": { - "type": "number" - }, - "blocked": { - "type": "number" - }, - "maintainerLane": { - "type": "number" - }, - "notes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "approvedOrMergeable", - "stale", - "closed", - "draft", - "blocked", - "maintainerLane", - "notes" - ] - }, - "githubBranchStatus": { - "type": "object", - "properties": { - "source": { - "type": "string", - "enum": [ - "cached_github_data" - ] - }, - "status": { - "type": "string", - "enum": [ - "approved", - "failing_checks", - "needs_author", - "blocked", - "pending_review", - "no_pr", - "unknown" - ] - }, - "pullNumber": { - "type": "number" - }, - "title": { - "type": "string" - }, - "reviewDecision": { - "type": "string", - "nullable": true - }, - "mergeableState": { - "type": "string", - "nullable": true - }, - "notes": { + "actions": { "type": "array", "items": { "type": "string" @@ -4764,382 +3888,267 @@ } }, "required": [ - "source", - "status", - "notes" + "level", + "actions" ] - }, - "branchEligibility": { - "type": "object", - "properties": { - "required": { - "type": "boolean" - }, - "status": { - "type": "string", - "enum": [ - "eligible", - "ineligible", - "unknown", - "not_required" - ] - }, - "evidence": { - "type": "string", - "enum": [ - "provided", - "missing" - ] - }, - "source": { - "type": "string", - "enum": [ - "github_metadata", - "local_metadata", - "registry", - "user_supplied", - "missing" - ] - }, - "reason": { - "type": "string" - }, - "checkedAt": { - "type": "string" - }, - "stale": { - "type": "boolean" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "required", - "status", - "evidence", - "source", - "stale", - "warnings" + } + }, + "required": [ + "repoFullName", + "generatedAt", + "scoringModelSnapshotId", + "activeModel", + "privateOnly", + "laneMath", + "scoreEstimate", + "linkedIssueMultiplier", + "gates", + "branchEligibility", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "gateDeltas", + "scenarioPreviews", + "scoreabilityStatus", + "warnings", + "assumptions", + "recommendation" + ] + }, + "RewardRiskAction": { + "type": "object", + "properties": { + "actionKind": { + "type": "string", + "enum": [ + "cleanup_existing_prs", + "land_existing_prs", + "close_or_withdraw_low_fit_prs", + "open_new_direct_pr", + "file_issue_discovery", + "maintainer_lane_improve_repo", + "maintainer_cut_readiness" ] }, - "rewardRisk": { - "$ref": "#/components/schemas/RepoRewardRisk" + "repoFullName": { + "type": "string" }, - "scoreBlockers": { - "type": "array", - "items": { - "type": "string" - } + "priorityScore": { + "type": "number" }, - "branchQualityBlockers": { + "laneValueScore": { + "type": "number" + }, + "scoreabilityScore": { + "type": "number" + }, + "personalFitScore": { + "type": "number" + }, + "riskPenalty": { + "type": "number" + }, + "maintainerFrictionPenalty": { + "type": "number" + }, + "actionLeverageScore": { + "type": "number" + }, + "whyThisHelps": { "type": "array", "items": { "type": "string" } }, - "accountStateBlockers": { + "nextActions": { "type": "array", "items": { "type": "string" } + } + }, + "required": [ + "actionKind", + "repoFullName", + "priorityScore", + "laneValueScore", + "scoreabilityScore", + "personalFitScore", + "riskPenalty", + "maintainerFrictionPenalty", + "actionLeverageScore", + "whyThisHelps", + "nextActions" + ] + }, + "RepoRewardRisk": { + "type": "object", + "properties": { + "login": { + "type": "string" }, - "recommendedRerunCondition": { + "repoFullName": { "type": "string" }, - "localFindings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Finding" - } + "generatedAt": { + "type": "string" }, - "maintainerFit": { - "type": "object", - "properties": { - "recommendation": { - "type": "string", - "enum": [ - "pursue", - "cleanup_first", - "maintainer_lane", - "avoid_for_now", - "unknown" - ] - }, - "reviewBurden": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "role": { - "type": "string", - "enum": [ - "outside_contributor", - "repo_maintainer", - "org_member", - "collaborator", - "owner", - "unknown" - ] - }, - "maintainerLane": { - "type": "boolean" - }, - "reasons": { - "type": "array", - "items": { - "type": "string" - } - }, - "risks": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "recommendation", - "reviewBurden", - "role", - "maintainerLane", - "reasons", - "risks" + "roleContext": { + "$ref": "#/components/schemas/RoleContext" + }, + "lane": { + "$ref": "#/components/schemas/LaneAdvice" + }, + "recommendation": { + "type": "string", + "enum": [ + "pursue", + "cleanup_first", + "maintainer_lane", + "avoid_for_now", + "unknown" ] }, - "manifestGuidance": { + "rewardUpside": { "type": "object", "properties": { - "present": { - "type": "boolean" - }, - "source": { + "relevantLane": { "type": "string", "enum": [ - "repo_file", - "api_record", + "direct_pr", + "issue_discovery", + "maintainer_lane", "none" ] }, - "linkedIssuePolicy": { - "type": "string", - "enum": [ - "required", - "preferred", - "optional" - ] - }, - "issueDiscoveryPolicy": { - "type": "string", - "enum": [ - "encouraged", - "neutral", - "discouraged" - ] - }, - "matchedWantedPaths": { - "type": "array", - "items": { - "type": "string" - } - }, - "matchedBlockedPaths": { - "type": "array", - "items": { - "type": "string" - } + "repoSlice": { + "type": "number" }, - "preferredLabelHits": { - "type": "array", - "items": { - "type": "string" - } + "directPrSlice": { + "type": "number" }, - "findings": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "severity": { - "type": "string", - "enum": [ - "info", - "warning", - "critical" - ] - }, - "title": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "action": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "title", - "detail" - ] - } + "issueDiscoverySlice": { + "type": "number" }, - "publicNextSteps": { - "type": "array", - "items": { - "type": "string" - } + "maintainerCutSlice": { + "type": "number" }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } + "labelMultiplier": { + "type": "number" }, - "summary": { - "type": "string" + "issueMultiplier": { + "type": "number" + }, + "estimatedScoreIfClean": { + "type": "number" + }, + "currentEstimatedScore": { + "type": "number" } }, "required": [ - "present", - "source", - "linkedIssuePolicy", - "issueDiscoveryPolicy", - "matchedWantedPaths", - "matchedBlockedPaths", - "preferredLabelHits", - "findings", - "publicNextSteps", - "warnings", - "summary" + "relevantLane", + "repoSlice", + "directPrSlice", + "issueDiscoverySlice", + "maintainerCutSlice", + "labelMultiplier", + "issueMultiplier", + "estimatedScoreIfClean", + "currentEstimatedScore" ] }, - "prPacket": { + "scoreBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "riskBreakdown": { "type": "object", "properties": { - "titleSuggestion": { - "type": "string" + "queueBurden": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] }, - "markdown": { - "type": "string" + "queueBurdenScore": { + "type": "number" }, - "bodySections": { - "type": "array", - "items": { - "type": "object", - "properties": { - "heading": { - "type": "string" - }, - "lines": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "heading", - "lines" - ] - } + "duplicateClusters": { + "type": "number" }, - "reviewerNotes": { - "type": "array", - "items": { - "type": "string" - } + "highRiskDuplicateClusters": { + "type": "number" }, - "validationSummary": { - "type": "object", - "properties": { - "passed": { - "type": "number" - }, - "failed": { - "type": "number" - }, - "notRun": { - "type": "number" - }, - "commands": { - "type": "array", - "items": { - "type": "object", - "properties": { - "command": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "passed", - "failed", - "not_run", - "skipped", - "focused", - "unknown" - ] - }, - "summary": { - "type": "string" - }, - "durationMs": { - "type": "number" - }, - "exitCode": { - "type": "number" - } - }, - "required": [ - "command", - "status" - ] - } - } - }, - "required": [ - "passed", - "failed", - "notRun", - "commands" - ] + "closedPullRequestRate": { + "type": "number" }, - "publicSafeWarnings": { - "type": "array", - "items": { - "type": "string" - } + "openPullRequests": { + "type": "number" + }, + "credibility": { + "type": "number" + }, + "reviewChurnRisk": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] } }, "required": [ - "titleSuggestion", - "markdown", - "bodySections", - "reviewerNotes", - "validationSummary", - "publicSafeWarnings" + "queueBurden", + "queueBurdenScore", + "duplicateClusters", + "highRiskDuplicateClusters", + "closedPullRequestRate", + "openPullRequests", + "credibility", + "reviewChurnRisk" ] }, - "nextActions": { + "actionImpact": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "currentPreview": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "afterCleanupPreview": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "actions": { "type": "array", "items": { "$ref": "#/components/schemas/RewardRiskAction" } }, - "workspaceIntelligence": { - "$ref": "#/components/schemas/LocalWorkspaceIntelligence" + "whyThisHelps": { + "type": "array", + "items": { + "type": "string" + } + }, + "nextActions": { + "type": "array", + "items": { + "type": "string" + } }, "summary": { "type": "string" @@ -5149,997 +4158,1824 @@ "login", "repoFullName", "generatedAt", - "baseFreshness", - "lane", "roleContext", - "preflight", - "scorePreview", - "scenarioScorePreview", - "observedPullRequestScenarios", - "githubBranchStatus", - "branchEligibility", - "rewardRisk", - "scoreBlockers", - "branchQualityBlockers", - "accountStateBlockers", - "recommendedRerunCondition", - "localFindings", - "maintainerFit", - "manifestGuidance", - "prPacket", - "nextActions", - "workspaceIntelligence", - "summary" - ] - }, - "ScorePreviewResult": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "scoringModelSnapshotId": { - "type": "string" - }, - "activeModel": { - "type": "string", - "enum": [ - "current_density_model", - "pending_saturation_model", - "exponential_saturation_model", - "unknown" - ] - }, - "privateOnly": { - "type": "boolean", + "lane", + "recommendation", + "rewardUpside", + "scoreBlockers", + "riskBreakdown", + "actionImpact", + "currentPreview", + "afterCleanupPreview", + "actions", + "whyThisHelps", + "nextActions", + "summary" + ] + }, + "LocalWorkspaceIntelligence": { + "type": "object", + "properties": { + "version": { + "type": "number", "enum": [ - true + 2 ] }, - "laneMath": { + "sourceUpload": { "type": "object", - "additionalProperties": { - "type": "number" - } + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + false + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "enabled", + "detail" + ] }, - "scoreEstimate": { + "branch": { "type": "object", "properties": { - "baseScore": { - "type": "number" + "name": { + "type": "string" }, - "densityMultiplier": { - "type": "number" + "baseRef": { + "type": "string" }, - "contributionBonus": { - "type": "number" + "headSha": { + "type": "string" }, - "labelMultiplier": { + "pendingCommitCount": { "type": "number" - }, - "issueMultiplier": { + } + }, + "required": [ + "pendingCommitCount" + ] + }, + "changedFiles": { + "type": "object", + "properties": { + "total": { "type": "number" }, - "credibilityMultiplier": { + "added": { "type": "number" }, - "reviewPenaltyMultiplier": { + "modified": { "type": "number" }, - "openPrMultiplier": { + "deleted": { "type": "number" }, - "estimatedMergedScore": { + "renamed": { "type": "number" }, - "pendingSaturationScore": { + "binary": { "type": "number" + }, + "paths": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" + "total", + "added", + "modified", + "deleted", + "renamed", + "binary", + "paths" ] }, - "linkedIssueMultiplier": { + "testEvidence": { "type": "object", "properties": { - "mode": { + "level": { "type": "string", "enum": [ - "none", - "standard", - "maintainer" + "test_files", + "validation_commands", + "both", + "none" ] }, + "testFileCount": { + "type": "number" + }, + "passedValidationCount": { + "type": "number" + }, + "commands": { + "type": "array", + "items": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "passed", + "failed", + "not_run" + ] + }, + "summary": { + "type": "string" + } + }, + "required": [ + "command", + "status" + ] + } + } + }, + "required": [ + "level", + "testFileCount", + "passedValidationCount", + "commands" + ] + }, + "linkedIssues": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseFreshness": { + "type": "object", + "properties": { "status": { "type": "string", "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" + "fresh", + "stale", + "possibly_stale", + "unknown" ] }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] + "baseRef": { + "type": "string" }, - "eligible": { - "type": "boolean" + "baseSha": { + "type": "string" }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } + "headSha": { + "type": "string" }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } + "mergeBaseSha": { + "type": "string" }, - "baseMultiplier": { + "remoteTrackingSha": { + "type": "string" + }, + "changedFileCount": { "type": "number" }, - "appliedMultiplier": { + "testFileCount": { "type": "number" }, - "reason": { - "type": "string" + "passedValidationCount": { + "type": "number" }, "warnings": { "type": "array", "items": { "type": "string" } + }, + "recommendation": { + "type": "string" } }, "required": [ - "mode", "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", + "changedFileCount", + "testFileCount", + "passedValidationCount", "warnings" ] }, - "gates": { + "ciStatusHints": { + "type": "array", + "items": { + "type": "string" + } + }, + "localScorerDiagnostics": { "type": "object", "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" + "mode": { + "type": "string" }, - "collateralFraction": { - "type": "number" + "activeModel": { + "type": "string" }, - "credibilityFloor": { - "type": "number" + "warnings": { + "type": "array", + "items": { + "type": "string" + } }, - "credibilityObserved": { - "type": "number" + "metadataOnly": { + "type": "boolean" } }, "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" + "mode", + "warnings", + "metadataOnly" ] }, - "branchEligibility": { + "blockers": { "type": "object", "properties": { - "required": { - "type": "boolean" + "branchQuality": { + "type": "array", + "items": { + "type": "string" + } }, + "accountState": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "branchQuality", + "accountState" + ] + }, + "rerunWhen": { + "type": "string" + } + }, + "required": [ + "version", + "sourceUpload", + "branch", + "changedFiles", + "testEvidence", + "linkedIssues", + "baseFreshness", + "ciStatusHints", + "blockers", + "rerunWhen" + ] + }, + "LocalBranchAnalysis": { + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "repoFullName": { + "type": "string" + }, + "generatedAt": { + "type": "string" + }, + "baseRef": { + "type": "string" + }, + "headRef": { + "type": "string" + }, + "branchName": { + "type": "string" + }, + "baseFreshness": { + "type": "object", + "properties": { "status": { "type": "string", "enum": [ - "eligible", - "ineligible", - "unknown", - "not_required" + "fresh", + "stale", + "possibly_stale", + "unknown" ] }, - "evidence": { - "type": "string", - "enum": [ - "provided", - "missing" - ] + "baseRef": { + "type": "string" }, - "source": { - "type": "string", - "enum": [ - "github_metadata", - "local_metadata", - "registry", - "user_supplied", - "missing" - ] + "baseSha": { + "type": "string" }, - "reason": { + "headSha": { "type": "string" }, - "checkedAt": { + "mergeBaseSha": { "type": "string" }, - "stale": { - "type": "boolean" + "remoteTrackingSha": { + "type": "string" + }, + "changedFileCount": { + "type": "number" + }, + "testFileCount": { + "type": "number" + }, + "passedValidationCount": { + "type": "number" }, "warnings": { "type": "array", "items": { "type": "string" } + }, + "recommendation": { + "type": "string" } }, "required": [ - "required", "status", - "evidence", - "source", - "stale", + "changedFileCount", + "testFileCount", + "passedValidationCount", "warnings" ] }, - "effectiveEstimatedScore": { - "type": "number" + "lane": { + "$ref": "#/components/schemas/LaneAdvice" }, - "underlyingPotentialScore": { - "type": "number" + "roleContext": { + "$ref": "#/components/schemas/RoleContext" }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } + "preflight": { + "$ref": "#/components/schemas/LocalDiffPreflightResult" }, - "gateDeltas": { - "type": "array", - "items": { - "type": "object", - "properties": { - "gate": { - "type": "string", - "enum": [ - "open_pr_threshold", - "credibility_floor", - "linked_issue_multiplier" - ] - }, - "current": { - "type": "string" - }, - "projected": { - "type": "string" + "scorePreview": { + "$ref": "#/components/schemas/ScorePreviewResult" + }, + "scenarioScorePreview": { + "type": "object", + "properties": { + "current": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } + }, + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } + }, + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "deltaExplanation": { + "type": "string" + } }, - "explanation": { - "type": "string" - } + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" + ] }, - "required": [ - "gate", - "current", - "projected", - "explanation" - ] - } - }, - "scenarioPreviews": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { + "bestReasonableCase": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } + }, + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } + }, + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "deltaExplanation": { "type": "string" } }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" + ] + }, + "afterPendingMerges": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } }, - "labelMultiplier": { - "type": "number" + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } }, - "issueMultiplier": { - "type": "number" + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } }, - "credibilityMultiplier": { - "type": "number" + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "deltaExplanation": { + "type": "string" + } + }, + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" + ] + }, + "afterApprovedPrsMerge": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } }, - "reviewPenaltyMultiplier": { - "type": "number" + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } }, - "openPrMultiplier": { - "type": "number" + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } }, - "estimatedMergedScore": { - "type": "number" + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "deltaExplanation": { + "type": "string" + } + }, + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" + ] + }, + "afterStalePrsClose": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } }, - "pendingSaturationScore": { - "type": "number" - } + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } }, - "credibilityObserved": { - "type": "number" + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] } }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { + "linkedIssueMultiplier": { "type": "object", "properties": { - "code": { + "mode": { "type": "string", "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" + "none", + "standard", + "maintainer" ] }, - "severity": { + "status": { "type": "string", "enum": [ - "blocker", - "reducer", - "context" + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" ] }, - "detail": { + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "code", - "severity", - "detail" + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" ] + }, + "deltaExplanation": { + "type": "string" } }, - "linkedIssueMultiplier": { + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" + ] + }, + "gateDeltas": { + "type": "array", + "items": { "type": "object", "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { + "gate": { "type": "string", "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" + "open_pr_threshold", + "credibility_floor", + "linked_issue_multiplier" ] }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" + "current": { + "type": "string" }, - "reason": { + "projected": { "type": "string" }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } + "explanation": { + "type": "string" } }, "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" + "gate", + "current", + "projected", + "explanation" ] - }, - "deltaExplanation": { - "type": "string" } }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" - ] - } - }, - "scoreabilityStatus": { - "type": "string", - "enum": [ - "blocked", - "conditionally_scoreable", - "scoreable", - "hold" - ] - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "recommendation": { - "type": "object", - "properties": { - "level": { - "type": "string", - "enum": [ - "strong_fit", - "reasonable_fit", - "needs_work", - "hold" - ] - }, - "actions": { + "blockedBy": { "type": "array", "items": { - "type": "string" - } - } - }, - "required": [ - "level", - "actions" - ] - } - }, - "required": [ - "repoFullName", - "generatedAt", - "scoringModelSnapshotId", - "activeModel", - "privateOnly", - "laneMath", - "scoreEstimate", - "linkedIssueMultiplier", - "gates", - "branchEligibility", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "gateDeltas", - "scenarioPreviews", - "scoreabilityStatus", - "warnings", - "assumptions", - "recommendation" - ] - }, - "RepoRewardRisk": { - "type": "object", - "properties": { - "login": { - "type": "string" - }, - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "roleContext": { - "$ref": "#/components/schemas/RoleContext" - }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "recommendation": { - "type": "string", - "enum": [ - "pursue", - "cleanup_first", - "maintainer_lane", - "avoid_for_now", - "unknown" - ] - }, - "rewardUpside": { - "type": "object", - "properties": { - "relevantLane": { - "type": "string", - "enum": [ - "direct_pr", - "issue_discovery", - "maintainer_lane", - "none" - ] - }, - "repoSlice": { - "type": "number" - }, - "directPrSlice": { - "type": "number" - }, - "issueDiscoverySlice": { - "type": "number" - }, - "maintainerCutSlice": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "estimatedScoreIfClean": { - "type": "number" - }, - "currentEstimatedScore": { - "type": "number" + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } } }, "required": [ - "relevantLane", - "repoSlice", - "directPrSlice", - "issueDiscoverySlice", - "maintainerCutSlice", - "labelMultiplier", - "issueMultiplier", - "estimatedScoreIfClean", - "currentEstimatedScore" + "current", + "bestReasonableCase", + "gateDeltas", + "blockedBy" ] }, - "scoreBlockers": { - "type": "array", - "items": { - "type": "string" - } - }, - "riskBreakdown": { + "observedPullRequestScenarios": { "type": "object", "properties": { - "queueBurden": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "critical" - ] - }, - "queueBurdenScore": { + "approvedOrMergeable": { "type": "number" }, - "duplicateClusters": { + "stale": { "type": "number" }, - "highRiskDuplicateClusters": { + "closed": { "type": "number" }, - "closedPullRequestRate": { + "draft": { "type": "number" }, - "openPullRequests": { + "blocked": { "type": "number" }, - "credibility": { + "maintainerLane": { "type": "number" }, - "reviewChurnRisk": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] + "notes": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "queueBurden", - "queueBurdenScore", - "duplicateClusters", - "highRiskDuplicateClusters", - "closedPullRequestRate", - "openPullRequests", - "credibility", - "reviewChurnRisk" - ] - }, - "actionImpact": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "currentPreview": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "afterCleanupPreview": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "actions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RewardRiskAction" - } - }, - "whyThisHelps": { - "type": "array", - "items": { - "type": "string" - } - }, - "nextActions": { - "type": "array", - "items": { - "type": "string" - } - }, - "summary": { - "type": "string" - } - }, - "required": [ - "login", - "repoFullName", - "generatedAt", - "roleContext", - "lane", - "recommendation", - "rewardUpside", - "scoreBlockers", - "riskBreakdown", - "actionImpact", - "currentPreview", - "afterCleanupPreview", - "actions", - "whyThisHelps", - "nextActions", - "summary" - ] - }, - "RewardRiskAction": { - "type": "object", - "properties": { - "actionKind": { - "type": "string", - "enum": [ - "cleanup_existing_prs", - "land_existing_prs", - "close_or_withdraw_low_fit_prs", - "open_new_direct_pr", - "file_issue_discovery", - "maintainer_lane_improve_repo", - "maintainer_cut_readiness" - ] - }, - "repoFullName": { - "type": "string" - }, - "priorityScore": { - "type": "number" - }, - "laneValueScore": { - "type": "number" - }, - "scoreabilityScore": { - "type": "number" - }, - "personalFitScore": { - "type": "number" - }, - "riskPenalty": { - "type": "number" - }, - "maintainerFrictionPenalty": { - "type": "number" - }, - "actionLeverageScore": { - "type": "number" - }, - "whyThisHelps": { - "type": "array", - "items": { - "type": "string" - } - }, - "nextActions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "actionKind", - "repoFullName", - "priorityScore", - "laneValueScore", - "scoreabilityScore", - "personalFitScore", - "riskPenalty", - "maintainerFrictionPenalty", - "actionLeverageScore", - "whyThisHelps", - "nextActions" - ] - }, - "LocalWorkspaceIntelligence": { - "type": "object", - "properties": { - "version": { - "type": "number", - "enum": [ - 2 + "approvedOrMergeable", + "stale", + "closed", + "draft", + "blocked", + "maintainerLane", + "notes" ] }, - "sourceUpload": { + "githubBranchStatus": { "type": "object", "properties": { - "enabled": { - "type": "boolean", + "source": { + "type": "string", "enum": [ - false + "cached_github_data" ] }, - "detail": { - "type": "string" - } - }, - "required": [ - "enabled", - "detail" - ] - }, - "branch": { - "type": "object", - "properties": { - "name": { - "type": "string" + "status": { + "type": "string", + "enum": [ + "approved", + "failing_checks", + "needs_author", + "blocked", + "pending_review", + "no_pr", + "unknown" + ] }, - "baseRef": { + "pullNumber": { + "type": "number" + }, + "title": { "type": "string" }, - "headSha": { - "type": "string" + "reviewDecision": { + "type": "string", + "nullable": true + }, + "mergeableState": { + "type": "string", + "nullable": true }, - "pendingCommitCount": { - "type": "number" + "notes": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "pendingCommitCount" + "source", + "status", + "notes" ] }, - "changedFiles": { + "branchEligibility": { "type": "object", "properties": { - "total": { - "type": "number" + "required": { + "type": "boolean" }, - "added": { - "type": "number" + "status": { + "type": "string", + "enum": [ + "eligible", + "ineligible", + "unknown", + "not_required" + ] }, - "modified": { - "type": "number" + "evidence": { + "type": "string", + "enum": [ + "provided", + "missing" + ] }, - "deleted": { - "type": "number" + "source": { + "type": "string", + "enum": [ + "github_metadata", + "local_metadata", + "registry", + "user_supplied", + "missing" + ] }, - "renamed": { - "type": "number" + "reason": { + "type": "string" }, - "binary": { - "type": "number" + "checkedAt": { + "type": "string" }, - "paths": { + "stale": { + "type": "boolean" + }, + "warnings": { "type": "array", "items": { "type": "string" @@ -6147,108 +5983,188 @@ } }, "required": [ - "total", - "added", - "modified", - "deleted", - "renamed", - "binary", - "paths" + "required", + "status", + "evidence", + "source", + "stale", + "warnings" ] }, - "testEvidence": { + "rewardRisk": { + "$ref": "#/components/schemas/RepoRewardRisk" + }, + "scoreBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "branchQualityBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "accountStateBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "recommendedRerunCondition": { + "type": "string" + }, + "localFindings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Finding" + } + }, + "maintainerFit": { "type": "object", "properties": { - "level": { + "recommendation": { "type": "string", "enum": [ - "test_files", - "validation_commands", - "both", - "none" + "pursue", + "cleanup_first", + "maintainer_lane", + "avoid_for_now", + "unknown" ] }, - "testFileCount": { - "type": "number" + "reviewBurden": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] }, - "passedValidationCount": { - "type": "number" + "role": { + "type": "string", + "enum": [ + "outside_contributor", + "repo_maintainer", + "org_member", + "collaborator", + "owner", + "unknown" + ] }, - "commands": { + "maintainerLane": { + "type": "boolean" + }, + "reasons": { "type": "array", "items": { - "type": "object", - "properties": { - "command": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "passed", - "failed", - "not_run" - ] - }, - "summary": { - "type": "string" - } - }, - "required": [ - "command", - "status" - ] + "type": "string" + } + }, + "risks": { + "type": "array", + "items": { + "type": "string" } } }, "required": [ - "level", - "testFileCount", - "passedValidationCount", - "commands" + "recommendation", + "reviewBurden", + "role", + "maintainerLane", + "reasons", + "risks" ] }, - "linkedIssues": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseFreshness": { + "manifestGuidance": { "type": "object", "properties": { - "status": { + "present": { + "type": "boolean" + }, + "source": { "type": "string", "enum": [ - "fresh", - "stale", - "possibly_stale", - "unknown" + "repo_file", + "api_record", + "none" ] }, - "baseRef": { - "type": "string" - }, - "baseSha": { - "type": "string" + "linkedIssuePolicy": { + "type": "string", + "enum": [ + "required", + "preferred", + "optional" + ] }, - "headSha": { - "type": "string" + "issueDiscoveryPolicy": { + "type": "string", + "enum": [ + "encouraged", + "neutral", + "discouraged" + ] }, - "mergeBaseSha": { - "type": "string" + "matchedWantedPaths": { + "type": "array", + "items": { + "type": "string" + } }, - "remoteTrackingSha": { - "type": "string" + "matchedBlockedPaths": { + "type": "array", + "items": { + "type": "string" + } }, - "changedFileCount": { - "type": "number" + "preferredLabelHits": { + "type": "array", + "items": { + "type": "string" + } }, - "testFileCount": { - "type": "number" + "findings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "severity": { + "type": "string", + "enum": [ + "info", + "warning", + "critical" + ] + }, + "title": { + "type": "string" + }, + "detail": { + "type": "string" + }, + "action": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "title", + "detail" + ] + } }, - "passedValidationCount": { - "type": "number" + "publicNextSteps": { + "type": "array", + "items": { + "type": "string" + } }, "warnings": { "type": "array", @@ -6256,59 +6172,116 @@ "type": "string" } }, - "recommendation": { + "summary": { "type": "string" } }, "required": [ - "status", - "changedFileCount", - "testFileCount", - "passedValidationCount", - "warnings" + "present", + "source", + "linkedIssuePolicy", + "issueDiscoveryPolicy", + "matchedWantedPaths", + "matchedBlockedPaths", + "preferredLabelHits", + "findings", + "publicNextSteps", + "warnings", + "summary" ] }, - "ciStatusHints": { - "type": "array", - "items": { - "type": "string" - } - }, - "localScorerDiagnostics": { + "prPacket": { "type": "object", "properties": { - "mode": { + "titleSuggestion": { "type": "string" }, - "activeModel": { + "markdown": { "type": "string" }, - "warnings": { + "bodySections": { "type": "array", "items": { - "type": "string" + "type": "object", + "properties": { + "heading": { + "type": "string" + }, + "lines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "heading", + "lines" + ] } }, - "metadataOnly": { - "type": "boolean" - } - }, - "required": [ - "mode", - "warnings", - "metadataOnly" - ] - }, - "blockers": { - "type": "object", - "properties": { - "branchQuality": { + "reviewerNotes": { "type": "array", "items": { "type": "string" } }, - "accountState": { + "validationSummary": { + "type": "object", + "properties": { + "passed": { + "type": "number" + }, + "failed": { + "type": "number" + }, + "notRun": { + "type": "number" + }, + "commands": { + "type": "array", + "items": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "passed", + "failed", + "not_run", + "skipped", + "focused", + "unknown" + ] + }, + "summary": { + "type": "string" + }, + "durationMs": { + "type": "number" + }, + "exitCode": { + "type": "number" + } + }, + "required": [ + "command", + "status" + ] + } + } + }, + "required": [ + "passed", + "failed", + "notRun", + "commands" + ] + }, + "publicSafeWarnings": { "type": "array", "items": { "type": "string" @@ -6316,25 +6289,52 @@ } }, "required": [ - "branchQuality", - "accountState" + "titleSuggestion", + "markdown", + "bodySections", + "reviewerNotes", + "validationSummary", + "publicSafeWarnings" ] }, - "rerunWhen": { + "nextActions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RewardRiskAction" + } + }, + "workspaceIntelligence": { + "$ref": "#/components/schemas/LocalWorkspaceIntelligence" + }, + "summary": { "type": "string" } }, "required": [ - "version", - "sourceUpload", - "branch", - "changedFiles", - "testEvidence", - "linkedIssues", + "login", + "repoFullName", + "generatedAt", "baseFreshness", - "ciStatusHints", - "blockers", - "rerunWhen" + "lane", + "roleContext", + "preflight", + "scorePreview", + "scenarioScorePreview", + "observedPullRequestScenarios", + "githubBranchStatus", + "branchEligibility", + "rewardRisk", + "scoreBlockers", + "branchQualityBlockers", + "accountStateBlockers", + "recommendedRerunCondition", + "localFindings", + "maintainerFit", + "manifestGuidance", + "prPacket", + "nextActions", + "workspaceIntelligence", + "summary" ] }, "MaintainerPacket": { @@ -6410,56 +6410,6 @@ "suggestedActions" ] }, - "MaintainerLaneReport": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "maintainerCut": { - "type": "number" - }, - "maintainerCutConfigured": { - "type": "boolean" - }, - "queueHealth": { - "$ref": "#/components/schemas/QueueHealth" - }, - "configQuality": { - "$ref": "#/components/schemas/ConfigQuality" - }, - "contributorIntakeHealth": { - "$ref": "#/components/schemas/ContributorIntakeHealth" - }, - "summary": { - "type": "string" - }, - "findings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Finding" - } - } - }, - "required": [ - "repoFullName", - "generatedAt", - "lane", - "maintainerCut", - "maintainerCutConfigured", - "queueHealth", - "configQuality", - "contributorIntakeHealth", - "summary", - "findings" - ] - }, "ContributorIntakeHealth": { "type": "object", "properties": { @@ -6525,6 +6475,56 @@ "findings" ] }, + "MaintainerLaneReport": { + "type": "object", + "properties": { + "repoFullName": { + "type": "string" + }, + "generatedAt": { + "type": "string" + }, + "lane": { + "$ref": "#/components/schemas/LaneAdvice" + }, + "maintainerCut": { + "type": "number" + }, + "maintainerCutConfigured": { + "type": "boolean" + }, + "queueHealth": { + "$ref": "#/components/schemas/QueueHealth" + }, + "configQuality": { + "$ref": "#/components/schemas/ConfigQuality" + }, + "contributorIntakeHealth": { + "$ref": "#/components/schemas/ContributorIntakeHealth" + }, + "summary": { + "type": "string" + }, + "findings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Finding" + } + } + }, + "required": [ + "repoFullName", + "generatedAt", + "lane", + "maintainerCut", + "maintainerCutConfigured", + "queueHealth", + "configQuality", + "contributorIntakeHealth", + "summary", + "findings" + ] + }, "MaintainerCutReadiness": { "type": "object", "properties": { @@ -7240,8 +7240,7 @@ "bot_author", "maintainer_author", "miner_detection_unavailable", - "not_official_gittensor_miner", - null + "not_official_gittensor_miner" ] }, "actions": { @@ -8016,251 +8015,63 @@ }, "currentAccess": { "type": "string" - }, - "ok": { - "type": "boolean" - }, - "action": { - "type": "string" - } - }, - "required": [ - "permission", - "requiredAccess", - "currentAccess", - "ok", - "action" - ] - } - }, - "eventRemediation": { - "type": "array", - "items": { - "type": "object", - "properties": { - "event": { - "type": "string" - }, - "ok": { - "type": "boolean" - }, - "action": { - "type": "string" - } - }, - "required": [ - "event", - "ok", - "action" - ] - } - }, - "repairSteps": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "installationId", - "accountLogin", - "installedReposCount", - "registeredInstalledCount", - "status", - "missingPermissions", - "missingEvents", - "permissions", - "events", - "checkedAt" - ] - }, - "SyncStatus": { - "type": "object", - "properties": { - "generatedAt": { - "type": "string" - }, - "signalFidelity": { - "$ref": "#/components/schemas/SignalFidelity" - }, - "freshnessSlo": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "fresh", - "degraded", - "blocked" - ] - }, - "generatedAt": { - "type": "string" - }, - "staleCount": { - "type": "number" - }, - "degradedCount": { - "type": "number" - }, - "blockedCount": { - "type": "number" - }, - "missingCount": { - "type": "number" - }, - "launchBlockingCount": { - "type": "number" - }, - "repairRecommended": { - "type": "boolean" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "area": { - "type": "string" - }, - "targetKey": { - "type": "string" - }, - "status": { - "type": "string" - }, - "launchBlocking": { - "type": "boolean" - }, - "ageSeconds": { - "type": "number" - }, - "sloSeconds": { - "type": "number" - }, - "breachSeconds": { - "type": "number" - }, - "observedAt": { - "type": "string", - "nullable": true - }, - "summary": { - "type": "string" - } - }, - "required": [ - "area", - "targetKey", - "status", - "launchBlocking", - "sloSeconds", - "summary" - ] - } - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "status", - "generatedAt", - "staleCount", - "degradedCount", - "blockedCount", - "missingCount", - "launchBlockingCount", - "repairRecommended", - "items", - "warnings" - ] - }, - "coreSignalFidelity": { - "$ref": "#/components/schemas/CoreSignalFidelity" - }, - "upstreamDrift": { - "$ref": "#/components/schemas/UpstreamStatus" - }, - "historyCoverage": { - "type": "string", - "enum": [ - "sampled", - "counts_only", - "full" - ] - }, - "refreshingRepos": { - "type": "array", - "items": { - "type": "string" - } - }, - "waitingForRateLimitRepos": { - "type": "array", - "items": { - "type": "string" - } - }, - "repositories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RepoSyncState" - } - }, - "segments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RepoSyncSegment" - } - }, - "githubTotals": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RepoGithubTotalsSnapshot" + }, + "ok": { + "type": "boolean" + }, + "action": { + "type": "string" + } + }, + "required": [ + "permission", + "requiredAccess", + "currentAccess", + "ok", + "action" + ] } }, - "pullRequestDetailSync": { + "eventRemediation": { "type": "array", "items": { "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "installations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InstallationHealth" + "properties": { + "event": { + "type": "string" + }, + "ok": { + "type": "boolean" + }, + "action": { + "type": "string" + } + }, + "required": [ + "event", + "ok", + "action" + ] } }, - "rateLimits": { + "repairSteps": { "type": "array", "items": { - "$ref": "#/components/schemas/GitHubRateLimitObservation" + "type": "string" } } }, "required": [ - "generatedAt", - "signalFidelity", - "freshnessSlo", - "coreSignalFidelity", - "upstreamDrift", - "historyCoverage", - "refreshingRepos", - "waitingForRateLimitRepos", - "repositories", - "segments", - "githubTotals", - "pullRequestDetailSync", - "installations", - "rateLimits" + "installationId", + "accountLogin", + "installedReposCount", + "registeredInstalledCount", + "status", + "missingPermissions", + "missingEvents", + "permissions", + "events", + "checkedAt" ] }, "CoreSignalFidelity": { @@ -8326,91 +8137,6 @@ "historyCoverage" ] }, - "UpstreamStatus": { - "type": "object", - "properties": { - "generatedAt": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "current", - "drift_detected", - "stale", - "unavailable" - ] - }, - "latestCommitSha": { - "type": "string", - "nullable": true - }, - "latestRulesetId": { - "type": "string", - "nullable": true - }, - "latestRulesetGeneratedAt": { - "type": "string", - "nullable": true - }, - "activeModel": { - "type": "string", - "nullable": true, - "enum": [ - "current_density_model", - "pending_saturation_model", - "exponential_saturation_model", - "unknown", - null - ] - }, - "highestSeverity": { - "type": "string", - "nullable": true, - "enum": [ - "low", - "medium", - "high", - "blocking", - null - ] - }, - "affectedAreas": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "registry", - "scoring_model", - "issue_discovery", - "mirror_linkage", - "language_weights", - "source" - ] - } - }, - "registryHyperparameterDrift": { - "$ref": "#/components/schemas/RegistryHyperparameterDriftSummary" - }, - "openReportCount": { - "type": "number" - }, - "reports": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UpstreamDriftReport" - } - } - }, - "required": [ - "generatedAt", - "status", - "affectedAreas", - "registryHyperparameterDrift", - "openReportCount", - "reports" - ] - }, "RegistryHyperparameterDriftSummary": { "type": "object", "properties": { @@ -8473,11 +8199,124 @@ "id": { "type": "string" }, - "fingerprint": { - "type": "string" + "fingerprint": { + "type": "string" + }, + "severity": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "blocking" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "acknowledged", + "resolved", + "ignored" + ] + }, + "summary": { + "type": "string" + }, + "affectedAreas": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "registry", + "scoring_model", + "issue_discovery", + "mirror_linkage", + "language_weights", + "source" + ] + } + }, + "previousRulesetId": { + "type": "string", + "nullable": true + }, + "currentRulesetId": { + "type": "string", + "nullable": true + }, + "issueNumber": { + "type": "number", + "nullable": true + }, + "issueUrl": { + "type": "string", + "nullable": true + }, + "payload": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "generatedAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "required": [ + "id", + "fingerprint", + "severity", + "status", + "summary", + "affectedAreas", + "generatedAt", + "updatedAt" + ] + }, + "UpstreamStatus": { + "type": "object", + "properties": { + "generatedAt": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "current", + "drift_detected", + "stale", + "unavailable" + ] + }, + "latestCommitSha": { + "type": "string", + "nullable": true + }, + "latestRulesetId": { + "type": "string", + "nullable": true + }, + "latestRulesetGeneratedAt": { + "type": "string", + "nullable": true + }, + "activeModel": { + "type": "string", + "nullable": true, + "enum": [ + "current_density_model", + "pending_saturation_model", + "exponential_saturation_model", + "unknown" + ] }, - "severity": { + "highestSeverity": { "type": "string", + "nullable": true, "enum": [ "low", "medium", @@ -8485,18 +8324,6 @@ "blocking" ] }, - "status": { - "type": "string", - "enum": [ - "open", - "acknowledged", - "resolved", - "ignored" - ] - }, - "summary": { - "type": "string" - }, "affectedAreas": { "type": "array", "items": { @@ -8511,44 +8338,26 @@ ] } }, - "previousRulesetId": { - "type": "string", - "nullable": true - }, - "currentRulesetId": { - "type": "string", - "nullable": true - }, - "issueNumber": { - "type": "number", - "nullable": true + "registryHyperparameterDrift": { + "$ref": "#/components/schemas/RegistryHyperparameterDriftSummary" }, - "issueUrl": { - "type": "string", - "nullable": true + "openReportCount": { + "type": "number" }, - "payload": { - "type": "object", - "additionalProperties": { - "nullable": true + "reports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpstreamDriftReport" } - }, - "generatedAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" } }, "required": [ - "id", - "fingerprint", - "severity", + "generatedAt", "status", - "summary", "affectedAreas", - "generatedAt", - "updatedAt" + "registryHyperparameterDrift", + "openReportCount", + "reports" ] }, "RepoGithubTotalsSnapshot": { @@ -8613,6 +8422,194 @@ "fetchedAt" ] }, + "SyncStatus": { + "type": "object", + "properties": { + "generatedAt": { + "type": "string" + }, + "signalFidelity": { + "$ref": "#/components/schemas/SignalFidelity" + }, + "freshnessSlo": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "fresh", + "degraded", + "blocked" + ] + }, + "generatedAt": { + "type": "string" + }, + "staleCount": { + "type": "number" + }, + "degradedCount": { + "type": "number" + }, + "blockedCount": { + "type": "number" + }, + "missingCount": { + "type": "number" + }, + "launchBlockingCount": { + "type": "number" + }, + "repairRecommended": { + "type": "boolean" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "area": { + "type": "string" + }, + "targetKey": { + "type": "string" + }, + "status": { + "type": "string" + }, + "launchBlocking": { + "type": "boolean" + }, + "ageSeconds": { + "type": "number" + }, + "sloSeconds": { + "type": "number" + }, + "breachSeconds": { + "type": "number" + }, + "observedAt": { + "type": "string", + "nullable": true + }, + "summary": { + "type": "string" + } + }, + "required": [ + "area", + "targetKey", + "status", + "launchBlocking", + "sloSeconds", + "summary" + ] + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "status", + "generatedAt", + "staleCount", + "degradedCount", + "blockedCount", + "missingCount", + "launchBlockingCount", + "repairRecommended", + "items", + "warnings" + ] + }, + "coreSignalFidelity": { + "$ref": "#/components/schemas/CoreSignalFidelity" + }, + "upstreamDrift": { + "$ref": "#/components/schemas/UpstreamStatus" + }, + "historyCoverage": { + "type": "string", + "enum": [ + "sampled", + "counts_only", + "full" + ] + }, + "refreshingRepos": { + "type": "array", + "items": { + "type": "string" + } + }, + "waitingForRateLimitRepos": { + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepoSyncState" + } + }, + "segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepoSyncSegment" + } + }, + "githubTotals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepoGithubTotalsSnapshot" + } + }, + "pullRequestDetailSync": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "installations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstallationHealth" + } + }, + "rateLimits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GitHubRateLimitObservation" + } + } + }, + "required": [ + "generatedAt", + "signalFidelity", + "freshnessSlo", + "coreSignalFidelity", + "upstreamDrift", + "historyCoverage", + "refreshingRepos", + "waitingForRateLimitRepos", + "repositories", + "segments", + "githubTotals", + "pullRequestDetailSync", + "installations", + "rateLimits" + ] + }, "Readiness": { "type": "object", "properties": { diff --git a/apps/gittensory-ui/src/lib/mcp-package.ts b/apps/gittensory-ui/src/lib/mcp-package.ts index 749d8fe434..684d56af4e 100644 --- a/apps/gittensory-ui/src/lib/mcp-package.ts +++ b/apps/gittensory-ui/src/lib/mcp-package.ts @@ -6,7 +6,7 @@ export const MCP_PACKAGE_NAME = "@jsonbored/gittensory-mcp"; export const MCP_PACKAGE_ENCODED_NAME = "@jsonbored%2fgittensory-mcp"; export const MCP_PACKAGE_REGISTRY_URL = `https://registry.npmjs.org/${MCP_PACKAGE_ENCODED_NAME}`; export const MCP_PACKAGE_NPM_URL = `https://www.npmjs.com/package/${MCP_PACKAGE_NAME}`; -export const MCP_PACKAGE_KNOWN_LATEST_VERSION = "0.3.0"; +export const MCP_PACKAGE_KNOWN_LATEST_VERSION = "0.4.0"; export const MCP_MINIMUM_SUPPORTED_VERSION = "0.2.0"; export type NpmPackageMetadata = { diff --git a/src/openapi/spec.ts b/src/openapi/spec.ts index 957d62a01c..309a26a9bc 100644 --- a/src/openapi/spec.ts +++ b/src/openapi/spec.ts @@ -620,7 +620,7 @@ export function buildOpenApiSpec() { 200: { description: "Weekly value report as structured JSON or copy-ready Markdown", content: { - "application/json": { schema: z.record(z.unknown()) }, + "application/json": { schema: z.record(z.string(), z.unknown()) }, "text/markdown": { schema: z.string().openapi({ example: "# Weekly Gittensory value report\n\n## Adoption metrics\n- Active users: 4\n", From a3e35cfb9ec1bc9647084bf4bcb5504fe56c9bc8 Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 14:17:59 +0200 Subject: [PATCH 3/4] test: add validation coverage headroom --- .../maintainer-settings-preview-ui.test.ts | 20 +++++++++++++++++++ test/unit/weekly-value-report.test.ts | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/test/unit/maintainer-settings-preview-ui.test.ts b/test/unit/maintainer-settings-preview-ui.test.ts index bd6e1e9bbf..5f3b34bccc 100644 --- a/test/unit/maintainer-settings-preview-ui.test.ts +++ b/test/unit/maintainer-settings-preview-ui.test.ts @@ -81,4 +81,24 @@ describe("maintainer settings preview UI helpers", () => { minerStatus: "unavailable", }); }); + + it("falls back safely for sparse preview helper inputs", () => { + expect(findPreviewScenario("unknown-scenario" as never).id).toBe("confirmed-miner"); + expect( + extractPreviewRepoOptions([ + { pr: { split: () => [] } as unknown as string }, + { pr: "JSONbored/gittensory#251" }, + ]), + ).toEqual(["JSONbored/gittensory"]); + + const request = buildSettingsPreviewRequest({ + repoFullName: "JSONbored/gittensory", + scenarioId: "confirmed-miner", + title: "Export weekly report", + labels: "", + linkedIssues: "", + body: " ", + }); + expect(request.sample).not.toHaveProperty("body"); + }); }); diff --git a/test/unit/weekly-value-report.test.ts b/test/unit/weekly-value-report.test.ts index 19d44c63fb..5437a74e2c 100644 --- a/test/unit/weekly-value-report.test.ts +++ b/test/unit/weekly-value-report.test.ts @@ -211,6 +211,15 @@ describe("weekly value reports", () => { expect(markdown).toContain("- No rollup-backed metric is available for this section."); expect(markdown).toContain("- No known blocker surfaced by the current report window."); expect(markdown).toContain("## Operator detail"); + + const { operatorDetails: _operatorDetails, ...reportWithoutOperatorDetails } = report; + const sparseMarkdown = formatWeeklyValueReportMarkdown({ + ...reportWithoutOperatorDetails, + period: { ...report.period, startDay: null, endDay: null }, + metrics: [{ id: "active_users", label: "Active users", value: 1, detail: "", visibility: "public" }], + }); + expect(sparseMarkdown).toContain("- Window: 1 day(s)"); + expect(sparseMarkdown).toContain("- Active users: 1\n"); }); it("normalizes report windows and records public scheduled generations without operator details", async () => { From 78a78b1d69bd2395a8c5f9daafbf529a0eb0522b Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 14:30:23 +0200 Subject: [PATCH 4/4] fix(ci): refresh openapi artifact --- apps/gittensory-ui/public/openapi.json | 7245 ++++++++++++------------ 1 file changed, 3624 insertions(+), 3621 deletions(-) diff --git a/apps/gittensory-ui/public/openapi.json b/apps/gittensory-ui/public/openapi.json index bef4cbed43..2beae1ab1e 100644 --- a/apps/gittensory-ui/public/openapi.json +++ b/apps/gittensory-ui/public/openapi.json @@ -146,59 +146,6 @@ "generatedAt" ] }, - "RegistryRepo": { - "type": "object", - "properties": { - "repo": { - "type": "string" - }, - "emissionShare": { - "type": "number" - }, - "issueDiscoveryShare": { - "type": "number" - }, - "labelMultipliers": { - "type": "object", - "additionalProperties": { - "type": "number" - } - }, - "trustedLabelPipeline": { - "type": "boolean", - "nullable": true - }, - "maintainerCut": { - "type": "number" - }, - "defaultLabelMultiplier": { - "type": "number", - "nullable": true - }, - "fixedBaseScore": { - "type": "number", - "nullable": true - }, - "eligibilityMode": { - "type": "string", - "nullable": true - }, - "raw": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "required": [ - "repo", - "emissionShare", - "issueDiscoveryShare", - "labelMultipliers", - "maintainerCut", - "raw" - ] - }, "RegistrySnapshot": { "type": "object", "properties": { @@ -260,6 +207,59 @@ "repositories" ] }, + "RegistryRepo": { + "type": "object", + "properties": { + "repo": { + "type": "string" + }, + "emissionShare": { + "type": "number" + }, + "issueDiscoveryShare": { + "type": "number" + }, + "labelMultipliers": { + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "trustedLabelPipeline": { + "type": "boolean", + "nullable": true + }, + "maintainerCut": { + "type": "number" + }, + "defaultLabelMultiplier": { + "type": "number", + "nullable": true + }, + "fixedBaseScore": { + "type": "number", + "nullable": true + }, + "eligibilityMode": { + "type": "string", + "nullable": true + }, + "raw": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "required": [ + "repo", + "emissionShare", + "issueDiscoveryShare", + "labelMultipliers", + "maintainerCut", + "raw" + ] + }, "Repository": { "type": "object", "properties": { @@ -313,40 +313,6 @@ "isPrivate" ] }, - "Finding": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "title": { - "type": "string" - }, - "severity": { - "type": "string", - "enum": [ - "info", - "warning", - "critical" - ] - }, - "detail": { - "type": "string" - }, - "action": { - "type": "string" - }, - "publicText": { - "type": "string" - } - }, - "required": [ - "code", - "title", - "severity", - "detail" - ] - }, "Advisory": { "type": "object", "properties": { @@ -421,6 +387,40 @@ "generatedAt" ] }, + "Finding": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "title": { + "type": "string" + }, + "severity": { + "type": "string", + "enum": [ + "info", + "warning", + "critical" + ] + }, + "detail": { + "type": "string" + }, + "action": { + "type": "string" + }, + "publicText": { + "type": "string" + } + }, + "required": [ + "code", + "title", + "severity", + "detail" + ] + }, "WorkboardItem": { "type": "object", "properties": { @@ -560,68 +560,6 @@ "findings" ] }, - "CollisionItem": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "issue", - "pull_request" - ] - }, - "number": { - "type": "number" - }, - "title": { - "type": "string" - }, - "authorLogin": { - "type": "string", - "nullable": true - }, - "htmlUrl": { - "type": "string", - "nullable": true - } - }, - "required": [ - "type", - "number", - "title" - ] - }, - "CollisionCluster": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "risk": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "reason": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CollisionItem" - } - } - }, - "required": [ - "id", - "risk", - "reason", - "items" - ] - }, "CollisionReport": { "type": "object", "properties": { @@ -664,44 +602,66 @@ "clusters" ] }, - "LaneAdvice": { + "CollisionCluster": { "type": "object", "properties": { - "lane": { + "id": { + "type": "string" + }, + "risk": { "type": "string", "enum": [ - "direct_pr", - "issue_discovery", - "split", - "inactive", - "unknown" + "low", + "medium", + "high" ] }, - "repoFullName": { + "reason": { "type": "string" }, - "issueDiscoveryShare": { - "type": "number" - }, - "directPrShare": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollisionItem" + } + } + }, + "required": [ + "id", + "risk", + "reason", + "items" + ] + }, + "CollisionItem": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "issue", + "pull_request" + ] + }, + "number": { "type": "number" }, - "summary": { + "title": { "type": "string" }, - "contributorGuidance": { - "type": "string" + "authorLogin": { + "type": "string", + "nullable": true }, - "maintainerGuidance": { - "type": "string" + "htmlUrl": { + "type": "string", + "nullable": true } }, "required": [ - "lane", - "repoFullName", - "summary", - "contributorGuidance", - "maintainerGuidance" + "type", + "number", + "title" ] }, "ConfigQuality": { @@ -765,6 +725,46 @@ "findings" ] }, + "LaneAdvice": { + "type": "object", + "properties": { + "lane": { + "type": "string", + "enum": [ + "direct_pr", + "issue_discovery", + "split", + "inactive", + "unknown" + ] + }, + "repoFullName": { + "type": "string" + }, + "issueDiscoveryShare": { + "type": "number" + }, + "directPrShare": { + "type": "number" + }, + "summary": { + "type": "string" + }, + "contributorGuidance": { + "type": "string" + }, + "maintainerGuidance": { + "type": "string" + } + }, + "required": [ + "lane", + "repoFullName", + "summary", + "contributorGuidance", + "maintainerGuidance" + ] + }, "LabelAudit": { "type": "object", "properties": { @@ -1901,129 +1901,246 @@ "summary" ] }, - "DecisionPackFreshness": { - "type": "string", - "enum": [ - "fresh", - "stale", - "rebuilding", - "missing" - ] - }, - "ContributorOpenPrNextStepPacket": { + "ContributorDecisionPack": { "type": "object", "properties": { - "repoFullName": { + "status": { + "type": "string", + "enum": [ + "ready" + ] + }, + "source": { + "type": "string", + "enum": [ + "computed", + "snapshot" + ] + }, + "login": { "type": "string" }, - "number": { + "generatedAt": { + "type": "string" + }, + "snapshotAgeSeconds": { "type": "number" }, - "title": { - "type": "string" + "stale": { + "type": "boolean" }, - "classification": { - "type": "string", - "enum": [ - "approved", - "blocked", - "stale", - "needs_author", - "failing_checks", - "missing_tests", - "duplicate_prone", - "reviewable", - "should_close_or_withdraw", - "maintainer_lane", - "draft" - ] + "freshness": { + "$ref": "#/components/schemas/DecisionPackFreshness" }, - "summary": { + "rebuildEnqueued": { + "type": "boolean" + }, + "scoringModelSnapshotId": { "type": "string" }, - "reasons": { + "profile": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "outcomeHistory": { + "$ref": "#/components/schemas/ContributorOutcomeHistory" + }, + "roleContexts": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/RoleContext" } }, - "nextSteps": { + "opportunities": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/ContributorOpportunity" } - } - }, - "required": [ - "repoFullName", - "number", - "title", - "classification", - "summary", - "reasons", - "nextSteps" - ] - }, - "ContributorOpenPrMonitor": { - "type": "object", - "properties": { - "login": { - "type": "string" - }, - "generatedAt": { - "type": "string" }, - "openPrCount": { - "type": "number" + "repoDecisions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } }, - "registeredRepoCount": { - "type": "number" + "topActions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } }, "cleanupFirst": { - "type": "boolean" + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } }, - "summary": { - "type": "string" + "pursueRepos": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } }, - "guidance": { + "avoidRepos": { "type": "array", "items": { - "type": "string" + "type": "object", + "additionalProperties": { + "nullable": true + } } }, - "pendingScenarios": { + "maintainerLaneRepos": { "type": "array", "items": { "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "detection": { - "type": "object", - "properties": { - "source": { - "type": "string", - "enum": [ - "github_observed", - "user_supplied" - ] - }, - "pendingMergedPrCount": { - "type": "number" - }, - "pendingClosedPrCount": { - "type": "number" - }, - "approvedPrCount": { - "type": "number" - }, - "expectedOpenPrCountAfterMerge": { - "type": "number" - }, - "scenarioNotes": { - "type": "array", - "items": { + "additionalProperties": { + "nullable": true + } + } + }, + "scoreBlockers": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } + }, + "evidenceGraph": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "dataQuality": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "summary": { + "type": "string" + }, + "nextActions": { + "type": "array", + "items": { + "type": "string" + } + }, + "openPrMonitor": { + "$ref": "#/components/schemas/ContributorOpenPrMonitor" + } + }, + "required": [ + "status", + "source", + "login", + "generatedAt", + "stale", + "freshness", + "rebuildEnqueued", + "scoringModelSnapshotId", + "profile", + "outcomeHistory", + "roleContexts", + "opportunities", + "repoDecisions", + "topActions", + "cleanupFirst", + "pursueRepos", + "avoidRepos", + "maintainerLaneRepos", + "scoreBlockers", + "dataQuality", + "summary", + "nextActions" + ] + }, + "DecisionPackFreshness": { + "type": "string", + "enum": [ + "fresh", + "stale", + "rebuilding", + "missing" + ] + }, + "ContributorOpenPrMonitor": { + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "generatedAt": { + "type": "string" + }, + "openPrCount": { + "type": "number" + }, + "registeredRepoCount": { + "type": "number" + }, + "cleanupFirst": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "guidance": { + "type": "array", + "items": { + "type": "string" + } + }, + "pendingScenarios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "repoFullName": { + "type": "string" + }, + "detection": { + "type": "object", + "properties": { + "source": { + "type": "string", + "enum": [ + "github_observed", + "user_supplied" + ] + }, + "pendingMergedPrCount": { + "type": "number" + }, + "pendingClosedPrCount": { + "type": "number" + }, + "approvedPrCount": { + "type": "number" + }, + "expectedOpenPrCountAfterMerge": { + "type": "number" + }, + "scenarioNotes": { + "type": "array", + "items": { "type": "string" } }, @@ -2096,33 +2213,127 @@ "pullRequests" ] }, - "ContributorDecisionPack": { + "ContributorOpenPrNextStepPacket": { "type": "object", "properties": { - "status": { + "repoFullName": { + "type": "string" + }, + "number": { + "type": "number" + }, + "title": { + "type": "string" + }, + "classification": { "type": "string", "enum": [ - "ready" + "approved", + "blocked", + "stale", + "needs_author", + "failing_checks", + "missing_tests", + "duplicate_prone", + "reviewable", + "should_close_or_withdraw", + "maintainer_lane", + "draft" ] }, - "source": { + "summary": { + "type": "string" + }, + "reasons": { + "type": "array", + "items": { + "type": "string" + } + }, + "nextSteps": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "repoFullName", + "number", + "title", + "classification", + "summary", + "reasons", + "nextSteps" + ] + }, + "DecisionPackRefreshNeeded": { + "type": "object", + "properties": { + "status": { "type": "string", "enum": [ - "computed", - "snapshot" + "needs_snapshot_refresh" ] }, "login": { "type": "string" }, + "repoFullName": { + "type": "string" + }, "generatedAt": { "type": "string" }, - "snapshotAgeSeconds": { - "type": "number" + "reason": { + "type": "string", + "enum": [ + "missing_snapshot" + ] }, - "stale": { + "freshness": { + "type": "string", + "enum": [ + "missing" + ] + }, + "rebuildEnqueued": { "type": "boolean" + } + }, + "required": [ + "status", + "login", + "generatedAt", + "reason", + "freshness", + "rebuildEnqueued" + ] + }, + "RepoDecisionResponse": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "ready" + ] + }, + "login": { + "type": "string" + }, + "repoFullName": { + "type": "string" + }, + "generatedAt": { + "type": "string" + }, + "source": { + "type": "string", + "enum": [ + "computed", + "snapshot" + ] }, "freshness": { "$ref": "#/components/schemas/DecisionPackFreshness" @@ -2130,95 +2341,110 @@ "rebuildEnqueued": { "type": "boolean" }, - "scoringModelSnapshotId": { - "type": "string" - }, - "profile": { + "decision": { "type": "object", "additionalProperties": { "nullable": true } }, - "outcomeHistory": { - "$ref": "#/components/schemas/ContributorOutcomeHistory" - }, - "roleContexts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RoleContext" + "dataQuality": { + "type": "object", + "additionalProperties": { + "nullable": true } + } + }, + "required": [ + "status", + "login", + "repoFullName", + "generatedAt", + "source", + "freshness", + "rebuildEnqueued", + "decision", + "dataQuality" + ] + }, + "RepoIntelligence": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "ready" + ] }, - "opportunities": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ContributorOpportunity" - } + "source": { + "type": "string", + "enum": [ + "computed", + "snapshot" + ] }, - "repoDecisions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } + "repoFullName": { + "type": "string" }, - "topActions": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { + "generatedAt": { + "type": "string" + }, + "repo": { + "allOf": [ + { + "$ref": "#/components/schemas/Repository" + }, + { "nullable": true } + ] + }, + "lane": { + "$ref": "#/components/schemas/LaneAdvice" + }, + "queueHealth": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true } }, - "cleanupFirst": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "collisions": { + "type": "object", + "additionalProperties": { + "nullable": true } }, - "pursueRepos": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "configQuality": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true } }, - "avoidRepos": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "labelAudit": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true } }, - "maintainerLaneRepos": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "maintainerLane": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true } }, - "scoreBlockers": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "maintainerCutReadiness": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true } }, - "evidenceGraph": { + "contributorIntakeHealth": { "type": "object", + "nullable": true, "additionalProperties": { "nullable": true } @@ -2229,183 +2455,179 @@ "nullable": true } }, - "summary": { - "type": "string" - }, - "nextActions": { - "type": "array", - "items": { - "type": "string" - } + "burdenForecast": { + "$ref": "#/components/schemas/BurdenForecast" }, - "openPrMonitor": { - "$ref": "#/components/schemas/ContributorOpenPrMonitor" + "burdenForecastFreshness": { + "type": "object", + "properties": { + "source": { + "type": "string", + "enum": [ + "snapshot", + "computed" + ] + }, + "generatedAt": { + "type": "string" + }, + "ageSeconds": { + "type": "number" + }, + "freshness": { + "type": "string", + "enum": [ + "fresh", + "stale" + ] + } + }, + "required": [ + "source", + "generatedAt", + "ageSeconds", + "freshness" + ] } }, "required": [ "status", "source", - "login", + "repoFullName", "generatedAt", - "stale", - "freshness", - "rebuildEnqueued", - "scoringModelSnapshotId", - "profile", - "outcomeHistory", - "roleContexts", - "opportunities", - "repoDecisions", - "topActions", - "cleanupFirst", - "pursueRepos", - "avoidRepos", - "maintainerLaneRepos", - "scoreBlockers", - "dataQuality", - "summary", - "nextActions" + "repo", + "lane", + "dataQuality" ] }, - "DecisionPackRefreshNeeded": { + "BurdenForecast": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "needs_snapshot_refresh" - ] - }, - "login": { - "type": "string" - }, "repoFullName": { "type": "string" }, "generatedAt": { "type": "string" }, - "reason": { - "type": "string", - "enum": [ - "missing_snapshot" + "horizonDays": { + "anyOf": [ + { + "type": "number", + "enum": [ + 7 + ] + }, + { + "type": "number", + "enum": [ + 30 + ] + } ] }, - "freshness": { + "level": { "type": "string", "enum": [ - "missing" + "low", + "medium", + "high", + "critical" ] }, - "rebuildEnqueued": { - "type": "boolean" + "forecast": { + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "findings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Finding" + } + }, + "summary": { + "type": "string" } }, "required": [ - "status", - "login", + "repoFullName", "generatedAt", - "reason", - "freshness", - "rebuildEnqueued" + "horizonDays", + "level", + "forecast", + "findings", + "summary" ] }, - "RepoDecisionResponse": { + "RepoOutcomePatterns": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "ready" - ] - }, - "login": { - "type": "string" - }, "repoFullName": { "type": "string" }, "generatedAt": { "type": "string" }, - "source": { + "lane": { "type": "string", "enum": [ - "computed", - "snapshot" + "direct_pr", + "issue_discovery", + "split", + "inactive", + "unknown" ] }, - "freshness": { - "$ref": "#/components/schemas/DecisionPackFreshness" + "primaryLanguage": { + "type": "string", + "nullable": true }, - "rebuildEnqueued": { - "type": "boolean" + "sampleSize": { + "type": "number" }, - "decision": { + "totals": { "type": "object", "additionalProperties": { - "nullable": true + "type": "number" } }, - "dataQuality": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "required": [ - "status", - "login", - "repoFullName", - "generatedAt", - "source", - "freshness", - "rebuildEnqueued", - "decision", - "dataQuality" - ] - }, - "BurdenForecast": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" + "outsideContributorMergeRate": { + "type": "number" }, - "generatedAt": { - "type": "string" + "maintainerLaneMergeRate": { + "type": "number" }, - "horizonDays": { - "anyOf": [ - { - "type": "number", - "enum": [ - 7 - ] - }, - { - "type": "number", - "enum": [ - 30 - ] + "dimensions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true } - ] + } }, - "level": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "critical" - ] + "successPatterns": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } + } }, - "forecast": { - "type": "object", - "additionalProperties": { - "type": "number" + "riskPatterns": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "nullable": true + } } }, + "evidenceCompleteness": { + "$ref": "#/components/schemas/RepoOutcomeEvidenceCompleteness" + }, "findings": { "type": "array", "items": { @@ -2419,14 +2641,69 @@ "required": [ "repoFullName", "generatedAt", - "horizonDays", - "level", - "forecast", + "lane", + "primaryLanguage", + "sampleSize", + "totals", + "outsideContributorMergeRate", + "maintainerLaneMergeRate", + "dimensions", + "successPatterns", + "riskPatterns", + "evidenceCompleteness", "findings", "summary" ] }, - "RepoIntelligence": { + "RepoOutcomeEvidenceCompleteness": { + "type": "object", + "properties": { + "pullRequestsAnalyzed": { + "type": "number" + }, + "withFileDetail": { + "type": "number" + }, + "withReviewDetail": { + "type": "number" + }, + "withCheckDetail": { + "type": "number" + }, + "filesCompletenessRatio": { + "type": "number" + }, + "reviewsCompletenessRatio": { + "type": "number" + }, + "checksCompletenessRatio": { + "type": "number" + }, + "fullyDecidedWithDetail": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "complete", + "partial", + "missing" + ] + } + }, + "required": [ + "pullRequestsAnalyzed", + "withFileDetail", + "withReviewDetail", + "withCheckDetail", + "filesCompletenessRatio", + "reviewsCompletenessRatio", + "checksCompletenessRatio", + "fullyDecidedWithDetail", + "status" + ] + }, + "RepoOutcomePatternsResponse": { "type": "object", "properties": { "status": { @@ -2438,8 +2715,8 @@ "source": { "type": "string", "enum": [ - "computed", - "snapshot" + "snapshot", + "computed" ] }, "repoFullName": { @@ -2448,2088 +2725,1142 @@ "generatedAt": { "type": "string" }, - "repo": { - "allOf": [ - { - "$ref": "#/components/schemas/Repository" - }, - { - "nullable": true - } + "ageSeconds": { + "type": "number" + }, + "freshness": { + "type": "string", + "enum": [ + "fresh", + "stale" ] }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" + "patterns": { + "$ref": "#/components/schemas/RepoOutcomePatterns" }, - "queueHealth": { + "dataQuality": { "type": "object", - "nullable": true, "additionalProperties": { "nullable": true } + } + }, + "required": [ + "status", + "source", + "repoFullName", + "generatedAt", + "ageSeconds", + "freshness", + "patterns" + ] + }, + "RegistrationReadiness": { + "type": "object", + "properties": { + "repoFullName": { + "type": "string" }, - "collisions": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "generatedAt": { + "type": "string" }, - "configQuality": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - } + "ready": { + "type": "boolean" }, - "labelAudit": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - } + "recommendedRegistrationMode": { + "type": "string", + "enum": [ + "direct_pr", + "issue_discovery", + "split" + ] }, - "maintainerLane": { + "issuePolicy": { + "type": "string", + "enum": [ + "issue_discovery_enabled", + "split_pr_and_issue_discovery_enabled", + "direct_pr_requires_linked_issue", + "direct_pr_no_issue_required" + ] + }, + "directPrReadiness": { + "type": "object", + "properties": { + "ready": { + "type": "boolean" + }, + "reasons": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "ready", + "reasons" + ] + }, + "issueDiscoveryReadiness": { + "type": "object", + "properties": { + "ready": { + "type": "boolean" + }, + "recommendation": { + "type": "string", + "enum": [ + "enabled", + "recommended", + "not_recommended" + ] + }, + "reasons": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "ready", + "recommendation", + "reasons" + ] + }, + "labelPolicy": { "type": "object", - "nullable": true, "additionalProperties": { "nullable": true } }, "maintainerCutReadiness": { "type": "object", - "nullable": true, "additionalProperties": { "nullable": true } }, + "testCoverageHealth": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "gate_ready", + "gate_unknown" + ] + }, + "trustedLabelPipelineReady": { + "type": "boolean" + }, + "checkRunMode": { + "type": "string", + "enum": [ + "off", + "enabled" + ] + }, + "requiredGate": { + "type": "array", + "items": { + "type": "string" + } + }, + "note": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "status", + "trustedLabelPipelineReady", + "checkRunMode", + "requiredGate", + "note", + "warnings" + ] + }, + "queueHealth": { + "type": "object", + "properties": { + "level": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "burdenScore": { + "type": "number" + }, + "reviewablePullRequests": { + "type": "number" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "level", + "burdenScore", + "reviewablePullRequests", + "summary" + ] + }, "contributorIntakeHealth": { "type": "object", - "nullable": true, "additionalProperties": { "nullable": true } }, - "dataQuality": { + "docsCompleteness": { "type": "object", "additionalProperties": { "nullable": true } }, - "burdenForecast": { - "$ref": "#/components/schemas/BurdenForecast" - }, - "burdenForecastFreshness": { + "githubApp": { "type": "object", "properties": { - "source": { + "installed": { + "type": "boolean" + }, + "publicSurface": { "type": "string", "enum": [ - "snapshot", - "computed" + "off", + "comment_and_label", + "comment_only", + "label_only" ] }, - "generatedAt": { - "type": "string" - }, - "ageSeconds": { - "type": "number" + "commentMode": { + "type": "string", + "enum": [ + "off", + "detected_contributors_only", + "all_prs" + ] }, - "freshness": { + "checkRunMode": { "type": "string", "enum": [ - "fresh", - "stale" + "off", + "enabled" ] + }, + "quietByDefault": { + "type": "boolean" + }, + "behavior": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "source", - "generatedAt", - "ageSeconds", - "freshness" + "installed", + "publicSurface", + "commentMode", + "checkRunMode", + "quietByDefault", + "behavior", + "warnings" ] + }, + "blockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "dataQuality": { + "type": "object", + "additionalProperties": { + "nullable": true + } } }, "required": [ - "status", - "source", "repoFullName", "generatedAt", - "repo", - "lane", + "ready", + "recommendedRegistrationMode", + "issuePolicy", + "directPrReadiness", + "issueDiscoveryReadiness", + "labelPolicy", + "maintainerCutReadiness", + "testCoverageHealth", + "queueHealth", + "contributorIntakeHealth", + "docsCompleteness", + "githubApp", + "blockers", + "warnings", "dataQuality" ] }, - "RepoOutcomeEvidenceCompleteness": { + "GittensorConfigRecommendation": { "type": "object", "properties": { - "pullRequestsAnalyzed": { - "type": "number" + "repoFullName": { + "type": "string" }, - "withFileDetail": { - "type": "number" + "generatedAt": { + "type": "string" }, - "withReviewDetail": { - "type": "number" + "privateOnly": { + "type": "boolean" }, - "withCheckDetail": { - "type": "number" + "current": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true + } }, - "filesCompletenessRatio": { - "type": "number" + "recommended": { + "type": "object", + "additionalProperties": { + "nullable": true + } }, - "reviewsCompletenessRatio": { - "type": "number" + "tradeoffs": { + "type": "array", + "items": { + "type": "string" + } }, - "checksCompletenessRatio": { - "type": "number" + "reasons": { + "type": "array", + "items": { + "type": "string" + } }, - "fullyDecidedWithDetail": { - "type": "number" + "warnings": { + "type": "array", + "items": { + "type": "string" + } }, - "status": { - "type": "string", - "enum": [ - "complete", - "partial", - "missing" - ] + "dataQuality": { + "type": "object", + "additionalProperties": { + "nullable": true + } } }, "required": [ - "pullRequestsAnalyzed", - "withFileDetail", - "withReviewDetail", - "withCheckDetail", - "filesCompletenessRatio", - "reviewsCompletenessRatio", - "checksCompletenessRatio", - "fullyDecidedWithDetail", - "status" + "repoFullName", + "generatedAt", + "privateOnly", + "current", + "recommended", + "tradeoffs", + "reasons", + "warnings", + "dataQuality" ] }, - "RepoOutcomePatterns": { + "RepoFitRecommendation": { "type": "object", "properties": { + "login": { + "type": "string" + }, "repoFullName": { "type": "string" }, "generatedAt": { "type": "string" }, + "roleContext": { + "$ref": "#/components/schemas/RoleContext" + }, "lane": { + "$ref": "#/components/schemas/LaneAdvice" + }, + "recommendation": { "type": "string", "enum": [ - "direct_pr", - "issue_discovery", - "split", - "inactive", + "pursue", + "cleanup_first", + "maintainer_lane", + "avoid_for_now", "unknown" ] }, - "primaryLanguage": { + "confidence": { "type": "string", - "nullable": true - }, - "sampleSize": { - "type": "number" - }, - "totals": { - "type": "object", - "additionalProperties": { - "type": "number" - } - }, - "outsideContributorMergeRate": { - "type": "number" - }, - "maintainerLaneMergeRate": { - "type": "number" + "enum": [ + "high", + "medium", + "low" + ] }, - "dimensions": { + "reasons": { "type": "array", "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "type": "string" } }, - "successPatterns": { + "risks": { "type": "array", "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "type": "string" } }, - "riskPatterns": { + "nextActions": { "type": "array", "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "type": "string" } }, - "evidenceCompleteness": { - "$ref": "#/components/schemas/RepoOutcomeEvidenceCompleteness" + "rewardRisk": { + "type": "object", + "additionalProperties": { + "nullable": true + } }, - "findings": { + "reasoning": { "type": "array", "items": { - "$ref": "#/components/schemas/Finding" + "type": "string" } }, - "summary": { - "type": "string" + "actionImpact": { + "type": "object", + "additionalProperties": { + "nullable": true + } } }, "required": [ + "login", "repoFullName", "generatedAt", + "roleContext", "lane", - "primaryLanguage", - "sampleSize", - "totals", - "outsideContributorMergeRate", - "maintainerLaneMergeRate", - "dimensions", - "successPatterns", - "riskPatterns", - "evidenceCompleteness", - "findings", - "summary" + "recommendation", + "confidence", + "reasons", + "risks", + "nextActions" ] }, - "RepoOutcomePatternsResponse": { + "PreflightResult": { "type": "object", "properties": { - "status": { - "type": "string", - "enum": [ - "ready" - ] - }, - "source": { - "type": "string", - "enum": [ - "snapshot", - "computed" - ] - }, "repoFullName": { "type": "string" }, "generatedAt": { "type": "string" }, - "ageSeconds": { - "type": "number" + "status": { + "type": "string", + "enum": [ + "ready", + "needs_work", + "hold" + ] }, - "freshness": { + "lane": { + "$ref": "#/components/schemas/LaneAdvice" + }, + "reviewBurden": { "type": "string", "enum": [ - "fresh", - "stale" + "low", + "medium", + "high" ] }, - "patterns": { - "$ref": "#/components/schemas/RepoOutcomePatterns" + "linkedIssues": { + "type": "array", + "items": { + "type": "number" + } }, - "dataQuality": { - "type": "object", - "additionalProperties": { - "nullable": true + "findings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Finding" + } + }, + "collisions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollisionCluster" } } }, "required": [ - "status", - "source", "repoFullName", "generatedAt", - "ageSeconds", - "freshness", - "patterns" + "status", + "lane", + "reviewBurden", + "linkedIssues", + "findings", + "collisions" ] }, - "RegistrationReadiness": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "ready": { - "type": "boolean" - }, - "recommendedRegistrationMode": { - "type": "string", - "enum": [ - "direct_pr", - "issue_discovery", - "split" - ] - }, - "issuePolicy": { - "type": "string", - "enum": [ - "issue_discovery_enabled", - "split_pr_and_issue_discovery_enabled", - "direct_pr_requires_linked_issue", - "direct_pr_no_issue_required" - ] + "LocalDiffPreflightResult": { + "allOf": [ + { + "$ref": "#/components/schemas/PreflightResult" }, - "directPrReadiness": { + { "type": "object", "properties": { - "ready": { - "type": "boolean" - }, - "reasons": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "ready", - "reasons" - ] - }, - "issueDiscoveryReadiness": { - "type": "object", - "properties": { - "ready": { - "type": "boolean" - }, - "recommendation": { - "type": "string", - "enum": [ - "enabled", - "recommended", - "not_recommended" + "localDiff": { + "type": "object", + "properties": { + "changedFileCount": { + "type": "number" + }, + "changedLineCount": { + "type": "number" + }, + "testFileCount": { + "type": "number" + }, + "codeFileCount": { + "type": "number" + }, + "inferredLinkedIssues": { + "type": "array", + "items": { + "type": "number" + } + }, + "summary": { + "type": "string" + } + }, + "required": [ + "changedFileCount", + "changedLineCount", + "testFileCount", + "codeFileCount", + "inferredLinkedIssues", + "summary" ] - }, - "reasons": { - "type": "array", - "items": { - "type": "string" - } } }, "required": [ - "ready", - "recommendation", - "reasons" + "localDiff" ] + } + ] + }, + "LocalBranchAnalysis": { + "type": "object", + "properties": { + "login": { + "type": "string" }, - "labelPolicy": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "repoFullName": { + "type": "string" }, - "maintainerCutReadiness": { - "type": "object", - "additionalProperties": { - "nullable": true - } + "generatedAt": { + "type": "string" }, - "testCoverageHealth": { + "baseRef": { + "type": "string" + }, + "headRef": { + "type": "string" + }, + "branchName": { + "type": "string" + }, + "baseFreshness": { "type": "object", "properties": { "status": { "type": "string", "enum": [ - "gate_ready", - "gate_unknown" + "fresh", + "stale", + "possibly_stale", + "unknown" ] }, - "trustedLabelPipelineReady": { - "type": "boolean" + "baseRef": { + "type": "string" }, - "checkRunMode": { - "type": "string", - "enum": [ - "off", - "enabled" - ] + "baseSha": { + "type": "string" }, - "requiredGate": { - "type": "array", - "items": { - "type": "string" - } + "headSha": { + "type": "string" }, - "note": { + "mergeBaseSha": { "type": "string" }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "status", - "trustedLabelPipelineReady", - "checkRunMode", - "requiredGate", - "note", - "warnings" - ] - }, - "queueHealth": { - "type": "object", - "properties": { - "level": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "critical" - ] + "remoteTrackingSha": { + "type": "string" }, - "burdenScore": { + "changedFileCount": { "type": "number" }, - "reviewablePullRequests": { + "testFileCount": { "type": "number" }, - "summary": { - "type": "string" - } - }, - "required": [ - "level", - "burdenScore", - "reviewablePullRequests", - "summary" - ] - }, - "contributorIntakeHealth": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "docsCompleteness": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "githubApp": { - "type": "object", - "properties": { - "installed": { - "type": "boolean" - }, - "publicSurface": { - "type": "string", - "enum": [ - "off", - "comment_and_label", - "comment_only", - "label_only" - ] - }, - "commentMode": { - "type": "string", - "enum": [ - "off", - "detected_contributors_only", - "all_prs" - ] - }, - "checkRunMode": { - "type": "string", - "enum": [ - "off", - "enabled" - ] - }, - "quietByDefault": { - "type": "boolean" - }, - "behavior": { - "type": "string" + "passedValidationCount": { + "type": "number" }, "warnings": { "type": "array", "items": { "type": "string" } + }, + "recommendation": { + "type": "string" } }, "required": [ - "installed", - "publicSurface", - "commentMode", - "checkRunMode", - "quietByDefault", - "behavior", + "status", + "changedFileCount", + "testFileCount", + "passedValidationCount", "warnings" ] }, - "blockers": { - "type": "array", - "items": { - "type": "string" - } + "lane": { + "$ref": "#/components/schemas/LaneAdvice" }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } + "roleContext": { + "$ref": "#/components/schemas/RoleContext" }, - "dataQuality": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "required": [ - "repoFullName", - "generatedAt", - "ready", - "recommendedRegistrationMode", - "issuePolicy", - "directPrReadiness", - "issueDiscoveryReadiness", - "labelPolicy", - "maintainerCutReadiness", - "testCoverageHealth", - "queueHealth", - "contributorIntakeHealth", - "docsCompleteness", - "githubApp", - "blockers", - "warnings", - "dataQuality" - ] - }, - "GittensorConfigRecommendation": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "privateOnly": { - "type": "boolean" - }, - "current": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - } - }, - "recommended": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "tradeoffs": { - "type": "array", - "items": { - "type": "string" - } - }, - "reasons": { - "type": "array", - "items": { - "type": "string" - } - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - }, - "dataQuality": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "required": [ - "repoFullName", - "generatedAt", - "privateOnly", - "current", - "recommended", - "tradeoffs", - "reasons", - "warnings", - "dataQuality" - ] - }, - "RepoFitRecommendation": { - "type": "object", - "properties": { - "login": { - "type": "string" - }, - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "roleContext": { - "$ref": "#/components/schemas/RoleContext" - }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "recommendation": { - "type": "string", - "enum": [ - "pursue", - "cleanup_first", - "maintainer_lane", - "avoid_for_now", - "unknown" - ] - }, - "confidence": { - "type": "string", - "enum": [ - "high", - "medium", - "low" - ] - }, - "reasons": { - "type": "array", - "items": { - "type": "string" - } - }, - "risks": { - "type": "array", - "items": { - "type": "string" - } - }, - "nextActions": { - "type": "array", - "items": { - "type": "string" - } - }, - "rewardRisk": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "reasoning": { - "type": "array", - "items": { - "type": "string" - } - }, - "actionImpact": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "required": [ - "login", - "repoFullName", - "generatedAt", - "roleContext", - "lane", - "recommendation", - "confidence", - "reasons", - "risks", - "nextActions" - ] - }, - "PreflightResult": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "ready", - "needs_work", - "hold" - ] - }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "reviewBurden": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "linkedIssues": { - "type": "array", - "items": { - "type": "number" - } - }, - "findings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Finding" - } - }, - "collisions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CollisionCluster" - } - } - }, - "required": [ - "repoFullName", - "generatedAt", - "status", - "lane", - "reviewBurden", - "linkedIssues", - "findings", - "collisions" - ] - }, - "LocalDiffPreflightResult": { - "allOf": [ - { - "$ref": "#/components/schemas/PreflightResult" - }, - { + "preflight": { + "$ref": "#/components/schemas/LocalDiffPreflightResult" + }, + "scorePreview": { + "$ref": "#/components/schemas/ScorePreviewResult" + }, + "scenarioScorePreview": { "type": "object", "properties": { - "localDiff": { + "current": { "type": "object", "properties": { - "changedFileCount": { - "type": "number" - }, - "changedLineCount": { - "type": "number" - }, - "testFileCount": { - "type": "number" + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] }, - "codeFileCount": { - "type": "number" + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] }, - "inferredLinkedIssues": { + "assumptions": { "type": "array", "items": { - "type": "number" + "type": "string" } }, - "summary": { + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } + }, + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } + }, + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "deltaExplanation": { "type": "string" } }, "required": [ - "changedFileCount", - "changedLineCount", - "testFileCount", - "codeFileCount", - "inferredLinkedIssues", - "summary" + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" ] - } - }, - "required": [ - "localDiff" - ] - } - ] - }, - "ScorePreviewResult": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "scoringModelSnapshotId": { - "type": "string" - }, - "activeModel": { - "type": "string", - "enum": [ - "current_density_model", - "pending_saturation_model", - "exponential_saturation_model", - "unknown" - ] - }, - "privateOnly": { - "type": "boolean", - "enum": [ - true - ] - }, - "laneMath": { - "type": "object", - "additionalProperties": { - "type": "number" - } - }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } - }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" - } - }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "branchEligibility": { - "type": "object", - "properties": { - "required": { - "type": "boolean" - }, - "status": { - "type": "string", - "enum": [ - "eligible", - "ineligible", - "unknown", - "not_required" - ] - }, - "evidence": { - "type": "string", - "enum": [ - "provided", - "missing" - ] - }, - "source": { - "type": "string", - "enum": [ - "github_metadata", - "local_metadata", - "registry", - "user_supplied", - "missing" - ] - }, - "reason": { - "type": "string" - }, - "checkedAt": { - "type": "string" - }, - "stale": { - "type": "boolean" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "required", - "status", - "evidence", - "source", - "stale", - "warnings" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } - }, - "gateDeltas": { - "type": "array", - "items": { - "type": "object", - "properties": { - "gate": { - "type": "string", - "enum": [ - "open_pr_threshold", - "credibility_floor", - "linked_issue_multiplier" - ] - }, - "current": { - "type": "string" - }, - "projected": { - "type": "string" - }, - "explanation": { - "type": "string" - } - }, - "required": [ - "gate", - "current", - "projected", - "explanation" - ] - } - }, - "scenarioPreviews": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } - }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" - } - }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } - }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] - }, - "deltaExplanation": { - "type": "string" - } - }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" - ] - } - }, - "scoreabilityStatus": { - "type": "string", - "enum": [ - "blocked", - "conditionally_scoreable", - "scoreable", - "hold" - ] - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "recommendation": { - "type": "object", - "properties": { - "level": { - "type": "string", - "enum": [ - "strong_fit", - "reasonable_fit", - "needs_work", - "hold" - ] - }, - "actions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "level", - "actions" - ] - } - }, - "required": [ - "repoFullName", - "generatedAt", - "scoringModelSnapshotId", - "activeModel", - "privateOnly", - "laneMath", - "scoreEstimate", - "linkedIssueMultiplier", - "gates", - "branchEligibility", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "gateDeltas", - "scenarioPreviews", - "scoreabilityStatus", - "warnings", - "assumptions", - "recommendation" - ] - }, - "RewardRiskAction": { - "type": "object", - "properties": { - "actionKind": { - "type": "string", - "enum": [ - "cleanup_existing_prs", - "land_existing_prs", - "close_or_withdraw_low_fit_prs", - "open_new_direct_pr", - "file_issue_discovery", - "maintainer_lane_improve_repo", - "maintainer_cut_readiness" - ] - }, - "repoFullName": { - "type": "string" - }, - "priorityScore": { - "type": "number" - }, - "laneValueScore": { - "type": "number" - }, - "scoreabilityScore": { - "type": "number" - }, - "personalFitScore": { - "type": "number" - }, - "riskPenalty": { - "type": "number" - }, - "maintainerFrictionPenalty": { - "type": "number" - }, - "actionLeverageScore": { - "type": "number" - }, - "whyThisHelps": { - "type": "array", - "items": { - "type": "string" - } - }, - "nextActions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "actionKind", - "repoFullName", - "priorityScore", - "laneValueScore", - "scoreabilityScore", - "personalFitScore", - "riskPenalty", - "maintainerFrictionPenalty", - "actionLeverageScore", - "whyThisHelps", - "nextActions" - ] - }, - "RepoRewardRisk": { - "type": "object", - "properties": { - "login": { - "type": "string" - }, - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "roleContext": { - "$ref": "#/components/schemas/RoleContext" - }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "recommendation": { - "type": "string", - "enum": [ - "pursue", - "cleanup_first", - "maintainer_lane", - "avoid_for_now", - "unknown" - ] - }, - "rewardUpside": { - "type": "object", - "properties": { - "relevantLane": { - "type": "string", - "enum": [ - "direct_pr", - "issue_discovery", - "maintainer_lane", - "none" - ] - }, - "repoSlice": { - "type": "number" - }, - "directPrSlice": { - "type": "number" - }, - "issueDiscoverySlice": { - "type": "number" - }, - "maintainerCutSlice": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "estimatedScoreIfClean": { - "type": "number" - }, - "currentEstimatedScore": { - "type": "number" - } - }, - "required": [ - "relevantLane", - "repoSlice", - "directPrSlice", - "issueDiscoverySlice", - "maintainerCutSlice", - "labelMultiplier", - "issueMultiplier", - "estimatedScoreIfClean", - "currentEstimatedScore" - ] - }, - "scoreBlockers": { - "type": "array", - "items": { - "type": "string" - } - }, - "riskBreakdown": { - "type": "object", - "properties": { - "queueBurden": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "critical" - ] - }, - "queueBurdenScore": { - "type": "number" - }, - "duplicateClusters": { - "type": "number" - }, - "highRiskDuplicateClusters": { - "type": "number" - }, - "closedPullRequestRate": { - "type": "number" - }, - "openPullRequests": { - "type": "number" - }, - "credibility": { - "type": "number" - }, - "reviewChurnRisk": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - } - }, - "required": [ - "queueBurden", - "queueBurdenScore", - "duplicateClusters", - "highRiskDuplicateClusters", - "closedPullRequestRate", - "openPullRequests", - "credibility", - "reviewChurnRisk" - ] - }, - "actionImpact": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "currentPreview": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "afterCleanupPreview": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "actions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RewardRiskAction" - } - }, - "whyThisHelps": { - "type": "array", - "items": { - "type": "string" - } - }, - "nextActions": { - "type": "array", - "items": { - "type": "string" - } - }, - "summary": { - "type": "string" - } - }, - "required": [ - "login", - "repoFullName", - "generatedAt", - "roleContext", - "lane", - "recommendation", - "rewardUpside", - "scoreBlockers", - "riskBreakdown", - "actionImpact", - "currentPreview", - "afterCleanupPreview", - "actions", - "whyThisHelps", - "nextActions", - "summary" - ] - }, - "LocalWorkspaceIntelligence": { - "type": "object", - "properties": { - "version": { - "type": "number", - "enum": [ - 2 - ] - }, - "sourceUpload": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "enum": [ - false - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "enabled", - "detail" - ] - }, - "branch": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "baseRef": { - "type": "string" - }, - "headSha": { - "type": "string" - }, - "pendingCommitCount": { - "type": "number" - } - }, - "required": [ - "pendingCommitCount" - ] - }, - "changedFiles": { - "type": "object", - "properties": { - "total": { - "type": "number" - }, - "added": { - "type": "number" - }, - "modified": { - "type": "number" - }, - "deleted": { - "type": "number" - }, - "renamed": { - "type": "number" - }, - "binary": { - "type": "number" - }, - "paths": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "total", - "added", - "modified", - "deleted", - "renamed", - "binary", - "paths" - ] - }, - "testEvidence": { - "type": "object", - "properties": { - "level": { - "type": "string", - "enum": [ - "test_files", - "validation_commands", - "both", - "none" - ] - }, - "testFileCount": { - "type": "number" - }, - "passedValidationCount": { - "type": "number" }, - "commands": { - "type": "array", - "items": { - "type": "object", - "properties": { - "command": { + "bestReasonableCase": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } }, - "status": { - "type": "string", - "enum": [ - "passed", - "failed", - "not_run" + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } + }, + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" ] - }, - "summary": { - "type": "string" } }, - "required": [ - "command", - "status" - ] - } - } - }, - "required": [ - "level", - "testFileCount", - "passedValidationCount", - "commands" - ] - }, - "linkedIssues": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseFreshness": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "fresh", - "stale", - "possibly_stale", - "unknown" - ] - }, - "baseRef": { - "type": "string" - }, - "baseSha": { - "type": "string" - }, - "headSha": { - "type": "string" - }, - "mergeBaseSha": { - "type": "string" - }, - "remoteTrackingSha": { - "type": "string" - }, - "changedFileCount": { - "type": "number" - }, - "testFileCount": { - "type": "number" - }, - "passedValidationCount": { - "type": "number" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - }, - "recommendation": { - "type": "string" - } - }, - "required": [ - "status", - "changedFileCount", - "testFileCount", - "passedValidationCount", - "warnings" - ] - }, - "ciStatusHints": { - "type": "array", - "items": { - "type": "string" - } - }, - "localScorerDiagnostics": { - "type": "object", - "properties": { - "mode": { - "type": "string" - }, - "activeModel": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadataOnly": { - "type": "boolean" - } - }, - "required": [ - "mode", - "warnings", - "metadataOnly" - ] - }, - "blockers": { - "type": "object", - "properties": { - "branchQuality": { - "type": "array", - "items": { - "type": "string" - } - }, - "accountState": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "branchQuality", - "accountState" - ] - }, - "rerunWhen": { - "type": "string" - } - }, - "required": [ - "version", - "sourceUpload", - "branch", - "changedFiles", - "testEvidence", - "linkedIssues", - "baseFreshness", - "ciStatusHints", - "blockers", - "rerunWhen" - ] - }, - "LocalBranchAnalysis": { - "type": "object", - "properties": { - "login": { - "type": "string" - }, - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "baseRef": { - "type": "string" - }, - "headRef": { - "type": "string" - }, - "branchName": { - "type": "string" - }, - "baseFreshness": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "fresh", - "stale", - "possibly_stale", - "unknown" + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "deltaExplanation": { + "type": "string" + } + }, + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" ] }, - "baseRef": { - "type": "string" - }, - "baseSha": { - "type": "string" - }, - "headSha": { - "type": "string" - }, - "mergeBaseSha": { - "type": "string" - }, - "remoteTrackingSha": { - "type": "string" - }, - "changedFileCount": { - "type": "number" - }, - "testFileCount": { - "type": "number" - }, - "passedValidationCount": { - "type": "number" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - }, - "recommendation": { - "type": "string" - } - }, - "required": [ - "status", - "changedFileCount", - "testFileCount", - "passedValidationCount", - "warnings" - ] - }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "roleContext": { - "$ref": "#/components/schemas/RoleContext" - }, - "preflight": { - "$ref": "#/components/schemas/LocalDiffPreflightResult" - }, - "scorePreview": { - "$ref": "#/components/schemas/ScorePreviewResult" - }, - "scenarioScorePreview": { - "type": "object", - "properties": { - "current": { + "afterPendingMerges": { "type": "object", "properties": { "name": { @@ -4777,7 +4108,7 @@ "deltaExplanation" ] }, - "bestReasonableCase": { + "afterApprovedPrsMerge": { "type": "object", "properties": { "name": { @@ -5025,7 +4356,7 @@ "deltaExplanation" ] }, - "afterPendingMerges": { + "afterStalePrsClose": { "type": "object", "properties": { "name": { @@ -5273,796 +4604,1542 @@ "deltaExplanation" ] }, - "afterApprovedPrsMerge": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { + "gateDeltas": { + "type": "array", + "items": { + "type": "object", + "properties": { + "gate": { + "type": "string", + "enum": [ + "open_pr_threshold", + "credibility_floor", + "linked_issue_multiplier" + ] + }, + "current": { + "type": "string" + }, + "projected": { + "type": "string" + }, + "explanation": { + "type": "string" + } + }, + "required": [ + "gate", + "current", + "projected", + "explanation" + ] + } + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } + } + }, + "required": [ + "current", + "bestReasonableCase", + "gateDeltas", + "blockedBy" + ] + }, + "observedPullRequestScenarios": { + "type": "object", + "properties": { + "approvedOrMergeable": { + "type": "number" + }, + "stale": { + "type": "number" + }, + "closed": { + "type": "number" + }, + "draft": { + "type": "number" + }, + "blocked": { + "type": "number" + }, + "maintainerLane": { + "type": "number" + }, + "notes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "approvedOrMergeable", + "stale", + "closed", + "draft", + "blocked", + "maintainerLane", + "notes" + ] + }, + "githubBranchStatus": { + "type": "object", + "properties": { + "source": { + "type": "string", + "enum": [ + "cached_github_data" + ] + }, + "status": { + "type": "string", + "enum": [ + "approved", + "failing_checks", + "needs_author", + "blocked", + "pending_review", + "no_pr", + "unknown" + ] + }, + "pullNumber": { + "type": "number" + }, + "title": { + "type": "string" + }, + "reviewDecision": { + "type": "string", + "nullable": true + }, + "mergeableState": { + "type": "string", + "nullable": true + }, + "notes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "source", + "status", + "notes" + ] + }, + "branchEligibility": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + }, + "status": { + "type": "string", + "enum": [ + "eligible", + "ineligible", + "unknown", + "not_required" + ] + }, + "evidence": { + "type": "string", + "enum": [ + "provided", + "missing" + ] + }, + "source": { + "type": "string", + "enum": [ + "github_metadata", + "local_metadata", + "registry", + "user_supplied", + "missing" + ] + }, + "reason": { + "type": "string" + }, + "checkedAt": { + "type": "string" + }, + "stale": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "status", + "evidence", + "source", + "stale", + "warnings" + ] + }, + "rewardRisk": { + "$ref": "#/components/schemas/RepoRewardRisk" + }, + "scoreBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "branchQualityBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "accountStateBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "recommendedRerunCondition": { + "type": "string" + }, + "localFindings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Finding" + } + }, + "maintainerFit": { + "type": "object", + "properties": { + "recommendation": { + "type": "string", + "enum": [ + "pursue", + "cleanup_first", + "maintainer_lane", + "avoid_for_now", + "unknown" + ] + }, + "reviewBurden": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "role": { + "type": "string", + "enum": [ + "outside_contributor", + "repo_maintainer", + "org_member", + "collaborator", + "owner", + "unknown" + ] + }, + "maintainerLane": { + "type": "boolean" + }, + "reasons": { + "type": "array", + "items": { + "type": "string" + } + }, + "risks": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "recommendation", + "reviewBurden", + "role", + "maintainerLane", + "reasons", + "risks" + ] + }, + "manifestGuidance": { + "type": "object", + "properties": { + "present": { + "type": "boolean" + }, + "source": { + "type": "string", + "enum": [ + "repo_file", + "api_record", + "none" + ] + }, + "linkedIssuePolicy": { + "type": "string", + "enum": [ + "required", + "preferred", + "optional" + ] + }, + "issueDiscoveryPolicy": { + "type": "string", + "enum": [ + "encouraged", + "neutral", + "discouraged" + ] + }, + "matchedWantedPaths": { + "type": "array", + "items": { + "type": "string" + } + }, + "matchedBlockedPaths": { + "type": "array", + "items": { + "type": "string" + } + }, + "preferredLabelHits": { + "type": "array", + "items": { + "type": "string" + } + }, + "findings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "severity": { + "type": "string", + "enum": [ + "info", + "warning", + "critical" + ] + }, + "title": { + "type": "string" + }, + "detail": { + "type": "string" + }, + "action": { "type": "string" } }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } + "required": [ + "code", + "severity", + "title", + "detail" + ] + } + }, + "publicNextSteps": { + "type": "array", + "items": { + "type": "string" + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "summary": { + "type": "string" + } + }, + "required": [ + "present", + "source", + "linkedIssuePolicy", + "issueDiscoveryPolicy", + "matchedWantedPaths", + "matchedBlockedPaths", + "preferredLabelHits", + "findings", + "publicNextSteps", + "warnings", + "summary" + ] + }, + "prPacket": { + "type": "object", + "properties": { + "titleSuggestion": { + "type": "string" + }, + "markdown": { + "type": "string" + }, + "bodySections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "heading": { + "type": "string" }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" + "lines": { + "type": "array", + "items": { + "type": "string" } - }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] + } }, - "effectiveEstimatedScore": { + "required": [ + "heading", + "lines" + ] + } + }, + "reviewerNotes": { + "type": "array", + "items": { + "type": "string" + } + }, + "validationSummary": { + "type": "object", + "properties": { + "passed": { "type": "number" }, - "underlyingPotentialScore": { + "failed": { "type": "number" }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] - } + "notRun": { + "type": "number" }, - "linkedIssueMultiplier": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { - "type": "string", - "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { + "commands": { + "type": "array", + "items": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "passed", + "failed", + "not_run", + "skipped", + "focused", + "unknown" + ] + }, + "summary": { + "type": "string" + }, + "durationMs": { "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { + }, + "exitCode": { "type": "number" } }, - "baseMultiplier": { - "type": "number" - }, - "appliedMultiplier": { - "type": "number" - }, - "reason": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" - ] - }, - "deltaExplanation": { - "type": "string" + "required": [ + "command", + "status" + ] + } } }, "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" + "passed", + "failed", + "notRun", + "commands" + ] + }, + "publicSafeWarnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "titleSuggestion", + "markdown", + "bodySections", + "reviewerNotes", + "validationSummary", + "publicSafeWarnings" + ] + }, + "nextActions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RewardRiskAction" + } + }, + "workspaceIntelligence": { + "$ref": "#/components/schemas/LocalWorkspaceIntelligence" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "login", + "repoFullName", + "generatedAt", + "baseFreshness", + "lane", + "roleContext", + "preflight", + "scorePreview", + "scenarioScorePreview", + "observedPullRequestScenarios", + "githubBranchStatus", + "branchEligibility", + "rewardRisk", + "scoreBlockers", + "branchQualityBlockers", + "accountStateBlockers", + "recommendedRerunCondition", + "localFindings", + "maintainerFit", + "manifestGuidance", + "prPacket", + "nextActions", + "workspaceIntelligence", + "summary" + ] + }, + "ScorePreviewResult": { + "type": "object", + "properties": { + "repoFullName": { + "type": "string" + }, + "generatedAt": { + "type": "string" + }, + "scoringModelSnapshotId": { + "type": "string" + }, + "activeModel": { + "type": "string", + "enum": [ + "current_density_model", + "pending_saturation_model", + "exponential_saturation_model", + "unknown" + ] + }, + "privateOnly": { + "type": "boolean", + "enum": [ + true + ] + }, + "laneMath": { + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" + } + }, + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "linkedIssueMultiplier": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "none", + "standard", + "maintainer" + ] + }, + "status": { + "type": "string", + "enum": [ + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" + ] + }, + "source": { + "type": "string", + "enum": [ + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" + ] + }, + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" + }, + "openPrThreshold": { + "type": "number" + }, + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" + } + }, + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "branchEligibility": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + }, + "status": { + "type": "string", + "enum": [ + "eligible", + "ineligible", + "unknown", + "not_required" ] }, - "afterStalePrsClose": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "current", - "cleanGates", - "afterPendingMerges", - "afterApprovedPrsMerge", - "afterStalePrsClose", - "linkedIssueFixed", - "bestReasonableCase" - ] - }, - "source": { - "type": "string", - "enum": [ - "current_data", - "user_supplied", - "github_observed", - "gittensory_projection" - ] - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" + "evidence": { + "type": "string", + "enum": [ + "provided", + "missing" + ] + }, + "source": { + "type": "string", + "enum": [ + "github_metadata", + "local_metadata", + "registry", + "user_supplied", + "missing" + ] + }, + "reason": { + "type": "string" + }, + "checkedAt": { + "type": "string" + }, + "stale": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "status", + "evidence", + "source", + "stale", + "warnings" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] + }, + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] + }, + "detail": { + "type": "string" + } + }, + "required": [ + "code", + "severity", + "detail" + ] + } + }, + "gateDeltas": { + "type": "array", + "items": { + "type": "object", + "properties": { + "gate": { + "type": "string", + "enum": [ + "open_pr_threshold", + "credibility_floor", + "linked_issue_multiplier" + ] + }, + "current": { + "type": "string" + }, + "projected": { + "type": "string" + }, + "explanation": { + "type": "string" + } + }, + "required": [ + "gate", + "current", + "projected", + "explanation" + ] + } + }, + "scenarioPreviews": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "current", + "cleanGates", + "afterPendingMerges", + "afterApprovedPrsMerge", + "afterStalePrsClose", + "linkedIssueFixed", + "bestReasonableCase" + ] + }, + "source": { + "type": "string", + "enum": [ + "current_data", + "user_supplied", + "github_observed", + "gittensory_projection" + ] + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "scoreEstimate": { + "type": "object", + "properties": { + "baseScore": { + "type": "number" + }, + "densityMultiplier": { + "type": "number" + }, + "contributionBonus": { + "type": "number" + }, + "labelMultiplier": { + "type": "number" + }, + "issueMultiplier": { + "type": "number" + }, + "credibilityMultiplier": { + "type": "number" + }, + "reviewPenaltyMultiplier": { + "type": "number" + }, + "openPrMultiplier": { + "type": "number" + }, + "estimatedMergedScore": { + "type": "number" + }, + "pendingSaturationScore": { + "type": "number" } }, - "scoreEstimate": { - "type": "object", - "properties": { - "baseScore": { - "type": "number" - }, - "densityMultiplier": { - "type": "number" - }, - "contributionBonus": { - "type": "number" - }, - "labelMultiplier": { - "type": "number" - }, - "issueMultiplier": { - "type": "number" - }, - "credibilityMultiplier": { - "type": "number" - }, - "reviewPenaltyMultiplier": { - "type": "number" - }, - "openPrMultiplier": { - "type": "number" - }, - "estimatedMergedScore": { - "type": "number" - }, - "pendingSaturationScore": { - "type": "number" - } + "required": [ + "baseScore", + "densityMultiplier", + "contributionBonus", + "labelMultiplier", + "issueMultiplier", + "credibilityMultiplier", + "reviewPenaltyMultiplier", + "openPrMultiplier", + "estimatedMergedScore", + "pendingSaturationScore" + ] + }, + "gates": { + "type": "object", + "properties": { + "baseTokenGatePassed": { + "type": "boolean" }, - "required": [ - "baseScore", - "densityMultiplier", - "contributionBonus", - "labelMultiplier", - "issueMultiplier", - "credibilityMultiplier", - "reviewPenaltyMultiplier", - "openPrMultiplier", - "estimatedMergedScore", - "pendingSaturationScore" - ] - }, - "gates": { - "type": "object", - "properties": { - "baseTokenGatePassed": { - "type": "boolean" - }, - "openPrThreshold": { - "type": "number" - }, - "openPrCount": { - "type": "number" - }, - "collateralFraction": { - "type": "number" - }, - "credibilityFloor": { - "type": "number" - }, - "credibilityObserved": { - "type": "number" - } + "openPrThreshold": { + "type": "number" }, - "required": [ - "baseTokenGatePassed", - "openPrThreshold", - "openPrCount", - "collateralFraction", - "credibilityFloor", - "credibilityObserved" - ] - }, - "effectiveEstimatedScore": { - "type": "number" - }, - "underlyingPotentialScore": { - "type": "number" - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" - ] - }, - "severity": { - "type": "string", - "enum": [ - "blocker", - "reducer", - "context" - ] - }, - "detail": { - "type": "string" - } - }, - "required": [ - "code", - "severity", - "detail" - ] + "openPrCount": { + "type": "number" + }, + "collateralFraction": { + "type": "number" + }, + "credibilityFloor": { + "type": "number" + }, + "credibilityObserved": { + "type": "number" } }, - "linkedIssueMultiplier": { + "required": [ + "baseTokenGatePassed", + "openPrThreshold", + "openPrCount", + "collateralFraction", + "credibilityFloor", + "credibilityObserved" + ] + }, + "effectiveEstimatedScore": { + "type": "number" + }, + "underlyingPotentialScore": { + "type": "number" + }, + "blockedBy": { + "type": "array", + "items": { "type": "object", "properties": { - "mode": { - "type": "string", - "enum": [ - "none", - "standard", - "maintainer" - ] - }, - "status": { - "type": "string", - "enum": [ - "not_required", - "raw", - "plausible", - "validated", - "invalid", - "unavailable" - ] - }, - "source": { + "code": { "type": "string", "enum": [ - "none", - "user_supplied", - "official_mirror", - "github_cache", - "issue_quality", - "missing" - ] - }, - "eligible": { - "type": "boolean" - }, - "issueNumbers": { - "type": "array", - "items": { - "type": "number" - } - }, - "solvedByPullRequests": { - "type": "array", - "items": { - "type": "number" - } - }, - "baseMultiplier": { - "type": "number" + "repo_not_registered", + "inactive_allocation", + "base_token_gate", + "open_pr_threshold", + "credibility_floor", + "review_penalty", + "metadata_only", + "linked_issue_invalid", + "linked_issue_unvalidated", + "branch_ineligible", + "branch_eligibility_missing" + ] }, - "appliedMultiplier": { - "type": "number" + "severity": { + "type": "string", + "enum": [ + "blocker", + "reducer", + "context" + ] }, - "reason": { + "detail": { "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } } }, "required": [ - "mode", - "status", - "source", - "eligible", - "issueNumbers", - "solvedByPullRequests", - "baseMultiplier", - "appliedMultiplier", - "reason", - "warnings" + "code", + "severity", + "detail" ] - }, - "deltaExplanation": { - "type": "string" } }, - "required": [ - "name", - "source", - "assumptions", - "scoreEstimate", - "gates", - "effectiveEstimatedScore", - "underlyingPotentialScore", - "blockedBy", - "linkedIssueMultiplier", - "deltaExplanation" - ] - }, - "gateDeltas": { - "type": "array", - "items": { + "linkedIssueMultiplier": { "type": "object", "properties": { - "gate": { + "mode": { "type": "string", "enum": [ - "open_pr_threshold", - "credibility_floor", - "linked_issue_multiplier" + "none", + "standard", + "maintainer" ] }, - "current": { - "type": "string" - }, - "projected": { - "type": "string" - }, - "explanation": { - "type": "string" - } - }, - "required": [ - "gate", - "current", - "projected", - "explanation" - ] - } - }, - "blockedBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "code": { + "status": { "type": "string", "enum": [ - "repo_not_registered", - "inactive_allocation", - "base_token_gate", - "open_pr_threshold", - "credibility_floor", - "review_penalty", - "metadata_only", - "linked_issue_invalid", - "linked_issue_unvalidated", - "branch_ineligible", - "branch_eligibility_missing" + "not_required", + "raw", + "plausible", + "validated", + "invalid", + "unavailable" ] }, - "severity": { + "source": { "type": "string", "enum": [ - "blocker", - "reducer", - "context" + "none", + "user_supplied", + "official_mirror", + "github_cache", + "issue_quality", + "missing" ] }, - "detail": { + "eligible": { + "type": "boolean" + }, + "issueNumbers": { + "type": "array", + "items": { + "type": "number" + } + }, + "solvedByPullRequests": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseMultiplier": { + "type": "number" + }, + "appliedMultiplier": { + "type": "number" + }, + "reason": { "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "code", - "severity", - "detail" + "mode", + "status", + "source", + "eligible", + "issueNumbers", + "solvedByPullRequests", + "baseMultiplier", + "appliedMultiplier", + "reason", + "warnings" ] + }, + "deltaExplanation": { + "type": "string" + } + }, + "required": [ + "name", + "source", + "assumptions", + "scoreEstimate", + "gates", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "linkedIssueMultiplier", + "deltaExplanation" + ] + } + }, + "scoreabilityStatus": { + "type": "string", + "enum": [ + "blocked", + "conditionally_scoreable", + "scoreable", + "hold" + ] + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "recommendation": { + "type": "object", + "properties": { + "level": { + "type": "string", + "enum": [ + "strong_fit", + "reasonable_fit", + "needs_work", + "hold" + ] + }, + "actions": { + "type": "array", + "items": { + "type": "string" } } }, "required": [ - "current", - "bestReasonableCase", - "gateDeltas", - "blockedBy" + "level", + "actions" + ] + } + }, + "required": [ + "repoFullName", + "generatedAt", + "scoringModelSnapshotId", + "activeModel", + "privateOnly", + "laneMath", + "scoreEstimate", + "linkedIssueMultiplier", + "gates", + "branchEligibility", + "effectiveEstimatedScore", + "underlyingPotentialScore", + "blockedBy", + "gateDeltas", + "scenarioPreviews", + "scoreabilityStatus", + "warnings", + "assumptions", + "recommendation" + ] + }, + "RepoRewardRisk": { + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "repoFullName": { + "type": "string" + }, + "generatedAt": { + "type": "string" + }, + "roleContext": { + "$ref": "#/components/schemas/RoleContext" + }, + "lane": { + "$ref": "#/components/schemas/LaneAdvice" + }, + "recommendation": { + "type": "string", + "enum": [ + "pursue", + "cleanup_first", + "maintainer_lane", + "avoid_for_now", + "unknown" ] }, - "observedPullRequestScenarios": { + "rewardUpside": { "type": "object", "properties": { - "approvedOrMergeable": { + "relevantLane": { + "type": "string", + "enum": [ + "direct_pr", + "issue_discovery", + "maintainer_lane", + "none" + ] + }, + "repoSlice": { "type": "number" }, - "stale": { + "directPrSlice": { "type": "number" }, - "closed": { + "issueDiscoverySlice": { "type": "number" }, - "draft": { + "maintainerCutSlice": { "type": "number" }, - "blocked": { + "labelMultiplier": { "type": "number" }, - "maintainerLane": { + "issueMultiplier": { "type": "number" }, - "notes": { - "type": "array", - "items": { - "type": "string" - } + "estimatedScoreIfClean": { + "type": "number" + }, + "currentEstimatedScore": { + "type": "number" } }, "required": [ - "approvedOrMergeable", - "stale", - "closed", - "draft", - "blocked", - "maintainerLane", - "notes" + "relevantLane", + "repoSlice", + "directPrSlice", + "issueDiscoverySlice", + "maintainerCutSlice", + "labelMultiplier", + "issueMultiplier", + "estimatedScoreIfClean", + "currentEstimatedScore" ] }, - "githubBranchStatus": { + "scoreBlockers": { + "type": "array", + "items": { + "type": "string" + } + }, + "riskBreakdown": { "type": "object", "properties": { - "source": { + "queueBurden": { "type": "string", "enum": [ - "cached_github_data" + "low", + "medium", + "high", + "critical" ] }, - "status": { + "queueBurdenScore": { + "type": "number" + }, + "duplicateClusters": { + "type": "number" + }, + "highRiskDuplicateClusters": { + "type": "number" + }, + "closedPullRequestRate": { + "type": "number" + }, + "openPullRequests": { + "type": "number" + }, + "credibility": { + "type": "number" + }, + "reviewChurnRisk": { "type": "string", "enum": [ - "approved", - "failing_checks", - "needs_author", - "blocked", - "pending_review", - "no_pr", - "unknown" + "low", + "medium", + "high" + ] + } + }, + "required": [ + "queueBurden", + "queueBurdenScore", + "duplicateClusters", + "highRiskDuplicateClusters", + "closedPullRequestRate", + "openPullRequests", + "credibility", + "reviewChurnRisk" + ] + }, + "actionImpact": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "currentPreview": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "afterCleanupPreview": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RewardRiskAction" + } + }, + "whyThisHelps": { + "type": "array", + "items": { + "type": "string" + } + }, + "nextActions": { + "type": "array", + "items": { + "type": "string" + } + }, + "summary": { + "type": "string" + } + }, + "required": [ + "login", + "repoFullName", + "generatedAt", + "roleContext", + "lane", + "recommendation", + "rewardUpside", + "scoreBlockers", + "riskBreakdown", + "actionImpact", + "currentPreview", + "afterCleanupPreview", + "actions", + "whyThisHelps", + "nextActions", + "summary" + ] + }, + "RewardRiskAction": { + "type": "object", + "properties": { + "actionKind": { + "type": "string", + "enum": [ + "cleanup_existing_prs", + "land_existing_prs", + "close_or_withdraw_low_fit_prs", + "open_new_direct_pr", + "file_issue_discovery", + "maintainer_lane_improve_repo", + "maintainer_cut_readiness" + ] + }, + "repoFullName": { + "type": "string" + }, + "priorityScore": { + "type": "number" + }, + "laneValueScore": { + "type": "number" + }, + "scoreabilityScore": { + "type": "number" + }, + "personalFitScore": { + "type": "number" + }, + "riskPenalty": { + "type": "number" + }, + "maintainerFrictionPenalty": { + "type": "number" + }, + "actionLeverageScore": { + "type": "number" + }, + "whyThisHelps": { + "type": "array", + "items": { + "type": "string" + } + }, + "nextActions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "actionKind", + "repoFullName", + "priorityScore", + "laneValueScore", + "scoreabilityScore", + "personalFitScore", + "riskPenalty", + "maintainerFrictionPenalty", + "actionLeverageScore", + "whyThisHelps", + "nextActions" + ] + }, + "LocalWorkspaceIntelligence": { + "type": "object", + "properties": { + "version": { + "type": "number", + "enum": [ + 2 + ] + }, + "sourceUpload": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + false ] }, - "pullNumber": { - "type": "number" - }, - "title": { + "detail": { "type": "string" - }, - "reviewDecision": { - "type": "string", - "nullable": true - }, - "mergeableState": { - "type": "string", - "nullable": true - }, - "notes": { - "type": "array", - "items": { - "type": "string" - } } }, "required": [ - "source", - "status", - "notes" + "enabled", + "detail" ] }, - "branchEligibility": { + "branch": { "type": "object", "properties": { - "required": { - "type": "boolean" - }, - "status": { - "type": "string", - "enum": [ - "eligible", - "ineligible", - "unknown", - "not_required" - ] - }, - "evidence": { - "type": "string", - "enum": [ - "provided", - "missing" - ] - }, - "source": { - "type": "string", - "enum": [ - "github_metadata", - "local_metadata", - "registry", - "user_supplied", - "missing" - ] - }, - "reason": { + "name": { "type": "string" }, - "checkedAt": { + "baseRef": { "type": "string" }, - "stale": { - "type": "boolean" + "headSha": { + "type": "string" }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } + "pendingCommitCount": { + "type": "number" } }, "required": [ - "required", - "status", - "evidence", - "source", - "stale", - "warnings" + "pendingCommitCount" ] }, - "rewardRisk": { - "$ref": "#/components/schemas/RepoRewardRisk" - }, - "scoreBlockers": { - "type": "array", - "items": { - "type": "string" - } - }, - "branchQualityBlockers": { - "type": "array", - "items": { - "type": "string" - } - }, - "accountStateBlockers": { - "type": "array", - "items": { - "type": "string" - } - }, - "recommendedRerunCondition": { - "type": "string" - }, - "localFindings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Finding" - } - }, - "maintainerFit": { + "changedFiles": { "type": "object", "properties": { - "recommendation": { - "type": "string", - "enum": [ - "pursue", - "cleanup_first", - "maintainer_lane", - "avoid_for_now", - "unknown" - ] + "total": { + "type": "number" }, - "reviewBurden": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] + "added": { + "type": "number" }, - "role": { - "type": "string", - "enum": [ - "outside_contributor", - "repo_maintainer", - "org_member", - "collaborator", - "owner", - "unknown" - ] + "modified": { + "type": "number" }, - "maintainerLane": { - "type": "boolean" + "deleted": { + "type": "number" }, - "reasons": { - "type": "array", - "items": { - "type": "string" - } + "renamed": { + "type": "number" }, - "risks": { + "binary": { + "type": "number" + }, + "paths": { "type": "array", "items": { "type": "string" @@ -6070,101 +6147,108 @@ } }, "required": [ - "recommendation", - "reviewBurden", - "role", - "maintainerLane", - "reasons", - "risks" + "total", + "added", + "modified", + "deleted", + "renamed", + "binary", + "paths" ] }, - "manifestGuidance": { + "testEvidence": { "type": "object", "properties": { - "present": { - "type": "boolean" - }, - "source": { + "level": { "type": "string", "enum": [ - "repo_file", - "api_record", + "test_files", + "validation_commands", + "both", "none" ] }, - "linkedIssuePolicy": { - "type": "string", - "enum": [ - "required", - "preferred", - "optional" - ] - }, - "issueDiscoveryPolicy": { - "type": "string", - "enum": [ - "encouraged", - "neutral", - "discouraged" - ] - }, - "matchedWantedPaths": { - "type": "array", - "items": { - "type": "string" - } - }, - "matchedBlockedPaths": { - "type": "array", - "items": { - "type": "string" - } + "testFileCount": { + "type": "number" }, - "preferredLabelHits": { - "type": "array", - "items": { - "type": "string" - } + "passedValidationCount": { + "type": "number" }, - "findings": { + "commands": { "type": "array", "items": { "type": "object", "properties": { - "code": { + "command": { "type": "string" }, - "severity": { + "status": { "type": "string", "enum": [ - "info", - "warning", - "critical" + "passed", + "failed", + "not_run" ] }, - "title": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "action": { + "summary": { "type": "string" } }, "required": [ - "code", - "severity", - "title", - "detail" + "command", + "status" ] } + } + }, + "required": [ + "level", + "testFileCount", + "passedValidationCount", + "commands" + ] + }, + "linkedIssues": { + "type": "array", + "items": { + "type": "number" + } + }, + "baseFreshness": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "fresh", + "stale", + "possibly_stale", + "unknown" + ] }, - "publicNextSteps": { - "type": "array", - "items": { - "type": "string" - } + "baseRef": { + "type": "string" + }, + "baseSha": { + "type": "string" + }, + "headSha": { + "type": "string" + }, + "mergeBaseSha": { + "type": "string" + }, + "remoteTrackingSha": { + "type": "string" + }, + "changedFileCount": { + "type": "number" + }, + "testFileCount": { + "type": "number" + }, + "passedValidationCount": { + "type": "number" }, "warnings": { "type": "array", @@ -6172,116 +6256,59 @@ "type": "string" } }, - "summary": { + "recommendation": { "type": "string" } }, "required": [ - "present", - "source", - "linkedIssuePolicy", - "issueDiscoveryPolicy", - "matchedWantedPaths", - "matchedBlockedPaths", - "preferredLabelHits", - "findings", - "publicNextSteps", - "warnings", - "summary" + "status", + "changedFileCount", + "testFileCount", + "passedValidationCount", + "warnings" ] }, - "prPacket": { + "ciStatusHints": { + "type": "array", + "items": { + "type": "string" + } + }, + "localScorerDiagnostics": { "type": "object", "properties": { - "titleSuggestion": { + "mode": { "type": "string" }, - "markdown": { + "activeModel": { "type": "string" }, - "bodySections": { + "warnings": { "type": "array", "items": { - "type": "object", - "properties": { - "heading": { - "type": "string" - }, - "lines": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "heading", - "lines" - ] + "type": "string" } }, - "reviewerNotes": { + "metadataOnly": { + "type": "boolean" + } + }, + "required": [ + "mode", + "warnings", + "metadataOnly" + ] + }, + "blockers": { + "type": "object", + "properties": { + "branchQuality": { "type": "array", "items": { "type": "string" } }, - "validationSummary": { - "type": "object", - "properties": { - "passed": { - "type": "number" - }, - "failed": { - "type": "number" - }, - "notRun": { - "type": "number" - }, - "commands": { - "type": "array", - "items": { - "type": "object", - "properties": { - "command": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "passed", - "failed", - "not_run", - "skipped", - "focused", - "unknown" - ] - }, - "summary": { - "type": "string" - }, - "durationMs": { - "type": "number" - }, - "exitCode": { - "type": "number" - } - }, - "required": [ - "command", - "status" - ] - } - } - }, - "required": [ - "passed", - "failed", - "notRun", - "commands" - ] - }, - "publicSafeWarnings": { + "accountState": { "type": "array", "items": { "type": "string" @@ -6289,52 +6316,25 @@ } }, "required": [ - "titleSuggestion", - "markdown", - "bodySections", - "reviewerNotes", - "validationSummary", - "publicSafeWarnings" + "branchQuality", + "accountState" ] }, - "nextActions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RewardRiskAction" - } - }, - "workspaceIntelligence": { - "$ref": "#/components/schemas/LocalWorkspaceIntelligence" - }, - "summary": { + "rerunWhen": { "type": "string" } }, "required": [ - "login", - "repoFullName", - "generatedAt", + "version", + "sourceUpload", + "branch", + "changedFiles", + "testEvidence", + "linkedIssues", "baseFreshness", - "lane", - "roleContext", - "preflight", - "scorePreview", - "scenarioScorePreview", - "observedPullRequestScenarios", - "githubBranchStatus", - "branchEligibility", - "rewardRisk", - "scoreBlockers", - "branchQualityBlockers", - "accountStateBlockers", - "recommendedRerunCondition", - "localFindings", - "maintainerFit", - "manifestGuidance", - "prPacket", - "nextActions", - "workspaceIntelligence", - "summary" + "ciStatusHints", + "blockers", + "rerunWhen" ] }, "MaintainerPacket": { @@ -6393,21 +6393,71 @@ ] } }, - "suggestedActions": { + "suggestedActions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "repoFullName", + "generatedAt", + "queueHealth", + "configQuality", + "collisions", + "pullRequestPackets", + "suggestedActions" + ] + }, + "MaintainerLaneReport": { + "type": "object", + "properties": { + "repoFullName": { + "type": "string" + }, + "generatedAt": { + "type": "string" + }, + "lane": { + "$ref": "#/components/schemas/LaneAdvice" + }, + "maintainerCut": { + "type": "number" + }, + "maintainerCutConfigured": { + "type": "boolean" + }, + "queueHealth": { + "$ref": "#/components/schemas/QueueHealth" + }, + "configQuality": { + "$ref": "#/components/schemas/ConfigQuality" + }, + "contributorIntakeHealth": { + "$ref": "#/components/schemas/ContributorIntakeHealth" + }, + "summary": { + "type": "string" + }, + "findings": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Finding" } } }, "required": [ "repoFullName", "generatedAt", + "lane", + "maintainerCut", + "maintainerCutConfigured", "queueHealth", "configQuality", - "collisions", - "pullRequestPackets", - "suggestedActions" + "contributorIntakeHealth", + "summary", + "findings" ] }, "ContributorIntakeHealth": { @@ -6475,56 +6525,6 @@ "findings" ] }, - "MaintainerLaneReport": { - "type": "object", - "properties": { - "repoFullName": { - "type": "string" - }, - "generatedAt": { - "type": "string" - }, - "lane": { - "$ref": "#/components/schemas/LaneAdvice" - }, - "maintainerCut": { - "type": "number" - }, - "maintainerCutConfigured": { - "type": "boolean" - }, - "queueHealth": { - "$ref": "#/components/schemas/QueueHealth" - }, - "configQuality": { - "$ref": "#/components/schemas/ConfigQuality" - }, - "contributorIntakeHealth": { - "$ref": "#/components/schemas/ContributorIntakeHealth" - }, - "summary": { - "type": "string" - }, - "findings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Finding" - } - } - }, - "required": [ - "repoFullName", - "generatedAt", - "lane", - "maintainerCut", - "maintainerCutConfigured", - "queueHealth", - "configQuality", - "contributorIntakeHealth", - "summary", - "findings" - ] - }, "MaintainerCutReadiness": { "type": "object", "properties": { @@ -7240,7 +7240,8 @@ "bot_author", "maintainer_author", "miner_detection_unavailable", - "not_official_gittensor_miner" + "not_official_gittensor_miner", + null ] }, "actions": { @@ -8032,46 +8033,234 @@ ] } }, - "eventRemediation": { + "eventRemediation": { + "type": "array", + "items": { + "type": "object", + "properties": { + "event": { + "type": "string" + }, + "ok": { + "type": "boolean" + }, + "action": { + "type": "string" + } + }, + "required": [ + "event", + "ok", + "action" + ] + } + }, + "repairSteps": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "installationId", + "accountLogin", + "installedReposCount", + "registeredInstalledCount", + "status", + "missingPermissions", + "missingEvents", + "permissions", + "events", + "checkedAt" + ] + }, + "SyncStatus": { + "type": "object", + "properties": { + "generatedAt": { + "type": "string" + }, + "signalFidelity": { + "$ref": "#/components/schemas/SignalFidelity" + }, + "freshnessSlo": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "fresh", + "degraded", + "blocked" + ] + }, + "generatedAt": { + "type": "string" + }, + "staleCount": { + "type": "number" + }, + "degradedCount": { + "type": "number" + }, + "blockedCount": { + "type": "number" + }, + "missingCount": { + "type": "number" + }, + "launchBlockingCount": { + "type": "number" + }, + "repairRecommended": { + "type": "boolean" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "area": { + "type": "string" + }, + "targetKey": { + "type": "string" + }, + "status": { + "type": "string" + }, + "launchBlocking": { + "type": "boolean" + }, + "ageSeconds": { + "type": "number" + }, + "sloSeconds": { + "type": "number" + }, + "breachSeconds": { + "type": "number" + }, + "observedAt": { + "type": "string", + "nullable": true + }, + "summary": { + "type": "string" + } + }, + "required": [ + "area", + "targetKey", + "status", + "launchBlocking", + "sloSeconds", + "summary" + ] + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "status", + "generatedAt", + "staleCount", + "degradedCount", + "blockedCount", + "missingCount", + "launchBlockingCount", + "repairRecommended", + "items", + "warnings" + ] + }, + "coreSignalFidelity": { + "$ref": "#/components/schemas/CoreSignalFidelity" + }, + "upstreamDrift": { + "$ref": "#/components/schemas/UpstreamStatus" + }, + "historyCoverage": { + "type": "string", + "enum": [ + "sampled", + "counts_only", + "full" + ] + }, + "refreshingRepos": { + "type": "array", + "items": { + "type": "string" + } + }, + "waitingForRateLimitRepos": { + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepoSyncState" + } + }, + "segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepoSyncSegment" + } + }, + "githubTotals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepoGithubTotalsSnapshot" + } + }, + "pullRequestDetailSync": { "type": "array", "items": { "type": "object", - "properties": { - "event": { - "type": "string" - }, - "ok": { - "type": "boolean" - }, - "action": { - "type": "string" - } - }, - "required": [ - "event", - "ok", - "action" - ] + "additionalProperties": { + "nullable": true + } } }, - "repairSteps": { + "installations": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/InstallationHealth" + } + }, + "rateLimits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GitHubRateLimitObservation" } } }, "required": [ - "installationId", - "accountLogin", - "installedReposCount", - "registeredInstalledCount", - "status", - "missingPermissions", - "missingEvents", - "permissions", - "events", - "checkedAt" + "generatedAt", + "signalFidelity", + "freshnessSlo", + "coreSignalFidelity", + "upstreamDrift", + "historyCoverage", + "refreshingRepos", + "waitingForRateLimitRepos", + "repositories", + "segments", + "githubTotals", + "pullRequestDetailSync", + "installations", + "rateLimits" ] }, "CoreSignalFidelity": { @@ -8137,6 +8326,91 @@ "historyCoverage" ] }, + "UpstreamStatus": { + "type": "object", + "properties": { + "generatedAt": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "current", + "drift_detected", + "stale", + "unavailable" + ] + }, + "latestCommitSha": { + "type": "string", + "nullable": true + }, + "latestRulesetId": { + "type": "string", + "nullable": true + }, + "latestRulesetGeneratedAt": { + "type": "string", + "nullable": true + }, + "activeModel": { + "type": "string", + "nullable": true, + "enum": [ + "current_density_model", + "pending_saturation_model", + "exponential_saturation_model", + "unknown", + null + ] + }, + "highestSeverity": { + "type": "string", + "nullable": true, + "enum": [ + "low", + "medium", + "high", + "blocking", + null + ] + }, + "affectedAreas": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "registry", + "scoring_model", + "issue_discovery", + "mirror_linkage", + "language_weights", + "source" + ] + } + }, + "registryHyperparameterDrift": { + "$ref": "#/components/schemas/RegistryHyperparameterDriftSummary" + }, + "openReportCount": { + "type": "number" + }, + "reports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpstreamDriftReport" + } + } + }, + "required": [ + "generatedAt", + "status", + "affectedAreas", + "registryHyperparameterDrift", + "openReportCount", + "reports" + ] + }, "RegistryHyperparameterDriftSummary": { "type": "object", "properties": { @@ -8199,124 +8473,11 @@ "id": { "type": "string" }, - "fingerprint": { - "type": "string" - }, - "severity": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "blocking" - ] - }, - "status": { - "type": "string", - "enum": [ - "open", - "acknowledged", - "resolved", - "ignored" - ] - }, - "summary": { - "type": "string" - }, - "affectedAreas": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "registry", - "scoring_model", - "issue_discovery", - "mirror_linkage", - "language_weights", - "source" - ] - } - }, - "previousRulesetId": { - "type": "string", - "nullable": true - }, - "currentRulesetId": { - "type": "string", - "nullable": true - }, - "issueNumber": { - "type": "number", - "nullable": true - }, - "issueUrl": { - "type": "string", - "nullable": true - }, - "payload": { - "type": "object", - "additionalProperties": { - "nullable": true - } - }, - "generatedAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - }, - "required": [ - "id", - "fingerprint", - "severity", - "status", - "summary", - "affectedAreas", - "generatedAt", - "updatedAt" - ] - }, - "UpstreamStatus": { - "type": "object", - "properties": { - "generatedAt": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "current", - "drift_detected", - "stale", - "unavailable" - ] - }, - "latestCommitSha": { - "type": "string", - "nullable": true - }, - "latestRulesetId": { - "type": "string", - "nullable": true - }, - "latestRulesetGeneratedAt": { - "type": "string", - "nullable": true - }, - "activeModel": { - "type": "string", - "nullable": true, - "enum": [ - "current_density_model", - "pending_saturation_model", - "exponential_saturation_model", - "unknown" - ] + "fingerprint": { + "type": "string" }, - "highestSeverity": { + "severity": { "type": "string", - "nullable": true, "enum": [ "low", "medium", @@ -8324,6 +8485,18 @@ "blocking" ] }, + "status": { + "type": "string", + "enum": [ + "open", + "acknowledged", + "resolved", + "ignored" + ] + }, + "summary": { + "type": "string" + }, "affectedAreas": { "type": "array", "items": { @@ -8338,26 +8511,44 @@ ] } }, - "registryHyperparameterDrift": { - "$ref": "#/components/schemas/RegistryHyperparameterDriftSummary" + "previousRulesetId": { + "type": "string", + "nullable": true }, - "openReportCount": { - "type": "number" + "currentRulesetId": { + "type": "string", + "nullable": true }, - "reports": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UpstreamDriftReport" + "issueNumber": { + "type": "number", + "nullable": true + }, + "issueUrl": { + "type": "string", + "nullable": true + }, + "payload": { + "type": "object", + "additionalProperties": { + "nullable": true } + }, + "generatedAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" } }, "required": [ - "generatedAt", + "id", + "fingerprint", + "severity", "status", + "summary", "affectedAreas", - "registryHyperparameterDrift", - "openReportCount", - "reports" + "generatedAt", + "updatedAt" ] }, "RepoGithubTotalsSnapshot": { @@ -8422,194 +8613,6 @@ "fetchedAt" ] }, - "SyncStatus": { - "type": "object", - "properties": { - "generatedAt": { - "type": "string" - }, - "signalFidelity": { - "$ref": "#/components/schemas/SignalFidelity" - }, - "freshnessSlo": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "fresh", - "degraded", - "blocked" - ] - }, - "generatedAt": { - "type": "string" - }, - "staleCount": { - "type": "number" - }, - "degradedCount": { - "type": "number" - }, - "blockedCount": { - "type": "number" - }, - "missingCount": { - "type": "number" - }, - "launchBlockingCount": { - "type": "number" - }, - "repairRecommended": { - "type": "boolean" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "area": { - "type": "string" - }, - "targetKey": { - "type": "string" - }, - "status": { - "type": "string" - }, - "launchBlocking": { - "type": "boolean" - }, - "ageSeconds": { - "type": "number" - }, - "sloSeconds": { - "type": "number" - }, - "breachSeconds": { - "type": "number" - }, - "observedAt": { - "type": "string", - "nullable": true - }, - "summary": { - "type": "string" - } - }, - "required": [ - "area", - "targetKey", - "status", - "launchBlocking", - "sloSeconds", - "summary" - ] - } - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "status", - "generatedAt", - "staleCount", - "degradedCount", - "blockedCount", - "missingCount", - "launchBlockingCount", - "repairRecommended", - "items", - "warnings" - ] - }, - "coreSignalFidelity": { - "$ref": "#/components/schemas/CoreSignalFidelity" - }, - "upstreamDrift": { - "$ref": "#/components/schemas/UpstreamStatus" - }, - "historyCoverage": { - "type": "string", - "enum": [ - "sampled", - "counts_only", - "full" - ] - }, - "refreshingRepos": { - "type": "array", - "items": { - "type": "string" - } - }, - "waitingForRateLimitRepos": { - "type": "array", - "items": { - "type": "string" - } - }, - "repositories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RepoSyncState" - } - }, - "segments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RepoSyncSegment" - } - }, - "githubTotals": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RepoGithubTotalsSnapshot" - } - }, - "pullRequestDetailSync": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "nullable": true - } - } - }, - "installations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InstallationHealth" - } - }, - "rateLimits": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GitHubRateLimitObservation" - } - } - }, - "required": [ - "generatedAt", - "signalFidelity", - "freshnessSlo", - "coreSignalFidelity", - "upstreamDrift", - "historyCoverage", - "refreshingRepos", - "waitingForRateLimitRepos", - "repositories", - "segments", - "githubTotals", - "pullRequestDetailSync", - "installations", - "rateLimits" - ] - }, "Readiness": { "type": "object", "properties": {