@loopover/engine 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +94 -0
- package/LICENSE +661 -0
- package/README.md +676 -0
- package/dist/advisory/gate-advisory.d.ts +151 -0
- package/dist/advisory/gate-advisory.js +512 -0
- package/dist/ai-policy-map.d.ts +97 -0
- package/dist/ai-policy-map.js +377 -0
- package/dist/ams-policy-spec.d.ts +56 -0
- package/dist/ams-policy-spec.js +165 -0
- package/dist/calibration-dashboard.d.ts +23 -0
- package/dist/calibration-dashboard.js +65 -0
- package/dist/calibration-trend.d.ts +40 -0
- package/dist/calibration-trend.js +60 -0
- package/dist/contributor-fit.d.ts +24 -0
- package/dist/contributor-fit.js +50 -0
- package/dist/discovery-index-contract.d.ts +74 -0
- package/dist/discovery-index-contract.js +184 -0
- package/dist/discovery-soft-claim.d.ts +35 -0
- package/dist/discovery-soft-claim.js +50 -0
- package/dist/duplicate-winner.d.ts +57 -0
- package/dist/duplicate-winner.js +98 -0
- package/dist/feasibility.d.ts +27 -0
- package/dist/feasibility.js +86 -0
- package/dist/finding-severity-calibration.d.ts +116 -0
- package/dist/finding-severity-calibration.js +457 -0
- package/dist/fleet-run-manifest.d.ts +41 -0
- package/dist/fleet-run-manifest.js +151 -0
- package/dist/focus-manifest/guidance.d.ts +21 -0
- package/dist/focus-manifest/guidance.js +222 -0
- package/dist/focus-manifest.d.ts +826 -0
- package/dist/focus-manifest.js +2730 -0
- package/dist/gate-verdict-calibration.d.ts +111 -0
- package/dist/gate-verdict-calibration.js +411 -0
- package/dist/github/constants.d.ts +1 -0
- package/dist/github/constants.js +1 -0
- package/dist/github/sanitize-public-comment.d.ts +1 -0
- package/dist/github/sanitize-public-comment.js +26 -0
- package/dist/goal-model.d.ts +7 -0
- package/dist/goal-model.js +87 -0
- package/dist/governor/action-mode.d.ts +55 -0
- package/dist/governor/action-mode.js +74 -0
- package/dist/governor/budget-cap.d.ts +49 -0
- package/dist/governor/budget-cap.js +34 -0
- package/dist/governor/chokepoint.d.ts +58 -0
- package/dist/governor/chokepoint.js +269 -0
- package/dist/governor/kill-switch.d.ts +38 -0
- package/dist/governor/kill-switch.js +62 -0
- package/dist/governor/rate-limit.d.ts +40 -0
- package/dist/governor/rate-limit.js +63 -0
- package/dist/governor/reputation-throttle.d.ts +50 -0
- package/dist/governor/reputation-throttle.js +94 -0
- package/dist/governor/run-halt.d.ts +39 -0
- package/dist/governor/run-halt.js +83 -0
- package/dist/governor/self-plagiarism.d.ts +47 -0
- package/dist/governor/self-plagiarism.js +200 -0
- package/dist/governor/write-rate-limit.d.ts +52 -0
- package/dist/governor/write-rate-limit.js +132 -0
- package/dist/governor-ledger.d.ts +25 -0
- package/dist/governor-ledger.js +91 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +120 -0
- package/dist/issue-plan-decomposition.d.ts +18 -0
- package/dist/issue-plan-decomposition.js +56 -0
- package/dist/issue-rag-query.d.ts +12 -0
- package/dist/issue-rag-query.js +35 -0
- package/dist/local-scorer.d.ts +34 -0
- package/dist/local-scorer.js +36 -0
- package/dist/metadata-best-min-score.d.ts +9 -0
- package/dist/metadata-best-min-score.js +9 -0
- package/dist/metadata-best-pick.d.ts +9 -0
- package/dist/metadata-best-pick.js +9 -0
- package/dist/metadata-min-score.d.ts +9 -0
- package/dist/metadata-min-score.js +13 -0
- package/dist/metadata-top-min-score.d.ts +9 -0
- package/dist/metadata-top-min-score.js +13 -0
- package/dist/metadata-top-pick.d.ts +9 -0
- package/dist/metadata-top-pick.js +13 -0
- package/dist/miner/acceptance-criteria.d.ts +43 -0
- package/dist/miner/acceptance-criteria.js +77 -0
- package/dist/miner/agent-sdk-driver.d.ts +39 -0
- package/dist/miner/agent-sdk-driver.js +162 -0
- package/dist/miner/attempt-log.d.ts +29 -0
- package/dist/miner/attempt-log.js +100 -0
- package/dist/miner/attempt-metering.d.ts +39 -0
- package/dist/miner/attempt-metering.js +67 -0
- package/dist/miner/cli-subprocess-driver.d.ts +68 -0
- package/dist/miner/cli-subprocess-driver.js +272 -0
- package/dist/miner/coding-agent-driver.d.ts +33 -0
- package/dist/miner/coding-agent-driver.js +36 -0
- package/dist/miner/coding-agent-invoke.d.ts +11 -0
- package/dist/miner/coding-agent-invoke.js +80 -0
- package/dist/miner/coding-agent-mode.d.ts +25 -0
- package/dist/miner/coding-agent-mode.js +43 -0
- package/dist/miner/driver-factory.d.ts +82 -0
- package/dist/miner/driver-factory.js +169 -0
- package/dist/miner/harness-submission-trigger.d.ts +37 -0
- package/dist/miner/harness-submission-trigger.js +46 -0
- package/dist/miner/iterate-loop.d.ts +97 -0
- package/dist/miner/iterate-loop.js +278 -0
- package/dist/miner/iterate-policy.d.ts +98 -0
- package/dist/miner/iterate-policy.js +98 -0
- package/dist/miner/lint-guard.d.ts +50 -0
- package/dist/miner/lint-guard.js +68 -0
- package/dist/miner/local-write-tools.d.ts +81 -0
- package/dist/miner/local-write-tools.js +113 -0
- package/dist/miner/loop-reentry-policy.d.ts +36 -0
- package/dist/miner/loop-reentry-policy.js +53 -0
- package/dist/miner/repo-map.d.ts +51 -0
- package/dist/miner/repo-map.js +268 -0
- package/dist/miner/self-review-adapter.d.ts +106 -0
- package/dist/miner/self-review-adapter.js +83 -0
- package/dist/miner/submission-gate.d.ts +40 -0
- package/dist/miner/submission-gate.js +89 -0
- package/dist/miner/worktree-allocator.d.ts +59 -0
- package/dist/miner/worktree-allocator.js +60 -0
- package/dist/miner/worktree-pool.d.ts +55 -0
- package/dist/miner/worktree-pool.js +65 -0
- package/dist/miner-goal-lane-fit.d.ts +18 -0
- package/dist/miner-goal-lane-fit.js +76 -0
- package/dist/miner-goal-spec.d.ts +139 -0
- package/dist/miner-goal-spec.js +281 -0
- package/dist/miner-prediction-metrics.d.ts +16 -0
- package/dist/miner-prediction-metrics.js +61 -0
- package/dist/miner-telemetry.d.ts +32 -0
- package/dist/miner-telemetry.js +87 -0
- package/dist/objective-anchor.d.ts +125 -0
- package/dist/objective-anchor.js +401 -0
- package/dist/opportunity-competition.d.ts +6 -0
- package/dist/opportunity-competition.js +29 -0
- package/dist/opportunity-freshness.d.ts +18 -0
- package/dist/opportunity-freshness.js +55 -0
- package/dist/opportunity-metadata.d.ts +53 -0
- package/dist/opportunity-metadata.js +204 -0
- package/dist/opportunity-ranker.d.ts +46 -0
- package/dist/opportunity-ranker.js +74 -0
- package/dist/pairwise-calibration.d.ts +49 -0
- package/dist/pairwise-calibration.js +106 -0
- package/dist/phase7-calibration-loop.d.ts +136 -0
- package/dist/phase7-calibration-loop.js +437 -0
- package/dist/plan-blocked.d.ts +6 -0
- package/dist/plan-blocked.js +24 -0
- package/dist/plan-completed.d.ts +5 -0
- package/dist/plan-completed.js +6 -0
- package/dist/plan-completion.d.ts +6 -0
- package/dist/plan-completion.js +7 -0
- package/dist/plan-empty.d.ts +5 -0
- package/dist/plan-empty.js +6 -0
- package/dist/plan-export.d.ts +27 -0
- package/dist/plan-export.js +86 -0
- package/dist/plan-failure.d.ts +5 -0
- package/dist/plan-failure.js +6 -0
- package/dist/plan-overall-status.d.ts +6 -0
- package/dist/plan-overall-status.js +25 -0
- package/dist/plan-pending.d.ts +5 -0
- package/dist/plan-pending.js +6 -0
- package/dist/plan-progress-complete.d.ts +7 -0
- package/dist/plan-progress-complete.js +10 -0
- package/dist/plan-ready.d.ts +6 -0
- package/dist/plan-ready.js +12 -0
- package/dist/plan-running.d.ts +5 -0
- package/dist/plan-running.js +6 -0
- package/dist/plan-skipped.d.ts +5 -0
- package/dist/plan-skipped.js +6 -0
- package/dist/plan-step-count.d.ts +5 -0
- package/dist/plan-step-count.js +6 -0
- package/dist/plan-step-stats.d.ts +5 -0
- package/dist/plan-step-stats.js +6 -0
- package/dist/plan-templates.d.ts +25 -0
- package/dist/plan-templates.js +107 -0
- package/dist/plan-terminated.d.ts +6 -0
- package/dist/plan-terminated.js +9 -0
- package/dist/portfolio/non-convergence.d.ts +37 -0
- package/dist/portfolio/non-convergence.js +57 -0
- package/dist/portfolio/queue.d.ts +30 -0
- package/dist/portfolio/queue.js +150 -0
- package/dist/predicted-gate.d.ts +103 -0
- package/dist/predicted-gate.js +218 -0
- package/dist/prompt-packet.d.ts +11 -0
- package/dist/prompt-packet.js +34 -0
- package/dist/ranked-opportunity-best-min-score.d.ts +8 -0
- package/dist/ranked-opportunity-best-min-score.js +9 -0
- package/dist/ranked-opportunity-best-pick.d.ts +8 -0
- package/dist/ranked-opportunity-best-pick.js +9 -0
- package/dist/ranked-opportunity-min-score.d.ts +8 -0
- package/dist/ranked-opportunity-min-score.js +13 -0
- package/dist/ranked-opportunity-top-min-score.d.ts +8 -0
- package/dist/ranked-opportunity-top-min-score.js +13 -0
- package/dist/review/advisory-ai-routing-config.d.ts +8 -0
- package/dist/review/advisory-ai-routing-config.js +40 -0
- package/dist/review/check-names.d.ts +1 -0
- package/dist/review/check-names.js +1 -0
- package/dist/review/cla-check.d.ts +49 -0
- package/dist/review/cla-check.js +71 -0
- package/dist/review/diff-file-priority.d.ts +1 -0
- package/dist/review/diff-file-priority.js +12 -0
- package/dist/review/enrichment-analyzer-names.d.ts +3 -0
- package/dist/review/enrichment-analyzer-names.js +63 -0
- package/dist/review/guardrail-config.d.ts +10 -0
- package/dist/review/guardrail-config.js +62 -0
- package/dist/review/linked-issue-hard-rules-config.d.ts +4 -0
- package/dist/review/linked-issue-hard-rules-config.js +79 -0
- package/dist/review/linked-issue-label-propagation.d.ts +9 -0
- package/dist/review/linked-issue-label-propagation.js +114 -0
- package/dist/review/pre-merge-checks.d.ts +28 -0
- package/dist/review/pre-merge-checks.js +66 -0
- package/dist/review/review-thread-findings.d.ts +1 -0
- package/dist/review/review-thread-findings.js +1 -0
- package/dist/review/safe-url.d.ts +5 -0
- package/dist/review/safe-url.js +137 -0
- package/dist/review/screenshot-table-gate.d.ts +87 -0
- package/dist/review/screenshot-table-gate.js +340 -0
- package/dist/review/unlinked-issue-guardrail-config.d.ts +9 -0
- package/dist/review/unlinked-issue-guardrail-config.js +44 -0
- package/dist/reviewer-consensus-calibration.d.ts +113 -0
- package/dist/reviewer-consensus-calibration.js +493 -0
- package/dist/reward-risk.d.ts +223 -0
- package/dist/reward-risk.js +618 -0
- package/dist/scoring/label-match.d.ts +4 -0
- package/dist/scoring/label-match.js +145 -0
- package/dist/scoring/model.d.ts +31 -0
- package/dist/scoring/model.js +157 -0
- package/dist/scoring/pending-pr-scenarios.d.ts +44 -0
- package/dist/scoring/pending-pr-scenarios.js +145 -0
- package/dist/scoring/preview.d.ts +246 -0
- package/dist/scoring/preview.js +1108 -0
- package/dist/scoring/types.d.ts +131 -0
- package/dist/scoring/types.js +7 -0
- package/dist/settings/auto-close-exempt.d.ts +10 -0
- package/dist/settings/auto-close-exempt.js +58 -0
- package/dist/settings/autonomy.d.ts +33 -0
- package/dist/settings/autonomy.js +80 -0
- package/dist/settings/command-authorization.d.ts +49 -0
- package/dist/settings/command-authorization.js +222 -0
- package/dist/settings/contributor-blacklist.d.ts +17 -0
- package/dist/settings/contributor-blacklist.js +86 -0
- package/dist/settings/moderation-rules.d.ts +51 -0
- package/dist/settings/moderation-rules.js +104 -0
- package/dist/settings/pr-type-label.d.ts +70 -0
- package/dist/settings/pr-type-label.js +149 -0
- package/dist/signals/change-guardrail.d.ts +49 -0
- package/dist/signals/change-guardrail.js +164 -0
- package/dist/signals/check-summary.d.ts +9 -0
- package/dist/signals/check-summary.js +12 -0
- package/dist/signals/contributor-calibration.d.ts +23 -0
- package/dist/signals/contributor-calibration.js +47 -0
- package/dist/signals/duplicate-winner.d.ts +9 -0
- package/dist/signals/duplicate-winner.js +9 -0
- package/dist/signals/path-matchers.d.ts +36 -0
- package/dist/signals/path-matchers.js +371 -0
- package/dist/signals/predicted-gate-engine.d.ts +62 -0
- package/dist/signals/predicted-gate-engine.js +895 -0
- package/dist/signals/preflight-limits.d.ts +14 -0
- package/dist/signals/preflight-limits.js +14 -0
- package/dist/signals/slop.d.ts +56 -0
- package/dist/signals/slop.js +324 -0
- package/dist/signals/test-evidence.d.ts +25 -0
- package/dist/signals/test-evidence.js +108 -0
- package/dist/subprocess-env.d.ts +23 -0
- package/dist/subprocess-env.js +74 -0
- package/dist/track-record-summary.d.ts +92 -0
- package/dist/track-record-summary.js +301 -0
- package/dist/types/manifest-deps-types.d.ts +514 -0
- package/dist/types/manifest-deps-types.js +4 -0
- package/dist/types/predicted-gate-types.d.ts +338 -0
- package/dist/types/predicted-gate-types.js +3 -0
- package/dist/types/reward-risk-types.d.ts +319 -0
- package/dist/types/reward-risk-types.js +11 -0
- package/dist/utils/json.d.ts +1 -0
- package/dist/utils/json.js +3 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/package.json +80 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { ScorePreviewResult } from "./scoring/preview.js";
|
|
2
|
+
import type { CheckSummaryRecord, CollisionReport, ContributorFit, ContributorOutcomeHistory, ContributorProfile, ContributorScoringProfile, IssueRecord, LaneAdvice, PullRequestFileRecord, PullRequestRecord, PullRequestReviewRecord, QueueHealth, RecentMergedPullRequestRecord, RepoFitRecommendation, RepositoryRecord, RoleContext, ScoringModelSnapshotRecord } from "./types/reward-risk-types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Minimal covariant view of `buildPullRequestReviewIntelligence`'s return — only the fields this module
|
|
5
|
+
* reads. The full `src` type (`PullRequestMaintainerPacket & …`) is covariantly assignable to it.
|
|
6
|
+
*/
|
|
7
|
+
export type PullRequestReviewIntelligenceView = {
|
|
8
|
+
roleContext: {
|
|
9
|
+
maintainerLane: boolean;
|
|
10
|
+
};
|
|
11
|
+
outcomeContext?: {
|
|
12
|
+
closedPullRequestRate: number;
|
|
13
|
+
} | undefined;
|
|
14
|
+
reviewSignals: {
|
|
15
|
+
linkedIssues: readonly unknown[];
|
|
16
|
+
collisionClusters: number;
|
|
17
|
+
approvalCount: number;
|
|
18
|
+
};
|
|
19
|
+
changeSummary: {
|
|
20
|
+
fileCount: number;
|
|
21
|
+
additions: number;
|
|
22
|
+
deletions: number;
|
|
23
|
+
codeFileCount: number;
|
|
24
|
+
testFileCount: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/** Input shared by {@link buildPullRequestReviewability} and the injected `buildPullRequestReviewIntelligence`. */
|
|
28
|
+
export type PullRequestReviewabilityInput = {
|
|
29
|
+
repo: RepositoryRecord | null;
|
|
30
|
+
pullRequest: PullRequestRecord | null;
|
|
31
|
+
issues: IssueRecord[];
|
|
32
|
+
pullRequests: PullRequestRecord[];
|
|
33
|
+
files: PullRequestFileRecord[];
|
|
34
|
+
reviews: PullRequestReviewRecord[];
|
|
35
|
+
checks: CheckSummaryRecord[];
|
|
36
|
+
recentMergedPullRequests: RecentMergedPullRequestRecord[];
|
|
37
|
+
repoFullName: string;
|
|
38
|
+
pullNumber: number;
|
|
39
|
+
profile?: ContributorProfile | null | undefined;
|
|
40
|
+
outcomeHistory?: ContributorOutcomeHistory | null | undefined;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The `src/signals/engine.ts` builders reward-risk depends on, injected so this package stays free of any
|
|
44
|
+
* `src/` import. The real `src`-typed builders bind cleanly: their argument records are wider than (assignable
|
|
45
|
+
* from) these engine mirrors, and their richer return types are covariantly assignable to the narrowed views
|
|
46
|
+
* above. `isFailingCheckSummary` is imported directly from `./signals/check-summary.js` (#4256).
|
|
47
|
+
*/
|
|
48
|
+
export type RewardRiskEngineDeps = {
|
|
49
|
+
buildRoleContext: (args: {
|
|
50
|
+
login: string;
|
|
51
|
+
repo: RepositoryRecord | null;
|
|
52
|
+
repoFullName: string;
|
|
53
|
+
pullRequests: PullRequestRecord[];
|
|
54
|
+
issues: IssueRecord[];
|
|
55
|
+
profile: ContributorProfile;
|
|
56
|
+
}) => RoleContext;
|
|
57
|
+
buildLaneAdvice: (repo: RepositoryRecord | null, fullName: string) => LaneAdvice;
|
|
58
|
+
buildCollisionReport: (fullName: string, issues: IssueRecord[], pullRequests: PullRequestRecord[], recentMergedPullRequests: RecentMergedPullRequestRecord[]) => CollisionReport;
|
|
59
|
+
buildQueueHealth: (repo: RepositoryRecord | null, issues: IssueRecord[], pullRequests: PullRequestRecord[], collisions: CollisionReport) => QueueHealth;
|
|
60
|
+
buildRepoFitRecommendation: (args: {
|
|
61
|
+
login: string;
|
|
62
|
+
repo: RepositoryRecord | null;
|
|
63
|
+
repoFullName: string;
|
|
64
|
+
profile: ContributorProfile;
|
|
65
|
+
outcomeHistory: ContributorOutcomeHistory;
|
|
66
|
+
issues: IssueRecord[];
|
|
67
|
+
pullRequests: PullRequestRecord[];
|
|
68
|
+
}) => RepoFitRecommendation;
|
|
69
|
+
buildContributorIntakeHealth: (repo: RepositoryRecord | null, issues: IssueRecord[], pullRequests: PullRequestRecord[], fullName: string, collisions: CollisionReport) => {
|
|
70
|
+
level: "healthy" | "watch" | "strained" | "blocked";
|
|
71
|
+
};
|
|
72
|
+
buildPullRequestReviewIntelligence: (args: PullRequestReviewabilityInput) => PullRequestReviewIntelligenceView;
|
|
73
|
+
};
|
|
74
|
+
export type RewardRiskActionKind = "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";
|
|
75
|
+
/** Severity tier for a reward/risk action, from most to least urgent. */
|
|
76
|
+
export type RewardRiskActionSeverity = "critical" | "warning" | "tip" | "info";
|
|
77
|
+
export type RewardRiskAction = {
|
|
78
|
+
actionKind: RewardRiskActionKind;
|
|
79
|
+
repoFullName: string;
|
|
80
|
+
/** Severity tier: critical = eligibility blocker; warning = active penalty; tip = multiplier opportunity; info = planning context. */
|
|
81
|
+
severity: RewardRiskActionSeverity;
|
|
82
|
+
priorityScore: number;
|
|
83
|
+
laneValueScore: number;
|
|
84
|
+
scoreabilityScore: number;
|
|
85
|
+
personalFitScore: number;
|
|
86
|
+
riskPenalty: number;
|
|
87
|
+
maintainerFrictionPenalty: number;
|
|
88
|
+
actionLeverageScore: number;
|
|
89
|
+
whyThisHelps: string[];
|
|
90
|
+
nextActions: string[];
|
|
91
|
+
};
|
|
92
|
+
export type RepoRewardRisk = {
|
|
93
|
+
login: string;
|
|
94
|
+
repoFullName: string;
|
|
95
|
+
generatedAt: string;
|
|
96
|
+
roleContext: RoleContext;
|
|
97
|
+
lane: LaneAdvice;
|
|
98
|
+
recommendation: RepoFitRecommendation["recommendation"];
|
|
99
|
+
rewardUpside: {
|
|
100
|
+
relevantLane: "direct_pr" | "issue_discovery" | "maintainer_lane" | "none";
|
|
101
|
+
repoSlice: number;
|
|
102
|
+
directPrSlice: number;
|
|
103
|
+
issueDiscoverySlice: number;
|
|
104
|
+
maintainerCutSlice: number;
|
|
105
|
+
labelMultiplier: number;
|
|
106
|
+
issueMultiplier: number;
|
|
107
|
+
estimatedScoreIfClean: number;
|
|
108
|
+
currentEstimatedScore: number;
|
|
109
|
+
/** Explicit opportunity factors: competition and freshness of available work. */
|
|
110
|
+
opportunityFactors: {
|
|
111
|
+
/** 0–1; higher = more competing open PRs with duplicate/collision risk. */
|
|
112
|
+
competitionFactor: number;
|
|
113
|
+
/** 0–1; higher = issues in this repo were created or updated more recently. */
|
|
114
|
+
freshnessFactor: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
scoreBlockers: string[];
|
|
118
|
+
riskBreakdown: {
|
|
119
|
+
queueBurden: QueueHealth["level"];
|
|
120
|
+
queueBurdenScore: number;
|
|
121
|
+
duplicateClusters: number;
|
|
122
|
+
highRiskDuplicateClusters: number;
|
|
123
|
+
closedPullRequestRate: number;
|
|
124
|
+
openPullRequests: number;
|
|
125
|
+
credibility: number;
|
|
126
|
+
reviewChurnRisk: "low" | "medium" | "high";
|
|
127
|
+
};
|
|
128
|
+
actionImpact: {
|
|
129
|
+
currentOpenPrCount: number;
|
|
130
|
+
openPrThreshold: number;
|
|
131
|
+
openPrMultiplierDelta: string;
|
|
132
|
+
estimatedScoreDelta: string;
|
|
133
|
+
cleanupNeeded: number;
|
|
134
|
+
explanation: string;
|
|
135
|
+
};
|
|
136
|
+
currentPreview: ScorePreviewResult;
|
|
137
|
+
afterCleanupPreview: ScorePreviewResult;
|
|
138
|
+
actions: RewardRiskAction[];
|
|
139
|
+
whyThisHelps: string[];
|
|
140
|
+
nextActions: string[];
|
|
141
|
+
summary: string;
|
|
142
|
+
};
|
|
143
|
+
/** A registered repo where a small number of PR cleanups would unlock or improve scoring. */
|
|
144
|
+
export type EligibilityGapEntry = {
|
|
145
|
+
repoFullName: string;
|
|
146
|
+
/** Number of open PRs to land or withdraw before the open-PR gate improves. */
|
|
147
|
+
prsToUnlock: number;
|
|
148
|
+
/** Estimated merged score after reaching the threshold (from afterCleanupPreview). */
|
|
149
|
+
estimatedScoreAtThreshold: number;
|
|
150
|
+
recommendation: string;
|
|
151
|
+
};
|
|
152
|
+
export type ContributorRewardRiskStrategy = {
|
|
153
|
+
login: string;
|
|
154
|
+
generatedAt: string;
|
|
155
|
+
scoringModelSnapshotId: string;
|
|
156
|
+
summary: string;
|
|
157
|
+
topActions: RewardRiskAction[];
|
|
158
|
+
repoAnalyses: RepoRewardRisk[];
|
|
159
|
+
reasoning: string[];
|
|
160
|
+
actionImpact: string[];
|
|
161
|
+
nextActions: string[];
|
|
162
|
+
/** Repos where 1–5 PR cleanups would flip the open-PR gate toward scoreable. Sorted by fewest prsToUnlock. */
|
|
163
|
+
eligibilityGap: EligibilityGapEntry[];
|
|
164
|
+
};
|
|
165
|
+
export type MaintainerNoiseReport = {
|
|
166
|
+
repoFullName: string;
|
|
167
|
+
generatedAt: string;
|
|
168
|
+
score: number;
|
|
169
|
+
level: "low" | "medium" | "high" | "critical";
|
|
170
|
+
noiseSources: string[];
|
|
171
|
+
maintainerActions: Array<"review_now" | "needs_author" | "likely_duplicate" | "close_or_redirect" | "watch" | "maintainer_lane">;
|
|
172
|
+
queueHealth: QueueHealth;
|
|
173
|
+
summary: string;
|
|
174
|
+
};
|
|
175
|
+
export type PullRequestReviewability = {
|
|
176
|
+
repoFullName: string;
|
|
177
|
+
pullNumber: number;
|
|
178
|
+
generatedAt: string;
|
|
179
|
+
score: number;
|
|
180
|
+
action: "review_now" | "needs_author" | "likely_duplicate" | "close_or_redirect" | "watch" | "maintainer_lane";
|
|
181
|
+
noiseSources: string[];
|
|
182
|
+
whyThisHelps: string[];
|
|
183
|
+
maintainerNextSteps: string[];
|
|
184
|
+
privateSummary: string;
|
|
185
|
+
};
|
|
186
|
+
export declare function buildRepoRewardRisk(args: {
|
|
187
|
+
login: string;
|
|
188
|
+
repo: RepositoryRecord | null;
|
|
189
|
+
repoFullName: string;
|
|
190
|
+
profile: ContributorProfile;
|
|
191
|
+
outcomeHistory: ContributorOutcomeHistory;
|
|
192
|
+
scoringSnapshot: ScoringModelSnapshotRecord;
|
|
193
|
+
scoringProfile?: ContributorScoringProfile | null | undefined;
|
|
194
|
+
issues: IssueRecord[];
|
|
195
|
+
pullRequests: PullRequestRecord[];
|
|
196
|
+
recentMergedPullRequests?: RecentMergedPullRequestRecord[] | undefined;
|
|
197
|
+
/** Repo primary language (from sync metadata / ContributorFit.languageFit),
|
|
198
|
+
* used for the personalFit language-match bonus. */
|
|
199
|
+
repoLanguage?: string | null | undefined;
|
|
200
|
+
}, deps: RewardRiskEngineDeps): RepoRewardRisk;
|
|
201
|
+
export declare function buildContributorRewardRiskStrategy(args: {
|
|
202
|
+
login: string;
|
|
203
|
+
fit: ContributorFit;
|
|
204
|
+
scoringProfile: ContributorScoringProfile;
|
|
205
|
+
scoringSnapshot: ScoringModelSnapshotRecord;
|
|
206
|
+
outcomeHistory: ContributorOutcomeHistory;
|
|
207
|
+
repositories: RepositoryRecord[];
|
|
208
|
+
allIssues: IssueRecord[];
|
|
209
|
+
allPullRequests: PullRequestRecord[];
|
|
210
|
+
recentMergedPullRequests?: RecentMergedPullRequestRecord[] | undefined;
|
|
211
|
+
}, deps: RewardRiskEngineDeps): ContributorRewardRiskStrategy;
|
|
212
|
+
export declare function buildMaintainerNoiseReport(repo: RepositoryRecord | null, issues: IssueRecord[], pullRequests: PullRequestRecord[], recentMergedPullRequests: RecentMergedPullRequestRecord[], fullName: string, deps: RewardRiskEngineDeps): MaintainerNoiseReport;
|
|
213
|
+
export declare function buildPullRequestReviewability(args: PullRequestReviewabilityInput, deps: RewardRiskEngineDeps): PullRequestReviewability;
|
|
214
|
+
declare function bestFitLabels(repo: RepositoryRecord | null): string[];
|
|
215
|
+
declare function pickIssueTimestamp(issue: IssueRecord): string | null;
|
|
216
|
+
/** Unknown/unparseable timestamps floor freshness (parity with gittensory-engine opportunity-freshness.ts). */
|
|
217
|
+
declare function issueAgeDays(value: string | null): number;
|
|
218
|
+
export declare const rewardRiskFreshnessInternals: {
|
|
219
|
+
pickIssueTimestamp: typeof pickIssueTimestamp;
|
|
220
|
+
issueAgeDays: typeof issueAgeDays;
|
|
221
|
+
bestFitLabels: typeof bestFitLabels;
|
|
222
|
+
};
|
|
223
|
+
export {};
|