@deftai/directive 0.64.0 → 0.65.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,9 +10,11 @@ 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", "framework-check-updates", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "policy", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "session-start", "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-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-bridge-drift", "verify-capacity", "verify-content-manifest", "verify-cursor-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-stubs", "rule-ownership-lint", "verify-story-ready", "verify-tools", "verify-wip-cap"];
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", "framework-check-updates", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "policy", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "session-start", "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-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-bridge-drift", "verify-capacity", "verify-content-manifest", "verify-contract-drift", "verify-cursor-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-stubs", "rule-ownership-lint", "verify-story-ready", "verify-tools", "verify-wip-cap"];
14
14
  /** Core-only CLI entrypoints without a packages/cli wrapper. */
15
15
  export declare const CORE_MODULE_VERBS: readonly ["scm", "github-auth-modes", "github-body", "issue-emit", "issue-ingest", "reconcile-issues", "swarm-launch", "swarm-complete-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", "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"];
16
+ /** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
17
+ export declare const TRIAGE_ACTION_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
16
18
  /** Task-style aliases (framework_commands / Taskfile names). */
17
19
  export declare const VERB_ALIASES: Readonly<Record<string, string>>;
18
20
  /** Pinned ghx version — keep in lockstep with .github/workflows/ci.yml env.GHX_VERSION. */
package/dist/dispatch.js CHANGED
@@ -92,6 +92,7 @@ export const CLI_MODULE_VERBS = [
92
92
  "verify-bridge-drift",
93
93
  "verify-capacity",
94
94
  "verify-content-manifest",
95
+ "verify-contract-drift",
95
96
  "verify-cursor-tier1",
96
97
  "verify-go-freeze",
97
98
  "verify-scm-boundary",
@@ -140,6 +141,18 @@ export const CORE_MODULE_VERBS = [
140
141
  "changelog-resolve-unreleased",
141
142
  "architecture-preflight-sor",
142
143
  ];
144
+ /** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
145
+ export const TRIAGE_ACTION_ALIAS_SUBCOMMANDS = {
146
+ "triage:accept": "accept",
147
+ "triage:reject": "reject",
148
+ "triage:defer": "defer",
149
+ "triage:needs-ac": "needs-ac",
150
+ "triage:mark-duplicate": "mark-duplicate",
151
+ "triage:status": "status",
152
+ "triage:reset": "reset",
153
+ "triage:history": "history",
154
+ };
155
+ const TRIAGE_ACTION_COLON_ALIASES = Object.fromEntries(Object.keys(TRIAGE_ACTION_ALIAS_SUBCOMMANDS).map((alias) => [alias, "triage-actions"]));
143
156
  /** Task-style aliases (framework_commands / Taskfile names). */
144
157
  export const VERB_ALIASES = {
145
158
  "verify:encoding": "verify-encoding",
@@ -161,6 +174,7 @@ export const VERB_ALIASES = {
161
174
  "verify:rule-ownership": "rule-ownership-lint",
162
175
  "rule:ownership-lint": "rule-ownership-lint",
163
176
  "verify:content-manifest": "verify-content-manifest",
177
+ "verify:contract-drift": "verify-contract-drift",
164
178
  "verify:cursor-tier1": "verify-cursor-tier1",
165
179
  "verify:go-freeze": "verify-go-freeze",
166
180
  "verify:bridge-drift": "verify-bridge-drift",
@@ -176,8 +190,7 @@ export const VERB_ALIASES = {
176
190
  "triage:summary": "triage-summary",
177
191
  "triage:queue": "triage-queue",
178
192
  "triage:scope": "triage-scope",
179
- "triage:accept": "triage-actions",
180
- "triage:status": "triage-actions",
193
+ ...TRIAGE_ACTION_COLON_ALIASES,
181
194
  "agents:refresh": "agents-refresh",
182
195
  "migrate:preflight": "migrate-preflight",
183
196
  "framework:check-updates": "framework-check-updates",
@@ -200,6 +213,7 @@ const SUBDIR_CLI_STEMS = {
200
213
  "verify-stubs": "verify-source-cli/verify-stubs",
201
214
  "rule-ownership-lint": "verify-source-cli/rule-ownership-lint",
202
215
  "verify-content-manifest": "verify-source-cli/verify-content-manifest",
216
+ "verify-contract-drift": "verify-source-cli/verify-contract-drift",
203
217
  "verify-cursor-tier1": "verify-source-cli/verify-cursor-tier1",
204
218
  "verify-scm-boundary": "verify-source-cli/verify-scm-boundary",
205
219
  "verify-go-freeze": "gates-cli/verify-go-freeze",
@@ -2110,9 +2124,12 @@ export async function dispatch(argv, io = defaultIo()) {
2110
2124
  }
2111
2125
  try {
2112
2126
  const handler = await loadHandler(canonical, io);
2127
+ const triageSubcommand = verb !== undefined ? TRIAGE_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
2113
2128
  const handlerArgv = canonical === "framework-commands" && verb !== undefined && verb !== canonical
2114
2129
  ? [verb, ...rest]
2115
- : rest;
2130
+ : triageSubcommand !== undefined && canonical === "triage-actions"
2131
+ ? [triageSubcommand, ...rest]
2132
+ : rest;
2116
2133
  return await invokeHandler(handler, handlerArgv);
2117
2134
  }
2118
2135
  catch (err) {
@@ -2,6 +2,7 @@
2
2
  import { dirname, resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { activeReferencedIssueNumbers, buildQueue, collectOrphanIssueNumbers, DEFAULT_QUEUE_LIMIT, loadCachedIssues, loadSliceRecords, readAuditEntries, renderQueue, resolveRankingLabels, resolveRepo, } from "@deftai/directive-core/dist/triage/queue/index.js";
5
+ import { resolveScopeIgnores } from "@deftai/directive-core/dist/triage/scope-drift/index.js";
5
6
  /** Parse triage-queue CLI args for the queue subcommand. */
6
7
  export function parseArgs(argv) {
7
8
  const parsed = {
@@ -150,6 +151,7 @@ export function run(argv) {
150
151
  });
151
152
  const orphanNumbers = collectOrphanIssueNumbers(sliceRecords, issuesByNumber);
152
153
  const limit = args.limit === 0 ? null : Math.max(0, args.limit);
154
+ const scopeIgnores = resolveScopeIgnores(projectRoot);
153
155
  const items = buildQueue(issuesForQueue, auditEntries, {
154
156
  repo,
155
157
  queue: {
@@ -158,6 +160,7 @@ export function run(argv) {
158
160
  orphanIssueNumbers: orphanNumbers,
159
161
  includeBlocked: args.includeBlocked,
160
162
  limit,
163
+ scopeIgnores,
161
164
  },
162
165
  });
163
166
  process.stdout.write(`${renderQueue({
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ projectRoot: string | null;
4
+ error?: string;
5
+ }
6
+ /** Parse verify-contract-drift CLI args (#1799). */
7
+ export declare function parseArgs(argv: string[]): ParsedArgs;
8
+ /** Run the gate and return the process exit code. */
9
+ export declare function run(argv: string[]): number;
10
+ export {};
11
+ //# sourceMappingURL=verify-contract-drift.d.ts.map
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluateContractDrift } from "@deftai/directive-core/verify-source";
5
+ /** Parse verify-contract-drift CLI args (#1799). */
6
+ export function parseArgs(argv) {
7
+ const parsed = { projectRoot: null };
8
+ for (let i = 0; i < argv.length; i += 1) {
9
+ const arg = argv[i];
10
+ if (arg === "--project-root") {
11
+ const value = argv[i + 1];
12
+ if (value === undefined) {
13
+ return { ...parsed, error: "argument --project-root: 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 {
22
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
23
+ }
24
+ }
25
+ return parsed;
26
+ }
27
+ /** Run the gate and return the process exit code. */
28
+ export function run(argv) {
29
+ const args = parseArgs(argv);
30
+ if (args.error !== undefined) {
31
+ process.stderr.write(`verify_contract_drift: ${args.error}\n`);
32
+ return 2;
33
+ }
34
+ const root = resolve(args.projectRoot ?? ".");
35
+ const result = evaluateContractDrift(root);
36
+ if (result.stream === "stdout") {
37
+ process.stdout.write(`${result.message}\n`);
38
+ }
39
+ else {
40
+ process.stderr.write(`${result.message}\n`);
41
+ }
42
+ return result.code;
43
+ }
44
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
45
+ process.exit(run(process.argv.slice(2)));
46
+ }
47
+ //# sourceMappingURL=verify-contract-drift.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive",
3
- "version": "0.64.0",
3
+ "version": "0.65.0",
4
4
  "description": "Directive CLI — npm install path for the Deft Directive framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,8 +31,8 @@
31
31
  "provenance": true
32
32
  },
33
33
  "dependencies": {
34
- "@deftai/directive-core": "^0.64.0",
35
- "@deftai/directive-content": "^0.64.0"
34
+ "@deftai/directive-core": "^0.65.0",
35
+ "@deftai/directive-content": "^0.65.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsc -b"