@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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { type ArcDestInstallMode } from "@deftai/directive-core/dist/design-critique/arc-dest.js";
|
|
3
|
+
export declare const DESIGN_CRITIQUE_ENSURE_ARC_DEST_HELP = "design-critique:ensure-arc-dest \u2014 create/verify arc dest via pin-bin (#6142)\n\nUsage:\n deft design-critique:ensure-arc-dest --dest-path <path> [--project-root PATH] [--against-implementation SHA] [--install-mode guarded-prep|process-only-no-install] [--json]\n\nOptions:\n --dest-path PATH Linked worktree path for the arc dest (required)\n --project-root PATH Repo root that owns the worktree (default: cwd)\n --against-implementation SHA Fetched PR head SHA (against-implementation pin)\n --install-mode MODE guarded-prep (default) or process-only-no-install\n --json Emit structured result\n\nExit codes:\n 0 Dest created or reused with selected install mode\n 1 Operational refuse (prep failed, runtime pin missing, stranger lease, \u2026)\n 2 Config / usage error\n";
|
|
4
|
+
export interface DesignCritiqueEnsureArcDestArgs {
|
|
5
|
+
destPath: string | null;
|
|
6
|
+
projectRoot: string;
|
|
7
|
+
againstImplementationSha: string | null;
|
|
8
|
+
installMode: ArcDestInstallMode | null;
|
|
9
|
+
emitJson: boolean;
|
|
10
|
+
help: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseDesignCritiqueEnsureArcDestArgs(argv: readonly string[]): DesignCritiqueEnsureArcDestArgs;
|
|
14
|
+
export declare function run(argv: readonly string[]): number;
|
|
15
|
+
export declare function main(argv: readonly string[]): number;
|
|
16
|
+
//# sourceMappingURL=design-critique-ensure-arc-dest.d.ts.map
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* design-critique:ensure-arc-dest — sanctioned pin-bin arc dest create/verify (#6142).
|
|
4
|
+
* Defaults to guarded-prep; explicit process-only-no-install for pin-read callers.
|
|
5
|
+
* Never treat gitignored packages/core/dist as SoT — call this verb instead.
|
|
6
|
+
*/
|
|
7
|
+
import { resolve } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { ensureArcDest, } from "../vendor/directive-core/dist/design-critique/arc-dest.js";
|
|
10
|
+
export const DESIGN_CRITIQUE_ENSURE_ARC_DEST_HELP = `design-critique:ensure-arc-dest — create/verify arc dest via pin-bin (#6142)
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
deft design-critique:ensure-arc-dest --dest-path <path> [--project-root PATH] [--against-implementation SHA] [--install-mode guarded-prep|process-only-no-install] [--json]
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--dest-path PATH Linked worktree path for the arc dest (required)
|
|
17
|
+
--project-root PATH Repo root that owns the worktree (default: cwd)
|
|
18
|
+
--against-implementation SHA Fetched PR head SHA (against-implementation pin)
|
|
19
|
+
--install-mode MODE guarded-prep (default) or process-only-no-install
|
|
20
|
+
--json Emit structured result
|
|
21
|
+
|
|
22
|
+
Exit codes:
|
|
23
|
+
0 Dest created or reused with selected install mode
|
|
24
|
+
1 Operational refuse (prep failed, runtime pin missing, stranger lease, …)
|
|
25
|
+
2 Config / usage error
|
|
26
|
+
`;
|
|
27
|
+
export function parseDesignCritiqueEnsureArcDestArgs(argv) {
|
|
28
|
+
const acc = {
|
|
29
|
+
destPath: null,
|
|
30
|
+
projectRoot: ".",
|
|
31
|
+
againstImplementationSha: null,
|
|
32
|
+
installMode: null,
|
|
33
|
+
emitJson: false,
|
|
34
|
+
help: false,
|
|
35
|
+
};
|
|
36
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
37
|
+
const arg = argv[i];
|
|
38
|
+
if (arg === "--")
|
|
39
|
+
continue;
|
|
40
|
+
if (arg === "--help" || arg === "-h")
|
|
41
|
+
return { ...acc, help: true };
|
|
42
|
+
if (arg === "--json") {
|
|
43
|
+
acc.emitJson = true;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (arg === "--dest-path") {
|
|
47
|
+
const value = argv[i + 1];
|
|
48
|
+
if (value === undefined || value.startsWith("--")) {
|
|
49
|
+
return { ...acc, error: "argument --dest-path: expected one argument" };
|
|
50
|
+
}
|
|
51
|
+
acc.destPath = value;
|
|
52
|
+
i += 1;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (arg?.startsWith("--dest-path=")) {
|
|
56
|
+
acc.destPath = arg.slice("--dest-path=".length);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (arg === "--project-root") {
|
|
60
|
+
const value = argv[i + 1];
|
|
61
|
+
if (value === undefined || value.startsWith("--")) {
|
|
62
|
+
return { ...acc, error: "argument --project-root: expected one argument" };
|
|
63
|
+
}
|
|
64
|
+
acc.projectRoot = value;
|
|
65
|
+
i += 1;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (arg?.startsWith("--project-root=")) {
|
|
69
|
+
acc.projectRoot = arg.slice("--project-root=".length);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (arg === "--against-implementation") {
|
|
73
|
+
const value = argv[i + 1];
|
|
74
|
+
if (value === undefined || value.startsWith("--")) {
|
|
75
|
+
return { ...acc, error: "argument --against-implementation: expected one argument" };
|
|
76
|
+
}
|
|
77
|
+
acc.againstImplementationSha = value;
|
|
78
|
+
i += 1;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (arg?.startsWith("--against-implementation=")) {
|
|
82
|
+
acc.againstImplementationSha = arg.slice("--against-implementation=".length);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (arg === "--install-mode") {
|
|
86
|
+
const value = argv[i + 1];
|
|
87
|
+
if (value === undefined || value.startsWith("--")) {
|
|
88
|
+
return { ...acc, error: "argument --install-mode: expected one argument" };
|
|
89
|
+
}
|
|
90
|
+
if (value !== "guarded-prep" && value !== "process-only-no-install") {
|
|
91
|
+
return {
|
|
92
|
+
...acc,
|
|
93
|
+
error: "argument --install-mode: expected guarded-prep|process-only-no-install",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
acc.installMode = value;
|
|
97
|
+
i += 1;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (arg?.startsWith("--install-mode=")) {
|
|
101
|
+
const value = arg.slice("--install-mode=".length);
|
|
102
|
+
if (value !== "guarded-prep" && value !== "process-only-no-install") {
|
|
103
|
+
return {
|
|
104
|
+
...acc,
|
|
105
|
+
error: "argument --install-mode: expected guarded-prep|process-only-no-install",
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
acc.installMode = value;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
return { ...acc, error: `unknown argument: ${arg}` };
|
|
112
|
+
}
|
|
113
|
+
return acc;
|
|
114
|
+
}
|
|
115
|
+
export function run(argv) {
|
|
116
|
+
const args = parseDesignCritiqueEnsureArcDestArgs(argv);
|
|
117
|
+
if (args.help) {
|
|
118
|
+
process.stdout.write(`${DESIGN_CRITIQUE_ENSURE_ARC_DEST_HELP}\n`);
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
if (args.error !== undefined) {
|
|
122
|
+
process.stderr.write(`design-critique:ensure-arc-dest: ${args.error}\n`);
|
|
123
|
+
return 2;
|
|
124
|
+
}
|
|
125
|
+
if (args.destPath === null || args.destPath.trim().length === 0) {
|
|
126
|
+
process.stderr.write("design-critique:ensure-arc-dest: --dest-path is required\n" +
|
|
127
|
+
"Remediation: deft design-critique:ensure-arc-dest --dest-path .deft-scratch/worktrees/arc-<N>\n");
|
|
128
|
+
return 2;
|
|
129
|
+
}
|
|
130
|
+
const projectRoot = resolve(args.projectRoot);
|
|
131
|
+
const destPath = resolve(projectRoot, args.destPath);
|
|
132
|
+
let result;
|
|
133
|
+
try {
|
|
134
|
+
result = ensureArcDest({
|
|
135
|
+
repoRoot: projectRoot,
|
|
136
|
+
destPath,
|
|
137
|
+
againstImplementationSha: args.againstImplementationSha ?? undefined,
|
|
138
|
+
installMode: args.installMode ?? "guarded-prep",
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
143
|
+
if (args.emitJson) {
|
|
144
|
+
process.stdout.write(`${JSON.stringify({ ok: false, code: "ensure-failed", message }, null, 2)}\n`);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
process.stderr.write(`design-critique:ensure-arc-dest: ${message}\n`);
|
|
148
|
+
}
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
if (args.emitJson) {
|
|
152
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
153
|
+
}
|
|
154
|
+
else if (result.ok) {
|
|
155
|
+
process.stdout.write(`design-critique:ensure-arc-dest: ok dest=${result.destPath} sha=${result.dispatchSha} pin=${result.pinKind} reused=${result.reused}\n`);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
process.stderr.write(`design-critique:ensure-arc-dest: ${result.code}: ${result.message}\n`);
|
|
159
|
+
}
|
|
160
|
+
return result.ok ? 0 : 1;
|
|
161
|
+
}
|
|
162
|
+
export function main(argv) {
|
|
163
|
+
return run(argv);
|
|
164
|
+
}
|
|
165
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
166
|
+
process.exit(run(process.argv.slice(2)));
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=design-critique-ensure-arc-dest.js.map
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface DispatchIo {
|
|
|
10
10
|
writeErr: (text: string) => void;
|
|
11
11
|
}
|
|
12
12
|
/** CLI modules in packages/cli/src (excluding parity harnesses and bin/index). */
|
|
13
|
-
export declare const CLI_MODULE_VERBS: readonly ["agents-refresh", "cache", "check", "capacity-backfill", "capacity-show", "codebase-default-extractor", "codebase-map", "codebase-map-fresh", "codebase-projection-registry", "codebase-provider", "doctor", "ownership-doctor", "ownership-fix", "verify-ownership", "install-upgrade", "install-uninstall", "migrate-preflight", "migrate-xbrief", "migrate-category-b", "framework-check-updates", "hook-dispatch", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "coverage-hotspots", "policy", "authz", "escalation-cli", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "pr-finish-loop", "directive-finish-loop", "pre-pr-run", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "release-wait-npm", "scope-lifecycle", "scope-record-approved-scope", "scope-record-observable-scope", "scope-record-intent-constraint", "scm-sync-default", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "occupancy-steal", "occupancy-release", "occupancy-heartbeat", "occupancy-grant", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-strip-withdrawn", "triage-evaluate", "triage-help", "triage-queue", "triage-reconcile", "triage-refresh", "triage-scope", "triage-scope-drift", "triage-smoketest", "triage-subscribe", "triage-summary", "triage-welcome", "ts-check-lane", "vbrief-activate", "vbrief-build", "vbrief-preflight", "vbrief-reconcile", "vbrief-validate", "vbrief-validation", "xbrief-create", "xbrief-verify", "xbrief-adopt-stored-plan-id", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-test-boundary", "verify-class-checks", "verify-presentation-coverage", "verify-scope-provenance", "verify-consumer-check-contract", "verify-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-biome-config", "verify-bridge-drift", "verify-capacity", "verify-contained-writes", "verify-telemetry-coverage", "verify-content-manifest", "verify-deposit-closure", "verify-consumer-hard-stops", "verify-closing-keywords", "verify-skill-external-fetch-gate", "verify-semantic-single-source", "verify-contract-drift", "verify-cursor-tier1", "verify-openclaw-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-plan-sequence", "verify-stubs", "verify-xbrief-drift", "verify-spec-prd-fresh", "verify-spec-drift", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-cohort-review-monitors", "verify-l4-owner", "verify-subagent-alive", "verify-subagent-steer", "subagent-pre-cancel", "subagent-steer-write", "design-critique-spend-resolve", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-pr-closeout-attestable", "verify-lifecycle-visible", "verify-completed-tracked", "verify-completed-write-guard", "verify-literal-ac", "verify-ac", "verify-agents-md-budget", "verify-consumer-header-placeholder", "verify-agents-md-advisory", "verify-persisted-planning-narratives", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "verify-evaluator-surface", "verify-observable-scope", "verify-operator-scope-limit", "verify-presentation-ceiling", "verify-intent-constraint", "verify-durable-effect-acquisition", "verify-consumer-test-lane", "eval-health", "eval-run", "eval-report", "eval-triggers"];
|
|
13
|
+
export declare const CLI_MODULE_VERBS: readonly ["agents-refresh", "cache", "check", "capacity-backfill", "capacity-show", "codebase-default-extractor", "codebase-map", "codebase-map-fresh", "codebase-projection-registry", "codebase-provider", "doctor", "ownership-doctor", "ownership-fix", "verify-ownership", "install-upgrade", "install-uninstall", "migrate-preflight", "migrate-xbrief", "migrate-category-b", "framework-check-updates", "hook-dispatch", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "coverage-hotspots", "policy", "authz", "escalation-cli", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "pr-finish-loop", "directive-finish-loop", "pre-pr-run", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "release-wait-npm", "scope-lifecycle", "scope-record-approved-scope", "scope-record-observable-scope", "scope-record-intent-constraint", "scm-sync-default", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "occupancy-steal", "occupancy-release", "occupancy-heartbeat", "occupancy-grant", "applying-host-release", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-strip-withdrawn", "triage-evaluate", "triage-help", "triage-queue", "triage-reconcile", "triage-refresh", "triage-scope", "triage-scope-drift", "triage-smoketest", "triage-subscribe", "triage-summary", "triage-welcome", "ts-check-lane", "vbrief-activate", "vbrief-build", "vbrief-preflight", "vbrief-reconcile", "vbrief-validate", "vbrief-validation", "xbrief-create", "xbrief-verify", "xbrief-adopt-stored-plan-id", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-test-boundary", "verify-class-checks", "verify-presentation-coverage", "verify-scope-provenance", "verify-consumer-check-contract", "verify-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-biome-config", "verify-bridge-drift", "verify-capacity", "verify-contained-writes", "verify-telemetry-coverage", "verify-content-manifest", "verify-deposit-closure", "verify-consumer-hard-stops", "verify-closing-keywords", "verify-skill-external-fetch-gate", "verify-semantic-single-source", "verify-contract-drift", "verify-cursor-tier1", "verify-openclaw-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-plan-sequence", "verify-stubs", "verify-xbrief-drift", "verify-spec-prd-fresh", "verify-spec-drift", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-cohort-review-monitors", "verify-l4-owner", "verify-subagent-alive", "verify-subagent-steer", "subagent-pre-cancel", "subagent-steer-write", "design-critique-spend-resolve", "design-critique-ensure-arc-dest", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-pr-closeout-attestable", "verify-lifecycle-visible", "verify-completed-tracked", "verify-completed-write-guard", "verify-literal-ac", "verify-ac", "verify-agents-md-budget", "verify-consumer-header-placeholder", "verify-agents-md-advisory", "verify-persisted-planning-narratives", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "verify-evaluator-surface", "verify-observable-scope", "verify-operator-scope-limit", "verify-presentation-ceiling", "verify-intent-constraint", "verify-durable-effect-acquisition", "verify-consumer-test-lane", "eval-health", "eval-run", "eval-report", "eval-triggers"];
|
|
14
14
|
/** Core-only CLI entrypoints without a packages/cli wrapper. */
|
|
15
15
|
export declare const CORE_MODULE_VERBS: readonly ["scm", "scm-readiness", "github-auth-modes", "github-body", "issue-emit", "issue-ingest", "issue-sync-from-xbrief", "reconcile-issues", "swarm-launch", "swarm-complete-cohort", "swarm-finalize-cohort", "swarm-finalize-owed", "swarm-pre-dispatch", "swarm-readiness", "swarm-routing-verify", "swarm-routing-set", "swarm-verify-review-clean", "swarm-worktrees", "framework-commands", "pack-render", "packs-slice", "prd-render", "export-spec", "project-render", "project-write-narratives", "roadmap-render", "rule-map", "capability-map", "spec-render", "spec-reconstruct", "spec-validate", "code-structure-validate", "pack-migrate-skills", "pack-migrate-rules", "pack-migrate-strategies", "pack-migrate-patterns", "pack-migrate-swarm-spec", "policy-set", "setup-ghx", "scope-undo", "scope-demote", "scope-decompose", "changelog-resolve-unreleased", "architecture-preflight-sor", "feedback-file", "value-readback", "product-signal", "freshness-report", "decision-write", "decision-list", "docs-impact", "tutorial", "migrate-clause-ids", "migrate-confidence", "rule-to-verb-parity"];
|
|
16
16
|
/** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
|
package/dist/dispatch.js
CHANGED
|
@@ -86,6 +86,7 @@ export const CLI_MODULE_VERBS = [
|
|
|
86
86
|
"occupancy-release",
|
|
87
87
|
"occupancy-heartbeat",
|
|
88
88
|
"occupancy-grant",
|
|
89
|
+
"applying-host-release",
|
|
89
90
|
"plan-sequence",
|
|
90
91
|
"slice",
|
|
91
92
|
"subagent-monitor",
|
|
@@ -162,6 +163,7 @@ export const CLI_MODULE_VERBS = [
|
|
|
162
163
|
"subagent-pre-cancel",
|
|
163
164
|
"subagent-steer-write",
|
|
164
165
|
"design-critique-spend-resolve",
|
|
166
|
+
"design-critique-ensure-arc-dest",
|
|
165
167
|
"review-monitor-register",
|
|
166
168
|
"review-monitor-release",
|
|
167
169
|
"verify-tools",
|
|
@@ -398,6 +400,7 @@ export const VERB_ALIASES = {
|
|
|
398
400
|
"subagent:pre-cancel": "subagent-pre-cancel",
|
|
399
401
|
"subagent:steer": "subagent-steer-write",
|
|
400
402
|
"design-critique:spend-resolve": "design-critique-spend-resolve",
|
|
403
|
+
"design-critique:ensure-arc-dest": "design-critique-ensure-arc-dest",
|
|
401
404
|
"agent:monitor": "subagent-monitor",
|
|
402
405
|
"review-monitor:register": "review-monitor-register",
|
|
403
406
|
"review-monitor:release": "review-monitor-release",
|
|
@@ -465,6 +468,7 @@ export const VERB_ALIASES = {
|
|
|
465
468
|
"occupancy:release": "occupancy-release",
|
|
466
469
|
"occupancy:heartbeat": "occupancy-heartbeat",
|
|
467
470
|
"occupancy:grant": "occupancy-grant",
|
|
471
|
+
"applying-host:release": "applying-host-release",
|
|
468
472
|
"session:end": "occupancy-release",
|
|
469
473
|
...FRESHNESS_COLON_ALIASES,
|
|
470
474
|
"lifecycle:event": "lifecycle-event",
|
|
@@ -2839,6 +2843,10 @@ const CURATED_HELP_GROUPS = [
|
|
|
2839
2843
|
name: "session:end",
|
|
2840
2844
|
summary: "End this mutation session by releasing occupancy (same as occupancy:release)",
|
|
2841
2845
|
},
|
|
2846
|
+
{
|
|
2847
|
+
name: "applying-host:release",
|
|
2848
|
+
summary: "Clear the worktree applying-host soft claim (owner or abandoned no-lease)",
|
|
2849
|
+
},
|
|
2842
2850
|
{
|
|
2843
2851
|
name: "freshness:report",
|
|
2844
2852
|
summary: "Bound vs live deposit generation (current|stale_soft|stale_hard)",
|
package/dist/hook-dispatch.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFileSync, realpathSync } from "node:fs";
|
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { checkCheapInSync } from "../vendor/directive-core/dist/install-health/cheap.js";
|
|
6
|
-
import { INSTALLATION_RECOVERY_GUIDANCE } from "../vendor/directive-core/dist/install-health/constants.js";
|
|
6
|
+
import { HOOK_ROOT_MISMATCH_RECOVERY_GUIDANCE, INSTALLATION_RECOVERY_GUIDANCE, } from "../vendor/directive-core/dist/install-health/constants.js";
|
|
7
7
|
import { decideHook, hookPayloadTopLevelKeys, isHookEvent, isHookHost, mergeHookDispatchEnviron, normalizeHookProjectRoot, parseHookStdin, projectRootFromHookPayload, renderHostDecision, } from "../vendor/directive-core/dist/hooks/index.js";
|
|
8
8
|
import { readProjectDataStatus } from "./data-status.js";
|
|
9
9
|
import { maybeSelfCompleteSetup } from "./self-complete.js";
|
|
@@ -216,7 +216,7 @@ export function run(argv, seams = {}) {
|
|
|
216
216
|
// owns the running hook-bin. Mismatch → fail closed (no setup, no policy).
|
|
217
217
|
const launchRoot = (seams.launchingCheckoutRoot ?? resolveLaunchingCheckoutRoot)();
|
|
218
218
|
if (launchRoot !== null && !rootsMatch(launchRoot, projectRoot)) {
|
|
219
|
-
const guidance =
|
|
219
|
+
const guidance = HOOK_ROOT_MISMATCH_RECOVERY_GUIDANCE;
|
|
220
220
|
const decision = installationIdentityDeny(args.host, args.event, projectRoot, `Directive hook refuse: payload project root does not match the launching checkout ` +
|
|
221
221
|
`(payloadRoot=${normalizeHookProjectRoot(projectRoot)} ` +
|
|
222
222
|
`launchRoot=${normalizeHookProjectRoot(launchRoot)}). Recovery: ${guidance}`);
|
|
@@ -226,6 +226,7 @@ export function run(argv, seams = {}) {
|
|
|
226
226
|
return 0;
|
|
227
227
|
}
|
|
228
228
|
// Wave 2k / AC9.4+AC14.8: pin≠installed → fail closed before policy.
|
|
229
|
+
// #6013/#5893: pin≠installed recovery names project PM install (not AC9.7).
|
|
229
230
|
// #5910: overlay-present also fail-closes (even when versions match); recovery
|
|
230
231
|
// names frozen-lockfile restore then overlay retirement.
|
|
231
232
|
const cheap = (seams.cheapInSync ?? checkCheapInSync)(projectRoot);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (pseudo-terminal residual; #3110 Greptile). Presence refuses mint.
|
|
4
4
|
* Expanded for dogfood conf 5/5 — markers are fail-closed (any non-empty value).
|
|
5
5
|
*/
|
|
6
|
-
export declare const AUTHZ_AGENT_SHELL_ENV_MARKERS: readonly ["CLAUDECODE", "CLAUDE_CODE", "CLAUDE_CODE_ENTRYPOINT", "CURSOR_AGENT", "CURSOR_TRACE_ID", "CURSOR_SESSION_ID", "AIDER", "CONTINUE_CLI", "CODEX_SANDBOX", "CODEX_CI", "OPENAI_CODEX", "OPENCLAW", "OPENCLAW_STATE_DIR", "DEFT_PROBE_OPENCLAW", "DEFT_HOOK_HOST", "DEFT_AGENT_SHELL", "DEFT_AGENT_RUNTIME", "WARP_SESSION_ID", "WARP_HARNESS", "WARP_RUN_ID", "GEMINI_CLI", "AMP_CLI", "SWARM_AGENT", "AI_AGENT", "CI", "CONTINUOUS_INTEGRATION", "GITHUB_ACTIONS", "GITLAB_CI", "CIRCLECI", "BUILDKITE", "TRAVIS", "JENKINS_URL", "TEAMCITY_VERSION", "TF_BUILD", "APPVEYOR", "BITBUCKET_BUILD_NUMBER", "CODEBUILD_BUILD_ID"];
|
|
6
|
+
export declare const AUTHZ_AGENT_SHELL_ENV_MARKERS: readonly ["CLAUDECODE", "CLAUDE_CODE", "CLAUDE_CODE_ENTRYPOINT", "CURSOR_AGENT", "CURSOR_TRACE_ID", "CURSOR_SESSION_ID", "AIDER", "CONTINUE_CLI", "CODEX_SANDBOX", "CODEX_CI", "OPENAI_CODEX", "GROK_AGENT", "GROK_SESSION_ID", "OPENCLAW", "OPENCLAW_STATE_DIR", "DEFT_PROBE_OPENCLAW", "DEFT_HOOK_HOST", "DEFT_AGENT_SHELL", "DEFT_AGENT_RUNTIME", "WARP_SESSION_ID", "WARP_HARNESS", "WARP_RUN_ID", "GEMINI_CLI", "AMP_CLI", "SWARM_AGENT", "AI_AGENT", "CI", "CONTINUOUS_INTEGRATION", "GITHUB_ACTIONS", "GITLAB_CI", "CIRCLECI", "BUILDKITE", "TRAVIS", "JENKINS_URL", "TEAMCITY_VERSION", "TF_BUILD", "APPVEYOR", "BITBUCKET_BUILD_NUMBER", "CODEBUILD_BUILD_ID"];
|
|
7
7
|
/** Phrase an operator must type on the controlling TTY after --confirm (#3110). */
|
|
8
8
|
export declare const AUTHZ_INTERACTIVE_CONFIRM_PHRASE = "mint";
|
|
9
9
|
/** Testable seams for TTY / agent-shell detection (#3110 / #3384). */
|
|
@@ -26,6 +26,11 @@ export interface HumanPresenceMintSeams {
|
|
|
26
26
|
*/
|
|
27
27
|
readonly readInteractiveConfirm?: () => string | null;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Matching agent/CI shell marker keys in AUTHZ_AGENT_SHELL_ENV_MARKERS order.
|
|
31
|
+
* Blank or whitespace-only values do not match (return []).
|
|
32
|
+
*/
|
|
33
|
+
export declare function detectedAgentShellMarkers(environ: NodeJS.ProcessEnv): string[];
|
|
29
34
|
export declare function looksLikeAgentShell(environ: NodeJS.ProcessEnv): boolean;
|
|
30
35
|
/** Platform controlling-terminal path (`\\.\CONIN$` on win32, `/dev/tty` elsewhere). */
|
|
31
36
|
export declare function controllingTerminalPath(platform?: NodeJS.Platform): string;
|
|
@@ -26,6 +26,9 @@ export const AUTHZ_AGENT_SHELL_ENV_MARKERS = [
|
|
|
26
26
|
"CODEX_SANDBOX",
|
|
27
27
|
"CODEX_CI",
|
|
28
28
|
"OPENAI_CODEX",
|
|
29
|
+
// Grok Build shell markers (#5983 Prefer-A Recut-2): exact names only, both unconditional.
|
|
30
|
+
"GROK_AGENT",
|
|
31
|
+
"GROK_SESSION_ID",
|
|
29
32
|
"OPENCLAW",
|
|
30
33
|
"OPENCLAW_STATE_DIR",
|
|
31
34
|
"DEFT_PROBE_OPENCLAW",
|
|
@@ -56,13 +59,21 @@ export const AUTHZ_AGENT_SHELL_ENV_MARKERS = [
|
|
|
56
59
|
];
|
|
57
60
|
/** Phrase an operator must type on the controlling TTY after --confirm (#3110). */
|
|
58
61
|
export const AUTHZ_INTERACTIVE_CONFIRM_PHRASE = "mint";
|
|
59
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Matching agent/CI shell marker keys in AUTHZ_AGENT_SHELL_ENV_MARKERS order.
|
|
64
|
+
* Blank or whitespace-only values do not match (return []).
|
|
65
|
+
*/
|
|
66
|
+
export function detectedAgentShellMarkers(environ) {
|
|
67
|
+
const matched = [];
|
|
60
68
|
for (const key of AUTHZ_AGENT_SHELL_ENV_MARKERS) {
|
|
61
69
|
const v = environ[key];
|
|
62
70
|
if (v !== undefined && String(v).trim().length > 0)
|
|
63
|
-
|
|
71
|
+
matched.push(key);
|
|
64
72
|
}
|
|
65
|
-
return
|
|
73
|
+
return matched;
|
|
74
|
+
}
|
|
75
|
+
export function looksLikeAgentShell(environ) {
|
|
76
|
+
return detectedAgentShellMarkers(environ).length > 0;
|
|
66
77
|
}
|
|
67
78
|
function defaultIsTty() {
|
|
68
79
|
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
@@ -163,10 +174,13 @@ export function refuseMintWhileUatActive(verb, projectRoot) {
|
|
|
163
174
|
*/
|
|
164
175
|
export function refuseNonInteractiveMint(input) {
|
|
165
176
|
const { verb, confirm } = input;
|
|
166
|
-
|
|
177
|
+
const matchedMarkers = detectedAgentShellMarkers(input.environ);
|
|
178
|
+
if (matchedMarkers.length > 0) {
|
|
179
|
+
const named = matchedMarkers.join(", ");
|
|
167
180
|
process.stderr.write(`${verb}: refusing operator-cli stamp from an agent/host/CI shell ` +
|
|
168
|
-
`(
|
|
169
|
-
"TTY without agent-shell markers, plus --confirm
|
|
181
|
+
`(matched agent-shell env markers: ${named}). Unset ${named} and retry ` +
|
|
182
|
+
"from a human interactive TTY without agent-shell markers, plus --confirm " +
|
|
183
|
+
"and typed phrase (#3110 / #5983).\n");
|
|
170
184
|
return 2;
|
|
171
185
|
}
|
|
172
186
|
const tty = input.isTty();
|
package/dist/session-start.d.ts
CHANGED
|
@@ -30,10 +30,16 @@ export interface ParsedSessionStartArgs {
|
|
|
30
30
|
hardBudget?: boolean;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* #3286: compact
|
|
34
|
-
*
|
|
33
|
+
* #3286 / #4966: tip `--compact` retained for argv compatibility; deprecated
|
|
34
|
+
* as whole-stdout volume gate (no-op for human stdout selection). Orientation
|
|
35
|
+
* section formatting may still honor it inside core.
|
|
35
36
|
*/
|
|
36
37
|
compact: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* #4966: restore full ceremony human stdout. Quiet success is the default.
|
|
40
|
+
* Also settable via DEFT_SESSION_VERBOSE=1.
|
|
41
|
+
*/
|
|
42
|
+
verbose: boolean;
|
|
37
43
|
/** #3433: steal the worktree occupancy lease. */
|
|
38
44
|
steal: boolean;
|
|
39
45
|
confirm: boolean;
|
package/dist/session-start.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { CEREMONY_DEPTHS, normalizeCeremonyModelTier, normalizeCeremonyProjectShape, normalizeCeremonyTaskSize, selectCeremonyDepth, } from "../vendor/directive-core/dist/policy/index.js";
|
|
5
|
-
import { COLD_CEREMONY_TIER, PRIMARY_CLAIM_EXCEPTIONS, parseDeferrals, parseSessionPostureToken, publishApplyingHostFromCanonicalSessionId, READ_ONLY_POSTURE, REARM_CEREMONY_TIER, REQUIREMENTS_POSTURE, resolveProductionHostEffortDescriptor, ritualStatePath, runSessionStart, SESSION_CEREMONY_TIERS, } from "../vendor/directive-core/dist/session/index.js";
|
|
5
|
+
import { COLD_CEREMONY_TIER, PRIMARY_CLAIM_EXCEPTIONS, parseDeferrals, parseSessionPostureToken, publishApplyingHostFromCanonicalSessionId, READ_ONLY_POSTURE, REARM_CEREMONY_TIER, REQUIREMENTS_POSTURE, resolveProductionHostEffortDescriptor, resolveSessionVerbose, ritualStatePath, runSessionStart, SESSION_CEREMONY_TIERS, selectSessionStartHumanLines, } from "../vendor/directive-core/dist/session/index.js";
|
|
6
6
|
function parseCeremonyDepth(raw) {
|
|
7
7
|
const value = raw.trim().toLowerCase();
|
|
8
8
|
if (CEREMONY_DEPTHS.includes(value)) {
|
|
@@ -40,6 +40,7 @@ export function parseArgs(argv) {
|
|
|
40
40
|
ceremonyDepthOverride: null,
|
|
41
41
|
effortBudgetHost: {},
|
|
42
42
|
compact: false,
|
|
43
|
+
verbose: false,
|
|
43
44
|
steal: false,
|
|
44
45
|
confirm: false,
|
|
45
46
|
occupant: null,
|
|
@@ -311,9 +312,14 @@ export function parseArgs(argv) {
|
|
|
311
312
|
parsed.effortBudgetHost.hardBudget = true;
|
|
312
313
|
}
|
|
313
314
|
else if (arg === "--compact") {
|
|
314
|
-
// #3286:
|
|
315
|
+
// #3286 / #4966: deprecated as whole-stdout volume gate (parsed; no-op for
|
|
316
|
+
// human stdout selection). Prefer --verbose / DEFT_SESSION_VERBOSE.
|
|
315
317
|
parsed.compact = true;
|
|
316
318
|
}
|
|
319
|
+
else if (arg === "--verbose") {
|
|
320
|
+
// #4966: restore full ceremony dump (quiet success is the default).
|
|
321
|
+
parsed.verbose = true;
|
|
322
|
+
}
|
|
317
323
|
else if (arg === "--steal") {
|
|
318
324
|
parsed.steal = true;
|
|
319
325
|
}
|
|
@@ -496,8 +502,10 @@ export function run(argv) {
|
|
|
496
502
|
ceremonyTier: args.ceremonyTier,
|
|
497
503
|
ceremonyDialInputs: args.ceremonyDialInputs,
|
|
498
504
|
effortBudgetSeams: { hostDescriptor, environ: process.env },
|
|
499
|
-
// #3286: --compact
|
|
505
|
+
// #3286 / #4966: --compact retained for orientation formatting; not volume.
|
|
500
506
|
compact: args.compact ? true : undefined,
|
|
507
|
+
// #4966: --verbose / DEFT_SESSION_VERBOSE restores ceremony dump.
|
|
508
|
+
verbose: args.verbose ? true : undefined,
|
|
501
509
|
steal: args.steal ? true : undefined,
|
|
502
510
|
confirm: args.confirm ? true : undefined,
|
|
503
511
|
occupant: args.occupant ?? undefined,
|
|
@@ -523,12 +531,15 @@ export function run(argv) {
|
|
|
523
531
|
if (stray) {
|
|
524
532
|
lines.push(stray);
|
|
525
533
|
}
|
|
526
|
-
// #5676: read-only may bootstrap the applying-host record; mutation/rearm
|
|
534
|
+
// #5676 / #6101: read-only may bootstrap the applying-host record; mutation/rearm
|
|
527
535
|
// republishes as reinforcement after a successful ceremony. Skip opt-out /
|
|
528
536
|
// kill-switch disabled results so .no-deft-directive stays write-free.
|
|
537
|
+
// Helper owns the live-occupant skip; CLI surfaces published / deferred / failed
|
|
538
|
+
// (deferred distinct from non-canonical null) without claiming conflict recovery.
|
|
529
539
|
const disabled = typeof result.payload === "object" &&
|
|
530
540
|
result.payload !== null &&
|
|
531
541
|
result.payload.disabled === true;
|
|
542
|
+
let applyingHostPublish = { status: "skipped" };
|
|
532
543
|
if (result.code === 0 && !disabled) {
|
|
533
544
|
const owner = args.sessionId?.trim() ||
|
|
534
545
|
(typeof result.payload.occupancy === "object" &&
|
|
@@ -541,37 +552,81 @@ export function run(argv) {
|
|
|
541
552
|
if (owner.length > 0) {
|
|
542
553
|
try {
|
|
543
554
|
const transport = process.env.GROK_HOOK_EVENT?.trim() ? "grok-hook-event" : "native";
|
|
544
|
-
publishApplyingHostFromCanonicalSessionId(projectRoot, owner, {
|
|
555
|
+
const published = publishApplyingHostFromCanonicalSessionId(projectRoot, owner, {
|
|
545
556
|
transport: owner.startsWith("host:cursor:") ? "native" : transport,
|
|
546
557
|
});
|
|
558
|
+
if (published === null) {
|
|
559
|
+
applyingHostPublish = { status: "non-canonical" };
|
|
560
|
+
}
|
|
561
|
+
else if (published.status === "published") {
|
|
562
|
+
applyingHostPublish = {
|
|
563
|
+
status: "published",
|
|
564
|
+
applyingHostSessionId: published.record.applyingHostSessionId,
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
applyingHostPublish = {
|
|
569
|
+
status: "deferred",
|
|
570
|
+
reason: published.reason,
|
|
571
|
+
liveSessionId: published.liveSessionId,
|
|
572
|
+
attemptedSessionId: published.attemptedSessionId,
|
|
573
|
+
};
|
|
574
|
+
}
|
|
547
575
|
}
|
|
548
|
-
catch {
|
|
549
|
-
|
|
576
|
+
catch (err) {
|
|
577
|
+
applyingHostPublish = {
|
|
578
|
+
status: "failed",
|
|
579
|
+
message: err instanceof Error ? err.message : String(err),
|
|
580
|
+
};
|
|
550
581
|
}
|
|
551
582
|
}
|
|
552
583
|
}
|
|
584
|
+
const payloadWithPublish = applyingHostPublish.status === "skipped"
|
|
585
|
+
? result.payload
|
|
586
|
+
: { ...result.payload, applyingHostPublish };
|
|
553
587
|
if (args.emitJson) {
|
|
554
|
-
const sorted = Object.keys(
|
|
588
|
+
const sorted = Object.keys(payloadWithPublish)
|
|
555
589
|
.sort()
|
|
556
590
|
.reduce((acc, key) => {
|
|
557
|
-
acc[key] =
|
|
591
|
+
acc[key] = payloadWithPublish[key];
|
|
558
592
|
return acc;
|
|
559
593
|
}, {});
|
|
560
594
|
process.stdout.write(`${JSON.stringify(sorted)}\n`);
|
|
561
595
|
return result.code;
|
|
562
596
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
sink.write(`${line}\n`);
|
|
566
|
-
}
|
|
597
|
+
// #4966: one final human-output selection point (core lines + stray + trailer).
|
|
598
|
+
const trailer = [];
|
|
567
599
|
if (result.code === 0) {
|
|
568
600
|
const posture = result.payload.posture;
|
|
569
601
|
if (posture === READ_ONLY_POSTURE || posture === REQUIREMENTS_POSTURE) {
|
|
570
|
-
|
|
602
|
+
trailer.push(`[deft] ${String(result.payload.message)}`);
|
|
571
603
|
}
|
|
572
604
|
else {
|
|
573
|
-
|
|
605
|
+
trailer.push(`[deft] session ritual recorded at ${ritualStatePath(projectRoot)} (diagnostic-only; not posture authority)`);
|
|
574
606
|
}
|
|
607
|
+
if (applyingHostPublish.status === "deferred") {
|
|
608
|
+
trailer.push(`[deft] applying-host publish deferred: live occupant ${applyingHostPublish.liveSessionId} ` +
|
|
609
|
+
`still holds this worktree (attempted ${applyingHostPublish.attemptedSessionId}); ` +
|
|
610
|
+
"not a conflict recovery — that owner must release/end or wait for lease TTL.");
|
|
611
|
+
}
|
|
612
|
+
else if (applyingHostPublish.status === "failed") {
|
|
613
|
+
trailer.push(`[deft] applying-host publish failed: ${applyingHostPublish.message}`);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
const verbose = resolveSessionVerbose({
|
|
617
|
+
verbose: args.verbose ? true : undefined,
|
|
618
|
+
env: process.env,
|
|
619
|
+
});
|
|
620
|
+
const humanLines = selectSessionStartHumanLines({
|
|
621
|
+
code: result.code,
|
|
622
|
+
payload: payloadWithPublish,
|
|
623
|
+
lines: [...lines, ...trailer],
|
|
624
|
+
verbose,
|
|
625
|
+
env: process.env,
|
|
626
|
+
});
|
|
627
|
+
const sink = result.code === 0 ? process.stdout : process.stderr;
|
|
628
|
+
for (const line of humanLines) {
|
|
629
|
+
sink.write(`${line}\n`);
|
|
575
630
|
}
|
|
576
631
|
return result.code;
|
|
577
632
|
}
|
package/dist/setup-wiring.d.ts
CHANGED
|
@@ -14,6 +14,15 @@ export type TrackResult = {
|
|
|
14
14
|
conflict?: boolean;
|
|
15
15
|
conflictReason?: string;
|
|
16
16
|
};
|
|
17
|
+
/** Normalize CRLF/CR to LF for ownership/wrapper equality (#5995). */
|
|
18
|
+
export declare function normalizeEol(text: string): string;
|
|
19
|
+
/** True when two texts differ only by end-of-line convention (#5995). */
|
|
20
|
+
export declare function contentsEqualIgnoringEol(a: string, b: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* `.githooks` shell entrypoints must be LF on disk for `sh` (#5995 / PR #6151 P1).
|
|
23
|
+
* Ownership stays EOL-insensitive; these paths still rewrite CRLF-only drift.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isShellHookEntrypoint(rel: string): boolean;
|
|
17
26
|
/**
|
|
18
27
|
* Resolve deft skill pointer target (AC9.6). Prefer skills/deft/SKILL.md when
|
|
19
28
|
* present in this runtime package; otherwise keep working package-root SKILL.md.
|
|
@@ -48,6 +57,32 @@ export declare function ensureSkillPointers(projectRoot: string): {
|
|
|
48
57
|
};
|
|
49
58
|
/** All wholly owned skill pointer paths (host roots × inventory). */
|
|
50
59
|
export declare function listSkillPointerPaths(): string[];
|
|
60
|
+
/**
|
|
61
|
+
* True when `rel` has unstaged worktree edits vs the index (#6151 P1).
|
|
62
|
+
* No repo / no git / clean path → false (safe to report modified for staging).
|
|
63
|
+
*/
|
|
64
|
+
export declare function pathHasUnstagedChanges(projectRoot: string, rel: string): boolean;
|
|
65
|
+
/** Left-unstaged disclosure when LF pins land on a dirty `.gitattributes` (#6151 P1). */
|
|
66
|
+
export declare const GITATTRIBUTES_STAGING_SKIPPED_DIRTY = ".gitattributes had unstaged local edits; LF pins were written but left unstaged so install/upgrade does not git add unrelated user changes (#6151 P1)";
|
|
67
|
+
/**
|
|
68
|
+
* True when every attribute line is a known Directive core/managed marker (or
|
|
69
|
+
* Deft deposit comment). Foreign rules mean the file is not pure Directive-owned
|
|
70
|
+
* (#6151 P1 dirty-skip heuristic).
|
|
71
|
+
*/
|
|
72
|
+
export declare function isDirectiveManagedGitattributes(content: string): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Deposit narrow LF .gitattributes for managed wiring paths (#5995).
|
|
75
|
+
* Reuses scaffold ensureGitattributes (core markers + managed wiring lines).
|
|
76
|
+
* Reports created/modified so install/upgrade staging commits the pins (#6151 P1).
|
|
77
|
+
* When the path already has unstaged user edits (or an untracked foreign file),
|
|
78
|
+
* still appends missing pins but does not report modified (avoids staging WIP).
|
|
79
|
+
*/
|
|
80
|
+
export declare function ensureManagedPathGitattributes(projectRoot: string): {
|
|
81
|
+
created: boolean;
|
|
82
|
+
modified: boolean;
|
|
83
|
+
wrote: boolean;
|
|
84
|
+
stagingSkippedNotice?: string;
|
|
85
|
+
};
|
|
51
86
|
/**
|
|
52
87
|
* Deposit host slash/prompt thin wrappers with package-relative targets (AC8.1 / AC8.10).
|
|
53
88
|
* Reuses emitter inventory; does not revive .deft/core teaching.
|
|
@@ -57,6 +92,7 @@ export declare function ensureSlashCommands(projectRoot: string): {
|
|
|
57
92
|
created: string[];
|
|
58
93
|
modified: string[];
|
|
59
94
|
conflicts: string[];
|
|
95
|
+
notices: string[];
|
|
60
96
|
};
|
|
61
97
|
/**
|
|
62
98
|
* Verified managed slash/prompt paths from the emitter inventory (AC8.1 / AC11.10).
|