@rigour-labs/core 6.6.3 → 6.6.4
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.
|
@@ -7,7 +7,7 @@ export declare function sessionBaseline(cwd: string, session: string): string |
|
|
|
7
7
|
* A stop in the same state as the last review (a turn that only read, or only talked) has
|
|
8
8
|
* nothing new to review, so the agent is not told the same thing again.
|
|
9
9
|
*/
|
|
10
|
-
export declare function workFingerprint(cwd: string): string | undefined;
|
|
10
|
+
export declare function workFingerprint(cwd: string, ownOutputs?: string[]): string | undefined;
|
|
11
11
|
/** Whether the work is in the state the last stop review saw. */
|
|
12
12
|
export declare function alreadyReviewed(cwd: string, session: string, fingerprint: string | undefined): boolean;
|
|
13
13
|
export declare function recordReviewed(cwd: string, session: string, fingerprint: string | undefined): void;
|
|
@@ -56,11 +56,13 @@ export function sessionBaseline(cwd, session) {
|
|
|
56
56
|
* A stop in the same state as the last review (a turn that only read, or only talked) has
|
|
57
57
|
* nothing new to review, so the agent is not told the same thing again.
|
|
58
58
|
*/
|
|
59
|
-
export function workFingerprint(cwd) {
|
|
59
|
+
export function workFingerprint(cwd, ownOutputs = DEFAULT_OWN_OUTPUTS) {
|
|
60
60
|
const run = (args) => spawnSync('git', args, { cwd, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
|
|
61
|
+
// Rigour's own files change on every review; where a repository does not ignore them, they must not count as work.
|
|
62
|
+
const pathspec = ['--', '.', ...ownOutputs.map(own => `:(exclude)${own}`)];
|
|
61
63
|
const head = run(['rev-parse', '--verify', '--quiet', 'HEAD']);
|
|
62
|
-
const diff = run(['diff', 'HEAD', '--no-color', '--no-ext-diff']);
|
|
63
|
-
const untracked = run(['ls-files', '--others', '--exclude-standard', '-z']);
|
|
64
|
+
const diff = run(['diff', 'HEAD', '--no-color', '--no-ext-diff', ...pathspec]);
|
|
65
|
+
const untracked = run(['ls-files', '--others', '--exclude-standard', '-z', ...pathspec]);
|
|
64
66
|
if (diff.status !== 0 || untracked.status !== 0)
|
|
65
67
|
return undefined;
|
|
66
68
|
const hash = createHash('sha256').update(head.stdout).update(diff.stdout);
|
|
@@ -75,6 +77,8 @@ export function workFingerprint(cwd) {
|
|
|
75
77
|
}
|
|
76
78
|
return hash.digest('hex');
|
|
77
79
|
}
|
|
80
|
+
/** What a review writes into the repository: its state folder and its reports. */
|
|
81
|
+
const DEFAULT_OWN_OUTPUTS = ['.rigour', 'rigour-report.json', 'rigour-fix-packet.json'];
|
|
78
82
|
/** Whether the work is in the state the last stop review saw. */
|
|
79
83
|
export function alreadyReviewed(cwd, session, fingerprint) {
|
|
80
84
|
return !!fingerprint && readStore(cwd)[session]?.reviewed === fingerprint;
|
|
@@ -140,7 +140,7 @@ describe('git-backed review', () => {
|
|
|
140
140
|
const shown = [...all.findings, ...all.fileFindings, ...all.advisory].filter(f => f.id === 'AST_COMPLEXITY');
|
|
141
141
|
expect(shown.map(f => f.files?.[0]).sort()).toEqual(['src/fresh.ts', 'src/old.ts']);
|
|
142
142
|
expect(all.preexisting).toBe(0);
|
|
143
|
-
});
|
|
143
|
+
}, 30_000); // two whole reviews, each running the rules on the change and on the base tree
|
|
144
144
|
it('lets a change dismiss its own finding only when the review trusts the working tree', async () => {
|
|
145
145
|
write('src/old.ts', 'export const a = 1;\n');
|
|
146
146
|
write('.gitignore', '.rigour/*\n!.rigour/dismissed.json\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/core",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.4",
|
|
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"
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"pg": "^8.16.3",
|
|
75
75
|
"sqlite3": "^5.1.7",
|
|
76
76
|
"openai": "^4.104.0",
|
|
77
|
-
"@rigour-labs/brain-darwin-arm64": "6.6.
|
|
78
|
-
"@rigour-labs/brain-darwin-x64": "6.6.
|
|
79
|
-
"@rigour-labs/brain-linux-
|
|
80
|
-
"@rigour-labs/brain-linux-
|
|
81
|
-
"@rigour-labs/brain-win-x64": "6.6.
|
|
77
|
+
"@rigour-labs/brain-darwin-arm64": "6.6.4",
|
|
78
|
+
"@rigour-labs/brain-darwin-x64": "6.6.4",
|
|
79
|
+
"@rigour-labs/brain-linux-x64": "6.6.4",
|
|
80
|
+
"@rigour-labs/brain-linux-arm64": "6.6.4",
|
|
81
|
+
"@rigour-labs/brain-win-x64": "6.6.4"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/fs-extra": "^11.0.4",
|