@deftai/directive 0.107.0 → 0.109.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/dispatch.d.ts +1 -1
- package/dist/dispatch.js +87 -51
- package/dist/doctor.js +6 -0
- 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 +1 -0
- package/dist/occupancy-release.js +26 -2
- 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/verify-orphan-active.d.ts +2 -0
- package/dist/verify-orphan-active.js +30 -0
- package/dist/verify-pr-closeout-attestable.d.ts +14 -0
- package/dist/verify-pr-closeout-attestable.js +96 -0
- package/dist/verify-source-cli/verify-closing-keywords.d.ts +35 -0
- package/dist/verify-source-cli/verify-closing-keywords.js +139 -0
- package/dist/verify-source-cli/verify-consumer-hard-stops.d.ts +16 -0
- package/dist/verify-source-cli/verify-consumer-hard-stops.js +99 -0
- package/dist/verify-source-cli/verify-deposit-closure.d.ts +12 -0
- package/dist/verify-source-cli/verify-deposit-closure.js +52 -0
- package/dist/verify-source-cli/verify-semantic-single-source.d.ts +11 -0
- package/dist/verify-source-cli/verify-semantic-single-source.js +49 -0
- package/dist/verify-subagent-alive.js +5 -1
- package/package.json +3 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { evaluateConsumerHardStopCensus, issueFromInventoryRow, parseClosesSet, } from "@deftai/directive-core/release";
|
|
6
|
+
import { restIssueListOpenInventory } from "@deftai/directive-core/scm";
|
|
7
|
+
/** Parse verify-consumer-hard-stops CLI args (#3900 / #3713). */
|
|
8
|
+
export function parseArgs(argv) {
|
|
9
|
+
const parsed = { repo: "deftai/directive", projectRoot: ".", changelog: null };
|
|
10
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
11
|
+
const arg = argv[i];
|
|
12
|
+
if (arg === "--repo") {
|
|
13
|
+
const value = argv[i + 1];
|
|
14
|
+
if (value === undefined)
|
|
15
|
+
return { ...parsed, error: "argument --repo: expected one argument" };
|
|
16
|
+
parsed.repo = value;
|
|
17
|
+
i += 1;
|
|
18
|
+
}
|
|
19
|
+
else if (arg?.startsWith("--repo=")) {
|
|
20
|
+
parsed.repo = arg.slice("--repo=".length);
|
|
21
|
+
}
|
|
22
|
+
else if (arg === "--project-root") {
|
|
23
|
+
const value = argv[i + 1];
|
|
24
|
+
if (value === undefined)
|
|
25
|
+
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
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 === "--changelog") {
|
|
33
|
+
const value = argv[i + 1];
|
|
34
|
+
if (value === undefined)
|
|
35
|
+
return { ...parsed, error: "argument --changelog: expected one argument" };
|
|
36
|
+
parsed.changelog = value;
|
|
37
|
+
i += 1;
|
|
38
|
+
}
|
|
39
|
+
else if (arg?.startsWith("--changelog=")) {
|
|
40
|
+
parsed.changelog = arg.slice("--changelog=".length);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return { ...parsed, error: "unrecognized argument: " + String(arg) };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return parsed;
|
|
47
|
+
}
|
|
48
|
+
export function run(argv, seams = {}) {
|
|
49
|
+
const args = parseArgs(argv);
|
|
50
|
+
if (args.error !== undefined) {
|
|
51
|
+
process.stderr.write("verify_consumer_hard_stops: " + args.error + "\n");
|
|
52
|
+
return 2;
|
|
53
|
+
}
|
|
54
|
+
const root = resolve(args.projectRoot);
|
|
55
|
+
let changelogText = seams.changelogText;
|
|
56
|
+
if (changelogText === undefined) {
|
|
57
|
+
const changelogPath = resolve(root, args.changelog ?? "CHANGELOG.md");
|
|
58
|
+
try {
|
|
59
|
+
changelogText = readFileSync(changelogPath, "utf8");
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
63
|
+
process.stderr.write("verify_consumer_hard_stops: could not read CHANGELOG (" + reason + ")\n");
|
|
64
|
+
return 2;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
let rows;
|
|
68
|
+
try {
|
|
69
|
+
rows = seams.inventory ?? restIssueListOpenInventory(args.repo);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
73
|
+
process.stderr.write("verify_consumer_hard_stops: fail -- could not list open issues. Recovery: check gh auth and REST quota. " +
|
|
74
|
+
reason +
|
|
75
|
+
"\n");
|
|
76
|
+
return 2;
|
|
77
|
+
}
|
|
78
|
+
const issues = [];
|
|
79
|
+
for (const row of rows) {
|
|
80
|
+
const issue = issueFromInventoryRow(row);
|
|
81
|
+
if (issue !== null)
|
|
82
|
+
issues.push(issue);
|
|
83
|
+
}
|
|
84
|
+
const result = evaluateConsumerHardStopCensus({
|
|
85
|
+
issues,
|
|
86
|
+
closesSet: parseClosesSet(changelogText),
|
|
87
|
+
});
|
|
88
|
+
if (result.stream === "stdout") {
|
|
89
|
+
process.stdout.write(result.message + "\n");
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
process.stderr.write(result.message + "\n");
|
|
93
|
+
}
|
|
94
|
+
return result.code;
|
|
95
|
+
}
|
|
96
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
97
|
+
process.exit(run(process.argv.slice(2)));
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=verify-consumer-hard-stops.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
interface ParsedArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
packRootExplicit: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Parse verify-deposit-closure CLI args (#3900 / #3601 C1). */
|
|
8
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
9
|
+
/** Run the gate and return the process exit code. */
|
|
10
|
+
export declare function run(argv: string[]): number;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=verify-deposit-closure.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { evaluateDepositClosureAtRoot } from "@deftai/directive-core/verify-source";
|
|
5
|
+
/** Parse verify-deposit-closure CLI args (#3900 / #3601 C1). */
|
|
6
|
+
export function parseArgs(argv) {
|
|
7
|
+
const parsed = { projectRoot: ".", packRootExplicit: false };
|
|
8
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
9
|
+
const arg = argv[i];
|
|
10
|
+
if (arg === "--project-root" || arg === "--pack-root") {
|
|
11
|
+
const value = argv[i + 1];
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
return { ...parsed, error: "argument " + arg + ": expected one argument" };
|
|
14
|
+
}
|
|
15
|
+
parsed.projectRoot = value;
|
|
16
|
+
parsed.packRootExplicit = arg === "--pack-root";
|
|
17
|
+
i += 1;
|
|
18
|
+
}
|
|
19
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
20
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
21
|
+
}
|
|
22
|
+
else if (arg?.startsWith("--pack-root=")) {
|
|
23
|
+
parsed.projectRoot = arg.slice("--pack-root=".length);
|
|
24
|
+
parsed.packRootExplicit = true;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return { ...parsed, error: "unrecognized argument: " + String(arg) };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return parsed;
|
|
31
|
+
}
|
|
32
|
+
/** Run the gate and return the process exit code. */
|
|
33
|
+
export function run(argv) {
|
|
34
|
+
const args = parseArgs(argv);
|
|
35
|
+
if (args.error !== undefined) {
|
|
36
|
+
process.stderr.write("verify_deposit_closure: " + args.error + "\n");
|
|
37
|
+
return 2;
|
|
38
|
+
}
|
|
39
|
+
const root = resolve(args.projectRoot);
|
|
40
|
+
const result = evaluateDepositClosureAtRoot(root, args.packRootExplicit);
|
|
41
|
+
if (result.stream === "stdout") {
|
|
42
|
+
process.stdout.write(result.message + "\n");
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
process.stderr.write(result.message + "\n");
|
|
46
|
+
}
|
|
47
|
+
return result.code;
|
|
48
|
+
}
|
|
49
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
50
|
+
process.exit(run(process.argv.slice(2)));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=verify-deposit-closure.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
interface ParsedArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Parse verify-semantic-single-source CLI args (#3600 / #3899 C2). */
|
|
7
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
8
|
+
/** Run the C2 gate and return the process exit code. */
|
|
9
|
+
export declare function run(argv: string[]): number;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=verify-semantic-single-source.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { evaluateSemanticSingleSource } from "@deftai/directive-core/verify-source";
|
|
5
|
+
/** Parse verify-semantic-single-source CLI args (#3600 / #3899 C2). */
|
|
6
|
+
export function parseArgs(argv) {
|
|
7
|
+
const parsed = { projectRoot: "." };
|
|
8
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
9
|
+
const arg = argv[i];
|
|
10
|
+
if (arg === "--project-root" || arg === "--pack-root") {
|
|
11
|
+
const value = argv[i + 1];
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
return { ...parsed, error: `argument ${arg}: expected one argument` };
|
|
14
|
+
}
|
|
15
|
+
parsed.projectRoot = value;
|
|
16
|
+
i += 1;
|
|
17
|
+
}
|
|
18
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
19
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
20
|
+
}
|
|
21
|
+
else if (arg?.startsWith("--pack-root=")) {
|
|
22
|
+
parsed.projectRoot = arg.slice("--pack-root=".length);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return parsed;
|
|
29
|
+
}
|
|
30
|
+
/** Run the C2 gate and return the process exit code. */
|
|
31
|
+
export function run(argv) {
|
|
32
|
+
const args = parseArgs(argv);
|
|
33
|
+
if (args.error !== undefined) {
|
|
34
|
+
process.stderr.write(`verify_semantic_single_source: ${args.error}\n`);
|
|
35
|
+
return 2;
|
|
36
|
+
}
|
|
37
|
+
const result = evaluateSemanticSingleSource(resolve(args.projectRoot));
|
|
38
|
+
if (result.stream === "stdout") {
|
|
39
|
+
process.stdout.write(`${result.message}\n`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
process.stderr.write(`${result.message}\n`);
|
|
43
|
+
}
|
|
44
|
+
return result.code;
|
|
45
|
+
}
|
|
46
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
47
|
+
process.exit(run(process.argv.slice(2)));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=verify-semantic-single-source.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.109.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.109.0",
|
|
38
|
+
"@deftai/directive-content": "^0.109.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -b"
|