@deftai/directive 0.55.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.
Files changed (261) hide show
  1. package/dist/bin.d.ts +3 -0
  2. package/dist/bin.js +5 -0
  3. package/dist/branch-parity.d.ts +47 -0
  4. package/dist/branch-parity.js +263 -0
  5. package/dist/cache-parity.d.ts +36 -0
  6. package/dist/cache-parity.js +165 -0
  7. package/dist/cache.d.ts +4 -0
  8. package/dist/cache.js +10 -0
  9. package/dist/capacity-backfill.d.ts +3 -0
  10. package/dist/capacity-backfill.js +9 -0
  11. package/dist/capacity-show.d.ts +3 -0
  12. package/dist/capacity-show.js +9 -0
  13. package/dist/check.d.ts +10 -0
  14. package/dist/check.js +60 -0
  15. package/dist/cli-router/index.d.ts +8 -0
  16. package/dist/cli-router/index.js +37 -0
  17. package/dist/cli-router/route-argv.d.ts +32 -0
  18. package/dist/cli-router/route-argv.js +226 -0
  19. package/dist/codebase-default-extractor.d.ts +3 -0
  20. package/dist/codebase-default-extractor.js +9 -0
  21. package/dist/codebase-map-fresh.d.ts +3 -0
  22. package/dist/codebase-map-fresh.js +9 -0
  23. package/dist/codebase-map.d.ts +3 -0
  24. package/dist/codebase-map.js +9 -0
  25. package/dist/codebase-parity.d.ts +30 -0
  26. package/dist/codebase-parity.js +294 -0
  27. package/dist/codebase-projection-registry.d.ts +3 -0
  28. package/dist/codebase-projection-registry.js +9 -0
  29. package/dist/codebase-provider.d.ts +3 -0
  30. package/dist/codebase-provider.js +9 -0
  31. package/dist/content-validate-cli/validate-links.d.ts +11 -0
  32. package/dist/content-validate-cli/validate-links.js +37 -0
  33. package/dist/content-validate-cli/validate-strategy-output.d.ts +13 -0
  34. package/dist/content-validate-cli/validate-strategy-output.js +56 -0
  35. package/dist/content-validate-cli/verify-capacity.d.ts +12 -0
  36. package/dist/content-validate-cli/verify-capacity.js +54 -0
  37. package/dist/dispatch.d.ts +26 -0
  38. package/dist/dispatch.js +569 -0
  39. package/dist/doctor-parity.d.ts +38 -0
  40. package/dist/doctor-parity.js +151 -0
  41. package/dist/doctor.d.ts +3 -0
  42. package/dist/doctor.js +10 -0
  43. package/dist/gates-cli/_helpers.d.ts +18 -0
  44. package/dist/gates-cli/_helpers.js +71 -0
  45. package/dist/index.d.ts +11 -0
  46. package/dist/index.js +15 -0
  47. package/dist/init-cli/constants.d.ts +5 -0
  48. package/dist/init-cli/constants.js +5 -0
  49. package/dist/init-cli/init.d.ts +3 -0
  50. package/dist/init-cli/init.js +11 -0
  51. package/dist/init-cli/resolve-binary.d.ts +34 -0
  52. package/dist/init-cli/resolve-binary.js +78 -0
  53. package/dist/init-cli/run-deft-install.d.ts +23 -0
  54. package/dist/init-cli/run-deft-install.js +71 -0
  55. package/dist/init-cli/update.d.ts +3 -0
  56. package/dist/init-cli/update.js +11 -0
  57. package/dist/install-cli/coverage-map.d.ts +14 -0
  58. package/dist/install-cli/coverage-map.js +111 -0
  59. package/dist/intake-parity.d.ts +30 -0
  60. package/dist/intake-parity.js +203 -0
  61. package/dist/lifecycle-cli/coverage-map.d.ts +16 -0
  62. package/dist/lifecycle-cli/coverage-map.js +254 -0
  63. package/dist/lifecycle-cli/helpers.d.ts +8 -0
  64. package/dist/lifecycle-cli/helpers.js +20 -0
  65. package/dist/lifecycle-packs-parity.d.ts +30 -0
  66. package/dist/lifecycle-packs-parity.js +377 -0
  67. package/dist/orchestration-cli/coverage-map.d.ts +21 -0
  68. package/dist/orchestration-cli/coverage-map.js +225 -0
  69. package/dist/orchestration-cli/helpers.d.ts +11 -0
  70. package/dist/orchestration-cli/helpers.js +35 -0
  71. package/dist/orchestration-parity.d.ts +38 -0
  72. package/dist/orchestration-parity.js +364 -0
  73. package/dist/parity.d.ts +36 -0
  74. package/dist/parity.js +176 -0
  75. package/dist/platform-parity.d.ts +26 -0
  76. package/dist/platform-parity.js +309 -0
  77. package/dist/policy-parity.d.ts +35 -0
  78. package/dist/policy-parity.js +214 -0
  79. package/dist/policy.d.ts +27 -0
  80. package/dist/policy.js +316 -0
  81. package/dist/pr-closing-keywords-parity.d.ts +45 -0
  82. package/dist/pr-closing-keywords-parity.js +259 -0
  83. package/dist/pr-closing-keywords.d.ts +3 -0
  84. package/dist/pr-closing-keywords.js +10 -0
  85. package/dist/pr-merge-readiness-parity.d.ts +44 -0
  86. package/dist/pr-merge-readiness-parity.js +296 -0
  87. package/dist/pr-merge-readiness.d.ts +3 -0
  88. package/dist/pr-merge-readiness.js +10 -0
  89. package/dist/pr-monitor-parity.d.ts +44 -0
  90. package/dist/pr-monitor-parity.js +283 -0
  91. package/dist/pr-monitor.d.ts +3 -0
  92. package/dist/pr-monitor.js +10 -0
  93. package/dist/pr-protected-issues-parity.d.ts +41 -0
  94. package/dist/pr-protected-issues-parity.js +220 -0
  95. package/dist/pr-protected-issues.d.ts +3 -0
  96. package/dist/pr-protected-issues.js +10 -0
  97. package/dist/pr-wait-mergeable-parity.d.ts +45 -0
  98. package/dist/pr-wait-mergeable-parity.js +340 -0
  99. package/dist/pr-wait-mergeable.d.ts +3 -0
  100. package/dist/pr-wait-mergeable.js +10 -0
  101. package/dist/preflight-cache.d.ts +16 -0
  102. package/dist/preflight-cache.js +106 -0
  103. package/dist/preflight-gh.d.ts +12 -0
  104. package/dist/preflight-gh.js +188 -0
  105. package/dist/probe-session.d.ts +3 -0
  106. package/dist/probe-session.js +10 -0
  107. package/dist/release-e2e-parity.d.ts +31 -0
  108. package/dist/release-e2e-parity.js +114 -0
  109. package/dist/release-e2e.d.ts +3 -0
  110. package/dist/release-e2e.js +10 -0
  111. package/dist/release-parity.d.ts +40 -0
  112. package/dist/release-parity.js +223 -0
  113. package/dist/release-publish-parity.d.ts +36 -0
  114. package/dist/release-publish-parity.js +138 -0
  115. package/dist/release-publish.d.ts +3 -0
  116. package/dist/release-publish.js +10 -0
  117. package/dist/release-rollback-parity.d.ts +37 -0
  118. package/dist/release-rollback-parity.js +161 -0
  119. package/dist/release-rollback.d.ts +3 -0
  120. package/dist/release-rollback.js +10 -0
  121. package/dist/release.d.ts +3 -0
  122. package/dist/release.js +10 -0
  123. package/dist/render-cli/deft-ts-runner.d.ts +20 -0
  124. package/dist/render-cli/deft-ts-runner.js +35 -0
  125. package/dist/render-cli/prd-render-cli.d.ts +2 -0
  126. package/dist/render-cli/prd-render-cli.js +7 -0
  127. package/dist/render-cli/project-render-cli.d.ts +2 -0
  128. package/dist/render-cli/project-render-cli.js +6 -0
  129. package/dist/render-cli/spec-render-cli.d.ts +2 -0
  130. package/dist/render-cli/spec-render-cli.js +6 -0
  131. package/dist/render-cli/spec-validate-cli.d.ts +2 -0
  132. package/dist/render-cli/spec-validate-cli.js +6 -0
  133. package/dist/render-parity.d.ts +35 -0
  134. package/dist/render-parity.js +383 -0
  135. package/dist/scm-parity.d.ts +39 -0
  136. package/dist/scm-parity.js +181 -0
  137. package/dist/scope-lifecycle-parity.d.ts +35 -0
  138. package/dist/scope-lifecycle-parity.js +177 -0
  139. package/dist/scope-lifecycle.d.ts +4 -0
  140. package/dist/scope-lifecycle.js +29 -0
  141. package/dist/session-parity.d.ts +39 -0
  142. package/dist/session-parity.js +260 -0
  143. package/dist/slice-parity.d.ts +36 -0
  144. package/dist/slice-parity.js +304 -0
  145. package/dist/slice.d.ts +4 -0
  146. package/dist/slice.js +29 -0
  147. package/dist/story-ready-parity.d.ts +49 -0
  148. package/dist/story-ready-parity.js +254 -0
  149. package/dist/subagent-monitor.d.ts +3 -0
  150. package/dist/subagent-monitor.js +10 -0
  151. package/dist/swarm-parity.d.ts +28 -0
  152. package/dist/swarm-parity.js +326 -0
  153. package/dist/toolchain-check.d.ts +3 -0
  154. package/dist/toolchain-check.js +14 -0
  155. package/dist/triage-actions-parity.d.ts +33 -0
  156. package/dist/triage-actions-parity.js +201 -0
  157. package/dist/triage-actions.d.ts +17 -0
  158. package/dist/triage-actions.js +144 -0
  159. package/dist/triage-aux-a-parity.d.ts +35 -0
  160. package/dist/triage-aux-a-parity.js +172 -0
  161. package/dist/triage-aux-b-parity.d.ts +32 -0
  162. package/dist/triage-aux-b-parity.js +308 -0
  163. package/dist/triage-bootstrap-parity.d.ts +44 -0
  164. package/dist/triage-bootstrap-parity.js +226 -0
  165. package/dist/triage-bootstrap.d.ts +24 -0
  166. package/dist/triage-bootstrap.js +172 -0
  167. package/dist/triage-bulk.d.ts +17 -0
  168. package/dist/triage-bulk.js +154 -0
  169. package/dist/triage-classify-parity.d.ts +40 -0
  170. package/dist/triage-classify-parity.js +227 -0
  171. package/dist/triage-classify.d.ts +13 -0
  172. package/dist/triage-classify.js +76 -0
  173. package/dist/triage-help.d.ts +3 -0
  174. package/dist/triage-help.js +10 -0
  175. package/dist/triage-queue-parity.d.ts +59 -0
  176. package/dist/triage-queue-parity.js +363 -0
  177. package/dist/triage-queue.d.ts +17 -0
  178. package/dist/triage-queue.js +174 -0
  179. package/dist/triage-reconcile.d.ts +11 -0
  180. package/dist/triage-reconcile.js +76 -0
  181. package/dist/triage-refresh.d.ts +7 -0
  182. package/dist/triage-refresh.js +37 -0
  183. package/dist/triage-scope-drift.d.ts +12 -0
  184. package/dist/triage-scope-drift.js +117 -0
  185. package/dist/triage-scope-parity.d.ts +34 -0
  186. package/dist/triage-scope-parity.js +218 -0
  187. package/dist/triage-scope.d.ts +4 -0
  188. package/dist/triage-scope.js +29 -0
  189. package/dist/triage-smoketest.d.ts +3 -0
  190. package/dist/triage-smoketest.js +43 -0
  191. package/dist/triage-subscribe.d.ts +15 -0
  192. package/dist/triage-subscribe.js +157 -0
  193. package/dist/triage-summary-parity.d.ts +50 -0
  194. package/dist/triage-summary-parity.js +306 -0
  195. package/dist/triage-summary.d.ts +14 -0
  196. package/dist/triage-summary.js +77 -0
  197. package/dist/triage-welcome.d.ts +12 -0
  198. package/dist/triage-welcome.js +78 -0
  199. package/dist/ts-check-lane.d.ts +9 -0
  200. package/dist/ts-check-lane.js +49 -0
  201. package/dist/validate-content-parity.d.ts +33 -0
  202. package/dist/validate-content-parity.js +356 -0
  203. package/dist/vbrief-activate-parity.d.ts +39 -0
  204. package/dist/vbrief-activate-parity.js +216 -0
  205. package/dist/vbrief-activate.d.ts +3 -0
  206. package/dist/vbrief-activate.js +7 -0
  207. package/dist/vbrief-build-parity.d.ts +28 -0
  208. package/dist/vbrief-build-parity.js +399 -0
  209. package/dist/vbrief-build.d.ts +3 -0
  210. package/dist/vbrief-build.js +8 -0
  211. package/dist/vbrief-preflight-parity.d.ts +34 -0
  212. package/dist/vbrief-preflight-parity.js +163 -0
  213. package/dist/vbrief-preflight.d.ts +12 -0
  214. package/dist/vbrief-preflight.js +58 -0
  215. package/dist/vbrief-reconcile-parity.d.ts +22 -0
  216. package/dist/vbrief-reconcile-parity.js +600 -0
  217. package/dist/vbrief-reconcile.d.ts +3 -0
  218. package/dist/vbrief-reconcile.js +7 -0
  219. package/dist/vbrief-validate-parity.d.ts +27 -0
  220. package/dist/vbrief-validate-parity.js +122 -0
  221. package/dist/vbrief-validate.d.ts +3 -0
  222. package/dist/vbrief-validate.js +8 -0
  223. package/dist/vbrief-validation-parity.d.ts +28 -0
  224. package/dist/vbrief-validation-parity.js +645 -0
  225. package/dist/vbrief-validation.d.ts +3 -0
  226. package/dist/vbrief-validation.js +8 -0
  227. package/dist/verify-branch.d.ts +14 -0
  228. package/dist/verify-branch.js +81 -0
  229. package/dist/verify-encoding.d.ts +15 -0
  230. package/dist/verify-encoding.js +86 -0
  231. package/dist/verify-env-parity.d.ts +28 -0
  232. package/dist/verify-env-parity.js +272 -0
  233. package/dist/verify-hooks-installed.d.ts +10 -0
  234. package/dist/verify-hooks-installed.js +48 -0
  235. package/dist/verify-investigation.d.ts +3 -0
  236. package/dist/verify-investigation.js +10 -0
  237. package/dist/verify-judgment-gates.d.ts +3 -0
  238. package/dist/verify-judgment-gates.js +10 -0
  239. package/dist/verify-no-task-runtime.d.ts +3 -0
  240. package/dist/verify-no-task-runtime.js +16 -0
  241. package/dist/verify-session-ritual.d.ts +13 -0
  242. package/dist/verify-session-ritual.js +78 -0
  243. package/dist/verify-source-cli/rule-ownership-lint.d.ts +12 -0
  244. package/dist/verify-source-cli/rule-ownership-lint.js +61 -0
  245. package/dist/verify-source-cli/verify-content-manifest.d.ts +12 -0
  246. package/dist/verify-source-cli/verify-content-manifest.js +61 -0
  247. package/dist/verify-source-cli/verify-scm-boundary.d.ts +13 -0
  248. package/dist/verify-source-cli/verify-scm-boundary.js +66 -0
  249. package/dist/verify-source-cli/verify-stubs.d.ts +11 -0
  250. package/dist/verify-source-cli/verify-stubs.js +27 -0
  251. package/dist/verify-source-parity.d.ts +26 -0
  252. package/dist/verify-source-parity.js +178 -0
  253. package/dist/verify-story-ready.d.ts +16 -0
  254. package/dist/verify-story-ready.js +138 -0
  255. package/dist/verify-tools.d.ts +13 -0
  256. package/dist/verify-tools.js +67 -0
  257. package/dist/verify-wip-cap.d.ts +13 -0
  258. package/dist/verify-wip-cap.js +62 -0
  259. package/dist/wip-cap-parity.d.ts +39 -0
  260. package/dist/wip-cap-parity.js +209 -0
  261. package/package.json +50 -0
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { emitBypassWarning, emitVerifyJson, verifySessionRitual, } from "@deftai/directive-core/session";
5
+ /** Parse verify-session-ritual CLI args, mirroring scripts/verify_session_ritual.py. */
6
+ export function parseArgs(argv) {
7
+ const parsed = { projectRoot: ".", tier: "quick", emitJson: false };
8
+ for (let i = 0; i < argv.length; i += 1) {
9
+ const arg = argv[i];
10
+ if (arg === "--json") {
11
+ parsed.emitJson = true;
12
+ }
13
+ else if (arg === "--project-root") {
14
+ const value = argv[i + 1];
15
+ if (value === undefined) {
16
+ return { ...parsed, error: "argument --project-root: expected one argument" };
17
+ }
18
+ parsed.projectRoot = value;
19
+ i += 1;
20
+ }
21
+ else if (arg?.startsWith("--project-root=")) {
22
+ parsed.projectRoot = arg.slice("--project-root=".length);
23
+ }
24
+ else if (arg === "--tier") {
25
+ const value = argv[i + 1];
26
+ if (value === undefined) {
27
+ return { ...parsed, error: "argument --tier: expected one argument" };
28
+ }
29
+ if (value !== "quick" && value !== "gated") {
30
+ return { ...parsed, error: `argument --tier: invalid choice: '${value}'` };
31
+ }
32
+ parsed.tier = value;
33
+ i += 1;
34
+ }
35
+ else if (arg?.startsWith("--tier=")) {
36
+ const value = arg.slice("--tier=".length);
37
+ if (value !== "quick" && value !== "gated") {
38
+ return { ...parsed, error: `argument --tier: invalid choice: '${value}'` };
39
+ }
40
+ parsed.tier = value;
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_session_ritual: ${args.error}\n`);
53
+ return 2;
54
+ }
55
+ const projectRoot = resolve(args.projectRoot);
56
+ const result = verifySessionRitual(projectRoot, { tier: args.tier });
57
+ const warning = emitBypassWarning(result);
58
+ const warningNeeded = result.bypassed && result.wouldFailCode !== null;
59
+ if (args.emitJson) {
60
+ process.stdout.write(`${emitVerifyJson(result)}\n`);
61
+ }
62
+ else if (result.code === 0) {
63
+ if (!warningNeeded) {
64
+ process.stdout.write(`${result.message}\n`);
65
+ }
66
+ }
67
+ else {
68
+ process.stderr.write(`${result.message}\n`);
69
+ }
70
+ if (warning.length > 0) {
71
+ process.stderr.write(`${warning}\n`);
72
+ }
73
+ return result.code;
74
+ }
75
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
76
+ process.exit(run(process.argv.slice(2)));
77
+ }
78
+ //# sourceMappingURL=verify-session-ritual.js.map
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ mapPath: string | null;
4
+ root: string | null;
5
+ error?: string;
6
+ }
7
+ /** Parse rule-ownership-lint CLI args, mirroring scripts/rule_ownership_lint.py. */
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=rule-ownership-lint.d.ts.map
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluateRuleOwnership } from "@deftai/directive-core/verify-source";
5
+ /** Parse rule-ownership-lint CLI args, mirroring scripts/rule_ownership_lint.py. */
6
+ export function parseArgs(argv) {
7
+ const parsed = { mapPath: null, root: null };
8
+ for (let i = 0; i < argv.length; i += 1) {
9
+ const arg = argv[i];
10
+ if (arg === "--map") {
11
+ const value = argv[i + 1];
12
+ if (value === undefined) {
13
+ return { ...parsed, error: "argument --map: expected one argument" };
14
+ }
15
+ parsed.mapPath = value;
16
+ i += 1;
17
+ }
18
+ else if (arg?.startsWith("--map=")) {
19
+ parsed.mapPath = arg.slice("--map=".length);
20
+ }
21
+ else if (arg === "--root") {
22
+ const value = argv[i + 1];
23
+ if (value === undefined) {
24
+ return { ...parsed, error: "argument --root: expected one argument" };
25
+ }
26
+ parsed.root = value;
27
+ i += 1;
28
+ }
29
+ else if (arg?.startsWith("--root=")) {
30
+ parsed.root = arg.slice("--root=".length);
31
+ }
32
+ else {
33
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
34
+ }
35
+ }
36
+ return parsed;
37
+ }
38
+ /** Run the gate and return the process exit code. */
39
+ export function run(argv) {
40
+ const args = parseArgs(argv);
41
+ if (args.error !== undefined) {
42
+ process.stderr.write(`rule_ownership_lint: ${args.error}\n`);
43
+ return 2;
44
+ }
45
+ const root = resolve(args.root ?? ".");
46
+ const result = evaluateRuleOwnership(root, {
47
+ root,
48
+ mapPath: args.mapPath !== null ? resolve(args.mapPath) : undefined,
49
+ });
50
+ if (result.stream === "stdout") {
51
+ process.stdout.write(`${result.message}\n`);
52
+ }
53
+ else {
54
+ process.stderr.write(`${result.message}\n`);
55
+ }
56
+ return result.code;
57
+ }
58
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
59
+ process.exit(run(process.argv.slice(2)));
60
+ }
61
+ //# sourceMappingURL=rule-ownership-lint.js.map
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ manifestPath: string | null;
4
+ projectRoot: string | null;
5
+ error?: string;
6
+ }
7
+ /** Parse verify-content-manifest CLI args (#1821). */
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-content-manifest.d.ts.map
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluateContentManifest } from "@deftai/directive-core/verify-source";
5
+ /** Parse verify-content-manifest CLI args (#1821). */
6
+ export function parseArgs(argv) {
7
+ const parsed = { manifestPath: null, projectRoot: null };
8
+ for (let i = 0; i < argv.length; i += 1) {
9
+ const arg = argv[i];
10
+ if (arg === "--manifest") {
11
+ const value = argv[i + 1];
12
+ if (value === undefined) {
13
+ return { ...parsed, error: "argument --manifest: expected one argument" };
14
+ }
15
+ parsed.manifestPath = value;
16
+ i += 1;
17
+ }
18
+ else if (arg?.startsWith("--manifest=")) {
19
+ parsed.manifestPath = arg.slice("--manifest=".length);
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 {
33
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
34
+ }
35
+ }
36
+ return parsed;
37
+ }
38
+ /** Run the gate and return the process exit code. */
39
+ export function run(argv) {
40
+ const args = parseArgs(argv);
41
+ if (args.error !== undefined) {
42
+ process.stderr.write(`verify_content_manifest: ${args.error}\n`);
43
+ return 2;
44
+ }
45
+ const root = resolve(args.projectRoot ?? ".");
46
+ const result = evaluateContentManifest(root, {
47
+ root,
48
+ manifestPath: args.manifestPath !== null ? resolve(args.manifestPath) : undefined,
49
+ });
50
+ if (result.stream === "stdout") {
51
+ process.stdout.write(`${result.message}\n`);
52
+ }
53
+ else {
54
+ process.stderr.write(`${result.message}\n`);
55
+ }
56
+ return result.code;
57
+ }
58
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
59
+ process.exit(run(process.argv.slice(2)));
60
+ }
61
+ //# sourceMappingURL=verify-content-manifest.js.map
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ projectRoot: string;
4
+ allowList: string | null;
5
+ quiet: boolean;
6
+ error?: string;
7
+ }
8
+ /** Parse verify-scm-boundary CLI args, mirroring scripts/verify_scm_boundary.py. */
9
+ export declare function parseArgs(argv: string[]): ParsedArgs;
10
+ /** Run the gate and return the process exit code. */
11
+ export declare function run(argv: string[]): number;
12
+ export {};
13
+ //# sourceMappingURL=verify-scm-boundary.d.ts.map
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluateScmBoundary } from "@deftai/directive-core/verify-source";
5
+ /** Parse verify-scm-boundary CLI args, mirroring scripts/verify_scm_boundary.py. */
6
+ export function parseArgs(argv) {
7
+ const parsed = { projectRoot: ".", allowList: null, quiet: false };
8
+ for (let i = 0; i < argv.length; i += 1) {
9
+ const arg = argv[i];
10
+ if (arg === "--quiet") {
11
+ parsed.quiet = true;
12
+ }
13
+ else if (arg === "--project-root") {
14
+ const value = argv[i + 1];
15
+ if (value === undefined) {
16
+ return { ...parsed, error: "argument --project-root: expected one argument" };
17
+ }
18
+ parsed.projectRoot = value;
19
+ i += 1;
20
+ }
21
+ else if (arg?.startsWith("--project-root=")) {
22
+ parsed.projectRoot = arg.slice("--project-root=".length);
23
+ }
24
+ else if (arg === "--allow-list") {
25
+ const value = argv[i + 1];
26
+ if (value === undefined) {
27
+ return { ...parsed, error: "argument --allow-list: expected one argument" };
28
+ }
29
+ parsed.allowList = value;
30
+ i += 1;
31
+ }
32
+ else if (arg?.startsWith("--allow-list=")) {
33
+ parsed.allowList = arg.slice("--allow-list=".length);
34
+ }
35
+ else {
36
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
37
+ }
38
+ }
39
+ return parsed;
40
+ }
41
+ /** Run the gate and return the process exit code. */
42
+ export function run(argv) {
43
+ const args = parseArgs(argv);
44
+ if (args.error !== undefined) {
45
+ process.stderr.write(`verify_scm_boundary: ${args.error}\n`);
46
+ return 2;
47
+ }
48
+ const projectRoot = resolve(args.projectRoot);
49
+ const result = evaluateScmBoundary(projectRoot, {
50
+ allowListPath: args.allowList !== null ? resolve(args.allowList) : null,
51
+ quiet: args.quiet,
52
+ });
53
+ if (result.code === 0) {
54
+ if (!args.quiet && result.message.length > 0) {
55
+ process.stdout.write(`${result.message}\n`);
56
+ }
57
+ }
58
+ else {
59
+ process.stderr.write(`${result.message}\n`);
60
+ }
61
+ return result.code;
62
+ }
63
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
64
+ process.exit(run(process.argv.slice(2)));
65
+ }
66
+ //# sourceMappingURL=verify-scm-boundary.js.map
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ projectRoot: string;
4
+ error?: string;
5
+ }
6
+ /** Parse verify-stubs CLI args (mirrors scripts/verify-stubs.py -- no flags). */
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-stubs.d.ts.map
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluateVerifyStubs } from "@deftai/directive-core/verify-source";
5
+ /** Parse verify-stubs CLI args (mirrors scripts/verify-stubs.py -- no flags). */
6
+ export function parseArgs(argv) {
7
+ const parsed = { projectRoot: "." };
8
+ for (const arg of argv) {
9
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
10
+ }
11
+ return parsed;
12
+ }
13
+ /** Run the gate and return the process exit code. */
14
+ export function run(argv) {
15
+ const args = parseArgs(argv);
16
+ if (args.error !== undefined) {
17
+ process.stderr.write(`verify-stubs: ${args.error}\n`);
18
+ return 2;
19
+ }
20
+ const result = evaluateVerifyStubs(resolve(args.projectRoot));
21
+ process.stdout.write(`${result.message}\n`);
22
+ return result.code;
23
+ }
24
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
25
+ process.exit(run(process.argv.slice(2)));
26
+ }
27
+ //# sourceMappingURL=verify-stubs.js.map
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ export interface GateCapture {
3
+ readonly name: string;
4
+ readonly exitCode: number;
5
+ readonly stdout: string;
6
+ readonly stderr: string;
7
+ }
8
+ export interface GateParity {
9
+ readonly name: string;
10
+ readonly exitMismatch: boolean;
11
+ readonly stdoutMismatch: boolean;
12
+ readonly stderrMismatch: boolean;
13
+ readonly pythonExit: number;
14
+ readonly tsExit: number;
15
+ }
16
+ export interface ParityResult {
17
+ readonly ok: boolean;
18
+ readonly gates: readonly GateParity[];
19
+ }
20
+ export declare function captureTsGate(name: string, deftRoot: string): GateCapture;
21
+ export declare function capturePythonGate(name: string, deftRoot: string): GateCapture;
22
+ export declare const PARITY_GATES: readonly ["verify_scm_boundary", "rule_ownership_lint", "code_structure_validate", "verify-stubs"];
23
+ export declare function diffGate(python: GateCapture, ts: GateCapture): GateParity;
24
+ export declare function runParity(deftRoot?: string): ParityResult;
25
+ export declare function renderReport(result: ParityResult): string;
26
+ //# sourceMappingURL=verify-source-parity.d.ts.map
@@ -0,0 +1,178 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Golden-output parity harness (#1783 s2): runs BOTH the frozen Python source-tree
4
+ * scanner gates and the ported TS verify-source module over the repository tree,
5
+ * then diffs exit codes + byte-identical stdout/stderr (cache-off).
6
+ *
7
+ * Exit codes: 0 parity / 1 divergence / 2 harness setup error.
8
+ */
9
+ import { spawnSync } from "node:child_process";
10
+ import { dirname, join, resolve } from "node:path";
11
+ import { fileURLToPath } from "node:url";
12
+ import { evaluateCodeStructure, evaluateRuleOwnership, evaluateScmBoundary, evaluateVerifyStubs, } from "@deftai/directive-core/verify-source";
13
+ function runCapture(cmd, args, cwd, env = {}) {
14
+ const result = spawnSync(cmd, args, {
15
+ cwd,
16
+ encoding: "utf8",
17
+ env: { ...process.env, ...env },
18
+ stdio: ["ignore", "pipe", "pipe"],
19
+ });
20
+ return {
21
+ status: result.status ?? 2,
22
+ stdout: typeof result.stdout === "string" ? result.stdout : "",
23
+ stderr: typeof result.stderr === "string" ? result.stderr : "",
24
+ };
25
+ }
26
+ function resolveDeftRoot() {
27
+ if (process.env.DEFT_ROOT !== undefined && process.env.DEFT_ROOT.length > 0) {
28
+ return resolve(process.env.DEFT_ROOT);
29
+ }
30
+ return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
31
+ }
32
+ function normaliseHarnessNoise(text) {
33
+ return text
34
+ .split("\n")
35
+ .filter((line) => !line.startsWith("Using CPython") &&
36
+ !line.startsWith("Creating virtual environment") &&
37
+ !line.startsWith("Installed "))
38
+ .join("\n");
39
+ }
40
+ export function captureTsGate(name, deftRoot) {
41
+ if (name === "verify_scm_boundary") {
42
+ const result = evaluateScmBoundary(deftRoot);
43
+ return {
44
+ name,
45
+ exitCode: result.code,
46
+ stdout: result.stream === "stdout" ? `${result.message}\n` : "",
47
+ stderr: result.stream === "stderr" ? `${result.message}\n` : "",
48
+ };
49
+ }
50
+ if (name === "rule_ownership_lint") {
51
+ const result = evaluateRuleOwnership(deftRoot, { root: deftRoot });
52
+ return {
53
+ name,
54
+ exitCode: result.code,
55
+ stdout: result.stream === "stdout" ? `${result.message}\n` : "",
56
+ stderr: result.stream === "stderr" ? `${result.message}\n` : "",
57
+ };
58
+ }
59
+ if (name === "code_structure_validate") {
60
+ const result = evaluateCodeStructure(deftRoot);
61
+ return {
62
+ name,
63
+ exitCode: result.code,
64
+ stdout: result.stdout,
65
+ stderr: result.stderr,
66
+ };
67
+ }
68
+ if (name === "verify-stubs") {
69
+ const result = evaluateVerifyStubs(deftRoot);
70
+ const msg = result.message.endsWith("\n") ? result.message : `${result.message}\n`;
71
+ return {
72
+ name,
73
+ exitCode: result.code,
74
+ stdout: msg,
75
+ stderr: "",
76
+ };
77
+ }
78
+ return { name, exitCode: 2, stdout: "", stderr: `unknown gate: ${name}\n` };
79
+ }
80
+ export function capturePythonGate(name, deftRoot) {
81
+ const env = { DEFT_CACHE_DISABLE: "1", PYTHONUTF8: "1" };
82
+ if (name === "verify_scm_boundary") {
83
+ const cap = runCapture("uv", [
84
+ "run",
85
+ "python",
86
+ join(deftRoot, "scripts", "verify_scm_boundary.py"),
87
+ "--project-root",
88
+ deftRoot,
89
+ ], deftRoot, env);
90
+ return { name, exitCode: cap.status, stdout: cap.stdout, stderr: cap.stderr };
91
+ }
92
+ if (name === "rule_ownership_lint") {
93
+ const cap = runCapture("uv", ["run", "python", join(deftRoot, "scripts", "rule_ownership_lint.py"), "--root", deftRoot], deftRoot, env);
94
+ return { name, exitCode: cap.status, stdout: cap.stdout, stderr: cap.stderr };
95
+ }
96
+ if (name === "code_structure_validate") {
97
+ const cap = runCapture("uv", [
98
+ "run",
99
+ "python",
100
+ join(deftRoot, "scripts", "code_structure_validate.py"),
101
+ "--project-root",
102
+ deftRoot,
103
+ ], deftRoot, env);
104
+ return { name, exitCode: cap.status, stdout: cap.stdout, stderr: cap.stderr };
105
+ }
106
+ if (name === "verify-stubs") {
107
+ const cap = runCapture("uv", ["run", "python", join(deftRoot, "scripts", "verify-stubs.py")], deftRoot, env);
108
+ return { name, exitCode: cap.status, stdout: cap.stdout, stderr: cap.stderr };
109
+ }
110
+ return { name, exitCode: 2, stdout: "", stderr: `unknown gate: ${name}\n` };
111
+ }
112
+ export const PARITY_GATES = [
113
+ "verify_scm_boundary",
114
+ "rule_ownership_lint",
115
+ "code_structure_validate",
116
+ "verify-stubs",
117
+ ];
118
+ export function diffGate(python, ts) {
119
+ const pyOut = normaliseHarnessNoise(python.stdout);
120
+ const tsOut = normaliseHarnessNoise(ts.stdout);
121
+ const pyErr = normaliseHarnessNoise(python.stderr);
122
+ const tsErr = normaliseHarnessNoise(ts.stderr);
123
+ return {
124
+ name: python.name,
125
+ exitMismatch: python.exitCode !== ts.exitCode,
126
+ stdoutMismatch: pyOut !== tsOut,
127
+ stderrMismatch: pyErr !== tsErr,
128
+ pythonExit: python.exitCode,
129
+ tsExit: ts.exitCode,
130
+ };
131
+ }
132
+ export function runParity(deftRoot = resolveDeftRoot()) {
133
+ const gates = [];
134
+ for (const name of PARITY_GATES) {
135
+ const python = capturePythonGate(name, deftRoot);
136
+ const ts = captureTsGate(name, deftRoot);
137
+ gates.push(diffGate(python, ts));
138
+ }
139
+ const ok = gates.every((g) => !g.exitMismatch && !g.stdoutMismatch && !g.stderrMismatch);
140
+ return { ok, gates };
141
+ }
142
+ export function renderReport(result) {
143
+ if (result.ok) {
144
+ return `verify-source parity: CLEAN -- Python and TS agree on ${PARITY_GATES.length} gate(s).`;
145
+ }
146
+ const lines = ["verify-source parity: DIVERGENCE"];
147
+ for (const g of result.gates) {
148
+ if (g.exitMismatch || g.stdoutMismatch || g.stderrMismatch) {
149
+ lines.push(` gate: ${g.name}`);
150
+ if (g.exitMismatch) {
151
+ lines.push(` exit: python=${g.pythonExit} ts=${g.tsExit}`);
152
+ }
153
+ if (g.stdoutMismatch) {
154
+ lines.push(" stdout mismatch");
155
+ }
156
+ if (g.stderrMismatch) {
157
+ lines.push(" stderr mismatch");
158
+ }
159
+ }
160
+ }
161
+ return lines.join("\n");
162
+ }
163
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
164
+ try {
165
+ const result = runParity();
166
+ if (result.ok) {
167
+ process.stdout.write(`${renderReport(result)}\n`);
168
+ process.exit(0);
169
+ }
170
+ process.stderr.write(`${renderReport(result)}\n`);
171
+ process.exit(1);
172
+ }
173
+ catch (err) {
174
+ process.stderr.write(`verify-source parity: harness error -- ${String(err)}\n`);
175
+ process.exit(2);
176
+ }
177
+ }
178
+ //# sourceMappingURL=verify-source-parity.js.map
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ vbriefPath: string | null;
4
+ projectRoot: string;
5
+ allocationContext: string | null;
6
+ allowDirty: boolean;
7
+ emitJson: boolean;
8
+ help?: boolean;
9
+ error?: string;
10
+ }
11
+ /** Parse verify-story-ready CLI args, mirroring the Python argparse surface. */
12
+ export declare function parseArgs(argv: string[]): ParsedArgs;
13
+ /** Run the gate and return the process exit code. */
14
+ export declare function run(argv: string[]): number;
15
+ export {};
16
+ //# sourceMappingURL=verify-story-ready.d.ts.map