@deftai/directive 0.92.0 → 0.94.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.
@@ -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", "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", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "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", "verify-branch", "verify-encoding", "verify-forward-coverage", "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-content-manifest", "verify-skill-external-fetch-gate", "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", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-subagent-alive", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-agents-md-budget", "verify-agents-md-advisory", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "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", "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", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "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", "verify-branch", "verify-encoding", "verify-forward-coverage", "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-content-manifest", "verify-skill-external-fetch-gate", "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", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-l4-owner", "verify-subagent-alive", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-agents-md-budget", "verify-agents-md-advisory", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "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-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", "roadmap-render", "rule-map", "spec-render", "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"];
16
16
  /** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
package/dist/dispatch.js CHANGED
@@ -97,6 +97,8 @@ export const CLI_MODULE_VERBS = [
97
97
  "vbrief-reconcile",
98
98
  "vbrief-validate",
99
99
  "vbrief-validation",
100
+ "xbrief-create",
101
+ "xbrief-verify",
100
102
  "verify-branch",
101
103
  "verify-encoding",
102
104
  "verify-forward-coverage",
@@ -124,6 +126,7 @@ export const CLI_MODULE_VERBS = [
124
126
  "rule-ownership-lint",
125
127
  "verify-story-ready",
126
128
  "verify-review-monitor",
129
+ "verify-l4-owner",
127
130
  "verify-subagent-alive",
128
131
  "review-monitor-register",
129
132
  "review-monitor-release",
@@ -261,9 +264,12 @@ export const VERB_ALIASES = {
261
264
  "vbrief:validate": "vbrief-validate",
262
265
  "vbrief:preflight": "vbrief-preflight",
263
266
  "xbrief:preflight": "vbrief-preflight",
267
+ "xbrief:create": "xbrief-create",
268
+ "xbrief:verify": "xbrief-verify",
264
269
  "vbrief:activate": "vbrief-activate",
265
270
  "verify:story-ready": "verify-story-ready",
266
271
  "verify:review-monitor": "verify-review-monitor",
272
+ "verify:l4-owner": "verify-l4-owner",
267
273
  "verify:subagent-alive": "verify-subagent-alive",
268
274
  "agent:monitor": "subagent-monitor",
269
275
  "review-monitor:register": "review-monitor-register",
@@ -373,6 +379,8 @@ const WRAPPER_CLI_STEMS = new Set([
373
379
  "vbrief-reconcile",
374
380
  "vbrief-validate",
375
381
  "vbrief-validation",
382
+ "xbrief-create",
383
+ "xbrief-verify",
376
384
  ]);
377
385
  function emitCliResult(result, io) {
378
386
  if (result.stdout)
@@ -440,6 +448,14 @@ async function loadWrapperCliHandler(stem, io) {
440
448
  const { cmdVbriefValidation } = await import("@deftai/directive-core/vbrief-validation");
441
449
  return cmdVbriefValidation;
442
450
  }
451
+ case "xbrief-create": {
452
+ const { runXbriefCreateCli } = await import("@deftai/directive-core/xbrief");
453
+ return (argv) => emitCliResult(runXbriefCreateCli(argv), io);
454
+ }
455
+ case "xbrief-verify": {
456
+ const { runXbriefVerifyCli } = await import("@deftai/directive-core/xbrief");
457
+ return (argv) => emitCliResult(runXbriefVerifyCli(argv), io);
458
+ }
443
459
  default:
444
460
  throw new Error(`no wrapper handler for ${stem}`);
445
461
  }
@@ -2560,6 +2576,19 @@ const CURATED_HELP_GROUPS = [
2560
2576
  title: "Scope lifecycle",
2561
2577
  commands: [{ name: "scope:promote", summary: "Promote a scope xBRIEF to pending" }],
2562
2578
  },
2579
+ {
2580
+ title: "xBRIEF create/verify (not lifecycle)",
2581
+ commands: [
2582
+ {
2583
+ name: "xbrief:create",
2584
+ summary: "Write a dense xBRIEF artifact at --out (requires --format); not scope:*",
2585
+ },
2586
+ {
2587
+ name: "xbrief:verify",
2588
+ summary: "Verify a dense xBRIEF artifact at --out (requires --format); not scope:*",
2589
+ },
2590
+ ],
2591
+ },
2563
2592
  {
2564
2593
  title: "Project artifacts",
2565
2594
  commands: [
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ pr: number | null;
4
+ projectRoot: string;
5
+ repo: string | null;
6
+ headSha: string | null;
7
+ reviewCycle: string | null;
8
+ emitJson: boolean;
9
+ help: boolean;
10
+ error?: string;
11
+ }
12
+ export declare function parseVerifyL4OwnerArgs(argv: readonly string[]): ParsedArgs;
13
+ export declare function run(argv: readonly string[]): number;
14
+ export {};
15
+ //# sourceMappingURL=verify-l4-owner.d.ts.map
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluateL4OwnerGate, L4_OWNER_HELP, l4OwnerResultToJson, } from "@deftai/directive-core/review-monitor";
5
+ export function parseVerifyL4OwnerArgs(argv) {
6
+ const acc = {
7
+ pr: null,
8
+ projectRoot: ".",
9
+ repo: null,
10
+ headSha: null,
11
+ reviewCycle: null,
12
+ emitJson: false,
13
+ help: false,
14
+ };
15
+ for (let i = 0; i < argv.length; i += 1) {
16
+ const arg = argv[i];
17
+ if (arg === "--help" || arg === "-h") {
18
+ return { ...acc, help: true };
19
+ }
20
+ if (arg === "--json") {
21
+ acc.emitJson = true;
22
+ }
23
+ else if (arg === "--pr") {
24
+ const value = argv[i + 1];
25
+ if (value === undefined) {
26
+ return { ...acc, error: "argument --pr: expected one argument" };
27
+ }
28
+ const n = Number(value);
29
+ if (!Number.isInteger(n) || n <= 0) {
30
+ return { ...acc, error: `invalid --pr value: ${value}` };
31
+ }
32
+ acc.pr = n;
33
+ i += 1;
34
+ }
35
+ else if (arg?.startsWith("--pr=")) {
36
+ const n = Number(arg.slice("--pr=".length));
37
+ if (!Number.isInteger(n) || n <= 0) {
38
+ return { ...acc, error: `invalid --pr value: ${arg}` };
39
+ }
40
+ acc.pr = n;
41
+ }
42
+ else if (arg === "--repo") {
43
+ const value = argv[i + 1];
44
+ if (value === undefined) {
45
+ return { ...acc, error: "argument --repo: expected one argument" };
46
+ }
47
+ acc.repo = value;
48
+ i += 1;
49
+ }
50
+ else if (arg?.startsWith("--repo=")) {
51
+ acc.repo = arg.slice("--repo=".length);
52
+ }
53
+ else if (arg === "--head-sha") {
54
+ const value = argv[i + 1];
55
+ if (value === undefined) {
56
+ return { ...acc, error: "argument --head-sha: expected one argument" };
57
+ }
58
+ acc.headSha = value;
59
+ i += 1;
60
+ }
61
+ else if (arg?.startsWith("--head-sha=")) {
62
+ acc.headSha = arg.slice("--head-sha=".length);
63
+ }
64
+ else if (arg === "--project-root") {
65
+ const value = argv[i + 1];
66
+ if (value === undefined) {
67
+ return { ...acc, error: "argument --project-root: expected one argument" };
68
+ }
69
+ acc.projectRoot = value;
70
+ i += 1;
71
+ }
72
+ else if (arg?.startsWith("--project-root=")) {
73
+ acc.projectRoot = arg.slice("--project-root=".length);
74
+ }
75
+ else if (arg === "--review-cycle") {
76
+ const value = argv[i + 1];
77
+ if (value === undefined) {
78
+ return { ...acc, error: "argument --review-cycle: expected one argument" };
79
+ }
80
+ acc.reviewCycle = value;
81
+ i += 1;
82
+ }
83
+ else if (arg?.startsWith("--review-cycle=")) {
84
+ acc.reviewCycle = arg.slice("--review-cycle=".length);
85
+ }
86
+ else if (arg?.startsWith("-")) {
87
+ return { ...acc, error: `unrecognized argument: ${arg}` };
88
+ }
89
+ else {
90
+ return { ...acc, error: `unrecognized argument: ${arg}` };
91
+ }
92
+ }
93
+ return acc;
94
+ }
95
+ export function run(argv) {
96
+ const args = parseVerifyL4OwnerArgs(argv);
97
+ if (args.help) {
98
+ process.stdout.write(L4_OWNER_HELP);
99
+ return 0;
100
+ }
101
+ if (args.error !== undefined) {
102
+ process.stderr.write(`verify_l4_owner: ${args.error}\n`);
103
+ process.stderr.write("Try: task verify:l4-owner -- --help\n");
104
+ return 2;
105
+ }
106
+ if (args.pr === null) {
107
+ process.stderr.write("verify_l4_owner: --pr is required\n");
108
+ process.stderr.write("Try: task verify:l4-owner -- --help\n");
109
+ return 2;
110
+ }
111
+ const result = evaluateL4OwnerGate({
112
+ pr: args.pr,
113
+ projectRoot: resolve(args.projectRoot),
114
+ repo: args.repo,
115
+ headSha: args.headSha,
116
+ reviewCycle: args.reviewCycle,
117
+ });
118
+ if (args.emitJson) {
119
+ process.stdout.write(`${JSON.stringify(l4OwnerResultToJson(result), null, 2)}\n`);
120
+ }
121
+ else if (result.exitCode === 0) {
122
+ process.stdout.write(`${result.message}\n`);
123
+ }
124
+ else {
125
+ process.stderr.write(`${result.message}\n`);
126
+ }
127
+ return result.exitCode;
128
+ }
129
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
130
+ process.exit(run(process.argv.slice(2)));
131
+ }
132
+ //# sourceMappingURL=verify-l4-owner.js.map
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=xbrief-create.d.ts.map
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { runXbriefCreateCli } from "@deftai/directive-core/xbrief";
3
+ const result = runXbriefCreateCli(process.argv.slice(2));
4
+ if (result.stdout)
5
+ process.stdout.write(result.stdout);
6
+ if (result.stderr)
7
+ process.stderr.write(result.stderr);
8
+ process.exit(result.exitCode);
9
+ //# sourceMappingURL=xbrief-create.js.map
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=xbrief-verify.d.ts.map
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { runXbriefVerifyCli } from "@deftai/directive-core/xbrief";
3
+ const result = runXbriefVerifyCli(process.argv.slice(2));
4
+ if (result.stdout)
5
+ process.stdout.write(result.stdout);
6
+ if (result.stderr)
7
+ process.stderr.write(result.stderr);
8
+ process.exit(result.exitCode);
9
+ //# sourceMappingURL=xbrief-verify.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive",
3
- "version": "0.92.0",
3
+ "version": "0.94.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.92.0",
38
- "@deftai/directive-content": "^0.92.0"
37
+ "@deftai/directive-core": "^0.94.0",
38
+ "@deftai/directive-content": "^0.94.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -b"