From 511426f5033f073bc5ca553184ccdfb4397b4cf4 Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 12:53:39 +0200 Subject: [PATCH 1/6] feat(analytics): add role retention rollups --- ...7_product_usage_role_retention_rollups.sql | 11 + src/db/repositories.ts | 269 ++++++++++++++++-- src/db/schema.ts | 4 + src/types.ts | 44 +++ 4 files changed, 312 insertions(+), 16 deletions(-) create mode 100644 migrations/0017_product_usage_role_retention_rollups.sql diff --git a/migrations/0017_product_usage_role_retention_rollups.sql b/migrations/0017_product_usage_role_retention_rollups.sql new file mode 100644 index 0000000000..a6fc4fc42d --- /dev/null +++ b/migrations/0017_product_usage_role_retention_rollups.sql @@ -0,0 +1,11 @@ +ALTER TABLE product_usage_daily_rollups + ADD COLUMN roles_json TEXT NOT NULL DEFAULT '[]'; + +ALTER TABLE product_usage_daily_rollups + ADD COLUMN activation_by_role_json TEXT NOT NULL DEFAULT '[]'; + +ALTER TABLE product_usage_daily_rollups + ADD COLUMN activation_by_surface_json TEXT NOT NULL DEFAULT '[]'; + +ALTER TABLE product_usage_daily_rollups + ADD COLUMN retention_json TEXT NOT NULL DEFAULT '[]'; diff --git a/src/db/repositories.ts b/src/db/repositories.ts index 239f4c5cb1..94807c0592 100644 --- a/src/db/repositories.ts +++ b/src/db/repositories.ts @@ -90,11 +90,18 @@ import type { ProductUsageDailyRollupRecord, ProductUsageDailyRollupStatus, ProductUsageEventRecord, + ProductUsageRetentionRollup, ProductUsageRollupRunResult, ProductUsageRollupStatus, ProductUsageOutcome, + ProductUsageRole, + ProductUsageRoleActivationFunnel, + ProductUsageRoleDimensionCount, + ProductUsageRoleRetention, ProductUsageSummary, ProductUsageSurface, + ProductUsageSurfaceActivationFunnel, + ProductUsageSurfaceRetention, PullRequestFileRecord, PullRequestDetailSyncStateRecord, PullRequestRecord, @@ -3091,6 +3098,10 @@ function toProductUsageDailyRollupRecord(row: typeof productUsageDailyRollups.$i byTool: parseJson>(row.toolsJson, []), byRouteClass: parseJson>(row.routeClassesJson, []), activation: parseJson(row.activationJson, emptyProductUsageActivationFunnel()), + byRole: parseJson(row.rolesJson, []), + activationByRole: parseJson(row.activationByRoleJson, []), + activationBySurface: parseJson(row.activationBySurfaceJson, []), + retention: parseJson(row.retentionJson, []), generatedAt: row.generatedAt, updatedAt: row.updatedAt, }; @@ -3183,12 +3194,25 @@ async function upsertProductUsageDailyRollup(env: Env, day: string, generatedAt: .limit(PRODUCT_USAGE_ROLLUP_EVENT_SCAN_LIMIT + 1); const capped = rows.length > PRODUCT_USAGE_ROLLUP_EVENT_SCAN_LIMIT || sourceEventCount > PRODUCT_USAGE_ROLLUP_EVENT_SCAN_LIMIT; const events = rows.slice(0, PRODUCT_USAGE_ROLLUP_EVENT_SCAN_LIMIT).map(toProductUsageEventRecord); + const retentionStartIso = `${addProductUsageUtcDays(day, -PRODUCT_USAGE_RETENTION_MAX_WINDOW_DAYS)}T00:00:00.000Z`; + const retentionWhere = and(gte(productUsageEvents.occurredAt, retentionStartIso), sql`${productUsageEvents.occurredAt} < ${startIso}`, sql`${productUsageEvents.actorHash} is not null`); + const [retentionSourceRow] = await db.select({ count: sql`count(*)` }).from(productUsageEvents).where(retentionWhere); + const retentionRows = await db + .select() + .from(productUsageEvents) + .where(retentionWhere) + .orderBy(desc(productUsageEvents.occurredAt)) + .limit(PRODUCT_USAGE_RETENTION_EVENT_SCAN_LIMIT + 1); + const retentionCapped = retentionRows.length > PRODUCT_USAGE_RETENTION_EVENT_SCAN_LIMIT || Number(retentionSourceRow?.count ?? 0) > PRODUCT_USAGE_RETENTION_EVENT_SCAN_LIMIT; + const retentionEvents = retentionRows.slice(0, PRODUCT_USAGE_RETENTION_EVENT_SCAN_LIMIT).map(toProductUsageEventRecord); const record = buildProductUsageDailyRollupRecord({ day, generatedAt, sourceEventCount, capped, events, + retentionEvents, + retentionCapped, }); await db .insert(productUsageDailyRollups) @@ -3211,6 +3235,10 @@ async function upsertProductUsageDailyRollup(env: Env, day: string, generatedAt: toolsJson: jsonString(record.byTool), routeClassesJson: jsonString(record.byRouteClass), activationJson: jsonString(record.activation), + rolesJson: jsonString(record.byRole), + activationByRoleJson: jsonString(record.activationByRole), + activationBySurfaceJson: jsonString(record.activationBySurface), + retentionJson: jsonString(record.retention), generatedAt: record.generatedAt, updatedAt: record.updatedAt, }) @@ -3234,6 +3262,10 @@ async function upsertProductUsageDailyRollup(env: Env, day: string, generatedAt: toolsJson: jsonString(record.byTool), routeClassesJson: jsonString(record.byRouteClass), activationJson: jsonString(record.activation), + rolesJson: jsonString(record.byRole), + activationByRoleJson: jsonString(record.activationByRole), + activationBySurfaceJson: jsonString(record.activationBySurface), + retentionJson: jsonString(record.retention), generatedAt: record.generatedAt, updatedAt: record.updatedAt, }, @@ -3247,27 +3279,16 @@ function buildProductUsageDailyRollupRecord(args: { sourceEventCount: number; capped: boolean; events: ProductUsageEventRecord[]; + retentionEvents: ProductUsageEventRecord[]; + retentionCapped: boolean; }): ProductUsageDailyRollupRecord { const today = productUsageDayFromIso(args.generatedAt); const actorHashes = new Set(args.events.map((event) => event.actorHash).filter(isNonEmptyString)); const sessionHashes = new Set(args.events.map((event) => event.sessionHash).filter(isNonEmptyString)); const repoNames = new Set(args.events.map((event) => event.repoFullName).filter(isNonEmptyString)); - const loginActors = productUsageActorSet(args.events, (event) => event.eventName === "auth_session_created"); - const doctorPassActors = productUsageActorSet(args.events, isProductUsageDoctorPassEvent); - const firstUsefulActionActors = productUsageActorSet(args.events, isProductUsageUsefulActionEvent); - const githubInstalledRepos = productUsageRepoSet(args.events, (event) => event.eventName === "github_installation_created"); - const githubFirstCommandRepos = productUsageRepoSet(args.events, isProductUsageGitHubCommandEvent); - const githubUsefulMaintainerRepos = productUsageRepoSet(args.events, isProductUsageUsefulMaintainerEvent); - const activation: ProductUsageActivationFunnel = { - loginActors: loginActors.size, - doctorPassActors: doctorPassActors.size, - firstUsefulActionActors: firstUsefulActionActors.size, - fullyActivatedActors: intersectionCount(loginActors, doctorPassActors, firstUsefulActionActors), - githubInstalledRepos: githubInstalledRepos.size, - githubFirstCommandRepos: githubFirstCommandRepos.size, - githubUsefulMaintainerRepos: githubUsefulMaintainerRepos.size, - githubActivatedRepos: intersectionCount(githubInstalledRepos, githubFirstCommandRepos, githubUsefulMaintainerRepos), - }; + const roleBuckets = productUsageRoleBuckets(args.events); + const surfaceBuckets = productUsageSurfaceBuckets(args.events); + const activation = buildProductUsageActivationFunnel(args.events); return { day: args.day, status: args.capped ? "incomplete" : args.day === today ? "partial" : "complete", @@ -3287,11 +3308,220 @@ function buildProductUsageDailyRollupRecord(args: { byTool: countProductUsageDimensions(args.events.map((event) => productUsageMetadataString(event, "toolName"))), byRouteClass: countProductUsageDimensions(args.events.map((event) => productUsageRouteClass(event.route))), activation, + byRole: roleBuckets.map(({ role, events }) => ({ + role, + count: events.length, + activeActors: new Set(events.map((event) => event.actorHash).filter(isNonEmptyString)).size, + activeRepos: new Set(events.map((event) => event.repoFullName).filter(isNonEmptyString)).size, + })), + activationByRole: roleBuckets.map(({ role, events }) => ({ role, ...buildProductUsageActivationFunnel(events) })), + activationBySurface: surfaceBuckets.map(({ surface, events }) => ({ surface, ...buildProductUsageActivationFunnel(events) })), + retention: buildProductUsageRetentionRollups(args.day, args.events, args.retentionEvents, args.retentionCapped), generatedAt: args.generatedAt, updatedAt: args.generatedAt, }; } +function buildProductUsageActivationFunnel(events: ProductUsageEventRecord[]): ProductUsageActivationFunnel { + const loginActors = productUsageActorSet(events, (event) => event.eventName === "auth_session_created"); + const doctorPassActors = productUsageActorSet(events, isProductUsageDoctorPassEvent); + const firstUsefulActionActors = productUsageActorSet(events, isProductUsageUsefulActionEvent); + const githubInstalledRepos = productUsageRepoSet(events, (event) => event.eventName === "github_installation_created"); + const githubFirstCommandRepos = productUsageRepoSet(events, isProductUsageGitHubCommandEvent); + const githubUsefulMaintainerRepos = productUsageRepoSet(events, isProductUsageUsefulMaintainerEvent); + return { + loginActors: loginActors.size, + doctorPassActors: doctorPassActors.size, + firstUsefulActionActors: firstUsefulActionActors.size, + fullyActivatedActors: intersectionCount(loginActors, doctorPassActors, firstUsefulActionActors), + githubInstalledRepos: githubInstalledRepos.size, + githubFirstCommandRepos: githubFirstCommandRepos.size, + githubUsefulMaintainerRepos: githubUsefulMaintainerRepos.size, + githubActivatedRepos: intersectionCount(githubInstalledRepos, githubFirstCommandRepos, githubUsefulMaintainerRepos), + }; +} + +function productUsageRoleBuckets(events: ProductUsageEventRecord[]): Array<{ role: ProductUsageRole; events: ProductUsageEventRecord[] }> { + const buckets = new Map(); + const actorRoles = productUsageRolesByActor(events); + for (const event of events) { + for (const role of productUsageRolesForEvent(event, actorRoles)) { + const bucket = buckets.get(role); + if (bucket) bucket.push(event); + else buckets.set(role, [event]); + } + } + return [...buckets.entries()] + .map(([role, bucketEvents]) => ({ role, events: bucketEvents })) + .sort((a, b) => b.events.length - a.events.length || productUsageRoleSortValue(a.role) - productUsageRoleSortValue(b.role)); +} + +function productUsageSurfaceBuckets(events: ProductUsageEventRecord[]): Array<{ surface: ProductUsageSurface; events: ProductUsageEventRecord[] }> { + const buckets = new Map(); + for (const event of events) { + const surface = normalizeProductUsageSurface(event.surface); + const bucket = buckets.get(surface); + if (bucket) bucket.push(event); + else buckets.set(surface, [event]); + } + return [...buckets.entries()] + .map(([surface, bucketEvents]) => ({ surface, events: bucketEvents })) + .sort((a, b) => b.events.length - a.events.length || a.surface.localeCompare(b.surface)); +} + +function buildProductUsageRetentionRollups(day: string, currentEvents: ProductUsageEventRecord[], previousEvents: ProductUsageEventRecord[], capped: boolean): ProductUsageRetentionRollup[] { + return PRODUCT_USAGE_RETENTION_WINDOWS.map(({ window, days }) => { + const previousStartIso = `${addProductUsageUtcDays(day, -days)}T00:00:00.000Z`; + const windowPreviousEvents = previousEvents.filter((event) => event.occurredAt >= previousStartIso); + const currentActors = productUsageActorHashes(currentEvents); + const previousActors = productUsageActorHashes(windowPreviousEvents); + const retainedActors = intersectionCount(currentActors, previousActors); + return { + window, + capped, + activeActors: currentActors.size, + retainedActors, + retentionRate: productUsageRetentionRate(retainedActors, currentActors.size), + byRole: productUsageRetentionByRole(currentEvents, windowPreviousEvents), + bySurface: productUsageRetentionBySurface(currentEvents, windowPreviousEvents), + }; + }); +} + +function productUsageRetentionByRole(currentEvents: ProductUsageEventRecord[], previousEvents: ProductUsageEventRecord[]): ProductUsageRoleRetention[] { + const previousActorRoles = productUsageRolesByActor(previousEvents); + return productUsageRoleBuckets(currentEvents).map(({ role, events }) => { + const currentActors = productUsageActorHashes(events); + const previousActors = productUsageActorHashes(previousEvents.filter((event) => productUsageRolesForEvent(event, previousActorRoles).includes(role))); + const retainedActors = intersectionCount(currentActors, previousActors); + return { + role, + activeActors: currentActors.size, + retainedActors, + retentionRate: productUsageRetentionRate(retainedActors, currentActors.size), + }; + }); +} + +function productUsageRetentionBySurface(currentEvents: ProductUsageEventRecord[], previousEvents: ProductUsageEventRecord[]): ProductUsageSurfaceRetention[] { + return productUsageSurfaceBuckets(currentEvents).map(({ surface, events }) => { + const currentActors = productUsageActorHashes(events); + const previousActors = productUsageActorHashes(previousEvents.filter((event) => normalizeProductUsageSurface(event.surface) === surface)); + const retainedActors = intersectionCount(currentActors, previousActors); + return { + surface, + activeActors: currentActors.size, + retainedActors, + retentionRate: productUsageRetentionRate(retainedActors, currentActors.size), + }; + }); +} + +function productUsageActorHashes(events: ProductUsageEventRecord[]): Set { + return new Set(events.map((event) => event.actorHash).filter(isNonEmptyString)); +} + +function productUsageRetentionRate(retainedActors: number, activeActors: number): number { + return activeActors > 0 ? Number((retainedActors / activeActors).toFixed(4)) : 0; +} + +function productUsageRolesByActor(events: ProductUsageEventRecord[]): Map { + const rolesByActor = new Map>(); + for (const event of events) { + if (!event.actorHash) continue; + const roles = productUsageBaseRolesForEvent(event).filter((role) => role !== "unknown"); + if (roles.length === 0) continue; + const bucket = rolesByActor.get(event.actorHash) ?? new Set(); + for (const role of roles) bucket.add(role); + rolesByActor.set(event.actorHash, bucket); + } + return new Map( + [...rolesByActor.entries()].map(([actorHash, roles]) => [ + actorHash, + [...roles].sort((a, b) => productUsageRoleSortValue(a) - productUsageRoleSortValue(b)), + ]), + ); +} + +function productUsageRolesForEvent(event: ProductUsageEventRecord, actorRoles: Map = new Map()): ProductUsageRole[] { + const baseRoles = productUsageBaseRolesForEvent(event); + if (baseRoles.length === 1 && baseRoles[0] === "unknown" && event.actorHash) return actorRoles.get(event.actorHash) ?? baseRoles; + return baseRoles; +} + +function productUsageBaseRolesForEvent(event: ProductUsageEventRecord): ProductUsageRole[] { + const roles = new Set(); + addProductUsageRolesFromValue(roles, event.metadata.role); + addProductUsageRolesFromValue(roles, event.metadata.roles); + addProductUsageRolesFromValue(roles, event.metadata.audience); + addProductUsageRolesFromValue(roles, event.metadata.actorRole); + addProductUsageRolesFromValue(roles, event.metadata.actorKind); + if (roles.size > 0) return [...roles].sort((a, b) => productUsageRoleSortValue(a) - productUsageRoleSortValue(b)); + + if (event.eventName === "github_installation_created") return ["owner"]; + if (event.eventName === "extension_session_created" || event.eventName === "pull_context_viewed") return ["maintainer"]; + if (event.surface === "mcp") return ["miner"]; + if ( + event.eventName === "local_branch_analysis_completed" || + event.eventName === "agent_run_started" || + event.eventName === "agent_plan_next_work_completed" || + event.eventName === "agent_preflight_branch_completed" || + event.eventName === "agent_pr_packet_completed" || + event.eventName === "agent_blockers_completed" + ) { + return ["miner"]; + } + if (event.eventName === "pr_public_surface_published") return ["contributor"]; + return ["unknown"]; +} + +function addProductUsageRolesFromValue(roles: Set, value: JsonValue | undefined): void { + if (Array.isArray(value)) { + for (const entry of value) addProductUsageRolesFromValue(roles, entry); + return; + } + if (typeof value !== "string") return; + const role = normalizeProductUsageRole(value); + if (role) roles.add(role); +} + +function normalizeProductUsageRole(value: string): ProductUsageRole | null { + switch (value.trim().toLowerCase().replace(/[\s-]+/g, "_")) { + case "miner": + case "miners": + return "miner"; + case "maintainer": + case "maintainers": + case "reviewer": + return "maintainer"; + case "owner": + case "owners": + case "repo_owner": + case "repo_owners": + case "repository_owner": + case "repository_owners": + return "owner"; + case "operator": + case "operators": + return "operator"; + case "author": + case "contributor": + case "contributors": + case "outside_contributor": + case "outside_contributors": + return "contributor"; + case "none": + case "unknown": + return "unknown"; + default: + return null; + } +} + +function productUsageRoleSortValue(role: ProductUsageRole): number { + return PRODUCT_USAGE_ROLE_ORDER.indexOf(role); +} + function productUsageActorSet(events: ProductUsageEventRecord[], predicate: (event: ProductUsageEventRecord) => boolean): Set { return new Set(events.filter(predicate).map((event) => event.actorHash).filter(isNonEmptyString)); } @@ -3410,8 +3640,15 @@ const PRODUCT_USAGE_METADATA_MAX_ARRAY_ITEMS = 20; const PRODUCT_USAGE_METADATA_MAX_KEY_CHARS = 64; const PRODUCT_USAGE_METADATA_MAX_STRING_CHARS = 200; const PRODUCT_USAGE_ROLLUP_EVENT_SCAN_LIMIT = 5000; +const PRODUCT_USAGE_RETENTION_EVENT_SCAN_LIMIT = 5000; +const PRODUCT_USAGE_RETENTION_MAX_WINDOW_DAYS = 30; +const PRODUCT_USAGE_RETENTION_WINDOWS: Array<{ window: ProductUsageRetentionRollup["window"]; days: number }> = [ + { window: "previous_7_days", days: 7 }, + { window: "previous_30_days", days: 30 }, +]; const MCP_COMPATIBILITY_ADOPTION_SCAN_LIMIT = 5000; const PRODUCT_USAGE_ACTOR_REDACTION_MAX_CHARS = 256; +const PRODUCT_USAGE_ROLE_ORDER: ProductUsageRole[] = ["miner", "maintainer", "owner", "operator", "contributor", "unknown"]; const PRODUCT_USAGE_USEFUL_ACTION_EVENTS = new Set([ "command_previewed", "pull_context_viewed", diff --git a/src/db/schema.ts b/src/db/schema.ts index 45d37fe943..3b041dce63 100644 --- a/src/db/schema.ts +++ b/src/db/schema.ts @@ -842,6 +842,10 @@ export const productUsageDailyRollups = sqliteTable( toolsJson: text("tools_json").notNull().default("[]"), routeClassesJson: text("route_classes_json").notNull().default("[]"), activationJson: text("activation_json").notNull().default("{}"), + rolesJson: text("roles_json").notNull().default("[]"), + activationByRoleJson: text("activation_by_role_json").notNull().default("[]"), + activationBySurfaceJson: text("activation_by_surface_json").notNull().default("[]"), + retentionJson: text("retention_json").notNull().default("[]"), generatedAt: text("generated_at").notNull().default("CURRENT_TIMESTAMP"), updatedAt: text("updated_at").notNull().default("CURRENT_TIMESTAMP"), }, diff --git a/src/types.ts b/src/types.ts index ac516d8e78..eb3e3f3379 100644 --- a/src/types.ts +++ b/src/types.ts @@ -970,6 +970,8 @@ export type ProductUsageSurface = "api" | "mcp" | "github_app" | "control_panel" export type ProductUsageOutcome = "success" | "denied" | "error" | "queued" | "completed" | "skipped"; +export type ProductUsageRole = "miner" | "maintainer" | "owner" | "operator" | "contributor" | "unknown"; + export type ProductUsageEventRecord = { id: string; surface: ProductUsageSurface; @@ -1020,6 +1022,13 @@ export type ProductUsageDimensionCount = { count: number; }; +export type ProductUsageRoleDimensionCount = { + role: ProductUsageRole; + count: number; + activeActors: number; + activeRepos: number; +}; + export type ProductUsageActivationFunnel = { loginActors: number; doctorPassActors: number; @@ -1031,6 +1040,37 @@ export type ProductUsageActivationFunnel = { githubActivatedRepos: number; }; +export type ProductUsageRoleActivationFunnel = ProductUsageActivationFunnel & { + role: ProductUsageRole; +}; + +export type ProductUsageSurfaceActivationFunnel = ProductUsageActivationFunnel & { + surface: ProductUsageSurface; +}; + +export type ProductUsageRetentionWindow = "previous_7_days" | "previous_30_days"; + +export type ProductUsageRetentionDimension = { + activeActors: number; + retainedActors: number; + retentionRate: number; +}; + +export type ProductUsageRoleRetention = ProductUsageRetentionDimension & { + role: ProductUsageRole; +}; + +export type ProductUsageSurfaceRetention = ProductUsageRetentionDimension & { + surface: ProductUsageSurface; +}; + +export type ProductUsageRetentionRollup = ProductUsageRetentionDimension & { + window: ProductUsageRetentionWindow; + capped: boolean; + byRole: ProductUsageRoleRetention[]; + bySurface: ProductUsageSurfaceRetention[]; +}; + export type ProductUsageDailyRollupRecord = { day: string; status: ProductUsageDailyRollupStatus; @@ -1050,6 +1090,10 @@ export type ProductUsageDailyRollupRecord = { byTool: ProductUsageDimensionCount[]; byRouteClass: ProductUsageDimensionCount[]; activation: ProductUsageActivationFunnel; + byRole: ProductUsageRoleDimensionCount[]; + activationByRole: ProductUsageRoleActivationFunnel[]; + activationBySurface: ProductUsageSurfaceActivationFunnel[]; + retention: ProductUsageRetentionRollup[]; generatedAt: string; updatedAt: string; }; From 452a0ddfb26cb6ea4e3dd056c05cd4cd21577872 Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 12:56:11 +0200 Subject: [PATCH 2/6] test(analytics): cover role retention rollups --- test/integration/api.test.ts | 43 ++++- test/unit/product-usage.test.ts | 266 ++++++++++++++++++++++++++ test/unit/weekly-value-report.test.ts | 4 + 3 files changed, 310 insertions(+), 3 deletions(-) diff --git a/test/integration/api.test.ts b/test/integration/api.test.ts index 2bbf76271c..684f37ec77 100644 --- a/test/integration/api.test.ts +++ b/test/integration/api.test.ts @@ -2078,10 +2078,47 @@ describe("api routes", () => { const dailyRollups = await app.request("/v1/app/analytics/daily-rollups?limit=3", { headers: apiHeaders(env) }, env); expect(dailyRollups.status).toBe(200); - await expect(dailyRollups.json()).resolves.toMatchObject({ + const dailyRollupsBody = (await dailyRollups.json()) as { + status: { status: string; latestRollupDay?: string }; + rollups: Array<{ + day: string; + activation: Record; + byRole: Array<{ role: string; count: number; activeActors: number; activeRepos: number }>; + activationByRole: Array>; + activationBySurface: Array>; + retention: Array<{ + window: string; + activeActors: number; + retainedActors: number; + retentionRate: number; + capped: boolean; + byRole: Array>; + bySurface: Array>; + }>; + }>; + }; + expect(dailyRollupsBody).toMatchObject({ status: expect.objectContaining({ status: "partial", latestRollupDay: "2026-05-28" }), rollups: [expect.objectContaining({ day: "2026-05-28", activation: expect.any(Object) })], }); + const [dailyRollup] = dailyRollupsBody.rollups; + expect(dailyRollup).toBeDefined(); + if (!dailyRollup) throw new Error("expected daily usage rollup"); + expect(dailyRollup.byRole).toEqual(expect.arrayContaining([expect.objectContaining({ role: "miner", count: expect.any(Number), activeActors: expect.any(Number), activeRepos: expect.any(Number) })])); + expect(dailyRollup.activationByRole).toEqual(expect.arrayContaining([expect.objectContaining({ role: "miner", doctorPassActors: expect.any(Number), firstUsefulActionActors: expect.any(Number) })])); + expect(dailyRollup.activationBySurface).toEqual( + expect.arrayContaining([ + expect.objectContaining({ surface: "mcp", doctorPassActors: expect.any(Number) }), + expect.objectContaining({ surface: "browser_extension", firstUsefulActionActors: expect.any(Number) }), + ]), + ); + expect(dailyRollup.retention).toEqual( + expect.arrayContaining([ + expect.objectContaining({ window: "previous_7_days", activeActors: expect.any(Number), retainedActors: expect.any(Number), retentionRate: expect.any(Number), capped: false, byRole: expect.any(Array), bySurface: expect.any(Array) }), + expect.objectContaining({ window: "previous_30_days", activeActors: expect.any(Number), retainedActors: expect.any(Number), retentionRate: expect.any(Number), capped: false, byRole: expect.any(Array), bySurface: expect.any(Array) }), + ]), + ); + expect(JSON.stringify(dailyRollupsBody)).not.toMatch(/oktofeesh1|operator@example.com|mcp-user|old-mcp-user|current-mcp-user|mcp-session|old-mcp-session|current-mcp-session|gittensory_session|\/Users|github_pat|ghp_|private-repo|wallet|hotkey|raw trust/i); const fallbackLimitRollups = await app.request("/v1/app/analytics/daily-rollups?limit=invalid", { headers: apiHeaders(env) }, env); expect(fallbackLimitRollups.status).toBe(200); await expect(fallbackLimitRollups.json()).resolves.toMatchObject({ @@ -2100,7 +2137,7 @@ describe("api routes", () => { const usageOperatorBody = (await usageOperator.json()) as { metrics: Array<{ label: string; value: string }>; usageSummary: { totalEvents: number }; - usageRollups: Array<{ day: string }>; + usageRollups: Array<{ day: string; byRole: unknown[]; activationBySurface: unknown[]; retention: unknown[] }>; usageRollupStatus: { status: string }; mcpCompatibilityAdoption: { totalEvents: number; @@ -2128,7 +2165,7 @@ describe("api routes", () => { ]), ); expect(usageOperatorBody.usageSummary.totalEvents).toBe(productUsageEvents.length); - expect(usageOperatorBody.usageRollups).toEqual([expect.objectContaining({ day: "2026-05-28" })]); + expect(usageOperatorBody.usageRollups).toEqual([expect.objectContaining({ day: "2026-05-28", byRole: expect.any(Array), activationBySurface: expect.any(Array), retention: expect.any(Array) })]); expect(usageOperatorBody.usageRollupStatus.status).toBe("partial"); expect(usageOperatorBody.mcpCompatibilityAdoption).toMatchObject({ totalEvents: 4, diff --git a/test/unit/product-usage.test.ts b/test/unit/product-usage.test.ts index 098f8862e9..f872afec5a 100644 --- a/test/unit/product-usage.test.ts +++ b/test/unit/product-usage.test.ts @@ -431,6 +431,272 @@ describe("product usage events", () => { await expect(getProductUsageRollupStatus(env, { nowIso: "2026-05-31T00:40:00.000Z" })).resolves.toMatchObject({ status: "ready", warnings: [] }); }); + it("builds empty role and retention rollups for days without product usage", async () => { + const env = createTestEnv({ PRODUCT_USAGE_HASH_SALT: "fixed-test-salt" }); + const result = await rollupProductUsageDaily(env, { day: "2026-06-01", nowIso: "2026-06-02T00:00:00.000Z" }); + + expect(result.rollups[0]).toMatchObject({ + day: "2026-06-01", + status: "complete", + totalEvents: 0, + activeActors: 0, + byRole: [], + activationByRole: [], + activationBySurface: [], + retention: [ + { window: "previous_7_days", capped: false, activeActors: 0, retainedActors: 0, retentionRate: 0, byRole: [], bySurface: [] }, + { window: "previous_30_days", capped: false, activeActors: 0, retainedActors: 0, retentionRate: 0, byRole: [], bySurface: [] }, + ], + }); + }); + + it("recomputes single-role retention rollups when late product usage makes a day stale", async () => { + const env = createTestEnv({ PRODUCT_USAGE_HASH_SALT: "fixed-test-salt" }); + const day = "2026-06-12"; + await recordProductUsageEvent(env, { + surface: "api", + eventName: "agent_pr_packet_completed", + actor: "single-miner", + outcome: "success", + metadata: { role: "miner" }, + occurredAt: "2026-06-05T12:00:00.000Z", + }); + await rollupProductUsageDaily(env, { day: "2026-06-05", nowIso: "2026-06-06T00:00:00.000Z" }); + await recordProductUsageEvent(env, { + surface: "api", + eventName: "agent_pr_packet_completed", + actor: "single-miner", + outcome: "success", + metadata: { role: "miner" }, + occurredAt: `${day}T01:00:00.000Z`, + }); + + const firstRun = await rollupProductUsageDaily(env, { day, nowIso: "2026-06-13T00:00:00.000Z" }); + expect(firstRun.rollups[0]).toMatchObject({ + byRole: [{ role: "miner", count: 1, activeActors: 1, activeRepos: 0 }], + activationByRole: [expect.objectContaining({ role: "miner", firstUsefulActionActors: 1 })], + activationBySurface: [expect.objectContaining({ surface: "api", firstUsefulActionActors: 1 })], + retention: expect.arrayContaining([ + expect.objectContaining({ + window: "previous_7_days", + activeActors: 1, + retainedActors: 1, + byRole: [{ role: "miner", activeActors: 1, retainedActors: 1, retentionRate: 1 }], + }), + ]), + }); + + await recordProductUsageEvent(env, { + surface: "github_app", + eventName: "github_installation_created", + actor: "late-owner", + repoFullName: "JSONbored/gittensory", + outcome: "completed", + occurredAt: `${day}T23:00:00.000Z`, + }); + await expect(getProductUsageRollupStatus(env, { nowIso: "2026-06-13T00:10:00.000Z" })).resolves.toMatchObject({ status: "stale", staleDays: [day] }); + + const rerun = await rollupProductUsageDaily(env, { day, nowIso: "2026-06-13T00:20:00.000Z" }); + expect(rerun.rollups[0]).toMatchObject({ + totalEvents: 2, + activeActors: 2, + byRole: expect.arrayContaining([ + { role: "miner", count: 1, activeActors: 1, activeRepos: 0 }, + { role: "owner", count: 1, activeActors: 1, activeRepos: 1 }, + ]), + retention: expect.arrayContaining([ + expect.objectContaining({ + window: "previous_7_days", + activeActors: 2, + retainedActors: 1, + retentionRate: 0.5, + byRole: expect.arrayContaining([ + { role: "miner", activeActors: 1, retainedActors: 1, retentionRate: 1 }, + { role: "owner", activeActors: 1, retainedActors: 0, retentionRate: 0 }, + ]), + }), + ]), + }); + expect(JSON.stringify(rerun.rollups[0])).not.toMatch(/single-miner|late-owner|fixed-test-salt/i); + }); + + it("normalizes explicit role metadata variants into aggregate buckets", async () => { + const env = createTestEnv({ PRODUCT_USAGE_HASH_SALT: "fixed-test-salt" }); + const day = "2026-06-14"; + await recordProductUsageEvent(env, { + surface: "control_panel", + eventName: "command_previewed", + actor: "multi-role-actor", + outcome: "success", + metadata: { + roles: [ + "miners", + "maintainers", + "owners", + "repo-owner", + "repo owners", + "repository-owner", + "repository owners", + "operators", + "author", + "contributors", + "outside contributor", + "outside-contributors", + "unknown", + ], + }, + occurredAt: `${day}T01:00:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "control_panel", + eventName: "command_previewed", + actor: "reviewer-actor", + outcome: "success", + metadata: { actorKind: "reviewer" }, + occurredAt: `${day}T02:00:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "control_panel", + eventName: "command_previewed", + actor: "none-actor", + outcome: "success", + metadata: { audience: "none" }, + occurredAt: `${day}T03:00:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "control_panel", + eventName: "command_previewed", + actor: "invalid-role-actor", + outcome: "success", + metadata: { role: "not-a-product-role" }, + occurredAt: `${day}T04:00:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "api", + eventName: "pr_public_surface_published", + actor: "public-surface-actor", + outcome: "success", + occurredAt: `${day}T05:00:00.000Z`, + }); + + const result = await rollupProductUsageDaily(env, { day, nowIso: "2026-06-15T00:00:00.000Z" }); + + expect(result.rollups[0]?.byRole).toEqual( + expect.arrayContaining([ + { role: "owner", count: 1, activeActors: 1, activeRepos: 0 }, + { role: "operator", count: 1, activeActors: 1, activeRepos: 0 }, + { role: "miner", count: 1, activeActors: 1, activeRepos: 0 }, + { role: "contributor", count: 2, activeActors: 2, activeRepos: 0 }, + { role: "maintainer", count: 2, activeActors: 2, activeRepos: 0 }, + { role: "unknown", count: 3, activeActors: 3, activeRepos: 0 }, + ]), + ); + expect(JSON.stringify(result.rollups[0])).not.toMatch(/multi-role-actor|reviewer-actor|none-actor|invalid-role-actor|public-surface-actor|fixed-test-salt/i); + }); + + it("builds role activation and coarse retention rollups without exposing actors", async () => { + const env = createTestEnv({ PRODUCT_USAGE_HASH_SALT: "fixed-test-salt" }); + const day = "2026-06-10"; + await recordProductUsageEvent(env, { + surface: "mcp", + eventName: "mcp_request", + actor: "miner-retained", + outcome: "success", + metadata: { role: "miner" }, + occurredAt: "2026-06-04T12:00:00.000Z", + }); + await recordProductUsageEvent(env, { + surface: "github_app", + eventName: "agent_command_replied", + actor: "maintainer-retained", + outcome: "completed", + metadata: { command: "blockers", actorKind: "maintainer" }, + occurredAt: "2026-06-06T12:00:00.000Z", + }); + await recordProductUsageEvent(env, { + surface: "control_panel", + eventName: "auth_session_created", + actor: "miner-retained", + outcome: "success", + metadata: { role: "miner" }, + occurredAt: `${day}T01:00:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "mcp", + eventName: "mcp_request", + actor: "miner-retained", + outcome: "success", + metadata: { role: "miner" }, + occurredAt: `${day}T01:05:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "api", + eventName: "agent_pr_packet_completed", + actor: "miner-retained", + outcome: "success", + metadata: { role: "miner" }, + occurredAt: `${day}T01:10:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "github_app", + eventName: "agent_command_replied", + actor: "maintainer-retained", + repoFullName: "JSONbored/gittensory", + outcome: "completed", + metadata: { command: "blockers", actorKind: "maintainer" }, + occurredAt: `${day}T02:00:00.000Z`, + }); + await recordProductUsageEvent(env, { + surface: "github_app", + eventName: "github_installation_created", + actor: "new-owner", + repoFullName: "JSONbored/gittensory", + outcome: "completed", + occurredAt: `${day}T03:00:00.000Z`, + }); + + const result = await rollupProductUsageDaily(env, { day, nowIso: "2026-06-11T00:00:00.000Z" }); + + expect(result.rollups[0]).toMatchObject({ + day, + totalEvents: 5, + activeActors: 3, + byRole: expect.arrayContaining([ + { role: "miner", count: 3, activeActors: 1, activeRepos: 0 }, + { role: "maintainer", count: 1, activeActors: 1, activeRepos: 1 }, + { role: "owner", count: 1, activeActors: 1, activeRepos: 1 }, + ]), + activationByRole: expect.arrayContaining([ + expect.objectContaining({ role: "miner", loginActors: 1, doctorPassActors: 1, firstUsefulActionActors: 1, fullyActivatedActors: 1 }), + expect.objectContaining({ role: "maintainer", githubUsefulMaintainerRepos: 1 }), + expect.objectContaining({ role: "owner", githubInstalledRepos: 1 }), + ]), + activationBySurface: expect.arrayContaining([ + expect.objectContaining({ surface: "mcp", doctorPassActors: 1 }), + expect.objectContaining({ surface: "github_app", githubInstalledRepos: 1, githubUsefulMaintainerRepos: 1 }), + ]), + retention: expect.arrayContaining([ + expect.objectContaining({ + window: "previous_7_days", + activeActors: 3, + retainedActors: 2, + retentionRate: 0.6667, + capped: false, + byRole: expect.arrayContaining([ + { role: "miner", activeActors: 1, retainedActors: 1, retentionRate: 1 }, + { role: "maintainer", activeActors: 1, retainedActors: 1, retentionRate: 1 }, + { role: "owner", activeActors: 1, retainedActors: 0, retentionRate: 0 }, + ]), + bySurface: expect.arrayContaining([ + { surface: "mcp", activeActors: 1, retainedActors: 1, retentionRate: 1 }, + { surface: "github_app", activeActors: 2, retainedActors: 1, retentionRate: 0.5 }, + ]), + }), + ]), + }); + expect(JSON.stringify(result.rollups[0])).not.toMatch(/miner-retained|maintainer-retained|new-owner|fixed-test-salt/i); + }); + it("classifies rollup route classes and rejects failed activation signals", async () => { const env = createTestEnv({ PRODUCT_USAGE_HASH_SALT: "fixed-test-salt" }); const day = "2026-05-27"; diff --git a/test/unit/weekly-value-report.test.ts b/test/unit/weekly-value-report.test.ts index 310b56dded..7bc48f6a93 100644 --- a/test/unit/weekly-value-report.test.ts +++ b/test/unit/weekly-value-report.test.ts @@ -367,6 +367,10 @@ function rollup( githubUsefulMaintainerRepos: 1, githubActivatedRepos: 1, }, + byRole: [], + activationByRole: [], + activationBySurface: [], + retention: [], generatedAt: `${day}T23:59:00.000Z`, updatedAt: `${day}T23:59:00.000Z`, }; From 535d06529c7828578868cdfbd5c78e61c95c26cc Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 13:14:40 +0200 Subject: [PATCH 3/6] chore(ui): refresh openapi snapshot --- apps/gittensory-ui/public/openapi.json | 7095 ++++++++++++------------ 1 file changed, 3546 insertions(+), 3549 deletions(-) diff --git a/apps/gittensory-ui/public/openapi.json b/apps/gittensory-ui/public/openapi.json index f2750e4c5b..867e3ced1d 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": { From c09d60979b8108020174866b94e2bc7407b214d4 Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 13:17:06 +0200 Subject: [PATCH 4/6] chore(ui): update mcp latest fallback --- apps/gittensory-ui/src/lib/mcp-package.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = { From 237a0a9fb01374a1f2170da87b464c21f837c6a7 Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 13:33:32 +0200 Subject: [PATCH 5/6] test(analytics): cover retention cap rollups --- test/unit/product-usage.test.ts | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/test/unit/product-usage.test.ts b/test/unit/product-usage.test.ts index f872afec5a..0167d17d68 100644 --- a/test/unit/product-usage.test.ts +++ b/test/unit/product-usage.test.ts @@ -532,11 +532,13 @@ describe("product usage events", () => { roles: [ "miners", "maintainers", + "owner", "owners", "repo-owner", "repo owners", "repository-owner", "repository owners", + "operator", "operators", "author", "contributors", @@ -776,6 +778,10 @@ describe("product usage events", () => { const invalidDay = await rollupProductUsageDaily(env, { day: "not-a-day", nowIso: "2026-05-27T12:00:00.000Z" }); expect(invalidDay.rollups[0]?.day).toBe("2026-05-27"); + const invalidGeneratedAt = await rollupProductUsageDaily(env, { day: "not-a-day", nowIso: "not-an-iso" }); + expect(invalidGeneratedAt.requestedDays[0]).toBe(invalidGeneratedAt.rollups[0]?.day); + expect(invalidGeneratedAt.rollups[0]?.day).toMatch(/^\d{4}-\d{2}-\d{2}$/); + await env.DB.prepare( "insert into product_usage_daily_rollups (day, status, total_events, active_actors, active_sessions, active_repos, source_event_count, max_event_capacity, first_event_at, last_event_at, surfaces_json, outcomes_json, events_json, repos_json, commands_json, tools_json, route_classes_json, activation_json, generated_at, updated_at) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", ) @@ -850,4 +856,72 @@ describe("product usage events", () => { incompleteDays: [day], }); }); + + it("marks retention windows capped when previous usage exceeds the retention scan cap", async () => { + const env = createTestEnv({ PRODUCT_USAGE_HASH_SALT: "fixed-test-salt" }); + const day = "2026-06-20"; + const previousDay = "2026-06-10"; + const previousStartMs = Date.parse(`${previousDay}T00:00:00.000Z`); + await env.DB.batch( + Array.from({ length: 5001 }, (_, index) => + env.DB.prepare( + "insert into product_usage_events (id, surface, event_name, route, actor_hash, session_hash, repo_full_name, target_key, outcome, latency_ms, client_name, client_version, metadata_json, occurred_at) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + ).bind( + `retention-cap-event-${index}`, + "mcp", + "mcp_request", + "/mcp", + index === 5000 ? "retained-actor-hash" : `previous-actor-${index}`, + null, + null, + null, + "success", + null, + null, + null, + JSON.stringify({ role: "miner" }), + new Date(previousStartMs + index * 1000).toISOString(), + ), + ), + ); + await env.DB.prepare( + "insert into product_usage_events (id, surface, event_name, route, actor_hash, session_hash, repo_full_name, target_key, outcome, latency_ms, client_name, client_version, metadata_json, occurred_at) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + ) + .bind( + "retention-cap-current-event", + "mcp", + "mcp_request", + "/mcp", + "retained-actor-hash", + null, + null, + null, + "success", + null, + null, + null, + JSON.stringify({ role: "miner" }), + `${day}T01:00:00.000Z`, + ) + .run(); + + const result = await rollupProductUsageDaily(env, { day, nowIso: "2026-06-21T00:00:00.000Z" }); + + expect(result.rollups[0]).toMatchObject({ + day, + status: "complete", + totalEvents: 1, + retention: expect.arrayContaining([ + expect.objectContaining({ + window: "previous_30_days", + capped: true, + activeActors: 1, + retainedActors: 1, + retentionRate: 1, + byRole: [{ role: "miner", activeActors: 1, retainedActors: 1, retentionRate: 1 }], + bySurface: [{ surface: "mcp", activeActors: 1, retainedActors: 1, retentionRate: 1 }], + }), + ]), + }); + }); }); From 57c964ef790418bacc9dbbcd7fcd5ecaccb011ab Mon Sep 17 00:00:00 2001 From: bitloi Date: Tue, 2 Jun 2026 13:46:01 +0200 Subject: [PATCH 6/6] chore(ui): refresh clean openapi snapshot --- 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 867e3ced1d..f2750e4c5b 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": {