ai2rules-harness 0.4.0 → 0.4.2-rc.2
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/bin/harness.js +9 -0
- package/package.json +5 -5
package/bin/harness.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// AI2RULES_HARNESS to an absolute path and it is used verbatim.
|
|
15
15
|
|
|
16
16
|
const fs = require('fs');
|
|
17
|
+
const os = require('os');
|
|
17
18
|
const path = require('path');
|
|
18
19
|
const { spawnSync } = require('child_process');
|
|
19
20
|
|
|
@@ -65,4 +66,12 @@ if (res.error) {
|
|
|
65
66
|
console.error(`ai2rules-harness: cannot execute ${bin} (via ${how}): ${res.error.message}`);
|
|
66
67
|
process.exit(126);
|
|
67
68
|
}
|
|
69
|
+
// Propagate how the harness actually ended. When a child dies from a signal,
|
|
70
|
+
// `status` is null and `signal` holds the name — exiting 1 there would tell a
|
|
71
|
+
// caller "the harness failed" when the truth is "the user pressed Ctrl-C", and a
|
|
72
|
+
// script cannot tell those apart. The shell convention is 128 + the signal number.
|
|
73
|
+
if (res.signal) {
|
|
74
|
+
const num = os.constants.signals[res.signal];
|
|
75
|
+
process.exit(num ? 128 + num : 1);
|
|
76
|
+
}
|
|
68
77
|
process.exit(res.status === null ? 1 : res.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai2rules-harness",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2-rc.2",
|
|
4
4
|
"description": "Deterministic governance for local CLI coding agents. `npx ai2rules-harness init` governs a project in one command.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"node": ">=18"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"ai2rules-harness-darwin-arm64": "0.4.
|
|
36
|
-
"ai2rules-harness-darwin-x64": "0.4.
|
|
37
|
-
"ai2rules-harness-linux-x64": "0.4.
|
|
38
|
-
"ai2rules-harness-windows-x64": "0.4.
|
|
35
|
+
"ai2rules-harness-darwin-arm64": "0.4.2-rc.2",
|
|
36
|
+
"ai2rules-harness-darwin-x64": "0.4.2-rc.2",
|
|
37
|
+
"ai2rules-harness-linux-x64": "0.4.2-rc.2",
|
|
38
|
+
"ai2rules-harness-windows-x64": "0.4.2-rc.2"
|
|
39
39
|
}
|
|
40
40
|
}
|