@lumenflow/core 2.2.2 → 2.3.1

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 (213) hide show
  1. package/dist/active-wu-detector.d.ts +1 -1
  2. package/dist/active-wu-detector.js +1 -1
  3. package/dist/arg-parser.js +51 -18
  4. package/dist/backlog-generator.d.ts +4 -4
  5. package/dist/backlog-generator.js +4 -4
  6. package/dist/backlog-sync-validator.js +1 -1
  7. package/dist/cleanup-lock.d.ts +9 -2
  8. package/dist/cleanup-lock.js +17 -7
  9. package/dist/code-path-validator.d.ts +3 -3
  10. package/dist/code-path-validator.js +3 -3
  11. package/dist/compliance-parser.d.ts +1 -1
  12. package/dist/compliance-parser.js +1 -1
  13. package/dist/constants/backlog-patterns.d.ts +1 -1
  14. package/dist/constants/backlog-patterns.js +1 -1
  15. package/dist/constants/dora-constants.d.ts +1 -1
  16. package/dist/constants/dora-constants.js +1 -1
  17. package/dist/constants/gate-constants.d.ts +1 -1
  18. package/dist/constants/gate-constants.js +1 -1
  19. package/dist/constants/linter-constants.d.ts +1 -1
  20. package/dist/constants/linter-constants.js +1 -1
  21. package/dist/constants/tokenizer-constants.d.ts +1 -1
  22. package/dist/constants/tokenizer-constants.js +1 -1
  23. package/dist/context/location-resolver.js +2 -1
  24. package/dist/context-validation-integration.d.ts +1 -0
  25. package/dist/core/scope-checker.d.ts +3 -3
  26. package/dist/core/scope-checker.js +3 -3
  27. package/dist/core/tool-runner.d.ts +5 -5
  28. package/dist/core/tool-runner.js +5 -5
  29. package/dist/core/tool.constants.d.ts +1 -1
  30. package/dist/core/tool.constants.js +1 -1
  31. package/dist/core/tool.schemas.d.ts +2 -2
  32. package/dist/core/tool.schemas.js +1 -1
  33. package/dist/core/worktree-guard.d.ts +1 -1
  34. package/dist/core/worktree-guard.js +1 -1
  35. package/dist/coverage-gate.d.ts +12 -3
  36. package/dist/coverage-gate.js +15 -8
  37. package/dist/date-utils.d.ts +4 -4
  38. package/dist/date-utils.js +4 -4
  39. package/dist/dependency-graph.d.ts +6 -0
  40. package/dist/dependency-graph.js +43 -2
  41. package/dist/dependency-guard.d.ts +2 -2
  42. package/dist/dependency-guard.js +3 -3
  43. package/dist/dependency-validator.d.ts +4 -4
  44. package/dist/dependency-validator.js +4 -7
  45. package/dist/domain/orchestration.constants.d.ts +31 -10
  46. package/dist/domain/orchestration.constants.js +45 -16
  47. package/dist/domain/orchestration.schemas.d.ts +54 -28
  48. package/dist/domain/orchestration.schemas.js +2 -2
  49. package/dist/domain/orchestration.types.d.ts +2 -2
  50. package/dist/domain/orchestration.types.js +2 -2
  51. package/dist/error-handler.d.ts +10 -10
  52. package/dist/error-handler.js +10 -10
  53. package/dist/file-classifiers.d.ts +6 -6
  54. package/dist/file-classifiers.js +6 -6
  55. package/dist/gates-config.d.ts +74 -0
  56. package/dist/gates-config.js +209 -2
  57. package/dist/git-adapter.d.ts +11 -11
  58. package/dist/git-adapter.js +11 -11
  59. package/dist/git-context-extractor.d.ts +112 -0
  60. package/dist/git-context-extractor.js +559 -0
  61. package/dist/hardcoded-strings.d.ts +1 -1
  62. package/dist/hardcoded-strings.js +1 -1
  63. package/dist/incremental-lint.d.ts +1 -1
  64. package/dist/incremental-lint.js +2 -2
  65. package/dist/incremental-test.d.ts +1 -1
  66. package/dist/incremental-test.js +1 -1
  67. package/dist/index.d.ts +13 -0
  68. package/dist/index.js +25 -0
  69. package/dist/invariants/check-automated-tests.d.ts +2 -2
  70. package/dist/invariants/check-automated-tests.js +3 -3
  71. package/dist/lane-checker.d.ts +28 -7
  72. package/dist/lane-checker.js +316 -159
  73. package/dist/lane-suggest-prompt.d.ts +108 -0
  74. package/dist/lane-suggest-prompt.js +359 -0
  75. package/dist/lane-validator.d.ts +3 -3
  76. package/dist/lane-validator.js +3 -3
  77. package/dist/logs-lib.d.ts +1 -1
  78. package/dist/logs-lib.js +1 -1
  79. package/dist/lumenflow-config-schema.d.ts +162 -0
  80. package/dist/lumenflow-config-schema.js +180 -0
  81. package/dist/manual-test-validator.d.ts +2 -2
  82. package/dist/manual-test-validator.js +3 -3
  83. package/dist/merge-lock.d.ts +8 -1
  84. package/dist/merge-lock.js +16 -7
  85. package/dist/micro-worktree.d.ts +81 -13
  86. package/dist/micro-worktree.js +98 -17
  87. package/dist/migration-deployer.d.ts +1 -1
  88. package/dist/migration-deployer.js +1 -1
  89. package/dist/orchestration-advisory-loader.d.ts +2 -2
  90. package/dist/orchestration-advisory-loader.js +10 -6
  91. package/dist/orchestration-advisory.d.ts +3 -3
  92. package/dist/orchestration-advisory.js +4 -4
  93. package/dist/orchestration-di.d.ts +4 -4
  94. package/dist/orchestration-di.js +4 -4
  95. package/dist/orchestration-rules.d.ts +4 -4
  96. package/dist/orchestration-rules.js +18 -10
  97. package/dist/orphan-detector.d.ts +3 -3
  98. package/dist/orphan-detector.js +3 -3
  99. package/dist/patrol-loop.d.ts +170 -0
  100. package/dist/patrol-loop.js +186 -0
  101. package/dist/process-detector.d.ts +5 -5
  102. package/dist/process-detector.js +5 -5
  103. package/dist/rebase-artifact-cleanup.d.ts +3 -3
  104. package/dist/rebase-artifact-cleanup.js +3 -3
  105. package/dist/resolve-policy.d.ts +195 -0
  106. package/dist/resolve-policy.js +203 -0
  107. package/dist/risk-detector.d.ts +2 -2
  108. package/dist/risk-detector.js +2 -2
  109. package/dist/rollback-utils.d.ts +1 -1
  110. package/dist/rollback-utils.js +1 -1
  111. package/dist/section-headings.d.ts +1 -1
  112. package/dist/section-headings.js +1 -1
  113. package/dist/spawn-escalation.d.ts +4 -4
  114. package/dist/spawn-escalation.js +3 -3
  115. package/dist/spawn-monitor.d.ts +4 -4
  116. package/dist/spawn-monitor.js +4 -4
  117. package/dist/spawn-recovery.d.ts +3 -3
  118. package/dist/spawn-recovery.js +3 -3
  119. package/dist/spawn-registry-schema.d.ts +2 -2
  120. package/dist/spawn-registry-schema.js +2 -2
  121. package/dist/spawn-registry-store.d.ts +2 -2
  122. package/dist/spawn-registry-store.js +2 -2
  123. package/dist/spawn-strategy.d.ts +17 -11
  124. package/dist/spawn-strategy.js +47 -44
  125. package/dist/spawn-tree.d.ts +3 -3
  126. package/dist/spawn-tree.js +3 -3
  127. package/dist/state-cleanup-core.d.ts +205 -0
  128. package/dist/state-cleanup-core.js +240 -0
  129. package/dist/state-doctor-core.d.ts +168 -0
  130. package/dist/state-doctor-core.js +251 -0
  131. package/dist/stream-error-handler.d.ts +67 -0
  132. package/dist/stream-error-handler.js +94 -0
  133. package/dist/telemetry.d.ts +1 -1
  134. package/dist/telemetry.js +1 -1
  135. package/dist/template-loader.d.ts +162 -0
  136. package/dist/template-loader.js +372 -0
  137. package/dist/test-baseline.d.ts +176 -0
  138. package/dist/test-baseline.js +282 -0
  139. package/dist/usecases/get-suggestions.usecase.d.ts +1 -1
  140. package/dist/validation/command-registry.js +37 -0
  141. package/dist/validators/backlog-sync.js +4 -2
  142. package/dist/worktree-scanner.d.ts +1 -1
  143. package/dist/worktree-scanner.js +1 -1
  144. package/dist/worktree-symlink.d.ts +3 -3
  145. package/dist/worktree-symlink.js +3 -3
  146. package/dist/wu-backlog-updater.d.ts +1 -1
  147. package/dist/wu-backlog-updater.js +1 -1
  148. package/dist/wu-claim-helpers.d.ts +1 -1
  149. package/dist/wu-claim-helpers.js +1 -1
  150. package/dist/wu-claim-resume.d.ts +1 -1
  151. package/dist/wu-claim-resume.js +1 -1
  152. package/dist/wu-consistency-checker.d.ts +1 -1
  153. package/dist/wu-consistency-checker.js +17 -11
  154. package/dist/wu-constants.d.ts +73 -21
  155. package/dist/wu-constants.js +65 -22
  156. package/dist/wu-done-branch-only.d.ts +1 -1
  157. package/dist/wu-done-branch-only.js +1 -1
  158. package/dist/wu-done-docs-generate.d.ts +1 -1
  159. package/dist/wu-done-docs-generate.js +1 -1
  160. package/dist/wu-done-messages.d.ts +2 -2
  161. package/dist/wu-done-messages.js +2 -2
  162. package/dist/wu-done-metadata.d.ts +3 -3
  163. package/dist/wu-done-metadata.js +3 -3
  164. package/dist/wu-done-pr.d.ts +1 -1
  165. package/dist/wu-done-pr.js +4 -2
  166. package/dist/wu-done-preflight.d.ts +8 -0
  167. package/dist/wu-done-preflight.js +18 -2
  168. package/dist/wu-done-ui.d.ts +3 -3
  169. package/dist/wu-done-ui.js +3 -3
  170. package/dist/wu-done-validation.d.ts +30 -0
  171. package/dist/wu-done-validation.js +106 -1
  172. package/dist/wu-done-worktree.d.ts +1 -1
  173. package/dist/wu-done-worktree.js +11 -1
  174. package/dist/wu-events-cleanup.d.ts +148 -0
  175. package/dist/wu-events-cleanup.js +401 -0
  176. package/dist/wu-helpers.d.ts +2 -2
  177. package/dist/wu-helpers.js +2 -2
  178. package/dist/wu-id-generator.d.ts +58 -0
  179. package/dist/wu-id-generator.js +103 -0
  180. package/dist/wu-lint.js +1 -1
  181. package/dist/wu-preflight-validators.d.ts +13 -1
  182. package/dist/wu-preflight-validators.js +56 -1
  183. package/dist/wu-recovery.d.ts +2 -2
  184. package/dist/wu-recovery.js +4 -4
  185. package/dist/wu-repair-core.d.ts +5 -5
  186. package/dist/wu-repair-core.js +6 -6
  187. package/dist/wu-schema-normalization.d.ts +1 -1
  188. package/dist/wu-schema-normalization.js +1 -1
  189. package/dist/wu-schema.d.ts +7 -7
  190. package/dist/wu-schema.js +8 -8
  191. package/dist/wu-spawn-context.d.ts +87 -0
  192. package/dist/wu-spawn-context.js +175 -0
  193. package/dist/wu-spawn-helpers.d.ts +1 -1
  194. package/dist/wu-spawn-helpers.js +1 -1
  195. package/dist/wu-spawn.d.ts +177 -4
  196. package/dist/wu-spawn.js +694 -72
  197. package/dist/wu-state-schema.d.ts +1 -1
  198. package/dist/wu-state-schema.js +1 -1
  199. package/dist/wu-state-store.d.ts +3 -3
  200. package/dist/wu-state-store.js +3 -3
  201. package/dist/wu-status-transition.d.ts +1 -1
  202. package/dist/wu-status-transition.js +1 -1
  203. package/dist/wu-status-updater.d.ts +3 -3
  204. package/dist/wu-status-updater.js +3 -3
  205. package/dist/wu-validation-constants.d.ts +2 -2
  206. package/dist/wu-validation-constants.js +2 -2
  207. package/dist/wu-validation.d.ts +3 -3
  208. package/dist/wu-validation.js +3 -3
  209. package/dist/wu-yaml-fixer.d.ts +2 -2
  210. package/dist/wu-yaml-fixer.js +3 -3
  211. package/dist/wu-yaml.d.ts +23 -0
  212. package/dist/wu-yaml.js +76 -2
  213. package/package.json +5 -2
@@ -4,7 +4,7 @@
4
4
  * Zod schemas for WU state event validation.
5
5
  * Defines event types for WU lifecycle: create, claim, block, unblock, complete.
6
6
  *
7
- * @see {@link tools/lib/__tests__/wu-state-store.test.mjs} - Tests
7
+ * @see {@link packages/@lumenflow/cli/src/lib/__tests__/wu-state-store.test.ts} - Tests
8
8
  */
9
9
  import { z } from 'zod';
10
10
  /**
@@ -4,7 +4,7 @@
4
4
  * Zod schemas for WU state event validation.
5
5
  * Defines event types for WU lifecycle: create, claim, block, unblock, complete.
6
6
  *
7
- * @see {@link tools/lib/__tests__/wu-state-store.test.mjs} - Tests
7
+ * @see {@link packages/@lumenflow/cli/src/lib/__tests__/wu-state-store.test.ts} - Tests
8
8
  */
9
9
  import { z } from 'zod';
10
10
  /**
@@ -12,8 +12,8 @@
12
12
  * - File locking with stale detection (WU-2240)
13
13
  * - Corruption recovery via repairStateFile (WU-2240)
14
14
  *
15
- * @see {@link tools/__tests__/state-store-concurrent.test.mjs} - Concurrent access tests
16
- * @see {@link tools/lib/wu-state-schema.mjs} - Schema definitions
15
+ * @see {@link packages/@lumenflow/cli/src/__tests__/state-store-concurrent.test.ts} - Concurrent access tests
16
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-state-schema.ts} - Schema definitions
17
17
  */
18
18
  import { type WUEvent } from './wu-state-schema.js';
19
19
  /**
@@ -174,7 +174,7 @@ export declare class WUStateStore {
174
174
  * @example
175
175
  * await store.checkpoint('WU-1748', 'Completed worktree scanner', {
176
176
  * progress: 'Scanner implemented and tests passing',
177
- * nextSteps: 'Integrate into orchestrate:status'
177
+ * nextSteps: 'Integrate into orchestrate:monitor'
178
178
  * });
179
179
  */
180
180
  checkpoint(wuId: string, note: string, options?: CheckpointOptions): Promise<void>;
@@ -12,8 +12,8 @@
12
12
  * - File locking with stale detection (WU-2240)
13
13
  * - Corruption recovery via repairStateFile (WU-2240)
14
14
  *
15
- * @see {@link tools/__tests__/state-store-concurrent.test.mjs} - Concurrent access tests
16
- * @see {@link tools/lib/wu-state-schema.mjs} - Schema definitions
15
+ * @see {@link packages/@lumenflow/cli/src/__tests__/state-store-concurrent.test.ts} - Concurrent access tests
16
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-state-schema.ts} - Schema definitions
17
17
  */
18
18
  import fs from 'node:fs/promises';
19
19
  import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync, unlinkSync, openSync, closeSync, fsyncSync, } from 'node:fs';
@@ -376,7 +376,7 @@ export class WUStateStore {
376
376
  * @example
377
377
  * await store.checkpoint('WU-1748', 'Completed worktree scanner', {
378
378
  * progress: 'Scanner implemented and tests passing',
379
- * nextSteps: 'Integrate into orchestrate:status'
379
+ * nextSteps: 'Integrate into orchestrate:monitor'
380
380
  * });
381
381
  */
382
382
  async checkpoint(wuId, note, options = {}) {
@@ -2,7 +2,7 @@
2
2
  * WU Status Transition Module
3
3
  *
4
4
  * Shared logic for block/unblock status transitions.
5
- * Eliminates 90% code duplication between wu-block.mjs and wu-unblock.mjs.
5
+ * Eliminates 90% code duplication between wu-block.ts and wu-unblock.ts.
6
6
  *
7
7
  * Responsibilities:
8
8
  * - Validate state transitions (via state-machine)
@@ -2,7 +2,7 @@
2
2
  * WU Status Transition Module
3
3
  *
4
4
  * Shared logic for block/unblock status transitions.
5
- * Eliminates 90% code duplication between wu-block.mjs and wu-unblock.mjs.
5
+ * Eliminates 90% code duplication between wu-block.ts and wu-unblock.ts.
6
6
  *
7
7
  * Responsibilities:
8
8
  * - Validate state transitions (via state-machine)
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Status.md Update Utilities
3
3
  *
4
- * Centralized status.md update functions (extracted from wu-done.mjs)
4
+ * Centralized status.md update functions (extracted from wu-done.ts)
5
5
  * Refactored to use frontmatter-based section headings (no magic strings)
6
6
  *
7
7
  * Used by both main wu:done flow AND recovery mode (DRY principle)
8
8
  */
9
9
  /**
10
10
  * Remove WU from In Progress section (idempotent)
11
- * Refactored from wu-done.mjs line 471 to use frontmatter headings
11
+ * Refactored from wu-done.ts line 471 to use frontmatter headings
12
12
  *
13
13
  * @param {string} statusPath - Path to status.md
14
14
  * @param {string} id - WU ID
@@ -16,7 +16,7 @@
16
16
  export declare function updateStatusRemoveInProgress(statusPath: any, id: any): void;
17
17
  /**
18
18
  * Add WU to Completed section (idempotent - checks for duplicates)
19
- * Refactored from wu-done.mjs line 499 to use frontmatter headings
19
+ * Refactored from wu-done.ts line 499 to use frontmatter headings
20
20
  *
21
21
  * @param {string} statusPath - Path to status.md
22
22
  * @param {string} id - WU ID
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Status.md Update Utilities
3
3
  *
4
- * Centralized status.md update functions (extracted from wu-done.mjs)
4
+ * Centralized status.md update functions (extracted from wu-done.ts)
5
5
  * Refactored to use frontmatter-based section headings (no magic strings)
6
6
  *
7
7
  * Used by both main wu:done flow AND recovery mode (DRY principle)
@@ -15,7 +15,7 @@ import { die, createError, ErrorCodes } from './error-handler.js';
15
15
  import { STRING_LITERALS } from './wu-constants.js';
16
16
  /**
17
17
  * Remove WU from In Progress section (idempotent)
18
- * Refactored from wu-done.mjs line 471 to use frontmatter headings
18
+ * Refactored from wu-done.ts line 471 to use frontmatter headings
19
19
  *
20
20
  * @param {string} statusPath - Path to status.md
21
21
  * @param {string} id - WU ID
@@ -67,7 +67,7 @@ export function updateStatusRemoveInProgress(statusPath, id) {
67
67
  }
68
68
  /**
69
69
  * Add WU to Completed section (idempotent - checks for duplicates)
70
- * Refactored from wu-done.mjs line 499 to use frontmatter headings
70
+ * Refactored from wu-done.ts line 499 to use frontmatter headings
71
71
  *
72
72
  * @param {string} statusPath - Path to status.md
73
73
  * @param {string} id - WU ID
@@ -2,7 +2,7 @@
2
2
  * WU Validation Constants (WU-1243)
3
3
  *
4
4
  * Centralizes magic numbers for lane inference and incident validation.
5
- * Extracted from lane-inference.mjs and agent-incidents.mjs for DRY compliance.
5
+ * Extracted from lane-inference.ts and agent-incidents.ts for DRY compliance.
6
6
  *
7
7
  * @module wu-validation-constants
8
8
  */
@@ -55,6 +55,6 @@ export declare const VALIDATION_LIMITS: {
55
55
  };
56
56
  /**
57
57
  * Valid incident categories for agent issue logging.
58
- * Duplicated from agent-incidents.mjs z.enum for use in default arrays.
58
+ * Duplicated from agent-incidents.ts z.enum for use in default arrays.
59
59
  */
60
60
  export declare const INCIDENT_CATEGORIES: readonly ["workflow", "tooling", "confusion", "violation", "error"];
@@ -2,7 +2,7 @@
2
2
  * WU Validation Constants (WU-1243)
3
3
  *
4
4
  * Centralizes magic numbers for lane inference and incident validation.
5
- * Extracted from lane-inference.mjs and agent-incidents.mjs for DRY compliance.
5
+ * Extracted from lane-inference.ts and agent-incidents.ts for DRY compliance.
6
6
  *
7
7
  * @module wu-validation-constants
8
8
  */
@@ -55,7 +55,7 @@ export const VALIDATION_LIMITS = {
55
55
  };
56
56
  /**
57
57
  * Valid incident categories for agent issue logging.
58
- * Duplicated from agent-incidents.mjs z.enum for use in default arrays.
58
+ * Duplicated from agent-incidents.ts z.enum for use in default arrays.
59
59
  */
60
60
  export const INCIDENT_CATEGORIES = [
61
61
  'workflow',
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * Part of INIT-031 Phase 4: Prevent backend-without-UI pattern.
11
11
  *
12
- * @see {@link tools/wu-done.mjs} - Consumer
13
- * @see {@link tools/lib/wu-schema.mjs} - WU schema with exposure field
14
- * @see {@link tools/lib/wu-constants.mjs} - WU_EXPOSURE values
12
+ * @see {@link packages/@lumenflow/cli/src/wu-done.ts} - Consumer
13
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-schema.ts} - WU schema with exposure field
14
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-constants.ts} - WU_EXPOSURE values
15
15
  */
16
16
  export declare function resolveExposureDefault(lane: any): "documentation" | "backend-only";
17
17
  /**
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * Part of INIT-031 Phase 4: Prevent backend-without-UI pattern.
11
11
  *
12
- * @see {@link tools/wu-done.mjs} - Consumer
13
- * @see {@link tools/lib/wu-schema.mjs} - WU schema with exposure field
14
- * @see {@link tools/lib/wu-constants.mjs} - WU_EXPOSURE values
12
+ * @see {@link packages/@lumenflow/cli/src/wu-done.ts} - Consumer
13
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-schema.ts} - WU schema with exposure field
14
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-constants.ts} - WU_EXPOSURE values
15
15
  */
16
16
  import { WU_EXPOSURE } from './wu-constants.js';
17
17
  const LANE_PARENTS = {
@@ -10,8 +10,8 @@
10
10
  * - docs → documentation (type field)
11
11
  * - String numbers → number (phase field)
12
12
  *
13
- * @see {@link tools/lib/wu-schema.mjs} - WU schema definition
14
- * @see {@link tools/wu-claim.mjs} - Consumer
13
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-schema.ts} - WU schema definition
14
+ * @see {@link packages/@lumenflow/cli/src/wu-claim.ts} - Consumer
15
15
  */
16
16
  /**
17
17
  * Issue types that can be detected and auto-fixed
@@ -10,13 +10,13 @@
10
10
  * - docs → documentation (type field)
11
11
  * - String numbers → number (phase field)
12
12
  *
13
- * @see {@link tools/lib/wu-schema.mjs} - WU schema definition
14
- * @see {@link tools/wu-claim.mjs} - Consumer
13
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-schema.ts} - WU schema definition
14
+ * @see {@link packages/@lumenflow/cli/src/wu-claim.ts} - Consumer
15
15
  */
16
16
  import { readFileSync, writeFileSync, copyFileSync } from 'node:fs';
17
17
  import { parseYAML, stringifyYAML } from './wu-yaml.js';
18
18
  import { DEFAULTS, STRING_LITERALS } from './wu-constants.js';
19
- // Valid type values from wu-schema.mjs
19
+ // Valid type values from wu-schema.ts
20
20
  const VALID_TYPES = ['feature', 'bug', 'documentation', 'process', 'tooling', 'chore', 'refactor'];
21
21
  // Common type aliases that should be auto-fixed
22
22
  const TYPE_ALIASES = {
package/dist/wu-yaml.d.ts CHANGED
@@ -27,6 +27,20 @@ export declare const YAML_STRINGIFY_OPTIONS: Readonly<{
27
27
  * @throws {Error} If file not found, YAML invalid, or ID mismatch
28
28
  */
29
29
  export declare function readWU(wuPath: any, expectedId: any): any;
30
+ /**
31
+ * Read and parse WU YAML file asynchronously.
32
+ *
33
+ * Validates:
34
+ * - File exists
35
+ * - YAML is valid
36
+ * - WU ID matches expected ID
37
+ *
38
+ * @param {string} wuPath - Path to WU YAML file
39
+ * @param {string} expectedId - Expected WU ID (e.g., 'WU-123')
40
+ * @returns {Promise<object>} Parsed YAML document
41
+ * @throws {Error} If file not found, YAML invalid, or ID mismatch
42
+ */
43
+ export declare function readWUAsync(wuPath: any, expectedId: any): Promise<any>;
30
44
  /**
31
45
  * Parse YAML string to object.
32
46
  * WU-1352: Centralized YAML parsing for consistency.
@@ -54,6 +68,15 @@ export declare function stringifyYAML(doc: any, options?: {}): string;
54
68
  * @throws {Error} If file not found or YAML invalid
55
69
  */
56
70
  export declare function readWURaw(yamlPath: any): any;
71
+ /**
72
+ * Read and parse YAML file without ID validation asynchronously.
73
+ * WU-1352: For cases where you don't know/need to validate the WU ID.
74
+ *
75
+ * @param {string} yamlPath - Path to YAML file
76
+ * @returns {Promise<object>} Parsed YAML document
77
+ * @throws {Error} If file not found or YAML invalid
78
+ */
79
+ export declare function readWURawAsync(yamlPath: any): Promise<any>;
57
80
  /**
58
81
  * Write WU YAML file with consistent formatting.
59
82
  * WU-1352: Uses YAML_STRINGIFY_OPTIONS for consistent output.
package/dist/wu-yaml.js CHANGED
@@ -1,7 +1,8 @@
1
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
1
+ import { existsSync, readFileSync, writeFileSync, promises as fs } from 'node:fs';
2
2
  import { parse, stringify } from 'yaml';
3
3
  import { createError, ErrorCodes } from './error-handler.js';
4
4
  import { STRING_LITERALS } from './wu-constants.js';
5
+ import { createWuPaths } from './wu-paths.js';
5
6
  /**
6
7
  * Unified WU YAML I/O module.
7
8
  *
@@ -102,6 +103,48 @@ export function readWU(wuPath, expectedId) {
102
103
  }
103
104
  return doc;
104
105
  }
106
+ /**
107
+ * Read and parse WU YAML file asynchronously.
108
+ *
109
+ * Validates:
110
+ * - File exists
111
+ * - YAML is valid
112
+ * - WU ID matches expected ID
113
+ *
114
+ * @param {string} wuPath - Path to WU YAML file
115
+ * @param {string} expectedId - Expected WU ID (e.g., 'WU-123')
116
+ * @returns {Promise<object>} Parsed YAML document
117
+ * @throws {Error} If file not found, YAML invalid, or ID mismatch
118
+ */
119
+ export async function readWUAsync(wuPath, expectedId) {
120
+ try {
121
+ const text = await fs.readFile(wuPath, { encoding: 'utf-8' });
122
+ let doc;
123
+ try {
124
+ doc = parse(text);
125
+ }
126
+ catch (e) {
127
+ throw createError(ErrorCodes.YAML_PARSE_ERROR, `Failed to parse YAML ${wuPath}: ${e.message}`, {
128
+ path: wuPath,
129
+ originalError: e.message,
130
+ });
131
+ }
132
+ // Validate ID matches
133
+ if (!doc || doc.id !== expectedId) {
134
+ throw createError(ErrorCodes.WU_NOT_FOUND, `WU YAML id mismatch. Expected ${expectedId}, found ${doc && doc.id}`, { path: wuPath, expectedId, foundId: doc && doc.id });
135
+ }
136
+ return doc;
137
+ }
138
+ catch (err) {
139
+ if (err.code === 'ENOENT') {
140
+ throw createError(ErrorCodes.FILE_NOT_FOUND, `WU file not found: ${wuPath}`, {
141
+ path: wuPath,
142
+ expectedId,
143
+ });
144
+ }
145
+ throw err;
146
+ }
147
+ }
105
148
  /**
106
149
  * Parse YAML string to object.
107
150
  * WU-1352: Centralized YAML parsing for consistency.
@@ -149,6 +192,36 @@ export function readWURaw(yamlPath) {
149
192
  });
150
193
  }
151
194
  }
195
+ /**
196
+ * Read and parse YAML file without ID validation asynchronously.
197
+ * WU-1352: For cases where you don't know/need to validate the WU ID.
198
+ *
199
+ * @param {string} yamlPath - Path to YAML file
200
+ * @returns {Promise<object>} Parsed YAML document
201
+ * @throws {Error} If file not found or YAML invalid
202
+ */
203
+ export async function readWURawAsync(yamlPath) {
204
+ try {
205
+ const text = await fs.readFile(yamlPath, { encoding: 'utf-8' });
206
+ try {
207
+ return parse(text);
208
+ }
209
+ catch (e) {
210
+ throw createError(ErrorCodes.YAML_PARSE_ERROR, `Failed to parse YAML ${yamlPath}: ${e.message}`, {
211
+ path: yamlPath,
212
+ originalError: e.message,
213
+ });
214
+ }
215
+ }
216
+ catch (err) {
217
+ if (err.code === 'ENOENT') {
218
+ throw createError(ErrorCodes.FILE_NOT_FOUND, `YAML file not found: ${yamlPath}`, {
219
+ path: yamlPath,
220
+ });
221
+ }
222
+ throw err;
223
+ }
224
+ }
152
225
  /**
153
226
  * Write WU YAML file with consistent formatting.
154
227
  * WU-1352: Uses YAML_STRINGIFY_OPTIONS for consistent output.
@@ -205,7 +278,8 @@ export function appendNote(doc, note) {
205
278
  * @throws {Error} if WU file not found
206
279
  */
207
280
  export function appendAgentSession(wuId, sessionData) {
208
- const wuPath = `docs/04-operations/tasks/wu/${wuId}.yaml`;
281
+ const paths = createWuPaths();
282
+ const wuPath = paths.WU(wuId);
209
283
  if (!existsSync(wuPath)) {
210
284
  throw new Error(`WU file not found: ${wuPath}`);
211
285
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/core",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "description": "Core WU lifecycle tools for LumenFlow workflow framework",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -40,6 +40,7 @@
40
40
  "./spawn-monitor": "./dist/spawn-monitor.js",
41
41
  "./spawn-escalation": "./dist/spawn-escalation.js",
42
42
  "./spawn-prompt-schema": "./dist/spawn-prompt-schema.js",
43
+ "./wu-spawn-context": "./dist/wu-spawn-context.js",
43
44
  "./backlog-generator": "./dist/backlog-generator.js",
44
45
  "./backlog-parser": "./dist/backlog-parser.js",
45
46
  "./backlog-editor": "./dist/backlog-editor.js",
@@ -52,8 +53,10 @@
52
53
  "./dependency-guard": "./dist/dependency-guard.js",
53
54
  "./worktree-scanner": "./dist/worktree-scanner.js",
54
55
  "./worktree-ownership": "./dist/worktree-ownership.js",
56
+ "./lane-suggest-prompt": "./dist/lane-suggest-prompt.js",
55
57
  "./config": "./dist/lumenflow-config.js",
56
58
  "./config-schema": "./dist/lumenflow-config-schema.js",
59
+ "./test-baseline": "./dist/test-baseline.js",
57
60
  "./dist/*": "./dist/*",
58
61
  "./lib/*": "./dist/*"
59
62
  },
@@ -95,7 +98,7 @@
95
98
  "vitest": "^4.0.17"
96
99
  },
97
100
  "peerDependencies": {
98
- "@lumenflow/memory": "2.2.2"
101
+ "@lumenflow/memory": "2.3.1"
99
102
  },
100
103
  "peerDependenciesMeta": {
101
104
  "@lumenflow/memory": {