@lumenflow/cli 3.12.5 → 3.12.6

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 (123) hide show
  1. package/dist/chunk-2D2VOCA4.js +37 -0
  2. package/dist/chunk-2D5KFYGX.js +284 -0
  3. package/dist/chunk-2GXVIN57.js +14072 -0
  4. package/dist/chunk-2MQ7HZWZ.js +26 -0
  5. package/dist/chunk-2UFQ3A3C.js +643 -0
  6. package/dist/chunk-3RG5ZIWI.js +10 -0
  7. package/dist/chunk-4N74J3UT.js +15 -0
  8. package/dist/chunk-5GTOXFYR.js +392 -0
  9. package/dist/chunk-5VY6MQMC.js +240 -0
  10. package/dist/chunk-67XVPMRY.js +1297 -0
  11. package/dist/chunk-6HO4GWJE.js +164 -0
  12. package/dist/chunk-6W5XHWYV.js +1890 -0
  13. package/dist/chunk-6X4EMYJQ.js +64 -0
  14. package/dist/chunk-6XYXI2NQ.js +772 -0
  15. package/dist/chunk-7ANSOV6Q.js +285 -0
  16. package/dist/chunk-A624LFLB.js +1380 -0
  17. package/dist/chunk-ADN5NHG4.js +126 -0
  18. package/dist/chunk-B7YJYJKG.js +33 -0
  19. package/dist/chunk-CCLHCPKG.js +210 -0
  20. package/dist/chunk-CK36VROC.js +1584 -0
  21. package/dist/chunk-D3UOFRSB.js +81 -0
  22. package/dist/chunk-DFR4DJBM.js +230 -0
  23. package/dist/chunk-DSYBDHYH.js +79 -0
  24. package/dist/chunk-DWMLTXKQ.js +1176 -0
  25. package/dist/chunk-E3REJTAJ.js +28 -0
  26. package/dist/chunk-EA3IVO64.js +633 -0
  27. package/dist/chunk-EK2AKZKD.js +55 -0
  28. package/dist/chunk-ELD7JTTT.js +343 -0
  29. package/dist/chunk-EX6TT2XI.js +195 -0
  30. package/dist/chunk-EXINSFZE.js +82 -0
  31. package/dist/chunk-EZ6ZBYBM.js +510 -0
  32. package/dist/chunk-FBKAPTJ2.js +16 -0
  33. package/dist/chunk-FVLV5RYH.js +1118 -0
  34. package/dist/chunk-GDNSBQVK.js +2485 -0
  35. package/dist/chunk-GPQHMBNN.js +278 -0
  36. package/dist/chunk-GTFJB67L.js +68 -0
  37. package/dist/chunk-HANJXVKW.js +1127 -0
  38. package/dist/chunk-HEVS5YLD.js +269 -0
  39. package/dist/chunk-HMEVZKPQ.js +9 -0
  40. package/dist/chunk-HRGSYNLM.js +3511 -0
  41. package/dist/chunk-ISZR5N4K.js +60 -0
  42. package/dist/chunk-J6SUPR2C.js +226 -0
  43. package/dist/chunk-JERYVEIZ.js +244 -0
  44. package/dist/chunk-JHHWGL2N.js +87 -0
  45. package/dist/chunk-JONWQUB5.js +775 -0
  46. package/dist/chunk-K2DIWWDM.js +1766 -0
  47. package/dist/chunk-KY4PGL5V.js +969 -0
  48. package/dist/chunk-L737LQ4C.js +1285 -0
  49. package/dist/chunk-LFTWYIB2.js +497 -0
  50. package/dist/chunk-LV47RFNJ.js +41 -0
  51. package/dist/chunk-MKSAITI7.js +15 -0
  52. package/dist/chunk-MZ7RKIX4.js +212 -0
  53. package/dist/chunk-NAP6CFSO.js +84 -0
  54. package/dist/chunk-ND6MY37M.js +16 -0
  55. package/dist/chunk-NMG736UR.js +683 -0
  56. package/dist/chunk-NRAXROED.js +32 -0
  57. package/dist/chunk-NRIZR3A7.js +690 -0
  58. package/dist/chunk-NX43BG3M.js +233 -0
  59. package/dist/chunk-O645XLSI.js +297 -0
  60. package/dist/chunk-OMJD6A3S.js +235 -0
  61. package/dist/chunk-QB6SJD4T.js +430 -0
  62. package/dist/chunk-QFSTL4J3.js +276 -0
  63. package/dist/chunk-QLGDFMFX.js +212 -0
  64. package/dist/chunk-RIAAGL2E.js +13 -0
  65. package/dist/chunk-RWO5XMZ6.js +86 -0
  66. package/dist/chunk-RXRKBBSM.js +149 -0
  67. package/dist/chunk-RZOZMML6.js +363 -0
  68. package/dist/chunk-U7I7FS7T.js +113 -0
  69. package/dist/chunk-UI42RODY.js +717 -0
  70. package/dist/chunk-UTVMVSCO.js +519 -0
  71. package/dist/chunk-V6OJGLBA.js +1746 -0
  72. package/dist/chunk-W2JHVH7D.js +152 -0
  73. package/dist/chunk-WD3Y7VQN.js +280 -0
  74. package/dist/chunk-WOCTQ5MS.js +303 -0
  75. package/dist/chunk-WZR3ZUNN.js +696 -0
  76. package/dist/chunk-XGI665H7.js +150 -0
  77. package/dist/chunk-XKY65P2T.js +304 -0
  78. package/dist/chunk-Y4CQZY65.js +57 -0
  79. package/dist/chunk-YFEXKLVE.js +194 -0
  80. package/dist/chunk-YHO3HS5X.js +287 -0
  81. package/dist/chunk-YLS7AZSX.js +738 -0
  82. package/dist/chunk-ZE473AO6.js +49 -0
  83. package/dist/chunk-ZF747T3O.js +644 -0
  84. package/dist/chunk-ZHCZHZH3.js +43 -0
  85. package/dist/chunk-ZZNZX2XY.js +87 -0
  86. package/dist/constants-7QAP3VQ4.js +23 -0
  87. package/dist/dist-IY3UUMWK.js +33 -0
  88. package/dist/init-templates.js +9 -9
  89. package/dist/invariants-runner-W5RGHCSU.js +27 -0
  90. package/dist/lane-lock-6J36HD5O.js +35 -0
  91. package/dist/mem-checkpoint-core-EANG2GVN.js +14 -0
  92. package/dist/mem-signal-core-2LZ2WYHW.js +19 -0
  93. package/dist/memory-store-OLB5FO7K.js +18 -0
  94. package/dist/service-6BYCOCO5.js +13 -0
  95. package/dist/spawn-policy-resolver-NTSZYQ6R.js +17 -0
  96. package/dist/spawn-task-builder-R4E2BHSW.js +22 -0
  97. package/dist/wu-claim.js +2 -2
  98. package/dist/wu-claim.js.map +1 -1
  99. package/dist/wu-done-gates.js +25 -4
  100. package/dist/wu-done-gates.js.map +1 -1
  101. package/dist/wu-done-ownership.js +6 -1
  102. package/dist/wu-done-ownership.js.map +1 -1
  103. package/dist/wu-done-pr-WLFFFEPJ.js +25 -0
  104. package/dist/wu-done-validation-3J5E36FE.js +30 -0
  105. package/dist/wu-done.js +6 -6
  106. package/dist/wu-done.js.map +1 -1
  107. package/dist/wu-duplicate-id-detector-5S7JHELK.js +232 -0
  108. package/dist/wu-edit-operations.js +58 -17
  109. package/dist/wu-edit-operations.js.map +1 -1
  110. package/dist/wu-edit-validators.js +104 -28
  111. package/dist/wu-edit-validators.js.map +1 -1
  112. package/dist/wu-edit.js +1 -1
  113. package/dist/wu-edit.js.map +1 -1
  114. package/dist/wu-spawn-prompt-builders.js +8 -7
  115. package/dist/wu-spawn-prompt-builders.js.map +1 -1
  116. package/package.json +8 -8
  117. package/packs/sidekick/.turbo/turbo-build.log +1 -1
  118. package/packs/sidekick/package.json +1 -1
  119. package/packs/software-delivery/.turbo/turbo-build.log +1 -1
  120. package/packs/software-delivery/package.json +1 -1
  121. package/templates/core/LUMENFLOW.md.template +1 -1
  122. package/templates/core/ai/onboarding/quick-ref-commands.md.template +3 -3
  123. package/templates/core/ai/onboarding/starting-prompt.md.template +11 -11
@@ -0,0 +1,1746 @@
1
+ import {
2
+ ErrorCodes,
3
+ createError
4
+ } from "./chunk-RXRKBBSM.js";
5
+
6
+ // ../core/dist/wu-statuses.js
7
+ var WU_STATUS = {
8
+ // Unclaimed statuses (not yet entered state machine)
9
+ // WU-1374: Legacy backlog status value
10
+ TODO: "todo",
11
+ READY: "ready",
12
+ // Canonical unclaimed status
13
+ BACKLOG: "backlog",
14
+ // Legacy variant of ready
15
+ // Active statuses (in state machine)
16
+ IN_PROGRESS: "in_progress",
17
+ BLOCKED: "blocked",
18
+ // Terminal statuses (work finished, no further transitions)
19
+ DONE: "done",
20
+ // Canonical terminal status
21
+ COMPLETED: "completed",
22
+ // Legacy variant of done
23
+ CANCELLED: "cancelled",
24
+ ABANDONED: "abandoned",
25
+ DEFERRED: "deferred",
26
+ CLOSED: "closed",
27
+ SUPERSEDED: "superseded"
28
+ };
29
+ var WU_STATUS_FALLBACK = {
30
+ UNKNOWN: "unknown"
31
+ };
32
+ var WU_STATUS_SET = new Set(Object.values(WU_STATUS));
33
+ function isWUStatus(value) {
34
+ return typeof value === "string" && WU_STATUS_SET.has(value);
35
+ }
36
+ function resolveWUStatus(value, fallback = WU_STATUS.READY) {
37
+ return isWUStatus(value) ? value : fallback;
38
+ }
39
+ function getWUStatusDisplay(value) {
40
+ return isWUStatus(value) ? value : WU_STATUS_FALLBACK.UNKNOWN;
41
+ }
42
+ var PROTECTED_WU_STATUSES = [
43
+ WU_STATUS.IN_PROGRESS,
44
+ WU_STATUS.BLOCKED
45
+ ];
46
+ var PROGRESSABLE_WU_STATUSES = [WU_STATUS.IN_PROGRESS];
47
+ var WU_STATUS_GROUPS = {
48
+ /** Statuses representing unclaimed work (not tracked in state store) */
49
+ UNCLAIMED: [WU_STATUS.READY, WU_STATUS.TODO, WU_STATUS.BACKLOG],
50
+ /** Terminal statuses (all map to 'done' in state store) */
51
+ TERMINAL: [
52
+ WU_STATUS.DONE,
53
+ WU_STATUS.COMPLETED,
54
+ WU_STATUS.CANCELLED,
55
+ WU_STATUS.ABANDONED,
56
+ WU_STATUS.DEFERRED,
57
+ WU_STATUS.CLOSED,
58
+ WU_STATUS.SUPERSEDED
59
+ ]
60
+ };
61
+ var CLAIMED_MODES = {
62
+ /** Standard worktree mode (isolated worktree per WU) */
63
+ WORKTREE: "worktree",
64
+ /** Branch-only mode (no worktree, direct branch work) */
65
+ BRANCH_ONLY: "branch-only",
66
+ /** Worktree PR mode (worktree with manual PR workflow) */
67
+ WORKTREE_PR: "worktree-pr",
68
+ /** Branch PR mode (no worktree, PR-based completion for cloud agents) */
69
+ BRANCH_PR: "branch-pr"
70
+ };
71
+ var INCIDENT_SEVERITY = {
72
+ BLOCKER: "blocker",
73
+ MAJOR: "major",
74
+ MINOR: "minor",
75
+ INFO: "info"
76
+ };
77
+ var WU_TYPES = {
78
+ DOCUMENTATION: "documentation",
79
+ PROCESS: "process",
80
+ FEATURE: "feature",
81
+ TOOLING: "tooling",
82
+ BUG: "bug"
83
+ };
84
+ var WU_EXPOSURE = {
85
+ /** User-facing UI changes (pages, components, widgets) */
86
+ UI: "ui",
87
+ /** API endpoints that are called by UI or external clients */
88
+ API: "api",
89
+ /** Backend-only changes (no user visibility) */
90
+ BACKEND_ONLY: "backend-only",
91
+ /** Documentation changes only */
92
+ DOCUMENTATION: "documentation"
93
+ };
94
+ var WU_EXPOSURE_VALUES = ["ui", "api", "backend-only", "documentation"];
95
+ var TEST_TYPES = {
96
+ UNIT: "unit",
97
+ E2E: "e2e",
98
+ MANUAL: "manual",
99
+ INTEGRATION: "integration"
100
+ };
101
+
102
+ // ../core/dist/config-contract.js
103
+ var WORKSPACE_CONFIG_BASENAME = "workspace";
104
+ var YAML_FILE_EXTENSION = "yaml";
105
+ var WORKSPACE_CONFIG_FILE_NAME = `${WORKSPACE_CONFIG_BASENAME}.${YAML_FILE_EXTENSION}`;
106
+ var GIT_DIRECTORY_NAME = ".git";
107
+ var GIT_WORKTREES_DIRECTORY_NAME = "worktrees";
108
+ var GIT_WORKTREES_SEGMENT = `${GIT_DIRECTORY_NAME}/${GIT_WORKTREES_DIRECTORY_NAME}`;
109
+ var GIT_WORKTREES_SENTINEL = `/${GIT_WORKTREES_SEGMENT}/`;
110
+ var WORKSPACE_V2_KEYS = {
111
+ SOFTWARE_DELIVERY: "software_delivery",
112
+ CONTROL_PLANE: "control_plane"
113
+ };
114
+ var WRITABLE_ROOT_KEYS = /* @__PURE__ */ new Set([
115
+ "control_plane",
116
+ "memory_namespace",
117
+ "event_namespace"
118
+ ]);
119
+ var MANAGED_ROOT_KEYS = {
120
+ packs: "pack:install",
121
+ lanes: "lane:edit",
122
+ security: "security:set",
123
+ id: "workspace-init",
124
+ name: "workspace-init",
125
+ policies: "policy:set"
126
+ };
127
+
128
+ // ../core/dist/docs-layout-presets.js
129
+ function buildDocsLayout(operations, tasks) {
130
+ const frameworkRoot = `${operations}/_frameworks/lumenflow`;
131
+ const onboarding = `${frameworkRoot}/agent/onboarding`;
132
+ return {
133
+ operations,
134
+ tasks,
135
+ onboarding,
136
+ quickRefLink: `${onboarding}/quick-ref-commands.md`,
137
+ completeGuidePath: `${frameworkRoot}/lumenflow-complete.md`,
138
+ quickRefPath: `${onboarding}/quick-ref-commands.md`,
139
+ startingPromptPath: `${onboarding}/starting-prompt.md`,
140
+ sizingGuidePath: `${frameworkRoot}/wu-sizing-guide.md`,
141
+ governancePath: `${operations}/governance/project-governance.md`
142
+ };
143
+ }
144
+ var DOCS_ROOT = "docs";
145
+ var SIMPLE_TASKS_PATH = `${DOCS_ROOT}/tasks`;
146
+ var ARC42_OPERATIONS_PATH = [DOCS_ROOT, "04-operations"].join("/");
147
+ var ARC42_TASKS_PATH = [ARC42_OPERATIONS_PATH, "tasks"].join("/");
148
+ var DOCS_LAYOUT_PRESETS = {
149
+ simple: buildDocsLayout(DOCS_ROOT, SIMPLE_TASKS_PATH),
150
+ arc42: buildDocsLayout(ARC42_OPERATIONS_PATH, ARC42_TASKS_PATH)
151
+ };
152
+ var DEFAULT_DOCS_LAYOUT = "simple";
153
+ function getDocsLayoutPreset(layout) {
154
+ return DOCS_LAYOUT_PRESETS[layout];
155
+ }
156
+
157
+ // ../core/dist/client-ids.js
158
+ var LUMENFLOW_CLIENT_IDS = {
159
+ CLAUDE_CODE: "claude-code",
160
+ CODEX_CLI: "codex-cli",
161
+ CURSOR: "cursor",
162
+ GEMINI_CLI: "gemini-cli",
163
+ WINDSURF: "windsurf"
164
+ };
165
+
166
+ // ../core/dist/resolve-policy.js
167
+ import { z } from "zod";
168
+ var TestingMethodologySchema = z.enum(["tdd", "test-after", "none"]);
169
+ var ArchitectureMethodologySchema = z.enum(["hexagonal", "layered", "none"]);
170
+ var CoverageModeSchema = z.enum(["block", "warn", "off"]);
171
+ var MethodologyOverridesSchema = z.object({
172
+ /** Override the default coverage threshold from the testing methodology */
173
+ coverage_threshold: z.number().min(0).max(100).optional(),
174
+ /** Override the default coverage mode from the testing methodology */
175
+ coverage_mode: CoverageModeSchema.optional()
176
+ });
177
+ var WorkClassificationUiSchema = z.object({
178
+ /**
179
+ * Additional glob patterns for detecting UI work via code paths.
180
+ * These extend the built-in defaults (CSS, SCSS, LESS, components, pages, etc.).
181
+ * Uses minimatch glob syntax.
182
+ */
183
+ code_path_patterns: z.array(z.string()).optional(),
184
+ /**
185
+ * Additional lane parent hints for detecting UI work.
186
+ * These extend the built-in defaults (Experience, Frontend, UI, Design).
187
+ * Matched case-insensitively against the lane parent (part before the colon).
188
+ */
189
+ lane_hints: z.array(z.string()).optional()
190
+ });
191
+ var WorkClassificationConfigSchema = z.object({
192
+ /** UI detection pattern overrides (extend defaults) */
193
+ ui: WorkClassificationUiSchema.optional()
194
+ });
195
+ var MethodologyConfigSchema = z.object({
196
+ /** Testing methodology (default: 'tdd') */
197
+ testing: TestingMethodologySchema.default("tdd"),
198
+ /** Architecture methodology (default: 'hexagonal') */
199
+ architecture: ArchitectureMethodologySchema.default("hexagonal"),
200
+ /** Optional overrides for template defaults */
201
+ overrides: MethodologyOverridesSchema.optional(),
202
+ /**
203
+ * WU-1899: Work classification configuration.
204
+ * Extends default signal patterns for UI/backend/docs/infra detection.
205
+ * Custom patterns extend defaults, they do not replace them.
206
+ */
207
+ work_classification: WorkClassificationConfigSchema.optional()
208
+ });
209
+ var TESTING_TEMPLATE_DEFAULTS = {
210
+ tdd: {
211
+ coverage_threshold: 90,
212
+ coverage_mode: "block",
213
+ tests_required: true
214
+ },
215
+ "test-after": {
216
+ coverage_threshold: 70,
217
+ coverage_mode: "warn",
218
+ tests_required: true
219
+ },
220
+ none: {
221
+ coverage_threshold: 0,
222
+ coverage_mode: "off",
223
+ tests_required: false
224
+ }
225
+ };
226
+ function resolvePolicy(config, options = {}) {
227
+ const { rawConfig } = options;
228
+ const methodology = MethodologyConfigSchema.parse(config.methodology ?? {});
229
+ const templateDefaults = TESTING_TEMPLATE_DEFAULTS[methodology.testing];
230
+ let coverage_threshold = templateDefaults.coverage_threshold;
231
+ let coverage_mode = templateDefaults.coverage_mode;
232
+ const tests_required = templateDefaults.tests_required;
233
+ if (methodology.overrides?.coverage_threshold !== void 0) {
234
+ coverage_threshold = methodology.overrides.coverage_threshold;
235
+ }
236
+ if (methodology.overrides?.coverage_mode !== void 0) {
237
+ coverage_mode = methodology.overrides.coverage_mode;
238
+ }
239
+ const gates = config.gates;
240
+ const gatesMinCoverageExplicit = rawConfig !== void 0 ? rawConfig.gates?.minCoverage !== void 0 : false;
241
+ const gatesEnableCoverageExplicit = rawConfig !== void 0 ? rawConfig.gates?.enableCoverage !== void 0 : false;
242
+ const methodologySpecified = config.methodology !== void 0;
243
+ if (gatesMinCoverageExplicit || !methodologySpecified && rawConfig === void 0) {
244
+ coverage_threshold = gates.minCoverage;
245
+ }
246
+ if (gatesEnableCoverageExplicit || !methodologySpecified && rawConfig === void 0) {
247
+ if (gates?.enableCoverage === false) {
248
+ coverage_mode = "off";
249
+ }
250
+ }
251
+ return {
252
+ testing: methodology.testing,
253
+ architecture: methodology.architecture,
254
+ coverage_threshold,
255
+ coverage_mode,
256
+ tests_required
257
+ };
258
+ }
259
+ function getDefaultPolicy() {
260
+ return {
261
+ testing: "tdd",
262
+ architecture: "hexagonal",
263
+ coverage_threshold: 90,
264
+ coverage_mode: "block",
265
+ tests_required: true
266
+ };
267
+ }
268
+
269
+ // ../core/dist/schemas/workspace-config.js
270
+ import { z as z2 } from "zod";
271
+ var WorkspaceControlPlanePolicyModeSchema = z2.enum([
272
+ "authoritative",
273
+ "tighten-only",
274
+ "dev-override"
275
+ ]);
276
+ var CONTROL_PLANE_AUTH_TOKEN_ENV_PATTERN = /^[A-Z][A-Z0-9_]*$/;
277
+ var WorkspaceControlPlaneAuthConfigSchema = z2.object({
278
+ token_env: z2.string().regex(CONTROL_PLANE_AUTH_TOKEN_ENV_PATTERN, "Expected uppercase environment variable name")
279
+ }).strict();
280
+ var WorkspaceControlPlaneConfigSchema = z2.object({
281
+ endpoint: z2.string().url(),
282
+ org_id: z2.string().min(1),
283
+ project_id: z2.string().min(1),
284
+ sync_interval: z2.number().int().positive(),
285
+ policy_mode: WorkspaceControlPlanePolicyModeSchema,
286
+ auth: WorkspaceControlPlaneAuthConfigSchema
287
+ }).strict();
288
+ var WorkspaceSoftwareDeliverySchema = z2.record(z2.string(), z2.unknown());
289
+ var WorkspaceV2ExtensionsSchema = z2.object({
290
+ [WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY]: WorkspaceSoftwareDeliverySchema,
291
+ [WORKSPACE_V2_KEYS.CONTROL_PLANE]: WorkspaceControlPlaneConfigSchema.optional()
292
+ });
293
+
294
+ // ../core/dist/constants/duration-constants.js
295
+ var MS_PER_SECOND = 1e3;
296
+ var MS_PER_MINUTE = 60 * MS_PER_SECOND;
297
+ var MS_PER_HOUR = 60 * MS_PER_MINUTE;
298
+ var MS_PER_DAY = 24 * MS_PER_HOUR;
299
+ var DURATION_MS = Object.freeze({
300
+ /** 7 days in milliseconds (signal cleanup TTL for read signals) */
301
+ SEVEN_DAYS: 7 * MS_PER_DAY,
302
+ /** 30 days in milliseconds (signal cleanup TTL for unread signals, checkpoint TTL) */
303
+ THIRTY_DAYS: 30 * MS_PER_DAY,
304
+ /** 90 days in milliseconds (event archival threshold) */
305
+ NINETY_DAYS: 90 * MS_PER_DAY
306
+ });
307
+
308
+ // ../core/dist/gates-presets.js
309
+ var GATE_PRESETS = {
310
+ node: {
311
+ setup: "npm ci || npm install",
312
+ format: "npx prettier --check .",
313
+ lint: "npx eslint .",
314
+ typecheck: "npx tsc --noEmit",
315
+ test: "npm test"
316
+ },
317
+ python: {
318
+ setup: 'pip install -e ".[dev]" || pip install -r requirements.txt',
319
+ format: "ruff format --check .",
320
+ lint: "ruff check .",
321
+ typecheck: "mypy .",
322
+ test: "pytest"
323
+ },
324
+ go: {
325
+ format: 'gofmt -l . | grep -v "^$" && exit 1 || exit 0',
326
+ lint: "golangci-lint run",
327
+ typecheck: "go vet ./...",
328
+ test: "go test ./..."
329
+ },
330
+ rust: {
331
+ format: "cargo fmt --check",
332
+ lint: "cargo clippy -- -D warnings",
333
+ typecheck: "cargo check",
334
+ test: "cargo test"
335
+ },
336
+ dotnet: {
337
+ setup: "dotnet restore",
338
+ format: "dotnet format --verify-no-changes",
339
+ lint: "dotnet build --no-restore -warnaserror",
340
+ test: "dotnet test --no-restore"
341
+ },
342
+ // WU-1118: Java/JVM, Ruby, and PHP presets
343
+ java: {
344
+ format: "mvn spotless:check || ./gradlew spotlessCheck",
345
+ lint: "mvn checkstyle:check || ./gradlew checkstyleMain",
346
+ typecheck: "mvn compile -DskipTests || ./gradlew compileJava",
347
+ test: "mvn test || ./gradlew test"
348
+ },
349
+ ruby: {
350
+ setup: "bundle install",
351
+ format: "bundle exec rubocop --format simple --fail-level W",
352
+ lint: "bundle exec rubocop",
353
+ test: "bundle exec rspec"
354
+ },
355
+ php: {
356
+ setup: "composer install",
357
+ format: "vendor/bin/php-cs-fixer fix --dry-run --diff",
358
+ lint: "vendor/bin/phpstan analyse",
359
+ test: "vendor/bin/phpunit"
360
+ }
361
+ };
362
+
363
+ // ../core/dist/object-guards.js
364
+ var VALUE_TYPE = {
365
+ OBJECT: "object",
366
+ STRING: "string",
367
+ NUMBER: "number",
368
+ BOOLEAN: "boolean"
369
+ };
370
+ function asRecord(value) {
371
+ return value && typeof value === VALUE_TYPE.OBJECT && !Array.isArray(value) ? value : null;
372
+ }
373
+ function isString(value) {
374
+ return typeof value === VALUE_TYPE.STRING;
375
+ }
376
+ function isNumber(value) {
377
+ return typeof value === VALUE_TYPE.NUMBER;
378
+ }
379
+ function isBoolean(value) {
380
+ return typeof value === VALUE_TYPE.BOOLEAN;
381
+ }
382
+
383
+ // ../core/dist/gates-config-internal.js
384
+ import * as fs from "fs";
385
+ import * as path from "path";
386
+ import * as yaml from "yaml";
387
+ var DEFAULT_POLICY = getDefaultPolicy();
388
+ var GATES_RUNTIME_DEFAULTS = {
389
+ COMMAND_TIMEOUT_MS: 12e4,
390
+ MAX_ESLINT_WARNINGS: 100,
391
+ DEFAULT_MIN_COVERAGE: DEFAULT_POLICY.coverage_threshold,
392
+ DEFAULT_ENABLE_COVERAGE: true,
393
+ DEFAULT_PACKAGE_MANAGER: "pnpm",
394
+ DEFAULT_TEST_RUNNER: "vitest"
395
+ };
396
+ var SOFTWARE_DELIVERY_KEY = WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY;
397
+ var SOFTWARE_DELIVERY_FIELDS = {
398
+ GATES: "gates",
399
+ METHODOLOGY: "methodology",
400
+ PACKAGE_MANAGER: "package_manager",
401
+ PACKAGE_MANAGER_CAMEL: "packageManager",
402
+ TEST_RUNNER: "test_runner",
403
+ TEST_RUNNER_CAMEL: "testRunner",
404
+ BUILD_COMMAND: "build_command",
405
+ BUILD_COMMAND_CAMEL: "buildCommand"
406
+ };
407
+ var GATES_FIELDS = {
408
+ EXECUTION: "execution",
409
+ LANE_HEALTH: "lane_health",
410
+ LANE_HEALTH_CAMEL: "laneHealth",
411
+ MIN_COVERAGE: "minCoverage",
412
+ MIN_COVERAGE_SNAKE: "min_coverage",
413
+ ENABLE_COVERAGE: "enableCoverage",
414
+ ENABLE_COVERAGE_SNAKE: "enable_coverage",
415
+ COMMANDS: "commands"
416
+ };
417
+ var GATES_COMMAND_FIELDS = {
418
+ TEST_FULL: "test_full",
419
+ TEST_DOCS_ONLY: "test_docs_only",
420
+ TEST_INCREMENTAL: "test_incremental",
421
+ LINT: "lint",
422
+ TYPECHECK: "typecheck",
423
+ FORMAT: "format"
424
+ };
425
+ function loadSoftwareDeliveryConfig(projectRoot) {
426
+ const configPath = path.join(projectRoot, WORKSPACE_CONFIG_FILE_NAME);
427
+ if (!fs.existsSync(configPath)) {
428
+ return null;
429
+ }
430
+ try {
431
+ const content = fs.readFileSync(configPath, "utf8");
432
+ const data = asRecord(yaml.parse(content));
433
+ if (!data) {
434
+ return null;
435
+ }
436
+ return asRecord(data[SOFTWARE_DELIVERY_KEY]);
437
+ } catch {
438
+ return null;
439
+ }
440
+ }
441
+ function getGatesSection(projectRoot) {
442
+ const softwareDelivery = loadSoftwareDeliveryConfig(projectRoot);
443
+ if (!softwareDelivery) {
444
+ return null;
445
+ }
446
+ return asRecord(softwareDelivery[SOFTWARE_DELIVERY_FIELDS.GATES]);
447
+ }
448
+
449
+ // ../core/dist/gates-coverage.js
450
+ function readNumberField(source, primaryKey, secondaryKey) {
451
+ const primary = source?.[primaryKey];
452
+ if (isNumber(primary)) {
453
+ return primary;
454
+ }
455
+ const secondary = source?.[secondaryKey];
456
+ return isNumber(secondary) ? secondary : void 0;
457
+ }
458
+ function readBooleanField(source, primaryKey, secondaryKey) {
459
+ const primary = source?.[primaryKey];
460
+ if (isBoolean(primary)) {
461
+ return primary;
462
+ }
463
+ const secondary = source?.[secondaryKey];
464
+ return isBoolean(secondary) ? secondary : void 0;
465
+ }
466
+ function readGateMinCoverage(gatesRaw) {
467
+ return readNumberField(gatesRaw, GATES_FIELDS.MIN_COVERAGE, GATES_FIELDS.MIN_COVERAGE_SNAKE);
468
+ }
469
+ function readGateEnableCoverage(gatesRaw) {
470
+ return readBooleanField(gatesRaw, GATES_FIELDS.ENABLE_COVERAGE, GATES_FIELDS.ENABLE_COVERAGE_SNAKE);
471
+ }
472
+ function resolvePolicyFromConfig(rawConfig) {
473
+ const methodologyRaw = asRecord(rawConfig[SOFTWARE_DELIVERY_FIELDS.METHODOLOGY]) ?? void 0;
474
+ const gatesRaw = asRecord(rawConfig[SOFTWARE_DELIVERY_FIELDS.GATES]) ?? void 0;
475
+ const minCoverage = readGateMinCoverage(gatesRaw);
476
+ const enableCoverage = readGateEnableCoverage(gatesRaw);
477
+ const methodology = MethodologyConfigSchema.parse(methodologyRaw ?? {});
478
+ const minimalConfig = {
479
+ methodology: methodologyRaw,
480
+ // Pass raw methodology for explicit detection
481
+ gates: {
482
+ minCoverage,
483
+ enableCoverage
484
+ }
485
+ };
486
+ return resolvePolicy({
487
+ methodology,
488
+ gates: {
489
+ // Default gates values from schema
490
+ maxEslintWarnings: GATES_RUNTIME_DEFAULTS.MAX_ESLINT_WARNINGS,
491
+ enableCoverage: enableCoverage ?? GATES_RUNTIME_DEFAULTS.DEFAULT_ENABLE_COVERAGE,
492
+ minCoverage: minCoverage ?? GATES_RUNTIME_DEFAULTS.DEFAULT_MIN_COVERAGE,
493
+ enableSafetyCriticalTests: true,
494
+ enableInvariants: true
495
+ }
496
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Minimal type for config
497
+ }, {
498
+ rawConfig: minimalConfig
499
+ });
500
+ }
501
+ function resolveTestPolicy(projectRoot) {
502
+ const rawConfig = loadSoftwareDeliveryConfig(projectRoot) ?? {};
503
+ if (Object.keys(rawConfig).length === 0) {
504
+ const defaultPolicy = getDefaultPolicy();
505
+ return {
506
+ threshold: defaultPolicy.coverage_threshold,
507
+ mode: defaultPolicy.coverage_mode,
508
+ tests_required: defaultPolicy.tests_required
509
+ };
510
+ }
511
+ const policy = resolvePolicyFromConfig(rawConfig);
512
+ return {
513
+ threshold: policy.coverage_threshold,
514
+ mode: policy.coverage_mode,
515
+ tests_required: policy.tests_required
516
+ };
517
+ }
518
+
519
+ // ../core/dist/package-manager-resolver.js
520
+ var SUPPORTED_PACKAGE_MANAGERS = ["pnpm", "npm", "yarn", "bun"];
521
+ var SUPPORTED_TEST_RUNNERS = ["vitest", "jest", "mocha"];
522
+ var DEFAULT_GATES_COMMANDS = {
523
+ pnpm: {
524
+ test_full: "pnpm turbo run test",
525
+ test_docs_only: "",
526
+ test_incremental: "pnpm vitest run --changed origin/main",
527
+ lint: "pnpm lint",
528
+ typecheck: "pnpm typecheck",
529
+ format: "pnpm format:check"
530
+ },
531
+ npm: {
532
+ test_full: "npm test",
533
+ test_docs_only: "",
534
+ test_incremental: "npm test -- --onlyChanged",
535
+ lint: "npm run lint",
536
+ typecheck: "npm run typecheck",
537
+ format: "npm run format:check"
538
+ },
539
+ yarn: {
540
+ test_full: "yarn test",
541
+ test_docs_only: "",
542
+ test_incremental: "yarn test --onlyChanged",
543
+ lint: "yarn lint",
544
+ typecheck: "yarn typecheck",
545
+ format: "yarn format:check"
546
+ },
547
+ bun: {
548
+ test_full: "bun test",
549
+ test_docs_only: "",
550
+ test_incremental: "bun test --changed",
551
+ lint: "bun run lint",
552
+ typecheck: "bun run typecheck",
553
+ format: "bun run format:check"
554
+ }
555
+ };
556
+ function resolvePackageManager(projectRoot) {
557
+ const softwareDelivery = loadSoftwareDeliveryConfig(projectRoot);
558
+ if (!softwareDelivery) {
559
+ return GATES_RUNTIME_DEFAULTS.DEFAULT_PACKAGE_MANAGER;
560
+ }
561
+ const pm = softwareDelivery[SOFTWARE_DELIVERY_FIELDS.PACKAGE_MANAGER] ?? softwareDelivery[SOFTWARE_DELIVERY_FIELDS.PACKAGE_MANAGER_CAMEL];
562
+ if (isString(pm) && SUPPORTED_PACKAGE_MANAGERS.includes(pm)) {
563
+ return pm;
564
+ }
565
+ return GATES_RUNTIME_DEFAULTS.DEFAULT_PACKAGE_MANAGER;
566
+ }
567
+ function resolveTestRunner(projectRoot) {
568
+ const softwareDelivery = loadSoftwareDeliveryConfig(projectRoot);
569
+ if (!softwareDelivery) {
570
+ return GATES_RUNTIME_DEFAULTS.DEFAULT_TEST_RUNNER;
571
+ }
572
+ const runner = softwareDelivery[SOFTWARE_DELIVERY_FIELDS.TEST_RUNNER] ?? softwareDelivery[SOFTWARE_DELIVERY_FIELDS.TEST_RUNNER_CAMEL];
573
+ if (isString(runner) && SUPPORTED_TEST_RUNNERS.includes(runner)) {
574
+ return runner;
575
+ }
576
+ return GATES_RUNTIME_DEFAULTS.DEFAULT_TEST_RUNNER;
577
+ }
578
+ function resolveGatesCommands(projectRoot) {
579
+ const pm = resolvePackageManager(projectRoot);
580
+ const defaults = DEFAULT_GATES_COMMANDS[pm];
581
+ const gates = getGatesSection(projectRoot);
582
+ if (!gates) {
583
+ return defaults;
584
+ }
585
+ const commands = asRecord(gates[GATES_FIELDS.COMMANDS]);
586
+ if (!commands) {
587
+ return defaults;
588
+ }
589
+ return {
590
+ test_full: commands[GATES_COMMAND_FIELDS.TEST_FULL] ?? defaults.test_full,
591
+ test_docs_only: commands[GATES_COMMAND_FIELDS.TEST_DOCS_ONLY] ?? defaults.test_docs_only,
592
+ test_incremental: commands[GATES_COMMAND_FIELDS.TEST_INCREMENTAL] ?? defaults.test_incremental,
593
+ lint: commands[GATES_COMMAND_FIELDS.LINT] ?? defaults.lint,
594
+ typecheck: commands[GATES_COMMAND_FIELDS.TYPECHECK] ?? defaults.typecheck,
595
+ format: commands[GATES_COMMAND_FIELDS.FORMAT] ?? defaults.format
596
+ };
597
+ }
598
+
599
+ // ../core/dist/gates-schemas.js
600
+ import { z as z3 } from "zod";
601
+ var GateCommandObjectSchema = z3.object({
602
+ /** The shell command to execute */
603
+ command: z3.string(),
604
+ /** Whether to continue if this gate fails (default: false) */
605
+ continueOnError: z3.boolean().optional(),
606
+ /** Timeout in milliseconds */
607
+ timeout: z3.number().int().positive().optional()
608
+ });
609
+ var GateCommandConfigSchema = z3.union([z3.string(), GateCommandObjectSchema]);
610
+ var GatesExecutionConfigSchema = z3.object({
611
+ /** Preset to use for default commands (node, python, go, rust, dotnet) */
612
+ preset: z3.string().optional(),
613
+ /** Setup command (e.g., install dependencies) */
614
+ setup: GateCommandConfigSchema.optional(),
615
+ /** Format check command */
616
+ format: GateCommandConfigSchema.optional(),
617
+ /** Lint command */
618
+ lint: GateCommandConfigSchema.optional(),
619
+ /** Type check command */
620
+ typecheck: GateCommandConfigSchema.optional(),
621
+ /** Test command */
622
+ test: GateCommandConfigSchema.optional(),
623
+ /** Coverage configuration */
624
+ coverage: z3.union([
625
+ z3.string(),
626
+ z3.object({
627
+ command: z3.string(),
628
+ threshold: z3.number().min(0).max(100).optional()
629
+ })
630
+ ]).optional()
631
+ });
632
+ var LaneHealthModeSchema = z3.enum(["warn", "error", "off"]);
633
+ var DEFAULT_LANE_HEALTH_MODE = "warn";
634
+
635
+ // ../core/dist/gates-config.js
636
+ var SOFTWARE_DELIVERY_KEY2 = WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY;
637
+ function loadLaneHealthConfig(projectRoot) {
638
+ const gates = getGatesSection(projectRoot);
639
+ if (!gates) {
640
+ return DEFAULT_LANE_HEALTH_MODE;
641
+ }
642
+ try {
643
+ const laneHealthConfig = gates[GATES_FIELDS.LANE_HEALTH] ?? gates[GATES_FIELDS.LANE_HEALTH_CAMEL];
644
+ if (laneHealthConfig === void 0) {
645
+ return DEFAULT_LANE_HEALTH_MODE;
646
+ }
647
+ const result = LaneHealthModeSchema.safeParse(laneHealthConfig);
648
+ if (!result.success) {
649
+ console.warn(`Warning: Invalid gates.lane_health value '${laneHealthConfig}', expected 'warn', 'error', or 'off'. Using default 'warn'.`);
650
+ return DEFAULT_LANE_HEALTH_MODE;
651
+ }
652
+ return result.data;
653
+ } catch (error) {
654
+ console.warn(`Warning: Failed to parse ${WORKSPACE_CONFIG_FILE_NAME} ${SOFTWARE_DELIVERY_KEY2}.gates.lane_health:`, error instanceof Error ? error.message : String(error));
655
+ return DEFAULT_LANE_HEALTH_MODE;
656
+ }
657
+ }
658
+
659
+ // ../core/dist/lumenflow-config-schema.js
660
+ import { z as z13 } from "zod";
661
+
662
+ // ../core/dist/schemas/directories-config.js
663
+ import { z as z4 } from "zod";
664
+ var DEFAULT_LAYOUT = DOCS_LAYOUT_PRESETS.simple;
665
+ var EventArchivalConfigSchema = z4.object({
666
+ /**
667
+ * Archive events older than this duration in milliseconds (default: 90 days).
668
+ * Completed WU events older than this are moved to monthly archive files.
669
+ * Active WU events (in_progress/blocked/waiting) are never archived.
670
+ */
671
+ archiveAfter: z4.number().int().positive().default(DURATION_MS.NINETY_DAYS),
672
+ /**
673
+ * Whether to keep archive files (default: true).
674
+ * When true, archived events are preserved in monthly archive files.
675
+ * When false, archived events are deleted (not recommended for audit trails).
676
+ */
677
+ keepArchives: z4.boolean().default(true)
678
+ });
679
+ var DirectoriesSchema = z4.object({
680
+ /** Working directory for web app (default: 'apps/web/') */
681
+ appsWeb: z4.string().default("apps/web/"),
682
+ /** Worktrees directory (default: 'worktrees/') */
683
+ worktrees: z4.string().default("worktrees/"),
684
+ /** AI assets directory (default: 'ai/') */
685
+ ai: z4.string().default("ai/"),
686
+ /** Claude configuration directory (default: '.claude/') */
687
+ claude: z4.string().default(".claude/"),
688
+ /** Documentation root (default: 'docs/') */
689
+ docs: z4.string().default("docs/"),
690
+ /** Packages directory (default: 'packages/') */
691
+ packages: z4.string().default("packages/"),
692
+ /** Tools directory (default: 'tools/') */
693
+ tools: z4.string().default("tools/"),
694
+ /** Memory bank directory (default: 'memory-bank/') */
695
+ memoryBank: z4.string().default("memory-bank/"),
696
+ /** WU YAML files directory (default: docs-layout simple preset + '/wu') */
697
+ wuDir: z4.string().default(`${DEFAULT_LAYOUT.tasks}/wu`),
698
+ /** Initiatives directory (default: docs-layout simple preset + '/initiatives') */
699
+ initiativesDir: z4.string().default(`${DEFAULT_LAYOUT.tasks}/initiatives`),
700
+ /** Backlog file path (default: docs-layout simple preset + '/backlog.md') */
701
+ backlogPath: z4.string().default(`${DEFAULT_LAYOUT.tasks}/backlog.md`),
702
+ /** Status file path (default: docs-layout simple preset + '/status.md') */
703
+ statusPath: z4.string().default(`${DEFAULT_LAYOUT.tasks}/status.md`),
704
+ /** Skills directory (default: '.claude/skills') */
705
+ skillsDir: z4.string().default(".claude/skills"),
706
+ /** Agents directory (default: '.claude/agents') */
707
+ agentsDir: z4.string().default(".claude/agents"),
708
+ /** Plans directory (default: docs-layout simple preset + '/plans') */
709
+ plansDir: z4.string().default(`${DEFAULT_LAYOUT.operations}/plans`),
710
+ /** Templates directory (default: '.lumenflow/templates') */
711
+ templatesDir: z4.string().default(".lumenflow/templates"),
712
+ /** Onboarding directory (default: docs-layout simple preset onboarding path) */
713
+ onboardingDir: z4.string().default(DEFAULT_LAYOUT.onboarding),
714
+ /** LumenFlow complete guide path (default: docs-layout simple preset complete guide path) */
715
+ completeGuidePath: z4.string().default(DEFAULT_LAYOUT.completeGuidePath),
716
+ /** Agent quick reference commands path (default: docs-layout simple preset quick-ref path) */
717
+ quickRefPath: z4.string().default(DEFAULT_LAYOUT.quickRefPath),
718
+ /** Agent starting prompt path (default: docs-layout simple preset starting prompt path) */
719
+ startingPromptPath: z4.string().default(DEFAULT_LAYOUT.startingPromptPath),
720
+ /** WU sizing guide path (default: docs-layout simple preset sizing guide path) */
721
+ sizingGuidePath: z4.string().default(DEFAULT_LAYOUT.sizingGuidePath),
722
+ /** Project governance document path (default: docs-layout simple preset governance path) */
723
+ governancePath: z4.string().default(DEFAULT_LAYOUT.governancePath),
724
+ /** Safe-git wrapper path relative to project root (default: 'scripts/safe-git') - WU-1654 */
725
+ safeGitPath: z4.string().default("scripts/safe-git")
726
+ });
727
+ var StatePathsSchema = z4.object({
728
+ /** Base state directory (default: '.lumenflow') */
729
+ base: z4.string().default(".lumenflow"),
730
+ /** State directory (default: '.lumenflow/state') */
731
+ stateDir: z4.string().default(".lumenflow/state"),
732
+ /** Archive directory (default: '.lumenflow/archive') */
733
+ archiveDir: z4.string().default(".lumenflow/archive"),
734
+ /** Stamps directory (default: '.lumenflow/stamps') */
735
+ stampsDir: z4.string().default(".lumenflow/stamps"),
736
+ /** Merge lock file (default: '.lumenflow/merge.lock') */
737
+ mergeLock: z4.string().default(".lumenflow/merge.lock"),
738
+ /** Telemetry directory (default: '.lumenflow/telemetry') */
739
+ telemetry: z4.string().default(".lumenflow/telemetry"),
740
+ /** Flow log file (default: '.lumenflow/flow.log') */
741
+ flowLog: z4.string().default(".lumenflow/flow.log"),
742
+ /** Sessions directory (default: '.lumenflow/sessions') */
743
+ sessions: z4.string().default(".lumenflow/sessions"),
744
+ /** Incidents directory (default: '.lumenflow/incidents') */
745
+ incidents: z4.string().default(".lumenflow/incidents"),
746
+ /** Commands log file (default: '.lumenflow/commands.log') */
747
+ commandsLog: z4.string().default(".lumenflow/commands.log"),
748
+ /**
749
+ * WU-1207: Event archival configuration
750
+ * Controls archival of old WU events to prevent unbounded growth.
751
+ */
752
+ eventArchival: EventArchivalConfigSchema.default(() => EventArchivalConfigSchema.parse({}))
753
+ });
754
+
755
+ // ../core/dist/schemas/git-config.js
756
+ import { z as z5 } from "zod";
757
+ var PushRetryConfigSchema = z5.object({
758
+ /**
759
+ * Enable push retry with rebase on non-fast-forward errors.
760
+ * When true, failed pushes trigger automatic rebase and retry.
761
+ * When false, the original error is thrown immediately.
762
+ * @default true
763
+ */
764
+ enabled: z5.boolean().default(true),
765
+ /**
766
+ * Maximum number of retry attempts (including the initial attempt).
767
+ * After this many failures, the operation fails with clear guidance.
768
+ * @default 3
769
+ */
770
+ retries: z5.number().int().positive().default(3),
771
+ /**
772
+ * Minimum delay in milliseconds between retries.
773
+ * Used as the base for exponential backoff.
774
+ * @default 100
775
+ */
776
+ min_delay_ms: z5.number().int().nonnegative().default(100),
777
+ /**
778
+ * Maximum delay in milliseconds between retries.
779
+ * Caps the exponential backoff to prevent excessive waits.
780
+ * @default 1000
781
+ */
782
+ max_delay_ms: z5.number().int().positive().default(1e3),
783
+ /**
784
+ * Add randomization to retry delays (recommended for concurrent agents).
785
+ * Helps prevent thundering herd when multiple agents retry simultaneously.
786
+ * @default true
787
+ */
788
+ jitter: z5.boolean().default(true)
789
+ });
790
+ var GitConfigSchema = z5.object({
791
+ /** Main branch name (default: 'main') */
792
+ mainBranch: z5.string().default("main"),
793
+ /** Default remote name (default: 'origin') */
794
+ defaultRemote: z5.string().default("origin"),
795
+ /** Lane branch prefix (default: 'lane/') */
796
+ laneBranchPrefix: z5.string().default("lane/"),
797
+ /** Temporary branch prefix (default: 'tmp/') */
798
+ tempBranchPrefix: z5.string().default("tmp/"),
799
+ /** Real git executable path (default: '/usr/bin/git') */
800
+ realGitPath: z5.string().default("/usr/bin/git"),
801
+ /** Maximum commits behind main before requiring rebase */
802
+ maxBranchDrift: z5.number().int().positive().default(20),
803
+ /** Warning threshold for branch drift */
804
+ branchDriftWarning: z5.number().int().positive().default(15),
805
+ /** Info threshold for branch drift */
806
+ branchDriftInfo: z5.number().int().positive().default(10),
807
+ /**
808
+ * WU-1302: Require a remote repository for wu:create and wu:claim.
809
+ * When true (default), operations fail if no remote 'origin' exists.
810
+ * When false, operations can proceed locally without pushing.
811
+ *
812
+ * Use `git.requireRemote: false` for:
813
+ * - Local-only development before remote is set up
814
+ * - Air-gapped environments
815
+ * - Testing/evaluation of LumenFlow
816
+ *
817
+ * @default true
818
+ *
819
+ * @example
820
+ * ```yaml
821
+ * git:
822
+ * requireRemote: false # Allow offline/local mode
823
+ * ```
824
+ */
825
+ requireRemote: z5.boolean().default(true),
826
+ /**
827
+ * Agent branch patterns to MERGE with the registry patterns.
828
+ * These patterns are merged with patterns from lumenflow.dev/registry/agent-patterns.json.
829
+ * Use this to add custom patterns that should work alongside the standard vendor patterns.
830
+ * Protected branches (mainBranch + 'master') are NEVER bypassed.
831
+ *
832
+ * WU-1089: Changed default from ['agent/*'] to [] to allow registry to be used by default.
833
+ *
834
+ * @example
835
+ * ```yaml
836
+ * git:
837
+ * agentBranchPatterns:
838
+ * - 'my-custom-agent/*'
839
+ * - 'internal-tool/*'
840
+ * ```
841
+ */
842
+ agentBranchPatterns: z5.array(z5.string()).default([]),
843
+ /**
844
+ * Agent branch patterns that REPLACE the registry patterns entirely.
845
+ * When set, these patterns are used instead of fetching from the registry.
846
+ * The agentBranchPatterns field is ignored when this is set.
847
+ *
848
+ * Use this for strict control over which agent patterns are allowed.
849
+ *
850
+ * @example
851
+ * ```yaml
852
+ * git:
853
+ * agentBranchPatternsOverride:
854
+ * - 'claude/*'
855
+ * - 'codex/*'
856
+ * ```
857
+ */
858
+ agentBranchPatternsOverride: z5.array(z5.string()).optional(),
859
+ /**
860
+ * Disable fetching agent patterns from the registry (airgapped mode).
861
+ * When true, only uses agentBranchPatterns from config or defaults to ['agent/*'].
862
+ * Useful for environments without network access or strict security requirements.
863
+ *
864
+ * @default false
865
+ *
866
+ * @example
867
+ * ```yaml
868
+ * git:
869
+ * disableAgentPatternRegistry: true
870
+ * agentBranchPatterns:
871
+ * - 'claude/*'
872
+ * - 'cursor/*'
873
+ * ```
874
+ */
875
+ disableAgentPatternRegistry: z5.boolean().default(false),
876
+ /**
877
+ * WU-1332: Push retry configuration for micro-worktree operations.
878
+ * When push fails due to non-fast-forward (origin moved), automatically
879
+ * rebase and retry with exponential backoff.
880
+ *
881
+ * @example
882
+ * ```yaml
883
+ * git:
884
+ * push_retry:
885
+ * enabled: true
886
+ * retries: 5 # Try 5 times total
887
+ * min_delay_ms: 200 # Start with 200ms delay
888
+ * max_delay_ms: 2000 # Cap at 2 second delay
889
+ * jitter: true # Add randomization
890
+ * ```
891
+ */
892
+ push_retry: PushRetryConfigSchema.default(() => PushRetryConfigSchema.parse({}))
893
+ });
894
+
895
+ // ../core/dist/schemas/wu-config.js
896
+ import { z as z6 } from "zod";
897
+ var WuBriefPolicyModeSchema = z6.enum(["off", "manual", "auto", "required"]);
898
+ var WuBriefConfigSchema = z6.object({
899
+ /** Claim-time wu:brief policy mode (default: 'auto') */
900
+ policyMode: WuBriefPolicyModeSchema.default("auto"),
901
+ /**
902
+ * Brief freshness threshold in minutes.
903
+ * Set to 0 to disable freshness checks.
904
+ */
905
+ freshnessMinutes: z6.number().int().nonnegative().default(1440)
906
+ });
907
+ var WuConfigSchema = z6.object({
908
+ /** WU ID pattern (regex string, default: '^WU-\\d+$') */
909
+ idPattern: z6.string().default("^WU-\\d+$"),
910
+ /** Minimum description length (default: 50) */
911
+ minDescriptionLength: z6.number().int().nonnegative().default(50),
912
+ /** Maximum commit subject length (default: 100) */
913
+ maxCommitSubject: z6.number().int().positive().default(100),
914
+ /** Default priority (default: 'P2') */
915
+ defaultPriority: z6.string().default("P2"),
916
+ /** Default status (default: 'ready') */
917
+ defaultStatus: z6.string().default("ready"),
918
+ /** Default type (default: 'feature') */
919
+ defaultType: z6.string().default("feature"),
920
+ /** wu:brief policy configuration */
921
+ brief: WuBriefConfigSchema.default(() => WuBriefConfigSchema.parse({}))
922
+ });
923
+
924
+ // ../core/dist/schemas/gates-section-config.js
925
+ import { z as z7 } from "zod";
926
+
927
+ // ../core/dist/constants/gate-constants.js
928
+ var GATE_CONFIG = {
929
+ /** Maximum execution time per gate step (ms) */
930
+ TIMEOUT_MS: 18e4,
931
+ /** Maximum file size allowed in commits (bytes) - 5MB */
932
+ MAX_FILE_SIZE_BYTES: 5 * 1024 * 1024,
933
+ /** Total number of gates (for progress display) */
934
+ TOTAL_GATES: 14
935
+ };
936
+ var DEFAULT_MIN_COVERAGE = 90;
937
+ var DEFAULT_MAX_ESLINT_WARNINGS = 100;
938
+
939
+ // ../core/dist/schemas/gates-section-config.js
940
+ var GatesCommandsConfigSchema = z7.object({
941
+ /**
942
+ * Command to run full test suite.
943
+ * Default: 'pnpm turbo run test'
944
+ */
945
+ test_full: z7.string().default("pnpm turbo run test"),
946
+ /**
947
+ * Command to run tests in docs-only mode.
948
+ * Default: empty (skip tests in docs-only mode)
949
+ */
950
+ test_docs_only: z7.string().default(""),
951
+ /**
952
+ * Command to run incremental tests (changed files only).
953
+ * Default: 'pnpm vitest run --changed origin/main'
954
+ */
955
+ test_incremental: z7.string().default("pnpm vitest run --changed origin/main"),
956
+ /**
957
+ * Command to run lint checks.
958
+ * Default: 'pnpm lint'
959
+ */
960
+ lint: z7.string().optional(),
961
+ /**
962
+ * Command to run type checks.
963
+ * Default: 'pnpm typecheck'
964
+ */
965
+ typecheck: z7.string().optional(),
966
+ /**
967
+ * Command to run format checks.
968
+ * Default: 'pnpm format:check'
969
+ */
970
+ format: z7.string().optional()
971
+ });
972
+ var CoChangeSeveritySchema = z7.enum(["warn", "error", "off"]);
973
+ var CoChangeRuleConfigSchema = z7.object({
974
+ name: z7.string().min(1),
975
+ trigger_patterns: z7.array(z7.string().min(1)).min(1),
976
+ require_patterns: z7.array(z7.string().min(1)).min(1),
977
+ severity: CoChangeSeveritySchema.default("error")
978
+ });
979
+ var GatesConfigSchema = z7.object({
980
+ /** Maximum ESLint warnings allowed (default: 100) */
981
+ maxEslintWarnings: z7.number().int().nonnegative().default(DEFAULT_MAX_ESLINT_WARNINGS),
982
+ /** Enable coverage gate (default: true) */
983
+ enableCoverage: z7.boolean().default(true),
984
+ /** Minimum coverage percentage (default: 90) */
985
+ minCoverage: z7.number().min(0).max(100).default(DEFAULT_MIN_COVERAGE),
986
+ /** Enable safety-critical tests (default: true) */
987
+ enableSafetyCriticalTests: z7.boolean().default(true),
988
+ /** Enable invariants check (default: true) */
989
+ enableInvariants: z7.boolean().default(true),
990
+ /**
991
+ * WU-1067: Config-driven gates execution
992
+ * Custom commands for each gate, with optional preset expansion.
993
+ * When set, gates runner uses these instead of hardcoded commands.
994
+ */
995
+ execution: GatesExecutionConfigSchema.optional(),
996
+ /**
997
+ * WU-1356: Configurable gate commands
998
+ * Replaces hard-coded turbo/vitest commands with user-configurable alternatives.
999
+ * Enables LumenFlow to work with npm/yarn/bun, Nx/plain scripts, Jest/Mocha, etc.
1000
+ */
1001
+ commands: GatesCommandsConfigSchema.default(() => GatesCommandsConfigSchema.parse({})),
1002
+ /**
1003
+ * WU-1356: Ignore patterns for test runners
1004
+ * Patterns to ignore when detecting changed tests.
1005
+ * Default: ['.turbo'] for vitest (derived from test_runner if not specified)
1006
+ */
1007
+ ignore_patterns: z7.array(z7.string()).optional(),
1008
+ /**
1009
+ * WU-1191: Lane health gate mode
1010
+ * Controls how lane health check behaves during gates.
1011
+ * - 'warn': Log warning if issues found (default)
1012
+ * - 'error': Fail gates if issues found
1013
+ * - 'off': Skip lane health check
1014
+ */
1015
+ lane_health: z7.enum(["warn", "error", "off"]).default("warn"),
1016
+ /**
1017
+ * WU-2158: Generic co-change rule set.
1018
+ * Each rule enforces that when trigger_patterns match changed files,
1019
+ * at least one require_patterns file must also be changed.
1020
+ */
1021
+ co_change: z7.array(CoChangeRuleConfigSchema).default([])
1022
+ });
1023
+
1024
+ // ../core/dist/schemas/memory-config.js
1025
+ import { z as z8 } from "zod";
1026
+ var ProgressSignalsConfigSchema = z8.object({
1027
+ /**
1028
+ * Enable mandatory progress signals in spawn prompts.
1029
+ * When true, spawn prompts show "Progress Signals (Required at Milestones)"
1030
+ * When false, spawn prompts show "Progress Signals (Optional)"
1031
+ * @default false
1032
+ */
1033
+ enabled: z8.boolean().default(false),
1034
+ /**
1035
+ * Send progress signals every N tool calls.
1036
+ * Set to 0 to disable frequency-based signals.
1037
+ * @default 0
1038
+ */
1039
+ frequency: z8.number().int().nonnegative().default(0),
1040
+ /**
1041
+ * Signal after each acceptance criterion is completed.
1042
+ * @default true
1043
+ */
1044
+ on_milestone: z8.boolean().default(true),
1045
+ /**
1046
+ * Signal when tests first pass.
1047
+ * @default true
1048
+ */
1049
+ on_tests_pass: z8.boolean().default(true),
1050
+ /**
1051
+ * Signal before running gates.
1052
+ * @default true
1053
+ */
1054
+ before_gates: z8.boolean().default(true),
1055
+ /**
1056
+ * Signal when work is blocked.
1057
+ * @default true
1058
+ */
1059
+ on_blocked: z8.boolean().default(true),
1060
+ /**
1061
+ * Automatically checkpoint memory at signal milestones.
1062
+ * @default false
1063
+ */
1064
+ auto_checkpoint: z8.boolean().default(false)
1065
+ });
1066
+ var SignalCleanupConfigSchema = z8.object({
1067
+ /**
1068
+ * TTL for read signals in milliseconds (default: 7 days).
1069
+ * Read signals older than this are removed during cleanup.
1070
+ */
1071
+ ttl: z8.number().int().positive().default(DURATION_MS.SEVEN_DAYS),
1072
+ /**
1073
+ * TTL for unread signals in milliseconds (default: 30 days).
1074
+ * Unread signals get a longer TTL to ensure important signals aren't missed.
1075
+ */
1076
+ unreadTtl: z8.number().int().positive().default(DURATION_MS.THIRTY_DAYS),
1077
+ /**
1078
+ * Maximum number of signals to retain (default: 500).
1079
+ * When exceeded, oldest signals are removed first (keeping newest).
1080
+ * Active WU signals are always retained regardless of this limit.
1081
+ */
1082
+ maxEntries: z8.number().int().positive().default(500)
1083
+ });
1084
+ var AutoCheckpointConfigSchema = z8.object({
1085
+ /**
1086
+ * Enable auto-checkpoint hooks.
1087
+ * When true (and hooks master switch is enabled), generates PostToolUse
1088
+ * and SubagentStop hooks that create checkpoints automatically.
1089
+ * @default false
1090
+ */
1091
+ enabled: z8.boolean().default(false),
1092
+ /**
1093
+ * Number of tool calls between automatic checkpoints.
1094
+ * The hook script tracks a per-WU counter and checkpoints
1095
+ * when the counter reaches this interval.
1096
+ * @default 30
1097
+ */
1098
+ interval_tool_calls: z8.number().int().positive().default(30)
1099
+ });
1100
+ var MemoryEnforcementConfigSchema = z8.object({
1101
+ /**
1102
+ * Auto-checkpoint configuration.
1103
+ * Controls automatic checkpointing via hooks.
1104
+ */
1105
+ auto_checkpoint: AutoCheckpointConfigSchema.default(() => AutoCheckpointConfigSchema.parse({})),
1106
+ /**
1107
+ * Checkpoint requirement for wu:done.
1108
+ * - 'off': No checkpoint check during wu:done
1109
+ * - 'warn': Warn if no checkpoints exist (default, fail-open)
1110
+ * - 'block': Block wu:done if no checkpoints exist
1111
+ * @default 'warn'
1112
+ */
1113
+ require_checkpoint_for_done: z8.enum(["off", "warn", "block"]).default("warn")
1114
+ });
1115
+ var MemoryDecayConfigSchema = z8.object({
1116
+ /**
1117
+ * Enable decay-based archival.
1118
+ * When false, no automatic archival is triggered.
1119
+ * @default false
1120
+ */
1121
+ enabled: z8.boolean().default(false),
1122
+ /**
1123
+ * Decay score threshold below which nodes are archived.
1124
+ * Nodes with a decay score below this value are marked as archived.
1125
+ * Must be between 0 and 1 inclusive.
1126
+ * @default 0.1
1127
+ */
1128
+ threshold: z8.number().min(0).max(1).default(0.1),
1129
+ /**
1130
+ * Half-life for decay scoring in days.
1131
+ * Controls how quickly nodes lose relevance over time.
1132
+ * Must be a positive integer.
1133
+ * @default 30
1134
+ */
1135
+ half_life_days: z8.number().int().positive().default(30),
1136
+ /**
1137
+ * When to trigger decay archival.
1138
+ * - 'on_done': Run during wu:done completion lifecycle
1139
+ * - 'manual': Only run via pnpm mem:cleanup
1140
+ * @default 'on_done'
1141
+ */
1142
+ trigger: z8.enum(["on_done", "manual"]).default("on_done")
1143
+ });
1144
+ var MEMORY_CONFIG_ERRORS = {
1145
+ DEPRECATED_SPAWN_CONTEXT_MAX_SIZE: "memory.spawn_context_max_size is no longer supported. Use memory.delegation_context_max_size instead."
1146
+ };
1147
+ var MemoryConfigSchema = z8.object({
1148
+ /** Memory directory (default: 'memory-bank/') */
1149
+ directory: z8.string().default("memory-bank/"),
1150
+ /** Session TTL in milliseconds (default: 7 days) */
1151
+ sessionTtl: z8.number().int().positive().default(DURATION_MS.SEVEN_DAYS),
1152
+ /** Checkpoint TTL in milliseconds (default: 30 days) */
1153
+ checkpointTtl: z8.number().int().positive().default(DURATION_MS.THIRTY_DAYS),
1154
+ /** Enable auto-cleanup (default: true) */
1155
+ enableAutoCleanup: z8.boolean().default(true),
1156
+ /**
1157
+ * WU-1203: Progress signals configuration for sub-agent coordination.
1158
+ * Optional - when not provided, spawn prompts show "Progress Signals (Optional)".
1159
+ */
1160
+ progress_signals: ProgressSignalsConfigSchema.optional(),
1161
+ /**
1162
+ * WU-1204: Signal cleanup configuration
1163
+ * Controls TTL-based cleanup for signals.jsonl to prevent unbounded growth.
1164
+ */
1165
+ signalCleanup: SignalCleanupConfigSchema.default(() => SignalCleanupConfigSchema.parse({})),
1166
+ /**
1167
+ * WU-1674: Maximum size in bytes for delegation memory context.
1168
+ * Controls the maximum size of memory context injected into delegation prompts.
1169
+ * Larger values include more context but increase token usage.
1170
+ * @default 4096 (4KB)
1171
+ */
1172
+ delegation_context_max_size: z8.number().int().positive().default(4096),
1173
+ /**
1174
+ * Deprecated key hard-fail for clean-slate cutover.
1175
+ * Keep this as an explicit validator so users get a direct migration message.
1176
+ */
1177
+ spawn_context_max_size: z8.unknown().optional().refine((value) => value === void 0, {
1178
+ message: MEMORY_CONFIG_ERRORS.DEPRECATED_SPAWN_CONTEXT_MAX_SIZE
1179
+ }),
1180
+ /**
1181
+ * WU-1471: Memory enforcement configuration.
1182
+ * Controls auto-checkpointing and checkpoint requirements for wu:done.
1183
+ * Optional - when not provided, existing WU-1943 warn behavior applies.
1184
+ */
1185
+ enforcement: MemoryEnforcementConfigSchema.optional(),
1186
+ /**
1187
+ * WU-1474: Decay policy configuration.
1188
+ * Controls automated archival of stale memory nodes during lifecycle events.
1189
+ * Optional - when not provided, no automatic decay archival runs.
1190
+ */
1191
+ decay: MemoryDecayConfigSchema.optional()
1192
+ });
1193
+
1194
+ // ../core/dist/schemas/agents-config.js
1195
+ import { z as z9 } from "zod";
1196
+ var DEFAULT_METHODOLOGY_PRINCIPLES = [
1197
+ "TDD",
1198
+ "Hexagonal Architecture",
1199
+ "SOLID",
1200
+ "DRY",
1201
+ "YAGNI",
1202
+ "KISS",
1203
+ "Library-First"
1204
+ ];
1205
+ var MethodologyDefaultsSchema = z9.object({
1206
+ /** Enable or disable project defaults output */
1207
+ enabled: z9.boolean().default(true),
1208
+ /** Whether defaults are required or recommended */
1209
+ enforcement: z9.enum(["required", "recommended"]).default("required"),
1210
+ /** Default methodology principles to apply */
1211
+ principles: z9.array(z9.string()).default(DEFAULT_METHODOLOGY_PRINCIPLES),
1212
+ /** Optional notes appended to Project Defaults */
1213
+ notes: z9.string().optional()
1214
+ });
1215
+ var ClientBlockSchema = z9.object({
1216
+ /** Block title */
1217
+ title: z9.string(),
1218
+ /** Block content (markdown allowed) */
1219
+ content: z9.string()
1220
+ });
1221
+ var ClientSkillsSchema = z9.object({
1222
+ /** Optional skills selection guidance text */
1223
+ instructions: z9.string().optional(),
1224
+ /** Recommended skills to load for this client */
1225
+ recommended: z9.array(z9.string()).default([]),
1226
+ /**
1227
+ * WU-1142: Lane-specific skills to recommend
1228
+ * Maps lane names to arrays of skill names
1229
+ * @example
1230
+ * byLane:
1231
+ * 'Framework: Core': ['tdd-workflow', 'lumenflow-gates']
1232
+ * 'Content: Documentation': ['worktree-discipline']
1233
+ */
1234
+ byLane: z9.record(z9.string(), z9.array(z9.string())).optional()
1235
+ });
1236
+ var ClientEnforcementSchema = z9.object({
1237
+ /**
1238
+ * Enable enforcement hooks.
1239
+ * When true, hooks are generated in .claude/hooks/
1240
+ * @default false
1241
+ */
1242
+ hooks: z9.boolean().default(false),
1243
+ /**
1244
+ * Block Write/Edit operations when cwd is not a worktree.
1245
+ * Prevents accidental edits to main checkout.
1246
+ * @default false
1247
+ */
1248
+ block_outside_worktree: z9.boolean().default(false),
1249
+ /**
1250
+ * Require a claimed WU for Write/Edit operations.
1251
+ * Ensures all edits are associated with tracked work.
1252
+ * @default false
1253
+ */
1254
+ require_wu_for_edits: z9.boolean().default(false),
1255
+ /**
1256
+ * Warn when session ends without wu:done being called.
1257
+ * Reminds agents to complete their work properly.
1258
+ * @default false
1259
+ */
1260
+ warn_on_stop_without_wu_done: z9.boolean().default(false)
1261
+ });
1262
+ var ClientConfigSchema = z9.object({
1263
+ /** Preamble file path (e.g. 'CLAUDE.md') or false to disable */
1264
+ preamble: z9.union([z9.string(), z9.boolean()]).optional(),
1265
+ /** Skills directory path */
1266
+ skillsDir: z9.string().optional(),
1267
+ /** Agents directory path */
1268
+ agentsDir: z9.string().optional(),
1269
+ /** Client-specific blocks injected into wu:spawn output */
1270
+ blocks: z9.array(ClientBlockSchema).default([]),
1271
+ /** Client-specific skills guidance for wu:spawn */
1272
+ skills: ClientSkillsSchema.optional(),
1273
+ /**
1274
+ * WU-1367: Enforcement configuration for Claude Code hooks.
1275
+ * When enabled, generates hooks that enforce workflow compliance.
1276
+ */
1277
+ enforcement: ClientEnforcementSchema.optional(),
1278
+ /**
1279
+ * WU-1900: Capability-to-skill mapping for classifier-driven skill suggestions.
1280
+ * Maps abstract capability tags from the work classifier to client-specific skill names.
1281
+ *
1282
+ * @example
1283
+ * ```yaml
1284
+ * agents:
1285
+ * clients:
1286
+ * claude-code:
1287
+ * capabilities_map:
1288
+ * ui-design-awareness: frontend-design
1289
+ * component-reuse-check: library-first
1290
+ * ```
1291
+ */
1292
+ capabilities_map: z9.record(z9.string(), z9.string()).optional()
1293
+ });
1294
+ var AgentsConfigSchema = z9.object({
1295
+ /** Default client to use if not specified (configure per project; bootstrap default: 'claude-code') */
1296
+ defaultClient: z9.string().default(LUMENFLOW_CLIENT_IDS.CLAUDE_CODE),
1297
+ /** Client-specific configurations */
1298
+ clients: z9.record(z9.string(), ClientConfigSchema).default({}),
1299
+ /** Project methodology defaults (agent-facing) */
1300
+ methodology: MethodologyDefaultsSchema.default(() => MethodologyDefaultsSchema.parse({}))
1301
+ });
1302
+
1303
+ // ../core/dist/schemas/lanes-config.js
1304
+ import { z as z10 } from "zod";
1305
+ var LockPolicySchema = z10.enum(["all", "active", "none"]).default("all");
1306
+ var LanesEnforcementSchema = z10.object({
1307
+ /**
1308
+ * When true, lanes MUST use "Parent: Sublane" format if parent has taxonomy.
1309
+ * @default true
1310
+ */
1311
+ require_parent: z10.boolean().default(true),
1312
+ /**
1313
+ * When false, only lanes in the taxonomy are allowed.
1314
+ * When true, custom lanes can be used.
1315
+ * @default false
1316
+ */
1317
+ allow_custom: z10.boolean().default(false)
1318
+ });
1319
+ var LaneLifecycleStatusSchema = z10.enum(["unconfigured", "draft", "locked"]);
1320
+ var LaneLifecycleSchema = z10.object({
1321
+ status: LaneLifecycleStatusSchema,
1322
+ updated_at: z10.string().optional(),
1323
+ migrated_at: z10.string().optional(),
1324
+ migration_reason: z10.string().optional()
1325
+ });
1326
+ var LaneDefinitionSchema = z10.object({
1327
+ /** Lane name in "Parent: Sublane" format (e.g., "Framework: Core") */
1328
+ name: z10.string(),
1329
+ /** WU-1016: Maximum WUs allowed in progress concurrently for this lane */
1330
+ wip_limit: z10.number().int().positive().optional(),
1331
+ /** WU-1187: Required justification when wip_limit > 1 */
1332
+ wip_justification: z10.string().optional(),
1333
+ /**
1334
+ * WU-1322: Lock policy for this lane.
1335
+ * - 'all': Lock lane for all other agents (default)
1336
+ * - 'active': Lock only for agents with overlapping code_paths
1337
+ * - 'none': No locking (suitable for documentation lanes)
1338
+ *
1339
+ * @default 'all'
1340
+ *
1341
+ * @example
1342
+ * ```yaml
1343
+ * lanes:
1344
+ * definitions:
1345
+ * - name: 'Content: Documentation'
1346
+ * wip_limit: 4
1347
+ * lock_policy: 'none' # Docs can be worked in parallel
1348
+ * ```
1349
+ */
1350
+ lock_policy: LockPolicySchema.default("all"),
1351
+ /** Code paths associated with this lane (glob patterns) */
1352
+ code_paths: z10.array(z10.string()).optional()
1353
+ });
1354
+ var LanesConfigSchema = z10.object({
1355
+ /** Lane enforcement configuration (validation rules) */
1356
+ enforcement: LanesEnforcementSchema.optional(),
1357
+ /** WU-1748: Deferred lane lifecycle state */
1358
+ lifecycle: LaneLifecycleSchema.optional(),
1359
+ /** Primary lane definitions array (recommended format) */
1360
+ definitions: z10.array(LaneDefinitionSchema).optional(),
1361
+ /** Engineering lanes (alternate format) */
1362
+ engineering: z10.array(LaneDefinitionSchema).optional(),
1363
+ /** Business lanes (alternate format) */
1364
+ business: z10.array(LaneDefinitionSchema).optional()
1365
+ });
1366
+
1367
+ // ../core/dist/schemas/cloud-config.js
1368
+ import { z as z11 } from "zod";
1369
+ var CloudEnvSignalSchema = z11.object({
1370
+ /**
1371
+ * Environment variable name to check.
1372
+ * Must be non-empty.
1373
+ */
1374
+ name: z11.string().min(1),
1375
+ /**
1376
+ * Optional exact value to match against.
1377
+ * When omitted, presence of a non-empty value is sufficient.
1378
+ */
1379
+ equals: z11.string().optional()
1380
+ });
1381
+ var CloudConfigSchema = z11.object({
1382
+ /**
1383
+ * Enable env-signal auto-detection for cloud mode.
1384
+ * When false (default), only explicit activation (--cloud / LUMENFLOW_CLOUD=1) works.
1385
+ * When true, env_signals are also checked.
1386
+ * @default false
1387
+ */
1388
+ auto_detect: z11.boolean().default(false),
1389
+ /**
1390
+ * Environment signals to check when auto_detect is true.
1391
+ * Each signal defines an environment variable name and optional value constraint.
1392
+ * Signals are checked in order; first match activates cloud mode.
1393
+ * @default []
1394
+ */
1395
+ env_signals: z11.array(CloudEnvSignalSchema).default([])
1396
+ });
1397
+
1398
+ // ../core/dist/schemas/operational-config.js
1399
+ import { z as z12 } from "zod";
1400
+ var PackageManagerSchema = z12.enum(["pnpm", "npm", "yarn", "bun"]).default("pnpm");
1401
+ var TestRunnerSchema = z12.enum(["vitest", "jest", "mocha"]).default("vitest");
1402
+ var UiConfigSchema = z12.object({
1403
+ /** Error box width (default: 70) */
1404
+ errorBoxWidth: z12.number().int().positive().default(70),
1405
+ /** Status preview lines (default: 5) */
1406
+ statusPreviewLines: z12.number().int().positive().default(5),
1407
+ /** Readiness box width (default: 50) */
1408
+ readinessBoxWidth: z12.number().int().positive().default(50)
1409
+ });
1410
+ var YamlConfigSchema = z12.object({
1411
+ /** Line width for YAML output (default: 100, -1 for no wrap) */
1412
+ lineWidth: z12.number().int().default(100)
1413
+ });
1414
+ var ValidationModeSchema = z12.enum(["off", "warn", "error"]).default("warn");
1415
+ var ExperimentalConfigSchema = z12.object({
1416
+ /**
1417
+ * Enable context-aware validation for wu:* commands
1418
+ * When enabled, commands will check location, WU status, and predicates
1419
+ * @default true
1420
+ */
1421
+ context_validation: z12.boolean().default(true),
1422
+ /**
1423
+ * Validation behavior mode
1424
+ * - 'off': No validation (legacy behavior)
1425
+ * - 'warn': Show warnings but proceed
1426
+ * - 'error': Block on validation failures
1427
+ * @default 'warn'
1428
+ */
1429
+ validation_mode: ValidationModeSchema,
1430
+ /**
1431
+ * Show next steps guidance after successful command completion
1432
+ * @default true
1433
+ */
1434
+ show_next_steps: z12.boolean().default(true),
1435
+ /**
1436
+ * Enable wu:recover command for state recovery
1437
+ * @default true
1438
+ */
1439
+ recovery_command: z12.boolean().default(true)
1440
+ });
1441
+ var MethodologyTelemetryConfigSchema = z12.object({
1442
+ /**
1443
+ * Enable methodology telemetry (opt-in).
1444
+ * When true, tracks methodology.testing and methodology.architecture values
1445
+ * on wu:spawn events. Data is privacy-preserving (no PII/project info).
1446
+ * @default false
1447
+ */
1448
+ enabled: z12.boolean().default(false)
1449
+ });
1450
+ var TelemetryConfigSchema = z12.object({
1451
+ /**
1452
+ * Methodology telemetry configuration (opt-in).
1453
+ * Tracks methodology selection patterns for adoption insights.
1454
+ */
1455
+ methodology: MethodologyTelemetryConfigSchema.default(() => MethodologyTelemetryConfigSchema.parse({}))
1456
+ });
1457
+ var CleanupTriggerSchema = z12.enum(["on_done", "on_init", "manual"]).default("on_done");
1458
+ var CleanupConfigSchema = z12.object({
1459
+ /**
1460
+ * When to trigger automatic state cleanup.
1461
+ * - 'on_done': Run after wu:done success (default)
1462
+ * - 'on_init': Run during lumenflow init
1463
+ * - 'manual': Only run via pnpm state:cleanup
1464
+ *
1465
+ * @default 'on_done'
1466
+ */
1467
+ trigger: CleanupTriggerSchema,
1468
+ /**
1469
+ * WU-1542: Commit message for auto-cleanup changes.
1470
+ * Consumer repos with strict main-branch guards may reject the default.
1471
+ * Configure this to match your repo's allowed commit message patterns.
1472
+ *
1473
+ * @default 'chore: lumenflow state cleanup [skip ci]'
1474
+ *
1475
+ * @example
1476
+ * ```yaml
1477
+ * cleanup:
1478
+ * commit_message: 'chore(repair): auto state cleanup [skip ci]'
1479
+ * ```
1480
+ */
1481
+ commit_message: z12.string().default("chore: lumenflow state cleanup [skip ci]")
1482
+ });
1483
+ var EscalationConfigSchema = z12.object({
1484
+ /**
1485
+ * Email address for human escalation notifications.
1486
+ * When escalation triggers fire, this email receives notification.
1487
+ *
1488
+ * @default 'escalation@example.com'
1489
+ */
1490
+ email: z12.string().email().default("escalation@example.com")
1491
+ });
1492
+
1493
+ // ../core/dist/lumenflow-config-schema.js
1494
+ var LumenFlowConfigSchema = z13.object({
1495
+ /** Schema version for future migrations */
1496
+ version: z13.string().default("1.0.0"),
1497
+ /** Directory paths */
1498
+ directories: DirectoriesSchema.default(() => DirectoriesSchema.parse({})),
1499
+ /** State paths (.lumenflow directory structure) */
1500
+ state: StatePathsSchema.default(() => StatePathsSchema.parse({})),
1501
+ /** Git configuration */
1502
+ git: GitConfigSchema.default(() => GitConfigSchema.parse({})),
1503
+ /** WU configuration */
1504
+ wu: WuConfigSchema.default(() => WuConfigSchema.parse({})),
1505
+ /** Gates configuration */
1506
+ gates: GatesConfigSchema.default(() => GatesConfigSchema.parse({})),
1507
+ /** Memory layer configuration */
1508
+ memory: MemoryConfigSchema.default(() => MemoryConfigSchema.parse({})),
1509
+ /** UI configuration */
1510
+ ui: UiConfigSchema.default(() => UiConfigSchema.parse({})),
1511
+ /** YAML configuration */
1512
+ yaml: YamlConfigSchema.default(() => YamlConfigSchema.parse({})),
1513
+ /** Agents configuration */
1514
+ agents: AgentsConfigSchema.default(() => AgentsConfigSchema.parse({})),
1515
+ /** Experimental features (WU-1090) */
1516
+ experimental: ExperimentalConfigSchema.default(() => ExperimentalConfigSchema.parse({})),
1517
+ /** WU-1366: Cleanup configuration */
1518
+ cleanup: CleanupConfigSchema.default(() => CleanupConfigSchema.parse({})),
1519
+ /** WU-1270: Telemetry configuration */
1520
+ telemetry: TelemetryConfigSchema.default(() => TelemetryConfigSchema.parse({})),
1521
+ /** WU-1259: Methodology configuration */
1522
+ methodology: MethodologyConfigSchema.optional(),
1523
+ /** WU-1495: Cloud auto-detection configuration */
1524
+ cloud: CloudConfigSchema.default(() => CloudConfigSchema.parse({})),
1525
+ /** WU-1345: Lanes configuration */
1526
+ lanes: LanesConfigSchema.optional(),
1527
+ /** WU-2122: Escalation routing configuration */
1528
+ escalation: EscalationConfigSchema.default(() => EscalationConfigSchema.parse({})),
1529
+ /** WU-1356: Package manager for CLI operations */
1530
+ package_manager: PackageManagerSchema,
1531
+ /** WU-1356: Test runner for incremental test detection */
1532
+ test_runner: TestRunnerSchema,
1533
+ /** WU-1356: Custom build command for CLI bootstrap */
1534
+ build_command: z13.string().default("pnpm build")
1535
+ });
1536
+ function parseConfig(data = {}) {
1537
+ return LumenFlowConfigSchema.parse(data);
1538
+ }
1539
+ function getDefaultConfig() {
1540
+ return LumenFlowConfigSchema.parse({});
1541
+ }
1542
+
1543
+ // ../core/dist/normalize-config-keys.js
1544
+ var GIT_KEY_MAP = {
1545
+ agent_branch_patterns: "agentBranchPatterns",
1546
+ agent_branch_patterns_override: "agentBranchPatternsOverride",
1547
+ disable_agent_pattern_registry: "disableAgentPatternRegistry",
1548
+ main_branch: "mainBranch",
1549
+ default_remote: "defaultRemote",
1550
+ require_remote: "requireRemote",
1551
+ lane_branch_prefix: "laneBranchPrefix",
1552
+ max_branch_drift: "maxBranchDrift"
1553
+ };
1554
+ function normalizeSection(section, keyMap) {
1555
+ const result = {};
1556
+ for (const [key, value] of Object.entries(section)) {
1557
+ const camelKey = keyMap[key];
1558
+ if (camelKey) {
1559
+ if (!(camelKey in section)) {
1560
+ result[camelKey] = value;
1561
+ }
1562
+ } else {
1563
+ result[key] = value;
1564
+ }
1565
+ }
1566
+ return result;
1567
+ }
1568
+ function normalizeConfigKeys(raw) {
1569
+ if (!raw || typeof raw !== "object") {
1570
+ return raw ?? {};
1571
+ }
1572
+ const result = { ...raw };
1573
+ if (result.git && typeof result.git === "object" && !Array.isArray(result.git)) {
1574
+ result.git = normalizeSection(result.git, GIT_KEY_MAP);
1575
+ }
1576
+ return result;
1577
+ }
1578
+
1579
+ // ../core/dist/lumenflow-config.js
1580
+ import * as fs2 from "fs";
1581
+ import * as path2 from "path";
1582
+ import * as yaml2 from "yaml";
1583
+ var UTF8_ENCODING = "utf8";
1584
+ var WARNING_PREFIX = "[lumenflow-config]";
1585
+ var WORKSPACE_INIT_COMMAND = "pnpm workspace-init --yes";
1586
+ var WORKSPACE_CONFIG_SECTION = WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY;
1587
+ function getConfigFilePresence(projectRoot) {
1588
+ return {
1589
+ workspaceConfigExists: fs2.existsSync(path2.join(projectRoot, WORKSPACE_CONFIG_FILE_NAME))
1590
+ };
1591
+ }
1592
+ var cachedConfig = null;
1593
+ var cachedProjectRoot = null;
1594
+ function parseYamlRecord(content) {
1595
+ return asRecord(yaml2.parse(content));
1596
+ }
1597
+ function findProjectRoot(startDir = process.cwd()) {
1598
+ let currentDir = path2.resolve(startDir);
1599
+ const filesystemRoot = path2.parse(currentDir).root;
1600
+ while (true) {
1601
+ if (fs2.existsSync(path2.join(currentDir, WORKSPACE_CONFIG_FILE_NAME))) {
1602
+ return currentDir;
1603
+ }
1604
+ if (fs2.existsSync(path2.join(currentDir, GIT_DIRECTORY_NAME))) {
1605
+ return currentDir;
1606
+ }
1607
+ if (currentDir === filesystemRoot) {
1608
+ break;
1609
+ }
1610
+ currentDir = path2.dirname(currentDir);
1611
+ }
1612
+ return process.cwd();
1613
+ }
1614
+ function loadWorkspaceSoftwareDeliveryConfig(projectRoot) {
1615
+ const workspacePath = path2.join(projectRoot, WORKSPACE_CONFIG_FILE_NAME);
1616
+ if (!fs2.existsSync(workspacePath)) {
1617
+ return null;
1618
+ }
1619
+ try {
1620
+ const content = fs2.readFileSync(workspacePath, UTF8_ENCODING);
1621
+ const workspaceData = parseYamlRecord(content);
1622
+ if (!workspaceData) {
1623
+ console.warn(`${WARNING_PREFIX} ${WORKSPACE_CONFIG_FILE_NAME} does not contain a valid object root.`);
1624
+ return null;
1625
+ }
1626
+ const parsedExtensions = WorkspaceV2ExtensionsSchema.safeParse(workspaceData);
1627
+ if (!parsedExtensions.success) {
1628
+ const hasSoftwareDeliveryError = parsedExtensions.error.issues.some((issue) => issue.path[0] === WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY);
1629
+ if (hasSoftwareDeliveryError) {
1630
+ console.warn(`${WARNING_PREFIX} ${WORKSPACE_CONFIG_FILE_NAME} is missing a valid ${WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY} block.`);
1631
+ }
1632
+ return null;
1633
+ }
1634
+ return normalizeConfigKeys(parsedExtensions.data[WORKSPACE_V2_KEYS.SOFTWARE_DELIVERY]);
1635
+ } catch (error) {
1636
+ console.warn(`${WARNING_PREFIX} Failed to parse ${WORKSPACE_CONFIG_FILE_NAME}:`, error instanceof Error ? error.message : String(error));
1637
+ return null;
1638
+ }
1639
+ }
1640
+ function getConfig(options = {}) {
1641
+ const { projectRoot: overrideRoot, reload = false, strictWorkspace = false } = options;
1642
+ if (cachedConfig && !reload && !overrideRoot) {
1643
+ return cachedConfig;
1644
+ }
1645
+ const projectRoot = overrideRoot || findProjectRoot();
1646
+ const { workspaceConfigExists } = getConfigFilePresence(projectRoot);
1647
+ if (strictWorkspace && !workspaceConfigExists) {
1648
+ throw createError(ErrorCodes.CONFIG_ERROR, `${WARNING_PREFIX} Missing ${WORKSPACE_CONFIG_FILE_NAME}. Run \`${WORKSPACE_INIT_COMMAND}\` to scaffold workspace config.`);
1649
+ }
1650
+ const workspaceConfig = loadWorkspaceSoftwareDeliveryConfig(projectRoot);
1651
+ if (strictWorkspace && workspaceConfigExists && !workspaceConfig) {
1652
+ throw createError(ErrorCodes.CONFIG_ERROR, `${WARNING_PREFIX} ${WORKSPACE_CONFIG_FILE_NAME} exists but is invalid. Ensure \`${WORKSPACE_CONFIG_SECTION}\` contains valid configuration values.`);
1653
+ }
1654
+ const config = parseConfig(workspaceConfig ?? {});
1655
+ if (!overrideRoot) {
1656
+ cachedConfig = config;
1657
+ cachedProjectRoot = projectRoot;
1658
+ }
1659
+ return config;
1660
+ }
1661
+ function getProjectRoot() {
1662
+ if (cachedProjectRoot) {
1663
+ return cachedProjectRoot;
1664
+ }
1665
+ cachedProjectRoot = findProjectRoot();
1666
+ return cachedProjectRoot;
1667
+ }
1668
+ function clearConfigCache() {
1669
+ cachedConfig = null;
1670
+ cachedProjectRoot = null;
1671
+ }
1672
+ function getResolvedPaths(options = {}) {
1673
+ const projectRoot = options.projectRoot || getProjectRoot();
1674
+ const config = getConfig({
1675
+ projectRoot,
1676
+ strictWorkspace: options.strictWorkspace
1677
+ });
1678
+ return {
1679
+ wuDir: path2.join(projectRoot, config.directories.wuDir),
1680
+ initiativesDir: path2.join(projectRoot, config.directories.initiativesDir),
1681
+ backlogPath: path2.join(projectRoot, config.directories.backlogPath),
1682
+ statusPath: path2.join(projectRoot, config.directories.statusPath),
1683
+ worktrees: path2.join(projectRoot, config.directories.worktrees),
1684
+ stampsDir: path2.join(projectRoot, config.state.stampsDir),
1685
+ stateDir: path2.join(projectRoot, config.state.stateDir),
1686
+ skillsDir: path2.join(projectRoot, config.directories.skillsDir),
1687
+ agentsDir: path2.join(projectRoot, config.directories.agentsDir),
1688
+ memoryBank: path2.join(projectRoot, config.directories.memoryBank),
1689
+ plansDir: path2.join(projectRoot, config.directories.plansDir),
1690
+ templatesDir: path2.join(projectRoot, config.directories.templatesDir),
1691
+ onboardingDir: path2.join(projectRoot, config.directories.onboardingDir),
1692
+ completeGuidePath: path2.join(projectRoot, config.directories.completeGuidePath),
1693
+ quickRefPath: path2.join(projectRoot, config.directories.quickRefPath),
1694
+ startingPromptPath: path2.join(projectRoot, config.directories.startingPromptPath),
1695
+ sizingGuidePath: path2.join(projectRoot, config.directories.sizingGuidePath),
1696
+ governancePath: path2.join(projectRoot, config.directories.governancePath),
1697
+ safeGitPath: path2.join(projectRoot, config.directories.safeGitPath)
1698
+ };
1699
+ }
1700
+
1701
+ export {
1702
+ WU_STATUS,
1703
+ resolveWUStatus,
1704
+ getWUStatusDisplay,
1705
+ PROTECTED_WU_STATUSES,
1706
+ PROGRESSABLE_WU_STATUSES,
1707
+ WU_STATUS_GROUPS,
1708
+ CLAIMED_MODES,
1709
+ INCIDENT_SEVERITY,
1710
+ WU_TYPES,
1711
+ WU_EXPOSURE,
1712
+ WU_EXPOSURE_VALUES,
1713
+ TEST_TYPES,
1714
+ WORKSPACE_CONFIG_FILE_NAME,
1715
+ GIT_DIRECTORY_NAME,
1716
+ GIT_WORKTREES_SENTINEL,
1717
+ WORKSPACE_V2_KEYS,
1718
+ WRITABLE_ROOT_KEYS,
1719
+ MANAGED_ROOT_KEYS,
1720
+ DOCS_LAYOUT_PRESETS,
1721
+ DEFAULT_DOCS_LAYOUT,
1722
+ getDocsLayoutPreset,
1723
+ LUMENFLOW_CLIENT_IDS,
1724
+ resolvePolicy,
1725
+ MS_PER_MINUTE,
1726
+ MS_PER_HOUR,
1727
+ MS_PER_DAY,
1728
+ asRecord,
1729
+ GATE_PRESETS,
1730
+ getGatesSection,
1731
+ resolveTestPolicy,
1732
+ resolveTestRunner,
1733
+ resolveGatesCommands,
1734
+ loadLaneHealthConfig,
1735
+ DEFAULT_MIN_COVERAGE,
1736
+ CoChangeRuleConfigSchema,
1737
+ LumenFlowConfigSchema,
1738
+ getDefaultConfig,
1739
+ normalizeConfigKeys,
1740
+ getConfigFilePresence,
1741
+ findProjectRoot,
1742
+ getConfig,
1743
+ getProjectRoot,
1744
+ clearConfigCache,
1745
+ getResolvedPaths
1746
+ };