@deftai/directive 0.106.0 → 0.108.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/authz.js +1 -1
- package/dist/cli-router/route-argv.js +3 -0
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +90 -51
- package/dist/human-presence-mint.d.ts +6 -6
- package/dist/human-presence-mint.js +7 -6
- package/dist/occupancy-grant.d.ts +18 -0
- package/dist/occupancy-grant.js +120 -0
- package/dist/occupancy-heartbeat.d.ts +8 -0
- package/dist/occupancy-heartbeat.js +62 -0
- package/dist/occupancy-release.d.ts +8 -0
- package/dist/occupancy-release.js +62 -0
- package/dist/occupancy-steal.d.ts +1 -0
- package/dist/occupancy-steal.js +32 -4
- package/dist/render-cli/prd-render-cli.js +6 -10
- package/dist/session-ready.d.ts +2 -0
- package/dist/session-ready.js +37 -5
- package/dist/session-start.d.ts +2 -0
- package/dist/session-start.js +39 -6
- package/dist/toolchain-check.d.ts +1 -0
- package/dist/toolchain-check.js +41 -2
- package/dist/triage-actions.js +2 -3
- package/dist/triage-evaluate.d.ts +14 -0
- package/dist/triage-evaluate.js +153 -0
- package/dist/verify-completed-tracked.js +34 -1
- package/dist/verify-completed-write-guard.d.ts +13 -0
- package/dist/verify-completed-write-guard.js +72 -0
- package/dist/verify-pr-closeout-attestable.d.ts +14 -0
- package/dist/verify-pr-closeout-attestable.js +96 -0
- package/dist/verify-subagent-alive.js +5 -1
- package/package.json +3 -3
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI for verify:completed-write-guard (#3679).
|
|
4
|
+
*/
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { evaluateCompletedWriteGuard } from "@deftai/directive-core/lifecycle";
|
|
8
|
+
/** Parse verify-completed-write-guard CLI args (#3679). */
|
|
9
|
+
export function parseArgs(argv) {
|
|
10
|
+
const parsed = {
|
|
11
|
+
projectRoot: ".",
|
|
12
|
+
baseRef: "",
|
|
13
|
+
quiet: false,
|
|
14
|
+
};
|
|
15
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
16
|
+
const arg = argv[i];
|
|
17
|
+
if (arg === "--quiet") {
|
|
18
|
+
parsed.quiet = true;
|
|
19
|
+
}
|
|
20
|
+
else if (arg === "--project-root") {
|
|
21
|
+
const value = argv[i + 1];
|
|
22
|
+
if (value === undefined) {
|
|
23
|
+
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
24
|
+
}
|
|
25
|
+
parsed.projectRoot = value;
|
|
26
|
+
i += 1;
|
|
27
|
+
}
|
|
28
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
29
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
30
|
+
}
|
|
31
|
+
else if (arg === "--base-ref") {
|
|
32
|
+
const value = argv[i + 1];
|
|
33
|
+
if (value === undefined) {
|
|
34
|
+
return { ...parsed, error: "argument --base-ref: expected one argument" };
|
|
35
|
+
}
|
|
36
|
+
parsed.baseRef = value;
|
|
37
|
+
i += 1;
|
|
38
|
+
}
|
|
39
|
+
else if (arg?.startsWith("--base-ref=")) {
|
|
40
|
+
parsed.baseRef = arg.slice("--base-ref=".length);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return parsed;
|
|
47
|
+
}
|
|
48
|
+
/** Run the gate and return the process exit code. */
|
|
49
|
+
export function run(argv) {
|
|
50
|
+
const args = parseArgs(argv);
|
|
51
|
+
if (args.error !== undefined) {
|
|
52
|
+
process.stderr.write(`verify_completed_write_guard: ${args.error}\n`);
|
|
53
|
+
return 2;
|
|
54
|
+
}
|
|
55
|
+
const projectRoot = resolve(args.projectRoot);
|
|
56
|
+
const result = evaluateCompletedWriteGuard(projectRoot, {
|
|
57
|
+
...(args.baseRef.length > 0 ? { baseRef: args.baseRef } : {}),
|
|
58
|
+
});
|
|
59
|
+
if (result.message.length > 0 && !args.quiet) {
|
|
60
|
+
if (result.code === 0) {
|
|
61
|
+
process.stdout.write(`${result.message}\n`);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
process.stderr.write(`${result.message}\n`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return result.code;
|
|
68
|
+
}
|
|
69
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
70
|
+
process.exit(run(process.argv.slice(2)));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=verify-completed-write-guard.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
interface ParsedArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
repo: string | null;
|
|
5
|
+
pr: number | null;
|
|
6
|
+
quiet: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Parse verify-pr-closeout-attestable CLI args. */
|
|
10
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
11
|
+
/** Run the gate and return the process exit code. */
|
|
12
|
+
export declare function run(argv: string[]): number;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=verify-pr-closeout-attestable.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { evaluate } from "@deftai/directive-core/pr-closeout-attestable";
|
|
5
|
+
function parsePrNumber(raw) {
|
|
6
|
+
const trimmed = raw.startsWith("#") ? raw.slice(1) : raw;
|
|
7
|
+
if (!/^\d+$/.test(trimmed)) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const value = Number(trimmed);
|
|
11
|
+
return Number.isInteger(value) && value > 0 ? value : null;
|
|
12
|
+
}
|
|
13
|
+
/** Parse verify-pr-closeout-attestable CLI args. */
|
|
14
|
+
export function parseArgs(argv) {
|
|
15
|
+
const parsed = { projectRoot: ".", repo: null, pr: null, quiet: false };
|
|
16
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
17
|
+
const arg = argv[i];
|
|
18
|
+
if (arg === "--quiet") {
|
|
19
|
+
parsed.quiet = true;
|
|
20
|
+
}
|
|
21
|
+
else if (arg === "--project-root") {
|
|
22
|
+
const value = argv[i + 1];
|
|
23
|
+
if (value === undefined) {
|
|
24
|
+
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
25
|
+
}
|
|
26
|
+
parsed.projectRoot = value;
|
|
27
|
+
i += 1;
|
|
28
|
+
}
|
|
29
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
30
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
31
|
+
}
|
|
32
|
+
else if (arg === "--repo") {
|
|
33
|
+
const value = argv[i + 1];
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
return { ...parsed, error: "argument --repo: expected one argument" };
|
|
36
|
+
}
|
|
37
|
+
parsed.repo = value;
|
|
38
|
+
i += 1;
|
|
39
|
+
}
|
|
40
|
+
else if (arg?.startsWith("--repo=")) {
|
|
41
|
+
parsed.repo = arg.slice("--repo=".length);
|
|
42
|
+
}
|
|
43
|
+
else if (arg === "--pr") {
|
|
44
|
+
const value = argv[i + 1];
|
|
45
|
+
if (value === undefined) {
|
|
46
|
+
return { ...parsed, error: "argument --pr: expected one argument" };
|
|
47
|
+
}
|
|
48
|
+
const pr = parsePrNumber(value);
|
|
49
|
+
if (pr === null) {
|
|
50
|
+
return { ...parsed, error: `argument --pr: expected a positive integer, got ${value}` };
|
|
51
|
+
}
|
|
52
|
+
parsed.pr = pr;
|
|
53
|
+
i += 1;
|
|
54
|
+
}
|
|
55
|
+
else if (arg?.startsWith("--pr=")) {
|
|
56
|
+
const value = arg.slice("--pr=".length);
|
|
57
|
+
const pr = parsePrNumber(value);
|
|
58
|
+
if (pr === null) {
|
|
59
|
+
return { ...parsed, error: `argument --pr: expected a positive integer, got ${value}` };
|
|
60
|
+
}
|
|
61
|
+
parsed.pr = pr;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (parsed.pr === null) {
|
|
68
|
+
return { ...parsed, error: "argument --pr is required" };
|
|
69
|
+
}
|
|
70
|
+
return parsed;
|
|
71
|
+
}
|
|
72
|
+
/** Run the gate and return the process exit code. */
|
|
73
|
+
export function run(argv) {
|
|
74
|
+
const args = parseArgs(argv);
|
|
75
|
+
if (args.error !== undefined) {
|
|
76
|
+
process.stderr.write(`verify_pr_closeout_attestable: ${args.error}\n`);
|
|
77
|
+
return 2;
|
|
78
|
+
}
|
|
79
|
+
const result = evaluate(resolve(args.projectRoot), args.pr, {
|
|
80
|
+
repo: args.repo,
|
|
81
|
+
quiet: args.quiet,
|
|
82
|
+
});
|
|
83
|
+
if (result.message.length > 0) {
|
|
84
|
+
if (result.stream === "stdout") {
|
|
85
|
+
process.stdout.write(`${result.message}\n`);
|
|
86
|
+
}
|
|
87
|
+
else if (result.stream === "stderr") {
|
|
88
|
+
process.stderr.write(`${result.message}\n`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return result.code;
|
|
92
|
+
}
|
|
93
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
94
|
+
process.exit(run(process.argv.slice(2)));
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=verify-pr-closeout-attestable.js.map
|
|
@@ -166,7 +166,11 @@ export function evaluateSubagentAliveGate(args, cwd = process.cwd()) {
|
|
|
166
166
|
}
|
|
167
167
|
lines.push("");
|
|
168
168
|
lines.push("REDISPATCH_OK: host-reported running + missing/STALE heartbeat authorizes takeover.");
|
|
169
|
-
lines.push("
|
|
169
|
+
lines.push("A killed worker's delivery attempt stays running until cancelled.");
|
|
170
|
+
lines.push("Takeover: task swarm:pre-dispatch -- --scope-id <id> --target-id <worktree> --action cancel");
|
|
171
|
+
lines.push("then: task swarm:pre-dispatch -- --scope-id <id> --target-id <worktree>");
|
|
172
|
+
lines.push("If verify:session-ritual --tier=gated fails, run session:start --rearm --session-id=<same> first.");
|
|
173
|
+
lines.push("Do not wait on Cursor false-alive state. Do not spawn while DENY_DUPLICATE_ACTIVE.");
|
|
170
174
|
return {
|
|
171
175
|
exitCode: EXIT_STALE,
|
|
172
176
|
redispatchOk: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.108.0",
|
|
4
4
|
"description": "Directive CLI — npm install path for the Deft Directive framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://deftai.github.io/directive/",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"provenance": true
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@deftai/directive-core": "^0.
|
|
38
|
-
"@deftai/directive-content": "^0.
|
|
37
|
+
"@deftai/directive-core": "^0.108.0",
|
|
38
|
+
"@deftai/directive-content": "^0.108.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -b"
|