@rigour-labs/core 6.9.0-rc.5 → 6.9.0-rc.6
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.
|
@@ -56,12 +56,17 @@ export interface OutcomeMetrics {
|
|
|
56
56
|
rate: number | null;
|
|
57
57
|
reason?: string;
|
|
58
58
|
};
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Dollars of every review round on a pull request, summed per pull request, over pull requests whose every review
|
|
61
|
+
* event counts every run. Median only from MIN_FOR_RATE. Pull requests with an earlier event are counted apart in
|
|
62
|
+
* `prsEarlierBasis`, never pooled: their dollars are on another basis.
|
|
63
|
+
*/
|
|
60
64
|
costPerPr: {
|
|
61
65
|
prs: number;
|
|
62
66
|
totalUsd: number;
|
|
63
67
|
medianUsd: number | null;
|
|
64
68
|
reason?: string;
|
|
69
|
+
prsEarlierBasis: number;
|
|
65
70
|
};
|
|
66
71
|
};
|
|
67
72
|
lessons: {
|
|
@@ -83,6 +88,8 @@ export interface PrReviews {
|
|
|
83
88
|
};
|
|
84
89
|
/** Every review round's dollars, summed. */
|
|
85
90
|
usd: number;
|
|
91
|
+
/** A review event from before cost_usd counted every run (no `cost_basis: 'runs'`): its dollars are on another basis. */
|
|
92
|
+
earlierBasis: boolean;
|
|
86
93
|
}
|
|
87
94
|
/** `reviewed`: the pull requests a review by Rigour ran on, each with its reviews (the threads' review events). */
|
|
88
95
|
export declare function outcomeMetrics(records: PrOutcome[], lessons: ReviewLesson[], reviewed: Map<number, PrReviews>): OutcomeMetrics;
|
package/dist/outcomes/metrics.js
CHANGED
|
@@ -32,7 +32,7 @@ function modelNumbers(prs) {
|
|
|
32
32
|
const model = firsts.reduce((n, f) => n + f.model, 0);
|
|
33
33
|
const checks = firsts.reduce((n, f) => n + f.checks, 0);
|
|
34
34
|
const few = (n) => n < MIN_FOR_RATE ? { reason: `fewer than ${MIN_FOR_RATE} pull requests: a count, not a rate` } : {};
|
|
35
|
-
const usd = prs.map(p => p.usd).sort((a, b) => a - b);
|
|
35
|
+
const usd = prs.filter(p => !p.earlierBasis).map(p => p.usd).sort((a, b) => a - b);
|
|
36
36
|
const mid = usd.length >> 1;
|
|
37
37
|
return {
|
|
38
38
|
share: { model, checks, prs: firsts.length, rate: firsts.length >= MIN_FOR_RATE && model + checks > 0 ? Math.round((model / (model + checks)) * 100) / 100 : null, ...few(firsts.length) },
|
|
@@ -41,6 +41,7 @@ function modelNumbers(prs) {
|
|
|
41
41
|
totalUsd: Math.round(usd.reduce((a, b) => a + b, 0) * 100) / 100,
|
|
42
42
|
medianUsd: usd.length >= MIN_FOR_RATE ? Math.round((usd.length % 2 ? usd[mid] : (usd[mid - 1] + usd[mid]) / 2) * 100) / 100 : null,
|
|
43
43
|
...few(usd.length),
|
|
44
|
+
prsEarlierBasis: prs.filter(p => p.earlierBasis).length,
|
|
44
45
|
},
|
|
45
46
|
};
|
|
46
47
|
}
|
package/dist/outcomes/run.js
CHANGED
|
@@ -52,8 +52,10 @@ function reviews(cwd) {
|
|
|
52
52
|
for (const e of eventsOfKind(cwd, 'review')) {
|
|
53
53
|
if (typeof e.pr !== 'number')
|
|
54
54
|
continue;
|
|
55
|
-
const pr = reviewed.get(e.pr) ?? { usd: 0 };
|
|
55
|
+
const pr = reviewed.get(e.pr) ?? { usd: 0, earlierBasis: false };
|
|
56
56
|
pr.usd += count(e.cost_usd);
|
|
57
|
+
if (e.cost_basis !== 'runs')
|
|
58
|
+
pr.earlierBasis = true;
|
|
57
59
|
if (!pr.first && typeof e.checks === 'number')
|
|
58
60
|
pr.first = { model: count(e.blocking) + count(e.should_fix), checks: e.checks };
|
|
59
61
|
reviewed.set(e.pr, pr);
|
package/dist/review/reviewer.js
CHANGED
|
@@ -66,6 +66,8 @@ export async function runReviewer(cwd, base, config, exec = defaultExec, progres
|
|
|
66
66
|
...(result.record ? { integrity: result.record.integrity, judges: result.record.judges.map(j => j.reviewer) } : {}),
|
|
67
67
|
// Every run this review made, failed ones included: the same dollars as its cost row (the savings ledger).
|
|
68
68
|
...(result.spentUsd !== undefined ? { cost_usd: result.spentUsd } : {}),
|
|
69
|
+
// Marks that cost_usd is on that basis: an earlier event's cost_usd missed failed runs and repeated a cached verdict's.
|
|
70
|
+
cost_basis: 'runs',
|
|
69
71
|
});
|
|
70
72
|
return result;
|
|
71
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/core",
|
|
3
|
-
"version": "6.9.0-rc.
|
|
3
|
+
"version": "6.9.0-rc.6",
|
|
4
4
|
"description": "Rigour's review engine: deterministic gates on changed lines, rules and lessons learned from your team's fixes, and per-check precision from what you fix versus dismiss, across TypeScript, JavaScript, Python, Go, Ruby and C#.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.13"
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"@anthropic-ai/sdk": "^0.132.1",
|
|
76
76
|
"pg": "^8.16.3",
|
|
77
77
|
"openai": "^5.23.2",
|
|
78
|
-
"@rigour-labs/brain-darwin-arm64": "6.9.0-rc.
|
|
79
|
-
"@rigour-labs/brain-linux-arm64": "6.9.0-rc.
|
|
80
|
-
"@rigour-labs/brain-
|
|
81
|
-
"@rigour-labs/brain-darwin-x64": "6.9.0-rc.
|
|
82
|
-
"@rigour-labs/brain-
|
|
78
|
+
"@rigour-labs/brain-darwin-arm64": "6.9.0-rc.6",
|
|
79
|
+
"@rigour-labs/brain-linux-arm64": "6.9.0-rc.6",
|
|
80
|
+
"@rigour-labs/brain-linux-x64": "6.9.0-rc.6",
|
|
81
|
+
"@rigour-labs/brain-darwin-x64": "6.9.0-rc.6",
|
|
82
|
+
"@rigour-labs/brain-win-x64": "6.9.0-rc.6"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/fs-extra": "^11.0.4",
|