@rigour-labs/core 6.12.0-rc.2 → 6.12.1-rc.1
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.
|
@@ -46,6 +46,8 @@ export interface ReviewRecord {
|
|
|
46
46
|
reported: {
|
|
47
47
|
human_reviews: number;
|
|
48
48
|
};
|
|
49
|
+
/** Reviewed without pull request context: no pull request, description or human review was read (`--blind`). */
|
|
50
|
+
blind?: true;
|
|
49
51
|
/** Decisions people made. */
|
|
50
52
|
people: {
|
|
51
53
|
dismissed: number;
|
|
@@ -66,6 +68,8 @@ export interface RecordInput {
|
|
|
66
68
|
lessonsServed: number;
|
|
67
69
|
humanReviews: number;
|
|
68
70
|
at?: string;
|
|
71
|
+
/** Reviewed without pull request context (`--blind`). */
|
|
72
|
+
blind?: boolean;
|
|
69
73
|
}
|
|
70
74
|
export declare function buildRecord(input: RecordInput): ReviewRecord;
|
|
71
75
|
/** The hash a record's integrity field must equal; a record whose hash differs was changed after Rigour wrote it. */
|
|
@@ -28,6 +28,7 @@ export function buildRecord(input) {
|
|
|
28
28
|
},
|
|
29
29
|
reported: { human_reviews: input.humanReviews },
|
|
30
30
|
people: { dismissed: input.accounted.dismissed.length },
|
|
31
|
+
...(input.blind ? { blind: true } : {}),
|
|
31
32
|
};
|
|
32
33
|
return { ...body, integrity: integrityOf(body) };
|
|
33
34
|
}
|
|
@@ -64,6 +65,6 @@ export function recordLines(r, shouldFixShown = 5) {
|
|
|
64
65
|
const folded = [[v.notes, 'working note'], [v.disputed, 'disputed'], [v.unverified, 'unverified'], [r.people.dismissed, 'dismissed']].filter(([n]) => n > 0);
|
|
65
66
|
if (folded.length)
|
|
66
67
|
lines.push(`Also seen, never blocking: ${folded.map(([n, w]) => `${n} ${w}${n === 1 || w === 'disputed' || w === 'unverified' || w === 'dismissed' ? '' : 's'}`).join(', ')}.`);
|
|
67
|
-
lines.push(`Judged by ${r.judges.map(j => `${j.reviewer}${j.version ? ` ${j.version}` : ''}${j.model ? ` (${j.model})` : ''}${typeof j.cost_usd === 'number' ? ` $${j.cost_usd.toFixed(2)}` : ''}${j.outside_repo ? ` [${j.outside_repo}]` : ''}`).join(', ') || 'no judge'} on \`${r.head.slice(0, 9)}\` against \`${r.base.slice(0, 9)}\` (${r.scope}); ${r.reported.human_reviews} human review(s) seen. Integrity \`${r.integrity.slice(0, 16)}\`.`);
|
|
68
|
+
lines.push(`Judged by ${r.judges.map(j => `${j.reviewer}${j.version ? ` ${j.version}` : ''}${j.model ? ` (${j.model})` : ''}${typeof j.cost_usd === 'number' ? ` $${j.cost_usd.toFixed(2)}` : ''}${j.outside_repo ? ` [${j.outside_repo}]` : ''}`).join(', ') || 'no judge'} on \`${r.head.slice(0, 9)}\` against \`${r.base.slice(0, 9)}\` (${r.scope}); ${r.blind ? 'reviewed without pull request context' : `${r.reported.human_reviews} human review(s) seen`}. Integrity \`${r.integrity.slice(0, 16)}\`.`);
|
|
68
69
|
return lines;
|
|
69
70
|
}
|
|
@@ -17,7 +17,7 @@ export interface ReviewerOptions {
|
|
|
17
17
|
pr?: number;
|
|
18
18
|
/** ISO time: a review or comment posted from then on is not shown to the reviewer (a backtest). */
|
|
19
19
|
reviewsBefore?: string;
|
|
20
|
-
/** No pull request at all: the commit is reviewed alone, with no human review or description, and GitHub is never asked (a backtest round that names no pull request). */
|
|
20
|
+
/** No pull request at all: the commit is reviewed alone, with no human review or description, and GitHub is never asked (`rigour review --reviewer --blind`, or a backtest round that names no pull request). */
|
|
21
21
|
blind?: boolean;
|
|
22
22
|
/** At push the ready-pull-request rule applies; a review command or a backtest always reviews. */
|
|
23
23
|
trigger?: 'push' | 'review' | 'backtest';
|
|
@@ -66,6 +66,8 @@ export interface ReviewerResult {
|
|
|
66
66
|
panel?: PanelItem[];
|
|
67
67
|
/** Why there is no verdict (unavailable) or why none was sought (skipped). */
|
|
68
68
|
reason?: string;
|
|
69
|
+
/** Reviewed without pull request context: no pull request lookup, description or human reviews (`--blind`). */
|
|
70
|
+
blind?: boolean;
|
|
69
71
|
reviewers: ReviewerName[];
|
|
70
72
|
scope?: 'full' | 'delta';
|
|
71
73
|
why?: string;
|
package/dist/review/reviewer.js
CHANGED
|
@@ -53,7 +53,7 @@ const MAX_DELTAS = 4;
|
|
|
53
53
|
const MAX_DELTA_LINES = 400;
|
|
54
54
|
/** The reviewer, and one anonymous usage event for what it did (only when the person opted in to telemetry). */
|
|
55
55
|
export async function runReviewer(cwd, base, config, exec = defaultExec, progress = message => process.stderr.write(`${message}\n`), options = {}) {
|
|
56
|
-
const result = await review(cwd, base, config, exec, progress, options);
|
|
56
|
+
const result = withoutPrMarked(await review(cwd, base, config, exec, progress, options), options);
|
|
57
57
|
const trigger = options.trigger ?? (options.reviewsBefore ? 'backtest' : 'review');
|
|
58
58
|
await trackUsage('reviewer_completed', reviewerUsage(result, trigger));
|
|
59
59
|
// On the task's thread, unless it replays history: a backtest's worktree is not anyone's task.
|
|
@@ -72,6 +72,10 @@ export async function runReviewer(cwd, base, config, exec = defaultExec, progres
|
|
|
72
72
|
});
|
|
73
73
|
return result;
|
|
74
74
|
}
|
|
75
|
+
/** A blind review says so on its result, whatever the outcome: no pull request context was read. */
|
|
76
|
+
function withoutPrMarked(result, options) {
|
|
77
|
+
return options.blind ? { ...result, blind: true } : result;
|
|
78
|
+
}
|
|
75
79
|
async function review(cwd, base, config, exec, progress, options) {
|
|
76
80
|
const settings = resolveReviewer(config, { ...options.choice, ...(options.full ? { mode: 'full' } : {}) });
|
|
77
81
|
const trigger = options.trigger ?? (options.reviewsBefore ? 'backtest' : 'review');
|
|
@@ -246,7 +250,7 @@ async function review(cwd, base, config, exec, progress, options) {
|
|
|
246
250
|
const res = result(accounted, verdict, reviewers, scope, why, cached, reviews, pr, modeRecord, settings.dismissals);
|
|
247
251
|
const judges = (verdict.reviewers ?? []).map(r => ({ reviewer: r.reviewer, ...(installed.get(r.reviewer)?.version ? { version: installed.get(r.reviewer).version } : {}), ...(modelFor(r.reviewer) ? { model: modelFor(r.reviewer) } : {}), ...(typeof r.cost_usd === 'number' ? { cost_usd: r.cost_usd } : {}), ...(r.trace?.turns ? { turns: r.trace.turns } : {}), ...outsideOf(r.reviewer) }));
|
|
248
252
|
const recordPath = store.recordPath(verdictFile);
|
|
249
|
-
const record = (cached && store.readJson(recordPath)) || buildRecord({ head, base: baseSha, scope, verdict, accounted, judges, lessonsServed: context.lessons, humanReviews: reviews.count });
|
|
253
|
+
const record = (cached && store.readJson(recordPath)) || buildRecord({ head, base: baseSha, scope, verdict, accounted, judges, lessonsServed: context.lessons, humanReviews: reviews.count, blind: options.blind });
|
|
250
254
|
if (!cached || !fs.existsSync(recordPath))
|
|
251
255
|
store.writeJson(recordPath, record);
|
|
252
256
|
const applied = lessonsApplied(verdict.lessons ?? [], context.servedLessons);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/core",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.1-rc.1",
|
|
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-
|
|
79
|
-
"@rigour-labs/brain-darwin-
|
|
80
|
-
"@rigour-labs/brain-linux-x64": "6.12.
|
|
81
|
-
"@rigour-labs/brain-win-x64": "6.12.
|
|
82
|
-
"@rigour-labs/brain-linux-arm64": "6.12.
|
|
78
|
+
"@rigour-labs/brain-darwin-x64": "6.12.1-rc.1",
|
|
79
|
+
"@rigour-labs/brain-darwin-arm64": "6.12.1-rc.1",
|
|
80
|
+
"@rigour-labs/brain-linux-x64": "6.12.1-rc.1",
|
|
81
|
+
"@rigour-labs/brain-win-x64": "6.12.1-rc.1",
|
|
82
|
+
"@rigour-labs/brain-linux-arm64": "6.12.1-rc.1"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/fs-extra": "^11.0.4",
|