@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
package/dist/index.js CHANGED
@@ -68,6 +68,12 @@ export * from './stamp-utils.js';
68
68
  // Configuration
69
69
  export * from './lumenflow-config.js';
70
70
  export * from './lumenflow-config-schema.js';
71
+ // WU Events Cleanup (WU-1207)
72
+ export * from './wu-events-cleanup.js';
73
+ // State Cleanup Orchestration (WU-1208)
74
+ export * from './state-cleanup-core.js';
75
+ // State Doctor Integrity Checking (WU-1209)
76
+ export * from './state-doctor-core.js';
71
77
  // Gates configuration (WU-1067)
72
78
  export * from './gates-config.js';
73
79
  // Branch check utilities
@@ -80,6 +86,9 @@ export * from './lumenflow-home.js';
80
86
  export * from './force-bypass-audit.js';
81
87
  // WU-1075: LumenFlow directory paths (exported from wu-constants)
82
88
  export { LUMENFLOW_PATHS, BEACON_PATHS } from './wu-constants.js';
89
+ // WU-1233: Stream error handling (EPIPE protection)
90
+ export { STREAM_ERRORS, EXIT_CODES } from './wu-constants.js';
91
+ export * from './stream-error-handler.js';
83
92
  // WU-1085: Color support for NO_COLOR/FORCE_COLOR/--no-color
84
93
  export * from './color-support.js';
85
94
  // WU-1090: Context-aware state machine for WU lifecycle commands
@@ -122,6 +131,10 @@ ComputeContextUseCase,
122
131
  ValidateCommandUseCase,
123
132
  // Recovery use cases
124
133
  AnalyzeRecoveryUseCase, } from './usecases/index.js';
134
+ // WU-1189: Lane suggestion prompt generation
135
+ export * from './lane-suggest-prompt.js';
136
+ // WU-1190: Git context extraction for lane suggestion
137
+ export * from './git-context-extractor.js';
125
138
  // WU-1094: Dependency Injection - Factory functions for wiring
126
139
  export {
127
140
  // Adapter factory functions
@@ -130,3 +143,15 @@ createContextAdapters, createValidationAdapters, createRecoveryAdapters,
130
143
  createComputeContextUseCase, createValidateCommandUseCase, createAnalyzeRecoveryUseCase,
131
144
  // Backwards compatible convenience functions
132
145
  computeWuContext, validateCommand, analyzeRecoveryIssues, } from './context-di.js';
146
+ // WU-1246: WU ID auto-generation
147
+ export * from './wu-id-generator.js';
148
+ // WU-1253: Test baseline ratchet pattern
149
+ export * from './test-baseline.js';
150
+ // WU-1253: Template loader for extracting prompt templates
151
+ export { loadManifest, loadTemplate, loadTemplatesWithOverrides, assembleTemplates, replaceTokens, evaluateCondition, } from './template-loader.js';
152
+ // WU-1253: Template-based spawn prompt generation
153
+ export { tryAssembleSpawnTemplates, buildTemplateContext } from './wu-spawn.js';
154
+ // WU-1242: Patrol loop for continuous spawn monitoring
155
+ export * from './patrol-loop.js';
156
+ // WU-1259: Methodology policy resolution
157
+ export { resolvePolicy, getDefaultPolicy, MethodologyConfigSchema, MethodologyOverridesSchema, TestingMethodologySchema, ArchitectureMethodologySchema, CoverageModeSchema, TESTING_METHODOLOGY, ARCHITECTURE_METHODOLOGY, COVERAGE_MODE, } from './resolve-policy.js';
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * Library-first check: This is custom validation logic for PatientPath WU workflow.
11
11
  * No external library exists for WU YAML validation - this integrates with
12
- * the existing manual-test-validator.mjs which already implements the core logic.
12
+ * the existing manual-test-validator.ts which already implements the core logic.
13
13
  *
14
- * @see {@link tools/lib/manual-test-validator.mjs} - Core validation logic
14
+ * @see {@link packages/@lumenflow/cli/src/lib/manual-test-validator.ts} - Core validation logic
15
15
  * @see {@link tools/invariants.yml} - Invariant registry
16
16
  */
17
17
  /**
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * Library-first check: This is custom validation logic for PatientPath WU workflow.
11
11
  * No external library exists for WU YAML validation - this integrates with
12
- * the existing manual-test-validator.mjs which already implements the core logic.
12
+ * the existing manual-test-validator.ts which already implements the core logic.
13
13
  *
14
- * @see {@link tools/lib/manual-test-validator.mjs} - Core validation logic
14
+ * @see {@link packages/@lumenflow/cli/src/lib/manual-test-validator.ts} - Core validation logic
15
15
  * @see {@link tools/invariants.yml} - Invariant registry
16
16
  */
17
17
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
@@ -55,7 +55,7 @@ function checkWUFile(filePath, options = {}) {
55
55
  if (!skipStatusCheck && !ACTIVE_STATUSES.includes(status)) {
56
56
  return { valid: true, wuId, error: null };
57
57
  }
58
- // Use the existing validation logic from manual-test-validator.mjs
58
+ // Use the existing validation logic from manual-test-validator.ts
59
59
  const result = validateAutomatedTestRequirement(doc);
60
60
  if (!result.valid) {
61
61
  return {
@@ -3,7 +3,7 @@
3
3
  * Lane Occupancy Checker
4
4
  *
5
5
  * Enforces one-WU-per-lane rule by checking status.md for active WUs in a given lane.
6
- * Used by wu-claim.mjs and wu-unblock.mjs to prevent WIP violations.
6
+ * Used by wu-claim.ts and wu-unblock.ts to prevent WIP violations.
7
7
  */
8
8
  import { getSubLanesForParent } from './lane-inference.js';
9
9
  interface ValidateLaneOptions {
@@ -42,12 +42,6 @@ export { getSubLanesForParent };
42
42
  * @returns {string} Parent lane name
43
43
  */
44
44
  export declare function extractParent(lane: string): string;
45
- /**
46
- * Validation mode options
47
- * @typedef {Object} ValidateLaneOptions
48
- * @property {boolean} [strict=true] - When true, throws error for parent-only lanes with taxonomy.
49
- * When false, only warns (for existing WU validation).
50
- */
51
45
  /**
52
46
  * Validate lane format and parent existence
53
47
  * @param {string} lane - Lane name (e.g., "Operations: Tooling" or "Operations")
@@ -81,3 +75,30 @@ export declare function getWipLimitForLane(lane: string, options?: GetWipLimitOp
81
75
  * @returns {{ free: boolean, occupiedBy: string | null, error: string | null, inProgressWUs?: string[], wipLimit?: number, currentCount?: number }}
82
76
  */
83
77
  export declare function checkLaneFree(statusPath: string, lane: string, wuid: string, options?: CheckLaneFreeOptions): CheckLaneFreeResult;
78
+ /** WU-1187: Options for checkWipJustification */
79
+ interface CheckWipJustificationOptions {
80
+ /** Path to .lumenflow.config.yaml (for testing) */
81
+ configPath?: string;
82
+ }
83
+ /** WU-1187: Result of WIP justification check */
84
+ interface CheckWipJustificationResult {
85
+ /** Always true - this is soft enforcement (warning only) */
86
+ valid: boolean;
87
+ /** Warning message if WIP > 1 without justification, null otherwise */
88
+ warning: string | null;
89
+ /** True if the lane needs justification but doesn't have one */
90
+ requiresJustification: boolean;
91
+ /** The wip_justification from config, if present */
92
+ justification?: string;
93
+ }
94
+ /**
95
+ * WU-1187: Check if a lane has WIP justification when required
96
+ *
97
+ * Philosophy: If you need WIP > 1, you need better lanes, not higher limits.
98
+ * This is soft enforcement: logs a warning at claim time, but doesn't block.
99
+ *
100
+ * @param {string} lane - Lane name to check
101
+ * @param {CheckWipJustificationOptions} options - Options including configPath for testing
102
+ * @returns {CheckWipJustificationResult} Result with valid=true (always) and optional warning
103
+ */
104
+ export declare function checkWipJustification(lane: string, options?: CheckWipJustificationOptions): CheckWipJustificationResult;