@deftai/directive 0.93.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", "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-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
@@ -126,6 +126,7 @@ export const CLI_MODULE_VERBS = [
126
126
  "rule-ownership-lint",
127
127
  "verify-story-ready",
128
128
  "verify-review-monitor",
129
+ "verify-l4-owner",
129
130
  "verify-subagent-alive",
130
131
  "review-monitor-register",
131
132
  "review-monitor-release",
@@ -268,6 +269,7 @@ export const VERB_ALIASES = {
268
269
  "vbrief:activate": "vbrief-activate",
269
270
  "verify:story-ready": "verify-story-ready",
270
271
  "verify:review-monitor": "verify-review-monitor",
272
+ "verify:l4-owner": "verify-l4-owner",
271
273
  "verify:subagent-alive": "verify-subagent-alive",
272
274
  "agent:monitor": "subagent-monitor",
273
275
  "review-monitor:register": "review-monitor-register",
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive",
3
- "version": "0.93.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.93.0",
38
- "@deftai/directive-content": "^0.93.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"