harnery 0.28.0 → 0.30.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/dist/commands/work.d.ts +2 -1
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +44 -4
- package/dist/core/harnesses/types.d.ts +5 -0
- package/dist/core/harnesses/types.d.ts.map +1 -1
- package/dist/core/supervisor/plan-read.js +7 -1
- package/dist/core/supervisor/plan-types.d.ts +10 -0
- package/dist/core/supervisor/plan-types.d.ts.map +1 -1
- package/dist/core/supervisor/planning.d.ts.map +1 -1
- package/dist/core/supervisor/planning.js +18 -0
- package/dist/core/supervisor/state.d.ts.map +1 -1
- package/dist/core/supervisor/state.js +65 -11
- package/dist/core/work/runner.d.ts.map +1 -1
- package/dist/core/work/runner.js +11 -2
- package/dist/core/work/state.d.ts +17 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +102 -3
- package/dist/core/workflow/engine.js +13 -0
- package/dist/core/workflow/index.d.ts +3 -2
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/index.js +2 -1
- package/dist/core/workflow/proof.d.ts +18 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +34 -0
- package/dist/core/workflow/spawn-claude.d.ts.map +1 -1
- package/dist/core/workflow/spawn-claude.js +19 -2
- package/dist/core/workflow/spawn-codex.d.ts.map +1 -1
- package/dist/core/workflow/spawn-codex.js +17 -2
- package/dist/core/workflow/spawn-cursor.d.ts.map +1 -1
- package/dist/core/workflow/spawn-cursor.js +18 -2
- package/dist/core/workflow/spawn-failure.d.ts +14 -0
- package/dist/core/workflow/spawn-failure.d.ts.map +1 -1
- package/dist/core/workflow/spawn-failure.js +34 -0
- package/dist/core/workflow/types.d.ts +26 -0
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/local-git.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/local-git.js +101 -20
- package/dist/lib/exec.d.ts +7 -0
- package/dist/lib/exec.d.ts.map +1 -1
- package/dist/lib/exec.js +6 -3
- package/package.json +1 -1
- package/src/commands/work.ts +51 -4
- package/src/core/harnesses/types.ts +5 -0
- package/src/core/supervisor/plan-read.ts +11 -2
- package/src/core/supervisor/plan-types.ts +11 -0
- package/src/core/supervisor/planning.ts +21 -0
- package/src/core/supervisor/state.ts +68 -11
- package/src/core/work/runner.ts +11 -2
- package/src/core/work/state.ts +125 -3
- package/src/core/workflow/engine.ts +11 -0
- package/src/core/workflow/index.ts +3 -0
- package/src/core/workflow/proof.ts +36 -0
- package/src/core/workflow/spawn-claude.ts +21 -2
- package/src/core/workflow/spawn-codex.ts +17 -2
- package/src/core/workflow/spawn-cursor.ts +18 -2
- package/src/core/workflow/spawn-failure.ts +40 -0
- package/src/core/workflow/types.ts +27 -0
- package/src/core/workflow/workspaces/local-git.ts +112 -22
- package/src/lib/exec.ts +13 -3
|
@@ -76,6 +76,11 @@ export interface WorkflowAgentProof {
|
|
|
76
76
|
session_id?: string;
|
|
77
77
|
result?: ResultDigest;
|
|
78
78
|
error?: string;
|
|
79
|
+
/** Set on a failed agent whose spawn was classified uninformative about the
|
|
80
|
+
* work (ADR 0046): environment (binary absent) or upstream (vendor refused).
|
|
81
|
+
* Absent ⇒ a work failure. Recorded even when a script's parallel() swallows
|
|
82
|
+
* the rejection, so the run-level class can still be derived from proof. */
|
|
83
|
+
class?: SpawnFailureClass;
|
|
79
84
|
}
|
|
80
85
|
export interface WorkflowRepoSnapshot {
|
|
81
86
|
cwd: string;
|
|
@@ -151,6 +156,12 @@ export interface WorkflowProof {
|
|
|
151
156
|
objective?: string;
|
|
152
157
|
error?: string;
|
|
153
158
|
result?: ResultDigest;
|
|
159
|
+
/** Set on a failed run that was uninformative about the work (ADR 0046):
|
|
160
|
+
* environment or upstream. Derived from the agents' classes when no agent
|
|
161
|
+
* produced a result; absent ⇒ the attempt is charged as before. The durable
|
|
162
|
+
* work projection reads this to decide charging, stopping, and the
|
|
163
|
+
* uncharged-attempt bound. */
|
|
164
|
+
class?: SpawnFailureClass;
|
|
154
165
|
};
|
|
155
166
|
acceptance: {
|
|
156
167
|
criteria: AcceptanceResult[];
|
|
@@ -256,6 +267,18 @@ export interface WorkflowSpecialistProfile {
|
|
|
256
267
|
timeoutMs?: number;
|
|
257
268
|
maxTurns?: number;
|
|
258
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Why a failed run was uninformative about the work (ADR 0046). Absent means
|
|
272
|
+
* the attempt produced information about the work (or succeeded), which is the
|
|
273
|
+
* default and is charged against the attempt budget exactly as before.
|
|
274
|
+
*
|
|
275
|
+
* - `environment`: the run never started — a precondition was missing (the
|
|
276
|
+
* vendor binary was absent). Uncharged AND not retried: retrying an unchanged
|
|
277
|
+
* environment cannot help, so the work item stops and names the precondition.
|
|
278
|
+
* - `upstream`: the vendor was reached and refused (5xx, 429, circuit open).
|
|
279
|
+
* Uncharged, but retry stays available (bounded by max_uncharged_attempts).
|
|
280
|
+
*/
|
|
281
|
+
export type SpawnFailureClass = "environment" | "upstream";
|
|
259
282
|
/** What a spawn adapter returns for one subagent run. */
|
|
260
283
|
export interface SpawnResult {
|
|
261
284
|
ok: boolean;
|
|
@@ -267,6 +290,9 @@ export interface SpawnResult {
|
|
|
267
290
|
durationMs: number;
|
|
268
291
|
/** Populated when ok=false. */
|
|
269
292
|
error?: string;
|
|
293
|
+
/** Set when ok=false and the failure was positively identified as
|
|
294
|
+
* uninformative about the work. Absent ⇒ a work failure (charged). */
|
|
295
|
+
class?: SpawnFailureClass;
|
|
270
296
|
}
|
|
271
297
|
export interface SpawnRequest {
|
|
272
298
|
prompt: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,E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AgB,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-git.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/workspaces/local-git.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAgBV,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EAElB,MAAM,YAAY,CAAC;AASpB,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB,CAAC,EAAE,MAAM,OAAO,CAAC;CAC1C;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,+BAA+B,GACvC,iBAAiB,CAgBnB;AAED,wBAAsB,KAAK,CACzB,KAAK,EAAE,mBAAmB,EAC1B,wBAAwB,GAAE,MAAM,OAAwC,GACvE,OAAO,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"local-git.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/workspaces/local-git.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAgBV,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EAElB,MAAM,YAAY,CAAC;AASpB,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB,CAAC,EAAE,MAAM,OAAO,CAAC;CAC1C;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,+BAA+B,GACvC,iBAAiB,CAgBnB;AAED,wBAAsB,KAAK,CACzB,KAAK,EAAE,mBAAmB,EAC1B,wBAAwB,GAAE,MAAM,OAAwC,GACvE,OAAO,CAAC,oBAAoB,CAAC,CA4E/B"}
|
|
@@ -44,17 +44,28 @@ export async function probe(input, descriptorPathsSupported = descriptorBackedPa
|
|
|
44
44
|
if (input.writable_roots.length === 0) {
|
|
45
45
|
unsupported.push(reason("writable_roots_required", "explicit writable roots are required"));
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
// Allocation always selects writable_roots[0] (validateRequest pins the selected root
|
|
48
|
+
// to it), so probe's authority-coverage verdict must be judged against that same root.
|
|
49
|
+
let selectedRoot;
|
|
50
|
+
input.writable_roots.forEach((root, index) => {
|
|
48
51
|
try {
|
|
49
|
-
validateConfiguredRoot(root);
|
|
52
|
+
const validated = validateConfiguredRoot(root);
|
|
53
|
+
if (index === 0)
|
|
54
|
+
selectedRoot = validated;
|
|
50
55
|
}
|
|
51
56
|
catch (error) {
|
|
52
57
|
unsupported.push(reason("writable_root_invalid", error.message));
|
|
53
58
|
}
|
|
54
|
-
}
|
|
59
|
+
});
|
|
55
60
|
if (version.ok) {
|
|
56
61
|
try {
|
|
57
|
-
inspectSourceRepository(input.requested_cwd);
|
|
62
|
+
const repo = inspectSourceRepository(input.requested_cwd);
|
|
63
|
+
if (selectedRoot) {
|
|
64
|
+
const outside = describeAuthorityOutsideRoot(repo, selectedRoot.realpath);
|
|
65
|
+
if (outside) {
|
|
66
|
+
unsupported.push(reason("repository_authority_outside_writable_root", outside));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
58
69
|
}
|
|
59
70
|
catch (error) {
|
|
60
71
|
unsupported.push(reason("repository_unsupported", error.message));
|
|
@@ -115,10 +126,9 @@ async function allocate(coordRoot, request) {
|
|
|
115
126
|
const repo = inspectSourceRepository(request.requested_cwd);
|
|
116
127
|
assertAllowedPathAuthority(request.allowed_paths, repo.sourceRoot.realpath, "source repository");
|
|
117
128
|
assertAllowedPathAuthority(request.allowed_paths, repo.commonDir.realpath, "Git common directory");
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
throw new Error(
|
|
121
|
-
}
|
|
129
|
+
const authorityOutside = describeAuthorityOutsideRoot(repo, root.realpath);
|
|
130
|
+
if (authorityOutside)
|
|
131
|
+
throw new Error(authorityOutside);
|
|
122
132
|
const workspaceRoot = candidateUnderRoot(root, ["harnery-workspaces", bindingId]);
|
|
123
133
|
const activeRoot = resolve(workspaceRoot, repo.requestedRelativePath);
|
|
124
134
|
if (!containsPath(workspaceRoot, activeRoot)) {
|
|
@@ -887,6 +897,17 @@ async function applyIntegrationUnderLease(coordRoot, input) {
|
|
|
887
897
|
}
|
|
888
898
|
revalidateClaimResources(claim, validateConfiguredRoot(plan.binding.writable_root.configured));
|
|
889
899
|
inspectIntegrationTarget(current.target_root, plan.binding);
|
|
900
|
+
// The fast-forward moves the target branch ref, which for a submodule or linked
|
|
901
|
+
// worktree lives in the common directory outside the checkout tree. allowed_paths is
|
|
902
|
+
// the real write authority (allocate and cleanup already gate the common directory on
|
|
903
|
+
// it), so re-authorize both the target checkout and its common directory here rather
|
|
904
|
+
// than trusting containment alone.
|
|
905
|
+
const applyCommonDir = plan.binding.repository?.common_dir.realpath;
|
|
906
|
+
if (!applyCommonDir) {
|
|
907
|
+
throw new Error("integration binding is missing Git common-dir authority");
|
|
908
|
+
}
|
|
909
|
+
assertAllowedPathAuthority(claim.request.allowed_paths, current.target_root, "integration target path");
|
|
910
|
+
assertAllowedPathAuthority(claim.request.allowed_paths, applyCommonDir, "integration Git common directory");
|
|
890
911
|
git(current.target_root, ["merge", "--ff-only", expected.source_commit]);
|
|
891
912
|
const finalCommit = git(current.target_root, ["rev-parse", "HEAD"]);
|
|
892
913
|
const finalTree = git(current.target_root, ["rev-parse", "HEAD^{tree}"]);
|
|
@@ -969,18 +990,15 @@ function inspectSourceRepository(cwd) {
|
|
|
969
990
|
if (!containsPath(sourceRoot, requestedCwd.realpath)) {
|
|
970
991
|
throw new Error("requested working directory is outside the resolved Git worktree");
|
|
971
992
|
}
|
|
972
|
-
|
|
973
|
-
throw new Error("symlink Git directories are unsupported");
|
|
974
|
-
}
|
|
975
|
-
if (!lstatSync(join(sourceRoot, ".git")).isDirectory()) {
|
|
976
|
-
throw new Error("linked worktree and submodule source repositories are unsupported");
|
|
977
|
-
}
|
|
978
|
-
const requestedGitDir = realpathSync(join(sourceRoot, ".git"));
|
|
993
|
+
const pointedGitDir = resolveGitDirPointer(sourceRoot);
|
|
979
994
|
const gitDir = realpathSync(resolve(sourceRoot, git(sourceRoot, ["rev-parse", "--git-dir"])));
|
|
980
995
|
const commonDir = realpathSync(resolve(sourceRoot, git(sourceRoot, ["rev-parse", "--git-common-dir"])));
|
|
981
|
-
if (
|
|
996
|
+
if (pointedGitDir !== gitDir) {
|
|
982
997
|
throw new Error("resolved Git authority does not match the requested checkout");
|
|
983
998
|
}
|
|
999
|
+
if (!containsPath(commonDir, gitDir)) {
|
|
1000
|
+
throw new Error("resolved Git directory is not inside its common directory");
|
|
1001
|
+
}
|
|
984
1002
|
const branch = gitMaybe(sourceRoot, ["symbolic-ref", "-q", "--short", "HEAD"]);
|
|
985
1003
|
if (!branch.ok || !branch.out)
|
|
986
1004
|
throw new Error("detached integration targets are unsupported");
|
|
@@ -1002,6 +1020,48 @@ function inspectSourceRepository(cwd) {
|
|
|
1002
1020
|
requestedRelativePath: relative(sourceRoot, requestedCwd.realpath),
|
|
1003
1021
|
};
|
|
1004
1022
|
}
|
|
1023
|
+
// Resolve the `.git` entry at a checkout root to the real Git directory it names,
|
|
1024
|
+
// without trusting the ambient environment. `.git` is a real directory in a plain
|
|
1025
|
+
// checkout, and a `gitdir:` pointer file in a linked worktree, submodule, or
|
|
1026
|
+
// worktree-of-a-submodule. A symlink is refused: the identity model pins a path to a
|
|
1027
|
+
// device and inode, and a symlink lets the target move under a pinned pointer.
|
|
1028
|
+
//
|
|
1029
|
+
// The caller cross-checks the result against `rev-parse --git-dir`. That is a
|
|
1030
|
+
// consistency assertion, not spoof detection: Git honours a `gitdir:` pointer, so a
|
|
1031
|
+
// pointer aimed at an unrelated repository agrees with `rev-parse` and is accepted.
|
|
1032
|
+
// It cannot be otherwise, because a doctored pointer and a submodule's pointer are
|
|
1033
|
+
// the same construct. What the equality buys is that this resolution and Git's own
|
|
1034
|
+
// never silently diverge, which is defence in depth over the `GIT_*` stripping in
|
|
1035
|
+
// `isolatedGitEnvironment`. The real authority check is containment plus
|
|
1036
|
+
// `allowed_paths` on the resolved common directory.
|
|
1037
|
+
function resolveGitDirPointer(sourceRoot) {
|
|
1038
|
+
const dotGit = join(sourceRoot, ".git");
|
|
1039
|
+
let stats;
|
|
1040
|
+
try {
|
|
1041
|
+
stats = lstatSync(dotGit);
|
|
1042
|
+
}
|
|
1043
|
+
catch {
|
|
1044
|
+
throw new Error("requested checkout has no .git entry");
|
|
1045
|
+
}
|
|
1046
|
+
if (stats.isSymbolicLink()) {
|
|
1047
|
+
throw new Error("symlink Git directories are unsupported");
|
|
1048
|
+
}
|
|
1049
|
+
if (stats.isDirectory()) {
|
|
1050
|
+
return realpathSync(dotGit);
|
|
1051
|
+
}
|
|
1052
|
+
if (!stats.isFile()) {
|
|
1053
|
+
throw new Error(".git must be a directory or a gitdir pointer file");
|
|
1054
|
+
}
|
|
1055
|
+
const pointer = readFileSync(dotGit, "utf8").split(/\r?\n/, 1)[0]?.trim() ?? "";
|
|
1056
|
+
const prefix = "gitdir:";
|
|
1057
|
+
if (!pointer.startsWith(prefix)) {
|
|
1058
|
+
throw new Error(".git file is not a gitdir pointer");
|
|
1059
|
+
}
|
|
1060
|
+
const target = pointer.slice(prefix.length).trim();
|
|
1061
|
+
if (!target)
|
|
1062
|
+
throw new Error(".git gitdir pointer is empty");
|
|
1063
|
+
return realpathSync(resolve(sourceRoot, target));
|
|
1064
|
+
}
|
|
1005
1065
|
function inspectFrozenSourceAuthority(sourceRoot, commonDir, targetRef) {
|
|
1006
1066
|
const configured = validateConfiguredRoot(sourceRoot.configured);
|
|
1007
1067
|
if (configured.realpath !== sourceRoot.realpath ||
|
|
@@ -1295,6 +1355,22 @@ function validFrozenFilesystemPath(path) {
|
|
|
1295
1355
|
typeof path.identity.device === "string" &&
|
|
1296
1356
|
typeof path.identity.inode === "string");
|
|
1297
1357
|
}
|
|
1358
|
+
// Explain, in the caller's terms, why a checkout's Git authority falls outside a
|
|
1359
|
+
// writable root — naming the offending path so a submodule or linked-worktree user
|
|
1360
|
+
// who declared only the inner checkout knows exactly what to widen. Returns undefined
|
|
1361
|
+
// when both the source checkout and its common directory are inside the root.
|
|
1362
|
+
function describeAuthorityOutsideRoot(repo, rootRealpath) {
|
|
1363
|
+
if (!containsPath(rootRealpath, repo.commonDir.realpath)) {
|
|
1364
|
+
return (`Git keeps this checkout's administrative files in ${repo.commonDir.realpath}, ` +
|
|
1365
|
+
`which is outside the writable root ${rootRealpath}. Linked-worktree and submodule ` +
|
|
1366
|
+
`checkouts keep their Git authority in the enclosing repository, and allocating a ` +
|
|
1367
|
+
`worktree writes there; declare that repository (or a parent of it) as the writable root.`);
|
|
1368
|
+
}
|
|
1369
|
+
if (!containsPath(rootRealpath, repo.sourceRoot.realpath)) {
|
|
1370
|
+
return `the source checkout ${repo.sourceRoot.realpath} is outside the writable root ${rootRealpath}`;
|
|
1371
|
+
}
|
|
1372
|
+
return undefined;
|
|
1373
|
+
}
|
|
1298
1374
|
function assertAllowedPathAuthority(allowedPaths, candidate, label) {
|
|
1299
1375
|
if (allowedPaths.length > 0 &&
|
|
1300
1376
|
!allowedPaths.some((allowedPath) => {
|
|
@@ -1383,10 +1459,15 @@ function capabilityDigestForClaim(claim) {
|
|
|
1383
1459
|
function acquireRepositoryLease(coordRoot, claim) {
|
|
1384
1460
|
const leaseDir = join(resolve(coordRoot), ".harnery", "workspaces", PROVIDER_ID, ".leases");
|
|
1385
1461
|
mkdirSync(leaseDir, { recursive: true, mode: 0o700 });
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1462
|
+
// Mutual exclusion keys on the Git common directory alone. `git worktree add`,
|
|
1463
|
+
// `prune`, and the shared-`config` migration all write to the common directory's
|
|
1464
|
+
// administrative area, and once worktrees and submodules are allowed, several
|
|
1465
|
+
// distinct source checkouts (a superproject and its linked worktrees; a submodule
|
|
1466
|
+
// and a worktree of it) share one common directory under different — possibly
|
|
1467
|
+
// nested — writable roots. Including the writable root in the key would hand those
|
|
1468
|
+
// agents different locks and let their admin-area writes race. The writable root
|
|
1469
|
+
// stays in the lease metadata for diagnostics, not in the exclusion key.
|
|
1470
|
+
const key = stableDigest({ common: claim.repository.common_dir.identity });
|
|
1390
1471
|
return acquireLease(coordRoot, join(leaseDir, `repository-${key}.lock`), claim, "repository");
|
|
1391
1472
|
}
|
|
1392
1473
|
function acquireLease(coordRoot, path, claim, scope) {
|
package/dist/lib/exec.d.ts
CHANGED
|
@@ -14,6 +14,13 @@ export interface ExecResult {
|
|
|
14
14
|
* child that handles the signal cleanly still exits 0, so the exit code alone
|
|
15
15
|
* cannot distinguish a kill from an ordinary finish. */
|
|
16
16
|
timedOut?: boolean;
|
|
17
|
+
/** The `code` from a spawn-level failure (`proc` "error" event), e.g.
|
|
18
|
+
* "ENOENT" when the binary is absent. Absent for an ordinary process exit.
|
|
19
|
+
* We collapse such failures to exitCode 127 so callers' exit-code branches
|
|
20
|
+
* still fire, but a shell can legitimately exit 127 too; only this field
|
|
21
|
+
* distinguishes "the binary was never there" from "the process ran and exited
|
|
22
|
+
* 127". The process that knows reports it (as ADR 0044 did for `timedOut`). */
|
|
23
|
+
spawnErrno?: string;
|
|
17
24
|
}
|
|
18
25
|
export interface ExecOpts {
|
|
19
26
|
cwd?: string;
|
package/dist/lib/exec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/lib/exec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;4DAEwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/lib/exec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;4DAEwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;mFAK+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,QAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CA2C5E;AAED,sEAAsE;AACtE,wBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAEhG"}
|
package/dist/lib/exec.js
CHANGED
|
@@ -34,7 +34,7 @@ export function exec(cmd, opts = {}) {
|
|
|
34
34
|
timedOut = true;
|
|
35
35
|
proc.kill();
|
|
36
36
|
}, timeout);
|
|
37
|
-
const finish = (exitCode, errOverride) => {
|
|
37
|
+
const finish = (exitCode, errOverride, spawnErrno) => {
|
|
38
38
|
clearTimeout(timer);
|
|
39
39
|
const stdout = Buffer.concat(out).toString("utf-8");
|
|
40
40
|
const stderr = errOverride ?? Buffer.concat(err).toString("utf-8");
|
|
@@ -44,12 +44,15 @@ export function exec(cmd, opts = {}) {
|
|
|
44
44
|
stderr: shouldTrim ? stderr.trim() : stderr.replace(/\n$/, ""),
|
|
45
45
|
exitCode,
|
|
46
46
|
...(timedOut ? { timedOut: true } : {}),
|
|
47
|
+
...(spawnErrno ? { spawnErrno } : {}),
|
|
47
48
|
});
|
|
48
49
|
};
|
|
49
50
|
// ENOENT (binary not found) and similar spawn failures surface here rather
|
|
50
51
|
// than throwing: resolve with 127 + the message so callers' exitCode
|
|
51
|
-
// branches handle it instead of crashing on an unhandled rejection.
|
|
52
|
-
|
|
52
|
+
// branches handle it instead of crashing on an unhandled rejection. The
|
|
53
|
+
// errno (e.g. "ENOENT") is carried through so a real missing binary is
|
|
54
|
+
// distinguishable from a shell that merely exited 127.
|
|
55
|
+
proc.on("error", (e) => finish(127, e.message, e.code));
|
|
53
56
|
proc.on("close", (code) => finish(code ?? 1));
|
|
54
57
|
});
|
|
55
58
|
}
|
package/package.json
CHANGED
package/src/commands/work.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
1
2
|
import type { Command } from "commander";
|
|
2
3
|
import type { EmitContext } from "../commander.ts";
|
|
3
4
|
import { workflowSubscriptionOnly } from "../core/config.ts";
|
|
@@ -29,6 +30,7 @@ interface WorkCreateOpts {
|
|
|
29
30
|
accept?: string[];
|
|
30
31
|
dependsOn?: string;
|
|
31
32
|
maxAttempts?: string;
|
|
33
|
+
maxUnchargedAttempts?: string;
|
|
32
34
|
sourceKind?: "human" | "workflow" | "external";
|
|
33
35
|
sourceRef?: string;
|
|
34
36
|
actor?: string;
|
|
@@ -44,6 +46,7 @@ interface WorkRunOpts {
|
|
|
44
46
|
allowApiBilling?: boolean;
|
|
45
47
|
policy?: string;
|
|
46
48
|
isolation?: PolicyIsolation;
|
|
49
|
+
workspaceRoot?: string;
|
|
47
50
|
approvalTo?: string;
|
|
48
51
|
actor?: string;
|
|
49
52
|
json?: boolean;
|
|
@@ -73,7 +76,11 @@ export function registerWorkCommand(program: Command, emit: EmitContext): void {
|
|
|
73
76
|
.option("--id <work-id>", "Stable work id (generated by default)")
|
|
74
77
|
.option("--accept <text>", "Acceptance statement; repeat for more than one", collect, [])
|
|
75
78
|
.option("--depends-on <ids>", "Comma-separated prerequisite work ids")
|
|
76
|
-
.option("--max-attempts <n>", "
|
|
79
|
+
.option("--max-attempts <n>", "Charged-attempt ceiling (default 3)")
|
|
80
|
+
.option(
|
|
81
|
+
"--max-uncharged-attempts <n>",
|
|
82
|
+
"Ceiling on consecutive uncharged upstream attempts (default 3)",
|
|
83
|
+
)
|
|
77
84
|
.option("--source-kind <kind>", "human | workflow | external", "human")
|
|
78
85
|
.option("--source-ref <ref>", "Bounded source reference")
|
|
79
86
|
.option("--actor <name>", "Actor recorded in the creation receipt")
|
|
@@ -89,6 +96,9 @@ export function registerWorkCommand(program: Command, emit: EmitContext): void {
|
|
|
89
96
|
acceptance: opts.accept,
|
|
90
97
|
dependencies: splitIds(opts.dependsOn),
|
|
91
98
|
maxAttempts: opts.maxAttempts ? Number.parseInt(opts.maxAttempts, 10) : undefined,
|
|
99
|
+
maxUnchargedAttempts: opts.maxUnchargedAttempts
|
|
100
|
+
? Number.parseInt(opts.maxUnchargedAttempts, 10)
|
|
101
|
+
: undefined,
|
|
92
102
|
source: opts.sourceKind ? { kind: opts.sourceKind, ref: opts.sourceRef } : undefined,
|
|
93
103
|
actor: opts.actor,
|
|
94
104
|
});
|
|
@@ -178,6 +188,7 @@ function registerRunCommand(
|
|
|
178
188
|
.option("--allow-api-billing", "Permit API-key override billing")
|
|
179
189
|
.option("--policy <file>", "Host policy JSON/JSONC")
|
|
180
190
|
.option("--isolation <mode>", "shared | worktree | sandbox | remote")
|
|
191
|
+
.option("--workspace-root <dir>", "Writable root the isolated workspace is allocated under")
|
|
181
192
|
.option("--approval-to <address>", "Address durable ASK requests")
|
|
182
193
|
.option("--actor <name>", "Actor recorded in attempt receipts")
|
|
183
194
|
.option("--json", "Emit the workflow report or parked result as JSON")
|
|
@@ -186,7 +197,21 @@ function registerRunCommand(
|
|
|
186
197
|
if (opts.harness && !registry.get(opts.harness)) {
|
|
187
198
|
throw new Error(`unknown harness ${JSON.stringify(opts.harness)}`);
|
|
188
199
|
}
|
|
200
|
+
if (opts.workspaceRoot && opts.isolation !== "worktree") {
|
|
201
|
+
throw new Error("--workspace-root requires --isolation worktree");
|
|
202
|
+
}
|
|
189
203
|
try {
|
|
204
|
+
// An isolated attempt needs a provider AND the writable root it may
|
|
205
|
+
// allocate under; the engine refuses to guess either. Without them a
|
|
206
|
+
// worktree request degrades to shared, which the proof records as
|
|
207
|
+
// requested vs effective isolation and the reporting below surfaces.
|
|
208
|
+
const { createLocalGitWorktreeProvider } = await import("../core/workflow/index.ts");
|
|
209
|
+
const workspace = opts.workspaceRoot
|
|
210
|
+
? {
|
|
211
|
+
provider: createLocalGitWorktreeProvider({ coordRoot }),
|
|
212
|
+
writableRoots: [resolve(opts.workspaceRoot)],
|
|
213
|
+
}
|
|
214
|
+
: undefined;
|
|
190
215
|
const report = await runWorkItem({
|
|
191
216
|
coordRoot,
|
|
192
217
|
workId,
|
|
@@ -209,6 +234,7 @@ function registerRunCommand(
|
|
|
209
234
|
approvalMode: "park",
|
|
210
235
|
approvalAddressee: opts.approvalTo,
|
|
211
236
|
isolation: opts.isolation,
|
|
237
|
+
workspace,
|
|
212
238
|
networkAccess: "enabled",
|
|
213
239
|
},
|
|
214
240
|
});
|
|
@@ -216,8 +242,18 @@ function registerRunCommand(
|
|
|
216
242
|
emit.config({ format: "json" });
|
|
217
243
|
emit.data(report);
|
|
218
244
|
} else {
|
|
245
|
+
// A requested isolation the run could not honour is recorded in the
|
|
246
|
+
// proof as requested vs effective, which nobody reads on a green run.
|
|
247
|
+
// Say it here instead, so a silent downgrade to shared cannot pass for
|
|
248
|
+
// an isolated attempt.
|
|
249
|
+
const degraded =
|
|
250
|
+
opts.isolation && opts.isolation !== "shared" && !report.workspaceBinding
|
|
251
|
+
? `note: ran shared; ${opts.isolation} isolation was requested but not allocated` +
|
|
252
|
+
`${opts.workspaceRoot ? "" : " (no --workspace-root given)"}\n`
|
|
253
|
+
: "";
|
|
219
254
|
emit.text(
|
|
220
|
-
`work ${workId}: run ${report.runId} finished\
|
|
255
|
+
`work ${workId}: run ${report.runId} finished\n${degraded}` +
|
|
256
|
+
`proof: ${report.proofPath}\n` +
|
|
221
257
|
`next: harn work reconcile ${workId}\n`,
|
|
222
258
|
);
|
|
223
259
|
}
|
|
@@ -346,7 +382,7 @@ function emitWork(
|
|
|
346
382
|
`objective: ${record.intent.objective}`,
|
|
347
383
|
`reason: ${projection.reason}`,
|
|
348
384
|
`next: ${projection.next_action}`,
|
|
349
|
-
`attempts: ${
|
|
385
|
+
`attempts: ${renderAttemptBudget(record)}`,
|
|
350
386
|
];
|
|
351
387
|
if (record.intent.dependencies.length)
|
|
352
388
|
lines.push(`depends on: ${record.intent.dependencies.join(", ")}`);
|
|
@@ -378,7 +414,18 @@ function renderAttemptJournalError(error: string | undefined): string {
|
|
|
378
414
|
|
|
379
415
|
function renderWorkRow(record: WorkRecord): string {
|
|
380
416
|
const projection = record.projection;
|
|
381
|
-
return `${record.intent.id} ${projection.state.padEnd(17)} ${
|
|
417
|
+
return `${record.intent.id} ${projection.state.padEnd(17)} ${renderAttemptBudget(record).padEnd(18)} ${projection.next_action.padEnd(21)} ${record.intent.title}`;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// `max_attempts` budgets CHARGED attempts (ADR 0046), so the budget is
|
|
421
|
+
// charged/max, not the raw attempt count. When uncharged environment/upstream
|
|
422
|
+
// attempts happened, surface them as a suffix rather than folding them into the
|
|
423
|
+
// numerator, where they would read as spent budget the item still has.
|
|
424
|
+
export function renderAttemptBudget(record: WorkRecord): string {
|
|
425
|
+
const { charged_attempts, attempts_used } = record.projection;
|
|
426
|
+
const uncharged = attempts_used - charged_attempts;
|
|
427
|
+
const base = `${charged_attempts}/${record.intent.max_attempts}`;
|
|
428
|
+
return uncharged > 0 ? `${base} (+${uncharged} uncharged)` : base;
|
|
382
429
|
}
|
|
383
430
|
|
|
384
431
|
function withWorkRoot(emit: EmitContext, fn: (coordRoot: string) => void): void {
|
|
@@ -88,6 +88,11 @@ export interface HarnessRawResult {
|
|
|
88
88
|
* kill from a finish; without this a timed-out child reads as a success with
|
|
89
89
|
* an empty answer. */
|
|
90
90
|
timedOut?: boolean;
|
|
91
|
+
/** The `code` from a spawn-level failure, e.g. "ENOENT" when the vendor
|
|
92
|
+
* binary is absent. Adapters spawn the binary directly, so a missing binary
|
|
93
|
+
* surfaces here; a normalizer can then classify it as an environment failure
|
|
94
|
+
* (run never started) rather than a work failure. Absent on ordinary exit. */
|
|
95
|
+
spawnErrno?: string;
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
export interface HarnessBenchFixture {
|
|
@@ -171,7 +171,10 @@ function deriveStatus(
|
|
|
171
171
|
coordRoot: string,
|
|
172
172
|
events: SupervisorPlanEvent[],
|
|
173
173
|
proposal: SupervisorPlanProposal | undefined,
|
|
174
|
-
): Pick<
|
|
174
|
+
): Pick<
|
|
175
|
+
SupervisorPlanRecord,
|
|
176
|
+
"status" | "approval_id" | "root_work_id" | "work_ids" | "reason" | "class"
|
|
177
|
+
> {
|
|
175
178
|
const latest = events.at(-1);
|
|
176
179
|
const completed = [...events].reverse().find((event) => event.event === "plan.completed");
|
|
177
180
|
if (completed) {
|
|
@@ -196,7 +199,10 @@ function deriveStatus(
|
|
|
196
199
|
return { status: "attention", work_ids: [], reason: latest.reason };
|
|
197
200
|
}
|
|
198
201
|
if (latest?.event === "plan.failed") {
|
|
199
|
-
|
|
202
|
+
// ADR 0046: carry the planner run's failure class so the projection can stop
|
|
203
|
+
// an environment failure and bound consecutive upstream ones, rather than
|
|
204
|
+
// replanning an unchanged environment to budget exhaustion.
|
|
205
|
+
return { status: "failed", work_ids: [], reason: latest.reason, class: latest.class };
|
|
200
206
|
}
|
|
201
207
|
const parked = [...events].reverse().find((event) => event.event === "plan.awaiting_approval");
|
|
202
208
|
const resumedAfterPark =
|
|
@@ -552,6 +558,9 @@ function validateEvent(event: SupervisorPlanEvent, planId: string, sequence: num
|
|
|
552
558
|
throw new Error(`supervisor plan ${planId} event ${sequence} has invalid work ids`);
|
|
553
559
|
}
|
|
554
560
|
}
|
|
561
|
+
if (event.class !== undefined && event.class !== "environment" && event.class !== "upstream") {
|
|
562
|
+
throw new Error(`supervisor plan ${planId} event ${sequence} has an unknown failure class`);
|
|
563
|
+
}
|
|
555
564
|
}
|
|
556
565
|
|
|
557
566
|
function approvalIsResolved(coordRoot: string, approvalId: string): boolean {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SpawnFailureClass } from "../workflow/types.ts";
|
|
2
|
+
|
|
1
3
|
export const SUPERVISOR_PLAN_SCHEMA_VERSION = 1 as const;
|
|
2
4
|
export const MAX_SUPERVISOR_PLAN_REVIEWERS = 5 as const;
|
|
3
5
|
export const MAX_SUPERVISOR_PLAN_REVISION_ROUNDS = 3 as const;
|
|
@@ -145,6 +147,11 @@ export interface SupervisorPlanEvent {
|
|
|
145
147
|
approval_id?: string;
|
|
146
148
|
root_work_id?: string;
|
|
147
149
|
work_ids?: string[];
|
|
150
|
+
/** Set on a `plan.failed` event whose planner workflow was uninformative about
|
|
151
|
+
* the plan (ADR 0046): environment (the planner binary was absent) or upstream
|
|
152
|
+
* (the vendor refused). Read from the planner run's `run.class`. Absent ⇒ a
|
|
153
|
+
* charged replan, exactly as before. */
|
|
154
|
+
class?: SpawnFailureClass;
|
|
148
155
|
}
|
|
149
156
|
|
|
150
157
|
export type SupervisorPlanStatus =
|
|
@@ -169,6 +176,10 @@ export interface SupervisorPlanRecord {
|
|
|
169
176
|
root_work_id?: string;
|
|
170
177
|
work_ids: string[];
|
|
171
178
|
reason?: string;
|
|
179
|
+
/** Set on a `failed` plan the planner run classified as uninformative about the
|
|
180
|
+
* plan (ADR 0046). Drives the projection's do-not-charge / stop handling and
|
|
181
|
+
* the consecutive-uncharged bound. Absent ⇒ a charged replan. */
|
|
182
|
+
class?: SpawnFailureClass;
|
|
172
183
|
}
|
|
173
184
|
|
|
174
185
|
export interface SupervisorPlanHistory {
|
|
@@ -247,15 +247,36 @@ export async function runSupervisorPlanner(
|
|
|
247
247
|
});
|
|
248
248
|
return outcome(readSupervisorPlan(coordRoot, input.record.intent.id, request.id));
|
|
249
249
|
}
|
|
250
|
+
// ADR 0046: a planner workflow that never touched the plan (its binary was
|
|
251
|
+
// absent, or the vendor refused) writes a proof carrying run.class. Stamp it
|
|
252
|
+
// on the failure so the projection can stop an environment failure and bound
|
|
253
|
+
// consecutive upstream ones, instead of replanning an unchanged environment
|
|
254
|
+
// to budget exhaustion — the failure mode that burned the measured 19.
|
|
255
|
+
const failureClass = plannerFailureClass(coordRoot, request.workflow_run_id);
|
|
250
256
|
appendPlanEvent(coordRoot, input.record.intent.id, request.id, {
|
|
251
257
|
event: "plan.failed",
|
|
252
258
|
actor: input.actor,
|
|
253
259
|
reason: bounded((error as Error).message, "plan failure", MAX_REASON),
|
|
260
|
+
...(failureClass ? { class: failureClass } : {}),
|
|
254
261
|
});
|
|
255
262
|
throw error;
|
|
256
263
|
}
|
|
257
264
|
}
|
|
258
265
|
|
|
266
|
+
/** The failure class (ADR 0046) of a planner workflow run, read from its proof.
|
|
267
|
+
* Undefined when no proof was written, the proof is unreadable, or the run was
|
|
268
|
+
* informative about the plan — all of which default to a charged replan. */
|
|
269
|
+
function plannerFailureClass(
|
|
270
|
+
coordRoot: string,
|
|
271
|
+
workflowRunId: string,
|
|
272
|
+
): SupervisorPlanEvent["class"] {
|
|
273
|
+
try {
|
|
274
|
+
return readWorkflowProof(coordRoot, workflowRunId).run.class;
|
|
275
|
+
} catch {
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
259
280
|
async function recoverReviewedPlan(input: {
|
|
260
281
|
coordRoot: string;
|
|
261
282
|
record: SupervisorRecord;
|