@deftai/directive-runtime 0.129.5 → 0.129.7
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/Taskfile.yml +316 -0
- package/UPGRADING.md +1 -0
- package/commands.md +5 -3
- package/contracts/design-critique.md +1 -1
- package/contracts/path-write-fence.md +6 -0
- package/dist/applying-host-release.d.ts +16 -0
- package/dist/applying-host-release.js +98 -0
- package/dist/authz.d.ts +1 -1
- package/dist/authz.js +1 -1
- package/dist/check.d.ts +1 -0
- package/dist/check.js +27 -4
- package/dist/design-critique-ensure-arc-dest.d.ts +16 -0
- package/dist/design-critique-ensure-arc-dest.js +168 -0
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +8 -0
- package/dist/hook-dispatch.js +3 -2
- package/dist/human-presence-mint.d.ts +6 -1
- package/dist/human-presence-mint.js +20 -6
- package/dist/session-start.d.ts +8 -2
- package/dist/session-start.js +70 -15
- package/dist/setup-wiring.d.ts +36 -0
- package/dist/setup-wiring.js +169 -14
- package/dist/vbrief-preflight.d.ts +4 -0
- package/dist/vbrief-preflight.js +34 -0
- package/dist/verify-scope-provenance.d.ts +13 -1
- package/dist/verify-scope-provenance.js +44 -1
- package/dist/verify-source-cli/verify-deposit-closure.js +5 -5
- package/dist/windows-bin-ps1.d.ts +2 -2
- package/dist/windows-bin-ps1.js +5 -11
- package/docs/deft-directive-disable.md +3 -3
- package/docs/getting-started.md +2 -0
- package/docs/scope-provenance.md +15 -1
- package/package.json +2 -3
- package/packs/lessons/lessons-pack-0.1.json +15 -0
- package/packs/skills/skills-pack-0.1.json +3 -3
- package/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/skills/deft-directive-release/SKILL.md +31 -1
- package/skills/deft-directive-review-cycle/SKILL.md +15 -6
- package/skills/deft-directive-swarm/references/host-grok-build.md +3 -2
- package/vendor/directive-content/Taskfile.yml +316 -0
- package/vendor/directive-content/UPGRADING.md +1 -0
- package/vendor/directive-content/commands.md +5 -3
- package/vendor/directive-content/contracts/design-critique.md +1 -1
- package/vendor/directive-content/contracts/path-write-fence.md +6 -0
- package/vendor/directive-content/docs/deft-directive-disable.md +3 -3
- package/vendor/directive-content/docs/getting-started.md +2 -0
- package/vendor/directive-content/docs/scope-provenance.md +15 -1
- package/vendor/directive-content/packs/lessons/lessons-pack-0.1.json +15 -0
- package/vendor/directive-content/packs/skills/skills-pack-0.1.json +3 -3
- package/vendor/directive-content/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/vendor/directive-content/skills/deft-directive-release/SKILL.md +31 -1
- package/vendor/directive-content/skills/deft-directive-review-cycle/SKILL.md +15 -6
- package/vendor/directive-content/skills/deft-directive-swarm/references/host-grok-build.md +3 -2
- package/vendor/directive-core/dist/.tsbuildinfo +1 -1
- package/vendor/directive-core/dist/authz/classify.d.ts +12 -0
- package/vendor/directive-core/dist/authz/classify.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/classify.js +40 -12
- package/vendor/directive-core/dist/authz/classify.js.map +1 -1
- package/vendor/directive-core/dist/authz/templates.d.ts +2 -2
- package/vendor/directive-core/dist/authz/templates.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/templates.js +1 -0
- package/vendor/directive-core/dist/authz/templates.js.map +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/types.js +2 -0
- package/vendor/directive-core/dist/authz/types.js.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.js +30 -3
- package/vendor/directive-core/dist/authz/verb-classification.js.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.d.ts.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.js +50 -4
- package/vendor/directive-core/dist/cache/fetch.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts +22 -5
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.js +61 -0
- package/vendor/directive-core/dist/design-critique/arc-dest.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts +7 -2
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js +6 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js.map +1 -1
- package/vendor/directive-core/dist/fs/contained-write.d.ts +8 -2
- package/vendor/directive-core/dist/fs/contained-write.d.ts.map +1 -1
- package/vendor/directive-core/dist/fs/contained-write.js +22 -6
- package/vendor/directive-core/dist/fs/contained-write.js.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.d.ts +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.js +290 -16
- package/vendor/directive-core/dist/hooks/dispatcher.js.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts +5 -0
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js +18 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/agent-hooks.d.ts +26 -1
- package/vendor/directive-core/dist/init-deposit/agent-hooks.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/agent-hooks.js +52 -3
- package/vendor/directive-core/dist/init-deposit/agent-hooks.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts +48 -0
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js +170 -9
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts +8 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.js +38 -4
- package/vendor/directive-core/dist/init-deposit/scaffold.js.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts +2 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.js +4 -3
- package/vendor/directive-core/dist/install-health/cheap.js.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.d.ts +18 -2
- package/vendor/directive-core/dist/install-health/constants.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.js +18 -2
- package/vendor/directive-core/dist/install-health/constants.js.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts +42 -5
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.js +71 -41
- package/vendor/directive-core/dist/policy/deft-directive-disable.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts +6 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js +24 -12
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts +68 -14
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js +278 -47
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.d.ts +10 -5
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.js +41 -18
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.js.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts +3 -2
- package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.js +19 -18
- package/vendor/directive-core/dist/preflight-gh/pre-push.js.map +1 -1
- package/vendor/directive-core/dist/release/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/gh.js +2 -1
- package/vendor/directive-core/dist/release/gh.js.map +1 -1
- package/vendor/directive-core/dist/release/version.d.ts +4 -2
- package/vendor/directive-core/dist/release/version.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/version.js +4 -2
- package/vendor/directive-core/dist/release/version.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.js +4 -2
- package/vendor/directive-core/dist/release-publish/gh-api.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.js +15 -4
- package/vendor/directive-core/dist/release-publish/main.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts +11 -0
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.js +143 -2
- package/vendor/directive-core/dist/release-publish/pipeline.js.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.js +2 -1
- package/vendor/directive-core/dist/release-rollback/gh.js.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts +202 -19
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.js +948 -107
- package/vendor/directive-core/dist/scope/delivery-evidence.js.map +1 -1
- package/vendor/directive-core/dist/scope/transition.d.ts +4 -1
- package/vendor/directive-core/dist/scope/transition.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/transition.js +2 -2
- package/vendor/directive-core/dist/scope/transition.js.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/base-fence.d.ts +11 -2
- package/vendor/directive-core/dist/scope-provenance/base-fence.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/base-fence.js +16 -1
- package/vendor/directive-core/dist/scope-provenance/base-fence.js.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/evaluate.d.ts +12 -0
- package/vendor/directive-core/dist/scope-provenance/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/evaluate.js +41 -5
- package/vendor/directive-core/dist/scope-provenance/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/forge-approval.d.ts +106 -0
- package/vendor/directive-core/dist/scope-provenance/forge-approval.d.ts.map +1 -0
- package/vendor/directive-core/dist/scope-provenance/forge-approval.js +382 -0
- package/vendor/directive-core/dist/scope-provenance/forge-approval.js.map +1 -0
- package/vendor/directive-core/dist/session/git.d.ts +21 -2
- package/vendor/directive-core/dist/session/git.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/git.js +21 -4
- package/vendor/directive-core/dist/session/git.js.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.d.ts +93 -6
- package/vendor/directive-core/dist/session/occupancy.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.js +215 -52
- package/vendor/directive-core/dist/session/occupancy.js.map +1 -1
- package/vendor/directive-core/dist/session/orientation-compression.d.ts +18 -2
- package/vendor/directive-core/dist/session/orientation-compression.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/orientation-compression.js +38 -5
- package/vendor/directive-core/dist/session/orientation-compression.js.map +1 -1
- package/vendor/directive-core/dist/session/session-start.d.ts +47 -2
- package/vendor/directive-core/dist/session/session-start.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/session-start.js +154 -3
- package/vendor/directive-core/dist/session/session-start.js.map +1 -1
- package/vendor/directive-core/dist/swarm/approach1-babysitter.d.ts +18 -4
- package/vendor/directive-core/dist/swarm/approach1-babysitter.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/approach1-babysitter.js +28 -4
- package/vendor/directive-core/dist/swarm/approach1-babysitter.js.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.js +36 -41
- package/vendor/directive-core/dist/swarm/dest-place.js.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-cohort.d.ts +29 -0
- package/vendor/directive-core/dist/swarm/finalize-cohort.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-cohort.js +122 -11
- package/vendor/directive-core/dist/swarm/finalize-cohort.js.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts +14 -0
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.js +214 -48
- package/vendor/directive-core/dist/swarm/finalize-owed.js.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.js +15 -4
- package/vendor/directive-core/dist/swarm/launch.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts +49 -2
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js +207 -12
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts +6 -0
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.js +79 -2
- package/vendor/directive-core/dist/swarm/worktrees-cli.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts +12 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.js +34 -26
- package/vendor/directive-core/dist/swarm/worktrees.js.map +1 -1
- package/vendor/directive-core/dist/triage/evaluate/worktrees.d.ts.map +1 -1
- package/vendor/directive-core/dist/triage/evaluate/worktrees.js +219 -60
- package/vendor/directive-core/dist/triage/evaluate/worktrees.js.map +1 -1
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { existsSync, mkdirSync } from "node:fs";
|
|
10
10
|
import { dirname, isAbsolute, join, resolve as pathResolve } from "node:path";
|
|
11
|
-
import { reconstituteLinkedWorktreeDeposit } from "../init-deposit/gitignore.js";
|
|
12
11
|
import { isLinkedWorktreePath, mainWorktreeRoot } from "../session/main-worktree.js";
|
|
13
12
|
import { ensureSubagentStatusDir } from "./subagent-status-dir.js";
|
|
14
|
-
import {
|
|
13
|
+
import { prepareLinkedWorktree } from "./worktree-pm-install.js";
|
|
15
14
|
import { defaultGitRunner } from "./worktrees.js";
|
|
16
15
|
function resolvePath(raw, repoRoot) {
|
|
17
16
|
const candidate = isAbsolute(raw) ? raw : pathResolve(repoRoot, raw);
|
|
@@ -120,16 +119,24 @@ export function destPlaceImplementSpawn(input) {
|
|
|
120
119
|
`(ownership check before deposit reconstitution).`,
|
|
121
120
|
};
|
|
122
121
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
122
|
+
const prep = prepareLinkedWorktree(worktreePath, {
|
|
123
|
+
repoRoot,
|
|
124
|
+
runner: input.pmRunner,
|
|
125
125
|
});
|
|
126
|
-
if (
|
|
126
|
+
if (!prep.ok) {
|
|
127
|
+
const code = prep.code === "foreign-worktree"
|
|
128
|
+
? "foreign-worktree"
|
|
129
|
+
: prep.code === "live-stranger-lease"
|
|
130
|
+
? "live-stranger-lease"
|
|
131
|
+
: prep.code === "pin-missing"
|
|
132
|
+
? "pin-missing"
|
|
133
|
+
: prep.code === "pm-failed"
|
|
134
|
+
? "pm-failed"
|
|
135
|
+
: "deposit-refused";
|
|
127
136
|
return {
|
|
128
137
|
ok: false,
|
|
129
|
-
code
|
|
130
|
-
message: `dest-place refused reuse of ${worktreePath}:
|
|
131
|
-
`${reuseDeposit.message}. Pick a fresh path or repair the payload source; ` +
|
|
132
|
-
`this path was left in place (no force-remove).`,
|
|
138
|
+
code,
|
|
139
|
+
message: `dest-place refused reuse of ${worktreePath}: ${prep.message}`,
|
|
133
140
|
};
|
|
134
141
|
}
|
|
135
142
|
ensureSubagentStatusDir(worktreePath);
|
|
@@ -161,38 +168,26 @@ export function destPlaceImplementSpawn(input) {
|
|
|
161
168
|
`(rc=${proc.returncode}): ${proc.stderr.trim() || "<no stderr>"}`,
|
|
162
169
|
};
|
|
163
170
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
`Worktree left in place (no force-remove). Retry reconstitutes the same path when HEAD matches; ` +
|
|
185
|
-
`or pick a fresh path.`,
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
const pm = installWorktreePackages(worktreePath, { runner: input.pmRunner });
|
|
189
|
-
if (!pm.ok && pm.message.includes("Yarn/Bun")) {
|
|
190
|
-
return {
|
|
191
|
-
ok: false,
|
|
192
|
-
code: "deposit-refused",
|
|
193
|
-
message: `dest-place PM install refused for ${worktreePath}: ${pm.message}`,
|
|
194
|
-
};
|
|
195
|
-
}
|
|
171
|
+
const prep = prepareLinkedWorktree(worktreePath, {
|
|
172
|
+
repoRoot,
|
|
173
|
+
runner: input.pmRunner,
|
|
174
|
+
});
|
|
175
|
+
if (!prep.ok) {
|
|
176
|
+
const code = prep.code === "foreign-worktree"
|
|
177
|
+
? "foreign-worktree"
|
|
178
|
+
: prep.code === "live-stranger-lease"
|
|
179
|
+
? "live-stranger-lease"
|
|
180
|
+
: prep.code === "pin-missing"
|
|
181
|
+
? "pin-missing"
|
|
182
|
+
: prep.code === "pm-failed"
|
|
183
|
+
? "pm-failed"
|
|
184
|
+
: "deposit-refused";
|
|
185
|
+
return {
|
|
186
|
+
ok: false,
|
|
187
|
+
code,
|
|
188
|
+
message: `dest-place prep failed for ${worktreePath}: ${prep.message}. ` +
|
|
189
|
+
`Worktree left in place (no force-remove).`,
|
|
190
|
+
};
|
|
196
191
|
}
|
|
197
192
|
ensureSubagentStatusDir(worktreePath);
|
|
198
193
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dest-place.js","sourceRoot":"","sources":["../../src/swarm/dest-place.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dest-place.js","sourceRoot":"","sources":["../../src/swarm/dest-place.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAyB,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAkB,MAAM,gBAAgB,CAAC;AAqClE,SAAS,WAAW,CAAC,GAAW,EAAE,QAAgB;IAChD,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACrE,OAAO,WAAW,CAAC,SAA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;IACtC,OAAO;QACL,EAAE,EAAE,IAAI;QACR,YAAY;QACZ,SAAS;QACT,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,YAAY;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { RunGhFn } from "../pr-protected-issues/types.js";
|
|
2
|
+
import { type FetchPrChangedFilesFn } from "../scope/delivery-evidence.js";
|
|
2
3
|
import { type SweepResult } from "./complete-cohort.js";
|
|
3
4
|
import { runText } from "./subprocess.js";
|
|
5
|
+
import { type WorktreePm, type WorktreePmRunner } from "./worktree-pm-install.js";
|
|
4
6
|
/** Structured awaiting-land state (#4919). Distinct from validation/REST failures. */
|
|
5
7
|
export interface FinalizeOriginClosePending {
|
|
6
8
|
readonly kind: "origin-close";
|
|
@@ -60,7 +62,34 @@ export interface FinalizeCohortArgs {
|
|
|
60
62
|
* isolated delivery checkout (#4714 R5). Default: the calling project root.
|
|
61
63
|
*/
|
|
62
64
|
readonly retainedDests?: readonly string[];
|
|
65
|
+
/** Test seam: package-manager runner for the lifecycle checkout install (#5882). */
|
|
66
|
+
readonly pmRunner?: WorktreePmRunner;
|
|
67
|
+
/** Test seam: PR changed-files lookup for the lifecycle-shaped PR guard (#6212). */
|
|
68
|
+
readonly fetchPrChangedFiles?: FetchPrChangedFilesFn;
|
|
63
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Lifecycle checkout package install disposition (#5882). Surfaced on finalize
|
|
72
|
+
* lines only; it is not an acceptance predicate member.
|
|
73
|
+
*/
|
|
74
|
+
export type LifecycleInstallDisposition = {
|
|
75
|
+
readonly kind: "not-pinned";
|
|
76
|
+
} | {
|
|
77
|
+
readonly kind: "installed";
|
|
78
|
+
readonly pm: WorktreePm;
|
|
79
|
+
} | {
|
|
80
|
+
readonly kind: "skipped-unsupported-pm";
|
|
81
|
+
} | {
|
|
82
|
+
readonly kind: "failed";
|
|
83
|
+
readonly pm: WorktreePm | null;
|
|
84
|
+
readonly message: string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Install packages on the lifecycle checkout before the completion sweep (#5882).
|
|
88
|
+
* Gated by the runtime pin, as linked-worktree prep gates it. npm/pnpm failure is
|
|
89
|
+
* `failed`; Yarn/Bun is diagnosed-only (`skipped-unsupported-pm`).
|
|
90
|
+
*/
|
|
91
|
+
export declare function installLifecycleCheckoutPackages(checkout: string, runner?: WorktreePmRunner): LifecycleInstallDisposition;
|
|
92
|
+
export declare function formatLifecycleInstallDisposition(disposition: LifecycleInstallDisposition): string;
|
|
64
93
|
/** Shared with finalize-owed protected skip (#5143 / #4919). */
|
|
65
94
|
export declare const PROTECTED_STAYING_OPEN_LABELS: Set<string>;
|
|
66
95
|
/** True when origin labels mean the issue stays open (epic/tracker/umbrella) (#5143). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finalize-cohort.d.ts","sourceRoot":"","sources":["../../src/swarm/finalize-cohort.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"finalize-cohort.d.ts","sourceRoot":"","sources":["../../src/swarm/finalize-cohort.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAKL,KAAK,qBAAqB,EAG3B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAaxE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAElC,sFAAsF;AACtF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM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;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAClC,WAAW,EAAE,MAAM,EACnB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,0BAA0B,CAwB5B;AAmlBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;CAC9B,CAk+BA"}
|
|
@@ -12,13 +12,37 @@ import { policyColonInvocation } from "../policy/policy-invocation.js";
|
|
|
12
12
|
import { ENV_ALLOW_BOT_MERGE, evaluateAgentMerge, resolveHumanMergePolicy, } from "../policy/require-human-merge.js";
|
|
13
13
|
import { parseAllDeftStoryMarks } from "../pr-closing-keywords/main.js";
|
|
14
14
|
import { defaultRunGh, fetchClosingIssuesReferences } from "../pr-protected-issues/gh.js";
|
|
15
|
-
import {
|
|
15
|
+
import { LIFECYCLE_FOLDERS } from "../scope/constants.js";
|
|
16
|
+
import { classifyStoredDeliveryDisposition, defaultFetchPrChangedFiles, evidenceFromPrPayload, verifyDeliveryAncestry, } from "../scope/delivery-evidence.js";
|
|
16
17
|
import { materializeRetainedBrief, SOURCE_RECOVERY_REMEDIATION } from "./brief-transport.js";
|
|
17
18
|
import { completeCohort } from "./complete-cohort.js";
|
|
18
19
|
import { EXIT_CONFIG_ERROR, EXIT_GATE_FAILED, EXIT_INCOMPLETE, EXIT_OK } from "./constants.js";
|
|
19
20
|
import { cancelledBriefReferencesIssue, completedBriefReferencesIssue, resolveStories, terminalBriefReferencesIssue, } from "./launch.js";
|
|
20
21
|
import { evaluateLifecycleDiff, expectedLifecycleRels, parseStagedXbriefPaths, } from "./lifecycle-diff.js";
|
|
21
22
|
import { runText } from "./subprocess.js";
|
|
23
|
+
import { detectWorktreePm, installWorktreePackages, worktreeHasRuntimePin, } from "./worktree-pm-install.js";
|
|
24
|
+
/**
|
|
25
|
+
* Install packages on the lifecycle checkout before the completion sweep (#5882).
|
|
26
|
+
* Gated by the runtime pin, as linked-worktree prep gates it. npm/pnpm failure is
|
|
27
|
+
* `failed`; Yarn/Bun is diagnosed-only (`skipped-unsupported-pm`).
|
|
28
|
+
*/
|
|
29
|
+
export function installLifecycleCheckoutPackages(checkout, runner) {
|
|
30
|
+
if (!worktreeHasRuntimePin(checkout)) {
|
|
31
|
+
return { kind: "not-pinned" };
|
|
32
|
+
}
|
|
33
|
+
if (detectWorktreePm(checkout) === null) {
|
|
34
|
+
return { kind: "skipped-unsupported-pm" };
|
|
35
|
+
}
|
|
36
|
+
const installed = installWorktreePackages(checkout, { runner });
|
|
37
|
+
if (!installed.ok) {
|
|
38
|
+
return { kind: "failed", pm: installed.pm, message: installed.message };
|
|
39
|
+
}
|
|
40
|
+
return { kind: "installed", pm: installed.pm };
|
|
41
|
+
}
|
|
42
|
+
export function formatLifecycleInstallDisposition(disposition) {
|
|
43
|
+
const pm = "pm" in disposition && disposition.pm !== null ? ` pm=${disposition.pm}` : "";
|
|
44
|
+
return `lifecycle install disposition=${disposition.kind}${pm}`;
|
|
45
|
+
}
|
|
22
46
|
function splitCsv(values) {
|
|
23
47
|
const out = [];
|
|
24
48
|
for (const value of values) {
|
|
@@ -342,9 +366,13 @@ function collectProductPullRequestOrigins(projectRoot, prNumbers) {
|
|
|
342
366
|
/**
|
|
343
367
|
* PR-body `deft-story: N` may bind only when this PR is delivery for N (#4864 / #4919):
|
|
344
368
|
* TIP_NONTERMINAL or completed brief for N with metadata.productPullRequest === this PR.
|
|
345
|
-
* Absent stamp never binds (unrelated completed issue must not close).
|
|
369
|
+
* Absent stamp never binds on its own (unrelated completed issue must not close).
|
|
370
|
+
* Also reports a stamp naming another PR and whether an unstamped active brief
|
|
371
|
+
* exists, for the operator-story bind at the call site (#6212).
|
|
346
372
|
*/
|
|
347
373
|
function deftStoryMarkBindsDelivery(projectRoot, issue, prNumber) {
|
|
374
|
+
let otherPr = null;
|
|
375
|
+
let unstampedActive = false;
|
|
348
376
|
for (const folder of MARK_READER_FOLDERS) {
|
|
349
377
|
const dir = resolve(projectRoot, folder);
|
|
350
378
|
if (!existsSync(dir)) {
|
|
@@ -367,8 +395,15 @@ function deftStoryMarkBindsDelivery(projectRoot, issue, prNumber) {
|
|
|
367
395
|
if (typeof plan !== "object" || plan === null || Array.isArray(plan)) {
|
|
368
396
|
continue;
|
|
369
397
|
}
|
|
370
|
-
|
|
371
|
-
|
|
398
|
+
const stamped = productPullRequestFromPlan(plan);
|
|
399
|
+
if (stamped === prNumber) {
|
|
400
|
+
return { stampMatch: true, otherPr: null, unstampedActive: false };
|
|
401
|
+
}
|
|
402
|
+
if (stamped !== null) {
|
|
403
|
+
otherPr ??= stamped;
|
|
404
|
+
}
|
|
405
|
+
else if (folder.endsWith("/active")) {
|
|
406
|
+
unstampedActive = true;
|
|
372
407
|
}
|
|
373
408
|
}
|
|
374
409
|
catch {
|
|
@@ -376,7 +411,25 @@ function deftStoryMarkBindsDelivery(projectRoot, issue, prNumber) {
|
|
|
376
411
|
}
|
|
377
412
|
}
|
|
378
413
|
}
|
|
379
|
-
return false;
|
|
414
|
+
return { stampMatch: false, otherPr, unstampedActive };
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Lifecycle-shaped PR (#6212): every changed path is a brief under an
|
|
418
|
+
* `xbrief|vbrief/<lifecycle>/` folder or root `CHANGELOG.md`. Activation and
|
|
419
|
+
* lifecycle PRs carry `deft-story` marks too, so they never bind as delivery.
|
|
420
|
+
*/
|
|
421
|
+
function isLifecycleShapedPr(files) {
|
|
422
|
+
const folders = new Set(LIFECYCLE_FOLDERS);
|
|
423
|
+
return files.every((f) => {
|
|
424
|
+
const path = f.filename.replace(/\\/g, "/");
|
|
425
|
+
if (path === "CHANGELOG.md") {
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
const parts = path.split("/");
|
|
429
|
+
return (parts.length === 3 &&
|
|
430
|
+
(parts[0] === "xbrief" || parts[0] === "vbrief") &&
|
|
431
|
+
folders.has(parts[1] ?? ""));
|
|
432
|
+
});
|
|
380
433
|
}
|
|
381
434
|
/**
|
|
382
435
|
* Persist productPullRequest on an active brief before leftover-complete so the
|
|
@@ -1167,6 +1220,8 @@ function waitForLifecycleLand(args) {
|
|
|
1167
1220
|
export function finalizeCohort(args) {
|
|
1168
1221
|
const projectRoot = resolve(args.projectRoot ?? process.cwd());
|
|
1169
1222
|
const runGh = args.runGh ?? defaultRunGh;
|
|
1223
|
+
const fetchPrChangedFiles = args.fetchPrChangedFiles ??
|
|
1224
|
+
((prNumber, repository) => defaultFetchPrChangedFiles(prNumber, repository, runGh));
|
|
1170
1225
|
const runGit = args.runGit ?? runText;
|
|
1171
1226
|
const gitRunner = asGitRunner(runGit);
|
|
1172
1227
|
const prNumbers = [...(args.prNumbers ?? [])].sort((a, b) => a - b);
|
|
@@ -1356,7 +1411,12 @@ export function finalizeCohort(args) {
|
|
|
1356
1411
|
const validatedPrs = [];
|
|
1357
1412
|
/** Full-story close intent from PR-body `deft-story: N` (#4864). Not Tracking/Refs scrape. */
|
|
1358
1413
|
const fullStoryCloseIssues = new Set();
|
|
1414
|
+
/** A refused deft-story mark stops the stamp and sweep in every write mode (#6212). */
|
|
1415
|
+
let deftStoryMarkRefused = false;
|
|
1359
1416
|
let closingLookupFailed = false;
|
|
1417
|
+
// Operator --stories issues: their deft-story marks may bind before the sweep stamp (#6212).
|
|
1418
|
+
const operatorResolved = storyTokens.length > 0 ? resolveStories(projectRoot, storyTokens) : null;
|
|
1419
|
+
const operatorStoryIssues = new Set(collectOriginIssueNumbers(operatorResolved?.resolved.map((story) => story.path) ?? [], storyTokens));
|
|
1360
1420
|
if (prNumbers.length > 0 && errors.length === 0) {
|
|
1361
1421
|
if (repo === null || repo.length === 0) {
|
|
1362
1422
|
errors.push("--repo OWNER/REPO is required when --pr is supplied (or set $GH_REPO).");
|
|
@@ -1408,11 +1468,39 @@ export function finalizeCohort(args) {
|
|
|
1408
1468
|
evidenceByIssue.set(issue, prEvidence);
|
|
1409
1469
|
}
|
|
1410
1470
|
const prBody = typeof snap.payload.body === "string" ? snap.payload.body : "";
|
|
1471
|
+
let prFiles;
|
|
1411
1472
|
for (const issue of parseAllDeftStoryMarks(prBody)) {
|
|
1412
|
-
|
|
1473
|
+
const mark = deftStoryMarkBindsDelivery(projectRoot, issue, prNumber);
|
|
1474
|
+
let bound = mark.stampMatch;
|
|
1475
|
+
let reason = `need active or completed brief #${String(issue)} with ` +
|
|
1476
|
+
`metadata.productPullRequest=${String(prNumber)}`;
|
|
1477
|
+
// Operator named N in --stories (#6212): an unstamped active brief binds this
|
|
1478
|
+
// validated PR, and the sweep stamps it. A lifecycle-shaped PR never binds.
|
|
1479
|
+
if (!bound && operatorStoryIssues.has(issue)) {
|
|
1480
|
+
if (mark.otherPr !== null) {
|
|
1481
|
+
reason =
|
|
1482
|
+
`brief #${String(issue)} is already stamped ` +
|
|
1483
|
+
`metadata.productPullRequest=${String(mark.otherPr)}`;
|
|
1484
|
+
}
|
|
1485
|
+
else if (mark.unstampedActive) {
|
|
1486
|
+
if (prFiles === undefined) {
|
|
1487
|
+
prFiles = fetchPrChangedFiles(prNumber, repo);
|
|
1488
|
+
}
|
|
1489
|
+
if (prFiles === null) {
|
|
1490
|
+
reason = `changed-file lookup for PR #${String(prNumber)} failed`;
|
|
1491
|
+
}
|
|
1492
|
+
else if (isLifecycleShapedPr(prFiles)) {
|
|
1493
|
+
reason = `PR #${String(prNumber)} changes only briefs and CHANGELOG.md`;
|
|
1494
|
+
}
|
|
1495
|
+
else {
|
|
1496
|
+
bound = true;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
if (!bound) {
|
|
1501
|
+
deftStoryMarkRefused = true;
|
|
1413
1502
|
errors.push(`#${String(issue)}: deft-story mark on PR #${String(prNumber)} does not bind PR delivery ` +
|
|
1414
|
-
`(
|
|
1415
|
-
`metadata.productPullRequest=${String(prNumber)}) (#4864).`);
|
|
1503
|
+
`(${reason}) (#4864).`);
|
|
1416
1504
|
continue;
|
|
1417
1505
|
}
|
|
1418
1506
|
fullStoryCloseIssues.add(issue);
|
|
@@ -1448,8 +1536,8 @@ export function finalizeCohort(args) {
|
|
|
1448
1536
|
};
|
|
1449
1537
|
// Operator-supplied story tokens keep the hard-error contract: an explicit
|
|
1450
1538
|
// --stories token that does not resolve to an active brief is a real error.
|
|
1451
|
-
if (
|
|
1452
|
-
const resolved =
|
|
1539
|
+
if (operatorResolved !== null) {
|
|
1540
|
+
const resolved = operatorResolved;
|
|
1453
1541
|
for (const story of resolved.resolved) {
|
|
1454
1542
|
addStory(story.path);
|
|
1455
1543
|
}
|
|
@@ -1705,6 +1793,7 @@ export function finalizeCohort(args) {
|
|
|
1705
1793
|
let pendingOrigin = null;
|
|
1706
1794
|
let createdSweepBranch = null;
|
|
1707
1795
|
let lifecycle = null;
|
|
1796
|
+
let lifecycleInstall = null;
|
|
1708
1797
|
// Closure assignment is invisible to finally control flow, so a bare let stays null.
|
|
1709
1798
|
const held = { outcome: null };
|
|
1710
1799
|
const respond = (partial) => {
|
|
@@ -1768,11 +1857,31 @@ export function finalizeCohort(args) {
|
|
|
1768
1857
|
if (branchResult.branch === branchName) {
|
|
1769
1858
|
createdSweepBranch = branchName;
|
|
1770
1859
|
}
|
|
1860
|
+
// Sweep is required: install packages so Taskfile includes that
|
|
1861
|
+
// resolve through node_modules exist on this checkout (#5882).
|
|
1862
|
+
lifecycleInstall = installLifecycleCheckoutPackages(prepared.checkout, args.pmRunner);
|
|
1863
|
+
if (lifecycleInstall.kind === "failed") {
|
|
1864
|
+
errors.push(`environment/setup: ${formatLifecycleInstallDisposition(lifecycleInstall)}: ` +
|
|
1865
|
+
`${oneLine(lifecycleInstall.message)}. The completion sweep did not run; ` +
|
|
1866
|
+
"this is not an acceptance commands-failed result. Fix the package install " +
|
|
1867
|
+
`on origin/${deliveryBranch}, then re-run swarm:finalize-cohort.`);
|
|
1868
|
+
skipSweep = true;
|
|
1869
|
+
}
|
|
1870
|
+
else if (lifecycleInstall.kind === "skipped-unsupported-pm") {
|
|
1871
|
+
warnings.push(`${formatLifecycleInstallDisposition(lifecycleInstall)}: Yarn/Bun lifecycle ` +
|
|
1872
|
+
"checkout was not installed (AC5.7). Taskfile includes that resolve through " +
|
|
1873
|
+
"node_modules can be missing during the completion sweep.");
|
|
1874
|
+
}
|
|
1771
1875
|
}
|
|
1772
1876
|
}
|
|
1773
1877
|
}
|
|
1774
1878
|
}
|
|
1775
1879
|
}
|
|
1880
|
+
// --no-commit skips the error stop above, but a refused mark must never let the
|
|
1881
|
+
// single-PR default evidence stamp that PR; a retry would then bind it (#6212).
|
|
1882
|
+
if (!dryRun && deftStoryMarkRefused) {
|
|
1883
|
+
skipSweep = true;
|
|
1884
|
+
}
|
|
1776
1885
|
let sweep = null;
|
|
1777
1886
|
if (!skipSweep) {
|
|
1778
1887
|
// Stamp on the sweep root (checkout or project) so leftover-complete preserves bind (#4864).
|
|
@@ -1824,7 +1933,9 @@ export function finalizeCohort(args) {
|
|
|
1824
1933
|
});
|
|
1825
1934
|
sweep = sweepResult.sweep;
|
|
1826
1935
|
if (sweepResult.exitCode !== 0) {
|
|
1827
|
-
errors.push(
|
|
1936
|
+
errors.push(lifecycleInstall === null
|
|
1937
|
+
? "cohort completion sweep failed."
|
|
1938
|
+
: `cohort completion sweep failed (${formatLifecycleInstallDisposition(lifecycleInstall)}).`);
|
|
1828
1939
|
if (sweep !== null) {
|
|
1829
1940
|
errors.push(...sweepDetailLines(sweep));
|
|
1830
1941
|
}
|