opencode-agent-orchestration-kit 1.0.32 → 1.0.37

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 (88) hide show
  1. package/README.md +73 -4
  2. package/SECURITY.md +7 -0
  3. package/docs/cli.md +100 -0
  4. package/docs/installation.md +25 -5
  5. package/docs/quickstart.md +1 -1
  6. package/docs/releases/v1.0.33.md +72 -0
  7. package/docs/releases/v1.0.34.md +59 -0
  8. package/docs/releases/v1.0.35.md +62 -0
  9. package/docs/releases/v1.0.36.md +58 -0
  10. package/docs/releases/v1.0.37.md +53 -0
  11. package/docs/security.md +4 -0
  12. package/docs/supply-chain.md +9 -5
  13. package/docs/threat-model.md +244 -0
  14. package/docs/use-cases/README.md +31 -0
  15. package/docs/use-cases/direct-label-change/README.md +76 -0
  16. package/docs/use-cases/direct-label-change/before/package.json +8 -0
  17. package/docs/use-cases/direct-label-change/before/src/settings-label.mjs +1 -0
  18. package/docs/use-cases/direct-label-change/before/test/settings-label.test.mjs +8 -0
  19. package/docs/use-cases/direct-label-change/case.json +118 -0
  20. package/docs/use-cases/direct-label-change/expected/package.json +8 -0
  21. package/docs/use-cases/direct-label-change/expected/src/settings-label.mjs +1 -0
  22. package/docs/use-cases/direct-label-change/expected/test/settings-label.test.mjs +8 -0
  23. package/docs/use-cases/feature-tag-normalizer/README.md +78 -0
  24. package/docs/use-cases/feature-tag-normalizer/before/package.json +8 -0
  25. package/docs/use-cases/feature-tag-normalizer/before/src/normalize-tags.mjs +3 -0
  26. package/docs/use-cases/feature-tag-normalizer/before/test/normalize-tags.test.mjs +13 -0
  27. package/docs/use-cases/feature-tag-normalizer/case.json +119 -0
  28. package/docs/use-cases/feature-tag-normalizer/expected/package.json +8 -0
  29. package/docs/use-cases/feature-tag-normalizer/expected/src/normalize-tags.mjs +14 -0
  30. package/docs/use-cases/feature-tag-normalizer/expected/test/normalize-tags.test.mjs +18 -0
  31. package/docs/workflows.md +6 -0
  32. package/opencode/agents/lead.md +11 -2
  33. package/opencode/agents/review_api.md +26 -9
  34. package/opencode/agents/review_coordinator.md +60 -68
  35. package/opencode/agents/review_quality.md +27 -11
  36. package/opencode/agents/review_security.md +26 -10
  37. package/opencode/agents/review_tests.md +26 -9
  38. package/opencode/agents/reviewer.md +95 -80
  39. package/opencode/commands/autonomous.md +75 -0
  40. package/opencode/commands/evolve.md +3 -1
  41. package/opencode/commands/feature.md +6 -2
  42. package/opencode/commands/loop.md +12 -8
  43. package/opencode/commands/review-orchestrated.md +26 -24
  44. package/opencode/commands/review-preflight.md +8 -7
  45. package/opencode/commands/review.md +27 -10
  46. package/opencode/docs/ai/harness/README.md +5 -0
  47. package/opencode/docs/ai/harness/agents.md +27 -3
  48. package/opencode/docs/ai/harness/checks.md +18 -0
  49. package/opencode/docs/ai/harness/commands.md +44 -0
  50. package/opencode/docs/ai/harness/orchestrated-review.md +8 -1
  51. package/opencode/docs/ai/harness/orchestration-contracts.json +924 -0
  52. package/opencode/package-lock.json +14 -8
  53. package/opencode/package.json +1 -0
  54. package/opencode/plugins/shell-export-guard.ts +23 -0
  55. package/opencode/scripts/adversarial-harness.test.mjs +5 -2
  56. package/opencode/scripts/check-harness.mjs +873 -18
  57. package/opencode/scripts/check-harness.test.mjs +562 -0
  58. package/opencode/scripts/loop-state.mjs +88 -14
  59. package/opencode/scripts/loop-state.test.mjs +82 -5
  60. package/opencode/scripts/review-orchestrated-prepare.mjs +18 -1
  61. package/opencode/scripts/review-orchestrated-prepare.test.mjs +49 -0
  62. package/opencode/scripts/shell-export-policy.d.mts +4 -0
  63. package/opencode/scripts/shell-export-policy.mjs +272 -0
  64. package/opencode/scripts/shell-export-policy.test.mjs +96 -0
  65. package/opencode/skills/code-review-and-quality/SKILL.md +63 -321
  66. package/opencode/skills/code-review-and-quality/references/profiles/backend-clean-ddd-cqrs.md +60 -0
  67. package/opencode/skills/code-review-and-quality/references/profiles/backend.md +54 -0
  68. package/opencode/skills/code-review-and-quality/references/profiles/frontend-clean-layered.md +60 -0
  69. package/opencode/skills/code-review-and-quality/references/profiles/frontend.md +62 -0
  70. package/opencode/skills/code-review-and-quality/references/review-policy.md +258 -0
  71. package/package.json +5 -2
  72. package/scripts/check-supply-chain.mjs +16 -2
  73. package/scripts/check-supply-chain.test.mjs +52 -1
  74. package/scripts/check-threat-model.mjs +421 -0
  75. package/scripts/check-threat-model.test.mjs +304 -0
  76. package/scripts/check-use-cases.mjs +501 -0
  77. package/scripts/check-use-cases.test.mjs +225 -0
  78. package/scripts/check.sh +55 -1
  79. package/scripts/install-smoke.sh +24 -1
  80. package/scripts/manage-installation.mjs +567 -25
  81. package/scripts/manage-installation.test.mjs +418 -0
  82. package/scripts/oak.mjs +246 -0
  83. package/scripts/oak.test.mjs +329 -0
  84. package/scripts/package-smoke.mjs +57 -0
  85. package/scripts/package-smoke.test.mjs +75 -2
  86. package/scripts/version.mjs +1 -0
  87. package/scripts/version.test.mjs +3 -2
  88. package/supply-chain.json +1 -0
@@ -0,0 +1,501 @@
1
+ import {
2
+ lstatSync,
3
+ readFileSync,
4
+ readdirSync,
5
+ } from "node:fs";
6
+ import { spawnSync } from "node:child_process";
7
+ import { dirname, join, relative, resolve } from "node:path";
8
+ import { fileURLToPath } from "node:url";
9
+
10
+ const CASE_IDS = ["direct-label-change", "feature-tag-normalizer"];
11
+ const VARIANT_IDS = ["harness", "reduced"];
12
+ const RESULTS = new Set(["pass", "fail", "inconclusive"]);
13
+ const VALIDATION_STATUSES = new Set(["pass", "fail", "not-run"]);
14
+ const TOKEN_STATUSES = new Set(["measured", "unavailable"]);
15
+ const FORBIDDEN_FLAGS = new Set([
16
+ "--auto",
17
+ "--share",
18
+ "--attach",
19
+ "--continue",
20
+ "--session",
21
+ "--model",
22
+ "--provider",
23
+ "--variant",
24
+ "--username",
25
+ "--password",
26
+ ]);
27
+ const AGENTS = new Set([
28
+ "debugger",
29
+ "designer",
30
+ "developer",
31
+ "evaluator",
32
+ "evolver",
33
+ "lead",
34
+ "researcher",
35
+ "review_api",
36
+ "review_coordinator",
37
+ "review_quality",
38
+ "review_security",
39
+ "review_tests",
40
+ "reviewer",
41
+ "scoper",
42
+ "specifier",
43
+ ]);
44
+ const README_HEADINGS = [
45
+ "Objective",
46
+ "Why this workflow",
47
+ "Initial tree",
48
+ "Expected change",
49
+ "Isolated preparation",
50
+ "Harness command",
51
+ "Reduced command",
52
+ "Expected and observed agents",
53
+ "Validation",
54
+ "Human intervention",
55
+ "Invocations and correction cycles",
56
+ "Tokens and cost",
57
+ "Result",
58
+ "Comparison",
59
+ "Limitations",
60
+ "Cleanup",
61
+ ];
62
+ const PRIVATE_MARKERS = [
63
+ ["", "Users", ""].join("/"),
64
+ [".config", "opencode"].join("/"),
65
+ ["auth", "json"].join("."),
66
+ ["OPENAI", "API", "KEY"].join("_"),
67
+ ["NAN", "API", "KEY"].join("_"),
68
+ ["nan", "web", "search"].join("-"),
69
+ ["sear", "xng"].join(""),
70
+ ["SEAR", "XNG", "URL"].join("_"),
71
+ ["syn", "ology", ".", "me"].join(""),
72
+ ];
73
+ const TOP_KEYS = [
74
+ "schema_version",
75
+ "id",
76
+ "objective",
77
+ "prompt",
78
+ "workflow",
79
+ "observation",
80
+ "fixture",
81
+ "variants",
82
+ "comparison",
83
+ ];
84
+ const OBSERVATION_KEYS = [
85
+ "date",
86
+ "opencode_version",
87
+ "same_model_selection",
88
+ "model_provider_identity",
89
+ ];
90
+ const FIXTURE_KEYS = ["before", "expected", "validation"];
91
+ const VARIANT_KEYS = [
92
+ "id",
93
+ "command",
94
+ "expected_agents",
95
+ "observed_agents",
96
+ "human_interventions",
97
+ "top_level_invocations",
98
+ "correction_cycles",
99
+ "validation_results",
100
+ "tokens",
101
+ "result",
102
+ "limitations",
103
+ ];
104
+ const VALIDATION_KEYS = ["command", "status"];
105
+ const TOKEN_KEYS = ["status", "value", "reason"];
106
+ const COMPARISON_KEYS = [
107
+ "outcome",
108
+ "orchestration",
109
+ "evidence",
110
+ "limitations",
111
+ ];
112
+ const VALIDATIONS = ["npm test", "git diff --check"];
113
+
114
+ function fail(message) {
115
+ throw new Error(message);
116
+ }
117
+
118
+ function assertObject(value, label) {
119
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
120
+ fail(`${label} must be an object`);
121
+ }
122
+ }
123
+
124
+ function assertExactKeys(value, expected, label) {
125
+ assertObject(value, label);
126
+ const actual = Object.keys(value).sort();
127
+ const wanted = [...expected].sort();
128
+ if (JSON.stringify(actual) !== JSON.stringify(wanted)) {
129
+ fail(`${label} has missing or unknown keys`);
130
+ }
131
+ }
132
+
133
+ function assertNonEmptyString(value, label) {
134
+ if (typeof value !== "string" || value.trim() === "") {
135
+ fail(`${label} must be a non-empty string`);
136
+ }
137
+ }
138
+
139
+ function assertStringArray(value, label, { allowEmpty = false } = {}) {
140
+ if (
141
+ !Array.isArray(value) ||
142
+ (!allowEmpty && value.length === 0) ||
143
+ value.some((item) => typeof item !== "string" || item.trim() === "")
144
+ ) {
145
+ fail(`${label} must be ${allowEmpty ? "an" : "a non-empty"} string array`);
146
+ }
147
+ }
148
+
149
+ function expectedCommand(caseId, variantId, prompt) {
150
+ if (variantId === "reduced") {
151
+ return [
152
+ "opencode",
153
+ "run",
154
+ "--agent",
155
+ "developer",
156
+ "--format",
157
+ "json",
158
+ "--thinking",
159
+ "--dir",
160
+ "<case-dir>",
161
+ prompt,
162
+ ];
163
+ }
164
+ if (caseId === "feature-tag-normalizer") {
165
+ return [
166
+ "opencode",
167
+ "run",
168
+ "--command",
169
+ "feature",
170
+ "--format",
171
+ "json",
172
+ "--thinking",
173
+ "--dir",
174
+ "<case-dir>",
175
+ prompt,
176
+ ];
177
+ }
178
+ return [
179
+ "opencode",
180
+ "run",
181
+ "--format",
182
+ "json",
183
+ "--thinking",
184
+ "--dir",
185
+ "<case-dir>",
186
+ prompt,
187
+ ];
188
+ }
189
+
190
+ function validateAgents(agents, label) {
191
+ assertStringArray(agents, label, { allowEmpty: label.includes("observed") });
192
+ for (const agent of agents) {
193
+ if (!AGENTS.has(agent)) {
194
+ fail(`${label} contains unknown agent`);
195
+ }
196
+ }
197
+ }
198
+
199
+ function validateValidationResults(results, label) {
200
+ if (!Array.isArray(results) || results.length !== VALIDATIONS.length) {
201
+ fail(`${label} has incomplete validation results`);
202
+ }
203
+ results.forEach((entry, index) => {
204
+ assertExactKeys(entry, VALIDATION_KEYS, `${label}[${index}]`);
205
+ if (entry.command !== VALIDATIONS[index]) {
206
+ fail(`${label} has unexpected validation results`);
207
+ }
208
+ if (!VALIDATION_STATUSES.has(entry.status)) {
209
+ fail(`${label} has invalid validation status`);
210
+ }
211
+ });
212
+ }
213
+
214
+ function validateTokens(tokens, label) {
215
+ assertExactKeys(tokens, TOKEN_KEYS, label);
216
+ if (!TOKEN_STATUSES.has(tokens.status)) {
217
+ fail(`${label} has invalid token status`);
218
+ }
219
+ assertNonEmptyString(tokens.reason, `${label}.reason`);
220
+ if (tokens.status === "unavailable" && tokens.value !== null) {
221
+ fail(`${label} unavailable token value must be null`);
222
+ }
223
+ if (
224
+ tokens.status === "measured" &&
225
+ (!Number.isInteger(tokens.value) || tokens.value < 0)
226
+ ) {
227
+ fail(`${label} measured token value must be a non-negative integer`);
228
+ }
229
+ }
230
+
231
+ export function validateCaseManifest(manifest, context) {
232
+ const caseId = context?.caseId;
233
+ if (!CASE_IDS.includes(caseId)) {
234
+ fail("unknown case ID");
235
+ }
236
+ assertExactKeys(manifest, TOP_KEYS, `${caseId} manifest`);
237
+ if (manifest.schema_version !== 1 || manifest.id !== caseId) {
238
+ fail(`${caseId} has invalid schema version or ID`);
239
+ }
240
+ assertNonEmptyString(manifest.objective, `${caseId} objective`);
241
+ assertNonEmptyString(manifest.prompt, `${caseId} prompt`);
242
+ const expectedWorkflow =
243
+ caseId === "direct-label-change" ? "direct-development" : "feature";
244
+ if (manifest.workflow !== expectedWorkflow) {
245
+ fail(`${caseId} has invalid workflow`);
246
+ }
247
+
248
+ assertExactKeys(
249
+ manifest.observation,
250
+ OBSERVATION_KEYS,
251
+ `${caseId} observation`,
252
+ );
253
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(manifest.observation.date)) {
254
+ fail(`${caseId} observation has invalid date`);
255
+ }
256
+ if (!/^\d+\.\d+\.\d+$/.test(manifest.observation.opencode_version)) {
257
+ fail(`${caseId} observation has invalid OpenCode version`);
258
+ }
259
+ if (
260
+ manifest.observation.same_model_selection !== true ||
261
+ manifest.observation.model_provider_identity !== "omitted"
262
+ ) {
263
+ fail(`${caseId} observation violates model privacy or comparability`);
264
+ }
265
+
266
+ assertExactKeys(manifest.fixture, FIXTURE_KEYS, `${caseId} fixture`);
267
+ if (
268
+ manifest.fixture.before !== "before" ||
269
+ manifest.fixture.expected !== "expected" ||
270
+ JSON.stringify(manifest.fixture.validation) !== JSON.stringify(VALIDATIONS)
271
+ ) {
272
+ fail(`${caseId} has invalid fixture contract`);
273
+ }
274
+
275
+ if (!Array.isArray(manifest.variants)) {
276
+ fail(`${caseId} variants must be an array`);
277
+ }
278
+ const variantIds = manifest.variants.map((variant) => variant?.id).sort();
279
+ if (JSON.stringify(variantIds) !== JSON.stringify([...VARIANT_IDS].sort())) {
280
+ fail(`${caseId} must have exact unique variant IDs`);
281
+ }
282
+
283
+ for (const variant of manifest.variants) {
284
+ const label = `${caseId} ${variant.id}`;
285
+ assertExactKeys(variant, VARIANT_KEYS, label);
286
+ if (
287
+ !Array.isArray(variant.command) ||
288
+ variant.command.some((part) => typeof part !== "string")
289
+ ) {
290
+ fail(`${label} command must be string argv`);
291
+ }
292
+ const forbidden = variant.command.find((part) => FORBIDDEN_FLAGS.has(part));
293
+ if (forbidden) {
294
+ fail(`${label} contains forbidden flag`);
295
+ }
296
+ if (
297
+ JSON.stringify(variant.command) !==
298
+ JSON.stringify(expectedCommand(caseId, variant.id, manifest.prompt))
299
+ ) {
300
+ fail(`${label} command shape or prompt is invalid`);
301
+ }
302
+
303
+ const expectedAgents =
304
+ variant.id === "reduced"
305
+ ? ["developer"]
306
+ : caseId === "direct-label-change"
307
+ ? ["lead", "developer"]
308
+ : ["lead", "specifier", "developer", "reviewer"];
309
+ if (
310
+ JSON.stringify(variant.expected_agents) !==
311
+ JSON.stringify(expectedAgents)
312
+ ) {
313
+ fail(`${label} expected agents are invalid`);
314
+ }
315
+ validateAgents(variant.expected_agents, `${label} expected agents`);
316
+ validateAgents(variant.observed_agents, `${label} observed agents`);
317
+ assertStringArray(variant.human_interventions, `${label} interventions`, {
318
+ allowEmpty: true,
319
+ });
320
+ if (
321
+ !Number.isInteger(variant.top_level_invocations) ||
322
+ variant.top_level_invocations < 0 ||
323
+ !Number.isInteger(variant.correction_cycles) ||
324
+ variant.correction_cycles < 0
325
+ ) {
326
+ fail(`${label} has invalid invocation counts`);
327
+ }
328
+ validateValidationResults(
329
+ variant.validation_results,
330
+ `${label} validation results`,
331
+ );
332
+ validateTokens(variant.tokens, `${label} tokens`);
333
+ if (!RESULTS.has(variant.result)) {
334
+ fail(`${label} has invalid result`);
335
+ }
336
+ assertStringArray(variant.limitations, `${label} limitations`);
337
+ }
338
+
339
+ assertExactKeys(manifest.comparison, COMPARISON_KEYS, `${caseId} comparison`);
340
+ assertNonEmptyString(manifest.comparison.outcome, `${caseId} outcome`);
341
+ assertNonEmptyString(
342
+ manifest.comparison.orchestration,
343
+ `${caseId} orchestration`,
344
+ );
345
+ if (manifest.comparison.evidence !== "live_smoke") {
346
+ fail(`${caseId} comparison evidence must be live_smoke`);
347
+ }
348
+ assertStringArray(
349
+ manifest.comparison.limitations,
350
+ `${caseId} comparison limitations`,
351
+ );
352
+
353
+ const serialized = JSON.stringify(manifest);
354
+ if (PRIVATE_MARKERS.some((marker) => serialized.includes(marker))) {
355
+ fail(`${caseId} manifest contains a private marker`);
356
+ }
357
+ }
358
+
359
+ function walkRegularFiles(directory, root = directory) {
360
+ const files = [];
361
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
362
+ const path = join(directory, entry.name);
363
+ const status = lstatSync(path);
364
+ if (status.isSymbolicLink()) {
365
+ fail(`use-case tree contains a symlink at ${relative(root, path)}`);
366
+ }
367
+ if (status.isDirectory()) {
368
+ files.push(...walkRegularFiles(path, root));
369
+ } else if (status.isFile()) {
370
+ files.push(path);
371
+ } else {
372
+ fail("use-case tree contains a non-regular entry");
373
+ }
374
+ }
375
+ return files;
376
+ }
377
+
378
+ function validateFixture(caseRoot, caseId, state, runFixtures) {
379
+ const fixtureRoot = join(caseRoot, state);
380
+ const expectedStem =
381
+ caseId === "direct-label-change" ? "settings-label" : "normalize-tags";
382
+ const expectedFiles = [
383
+ "package.json",
384
+ `src/${expectedStem}.mjs`,
385
+ `test/${expectedStem}.test.mjs`,
386
+ ];
387
+ const actualFiles = walkRegularFiles(fixtureRoot, fixtureRoot)
388
+ .map((path) => relative(fixtureRoot, path))
389
+ .sort();
390
+ if (
391
+ JSON.stringify(actualFiles) !== JSON.stringify([...expectedFiles].sort())
392
+ ) {
393
+ fail(`${caseId} ${state} fixture files are invalid`);
394
+ }
395
+
396
+ let pkg;
397
+ try {
398
+ pkg = JSON.parse(readFileSync(join(fixtureRoot, "package.json"), "utf8"));
399
+ } catch {
400
+ fail(`${caseId} ${state} package must be valid JSON`);
401
+ }
402
+ for (const key of [
403
+ "dependencies",
404
+ "devDependencies",
405
+ "optionalDependencies",
406
+ "peerDependencies",
407
+ ]) {
408
+ if (key in pkg) {
409
+ fail(`${caseId} ${state} fixture must not declare dependencies`);
410
+ }
411
+ }
412
+ if (pkg.private !== true || pkg.type !== "module") {
413
+ fail(`${caseId} ${state} fixture package contract is invalid`);
414
+ }
415
+ if (
416
+ !pkg.scripts ||
417
+ Object.keys(pkg.scripts).length !== 1 ||
418
+ pkg.scripts.test !== "node --test"
419
+ ) {
420
+ fail(`${caseId} ${state} fixture test script must be node --test`);
421
+ }
422
+
423
+ if (runFixtures) {
424
+ const result = spawnSync("npm", ["test"], {
425
+ cwd: fixtureRoot,
426
+ encoding: "utf8",
427
+ shell: false,
428
+ timeout: 30_000,
429
+ env: {
430
+ PATH: process.env.PATH ?? "",
431
+ CI: "1",
432
+ LANG: "C",
433
+ LC_ALL: "C",
434
+ },
435
+ });
436
+ if (result.status !== 0) {
437
+ fail(`${caseId} ${state} fixture tests failed`);
438
+ }
439
+ }
440
+ }
441
+
442
+ export function loadAndValidateUseCases(root, options = {}) {
443
+ const useCasesRoot = join(root, "docs", "use-cases");
444
+ const rootEntries = readdirSync(useCasesRoot, { withFileTypes: true });
445
+ const caseDirectories = rootEntries
446
+ .filter((entry) => entry.isDirectory())
447
+ .map((entry) => entry.name)
448
+ .sort();
449
+ if (
450
+ JSON.stringify(caseDirectories) !== JSON.stringify([...CASE_IDS].sort())
451
+ ) {
452
+ fail("use-case index must contain the exact case directories");
453
+ }
454
+ const files = walkRegularFiles(useCasesRoot);
455
+ for (const path of files) {
456
+ const content = readFileSync(path, "utf8");
457
+ if (PRIVATE_MARKERS.some((marker) => content.includes(marker))) {
458
+ fail("use-case tree contains a private marker");
459
+ }
460
+ }
461
+
462
+ for (const caseId of CASE_IDS) {
463
+ const caseRoot = join(useCasesRoot, caseId);
464
+ const readme = readFileSync(join(caseRoot, "README.md"), "utf8");
465
+ for (const heading of README_HEADINGS) {
466
+ if (!readme.includes(`## ${heading}\n`)) {
467
+ fail(`${caseId} README heading is missing`);
468
+ }
469
+ }
470
+ let manifest;
471
+ try {
472
+ manifest = JSON.parse(readFileSync(join(caseRoot, "case.json"), "utf8"));
473
+ } catch {
474
+ fail(`${caseId} manifest must be valid JSON`);
475
+ }
476
+ validateCaseManifest(manifest, { caseId });
477
+ for (const state of ["before", "expected"]) {
478
+ validateFixture(caseRoot, caseId, state, options.runFixtures !== false);
479
+ }
480
+ }
481
+
482
+ return {
483
+ cases: CASE_IDS.length,
484
+ variants: CASE_IDS.length * VARIANT_IDS.length,
485
+ fixtureRepositories: CASE_IDS.length * 2,
486
+ };
487
+ }
488
+
489
+ const scriptPath = process.argv[1] ? resolve(process.argv[1]) : "";
490
+ if (scriptPath === fileURLToPath(import.meta.url)) {
491
+ try {
492
+ const root = dirname(dirname(fileURLToPath(import.meta.url)));
493
+ const summary = loadAndValidateUseCases(root);
494
+ console.log(
495
+ `Use-case check passed: ${summary.cases} cases, ${summary.variants} variants, ${summary.fixtureRepositories} fixture repositories.`,
496
+ );
497
+ } catch (error) {
498
+ console.error(`Use-case check failed: ${error.message}`);
499
+ process.exitCode = 1;
500
+ }
501
+ }