@farmslot/agent-runtime 0.37.2 → 0.38.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
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
- Active-development baseline; add user-facing changes here before release or package publication.
|
|
6
6
|
|
|
7
|
+
## 0.38.0 - 2026-10-23
|
|
8
|
+
|
|
9
|
+
- Align with `@farmslot/protocol` 0.65.0.
|
|
10
|
+
|
|
11
|
+
- Include the shared approval policy in self-review and paired review instructions.
|
|
12
|
+
- Reuse validated passing deterministic receipts for unchanged commands and inputs.
|
|
13
|
+
|
|
7
14
|
## 0.37.2 - 2026-10-22
|
|
8
15
|
|
|
9
16
|
- Read-only reviewers skip repository settings and hooks at startup while retaining the user's account configuration.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farmslot/agent-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@farmslot/adapter-sdk": "0.25.1",
|
|
64
|
-
"@farmslot/protocol": "0.
|
|
64
|
+
"@farmslot/protocol": "0.65.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/node": "^22.0.0",
|
|
@@ -547,13 +547,13 @@ if (
|
|
|
547
547
|
assertChecklistComplete(taskPath, { allowOneUnchecked: true });
|
|
548
548
|
}
|
|
549
549
|
// A successful verdict (no-change writes `complete` too) stays put: `./mark N` on
|
|
550
|
-
// a declared deterministic step
|
|
551
|
-
//
|
|
550
|
+
// a declared deterministic step validates its receipt against the current tree,
|
|
551
|
+
// executing only when needed, and leaves the box and signal as they are.
|
|
552
552
|
if (stepNumber != null && readJson(signalPath).status === 'complete') {
|
|
553
553
|
try {
|
|
554
554
|
if (deterministicChecks.execute(taskDir, path.basename(taskPath), stepNumber)) {
|
|
555
555
|
console.log(
|
|
556
|
-
`signal already terminal: status=complete;
|
|
556
|
+
`signal already terminal: status=complete; validated deterministic step ${stepNumber} for the current tree`,
|
|
557
557
|
);
|
|
558
558
|
process.exit(0);
|
|
559
559
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { execFileSync } = require('node:child_process');
|
|
4
|
+
const { readFileSync } = require('node:fs');
|
|
5
|
+
const { renderApprovalPolicy } = require('@farmslot/protocol/review-approval-policy.cjs');
|
|
4
6
|
|
|
5
7
|
const sensitivePaths = [
|
|
6
8
|
[
|
|
@@ -45,12 +47,14 @@ function diffScopeCandidates(files) {
|
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
function buildDiffScopePacket(files, unavailable) {
|
|
50
|
+
function buildDiffScopePacket(files, unavailable, approvalPolicy) {
|
|
49
51
|
const unique = [...new Set(files)].sort();
|
|
50
52
|
const candidates = diffScopeCandidates(unique);
|
|
51
53
|
return [
|
|
52
54
|
REVIEW_DIFF_SCOPE_RULE,
|
|
53
55
|
'',
|
|
56
|
+
renderApprovalPolicy(approvalPolicy),
|
|
57
|
+
'',
|
|
54
58
|
'### Whole-contribution path inventory',
|
|
55
59
|
unavailable ? `UNVERIFIED: ${unavailable}` : JSON.stringify(unique),
|
|
56
60
|
'',
|
|
@@ -90,9 +94,11 @@ module.exports = {
|
|
|
90
94
|
};
|
|
91
95
|
|
|
92
96
|
if (require.main === module) {
|
|
93
|
-
const [command, repo, base, head] = process.argv.slice(2);
|
|
94
|
-
if (command === 'instructions')
|
|
95
|
-
|
|
97
|
+
const [command, repo, base, head, policyJson] = process.argv.slice(2);
|
|
98
|
+
if (command === 'instructions') {
|
|
99
|
+
const policy = repo ? JSON.parse(readFileSync(repo, 'utf8')).approvalPolicy : undefined;
|
|
100
|
+
process.stdout.write(`${REVIEW_DIFF_SCOPE_RULE}\n\n${renderApprovalPolicy(policy)}\n`);
|
|
101
|
+
} else if (command === 'packet' && repo && base && head) {
|
|
96
102
|
let files = [];
|
|
97
103
|
let unavailable;
|
|
98
104
|
try {
|
|
@@ -101,9 +107,11 @@ if (require.main === module) {
|
|
|
101
107
|
// Missing source is recorded in the packet; it never becomes a clean scan.
|
|
102
108
|
unavailable = error instanceof Error ? error.message.split('\n')[0] : String(error);
|
|
103
109
|
}
|
|
104
|
-
process.stdout.write(
|
|
110
|
+
process.stdout.write(
|
|
111
|
+
`${buildDiffScopePacket(files, unavailable, policyJson ? JSON.parse(policyJson) : undefined)}\n`,
|
|
112
|
+
);
|
|
105
113
|
} else
|
|
106
114
|
throw new Error(
|
|
107
|
-
'Usage: review-diff-scope.cjs instructions | packet <repo> <publication-base> <head>',
|
|
115
|
+
'Usage: review-diff-scope.cjs instructions [project.json] | packet <repo> <publication-base> <head> [approval-policy-json]',
|
|
108
116
|
);
|
|
109
117
|
}
|
|
@@ -5,5 +5,11 @@ export interface DiffScopeCandidate {
|
|
|
5
5
|
|
|
6
6
|
export const REVIEW_DIFF_SCOPE_RULE: string;
|
|
7
7
|
export function diffScopeCandidates(files: readonly string[]): DiffScopeCandidate[];
|
|
8
|
-
export function buildDiffScopePacket(
|
|
8
|
+
export function buildDiffScopePacket(
|
|
9
|
+
files: readonly string[],
|
|
10
|
+
unavailable?: string,
|
|
11
|
+
approvalPolicy?: Partial<
|
|
12
|
+
import('@farmslot/protocol/review-approval-policy.cjs').ReviewApprovalPolicy
|
|
13
|
+
>,
|
|
14
|
+
): string;
|
|
9
15
|
export function gitDiffScopeFiles(repo: string, base: string, head: string): string[];
|
|
@@ -633,6 +633,15 @@ function executeDeterministicStep(taskDir, checklist, stepNumber) {
|
|
|
633
633
|
);
|
|
634
634
|
const checkout = deterministicCheckout(taskDir);
|
|
635
635
|
const inputHash = deterministicInputHash(checkout, taskDir);
|
|
636
|
+
const previous = readDeterministicChecks(taskDir, checklist, { inputHash }).find(
|
|
637
|
+
(check) => check.stepNumber === stepNumber,
|
|
638
|
+
);
|
|
639
|
+
if (previous?.status === 'passed') {
|
|
640
|
+
console.log(
|
|
641
|
+
`Deterministic step ${stepNumber} reuses its passing receipt. Log: ${previous.logPath}`,
|
|
642
|
+
);
|
|
643
|
+
return true;
|
|
644
|
+
}
|
|
636
645
|
const logPath = path.posix.join(
|
|
637
646
|
'artifacts',
|
|
638
647
|
'deterministic-checks',
|