@lumenflow/cli 5.4.0 → 5.7.12

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 (227) hide show
  1. package/README.md +42 -40
  2. package/dist/db-journal-recover.js +400 -0
  3. package/dist/db-journal-recover.js.map +1 -0
  4. package/dist/docs-sync.js +8 -3
  5. package/dist/docs-sync.js.map +1 -1
  6. package/dist/gate-defaults.js +191 -9
  7. package/dist/gate-defaults.js.map +1 -1
  8. package/dist/gate-registry.js.map +1 -1
  9. package/dist/gates/monolithic-file-contention-guard.js +167 -0
  10. package/dist/gates/monolithic-file-contention-guard.js.map +1 -0
  11. package/dist/gates/prod-migration-drift.js +207 -0
  12. package/dist/gates/prod-migration-drift.js.map +1 -0
  13. package/dist/gates/test-over-deletion-guard.js +255 -0
  14. package/dist/gates/test-over-deletion-guard.js.map +1 -0
  15. package/dist/gates-runners.js +401 -2
  16. package/dist/gates-runners.js.map +1 -1
  17. package/dist/gates.js +349 -4
  18. package/dist/gates.js.map +1 -1
  19. package/dist/lumenflow-setup.js +144 -0
  20. package/dist/lumenflow-setup.js.map +1 -0
  21. package/dist/lumenflow-upgrade.js +2 -1
  22. package/dist/lumenflow-upgrade.js.map +1 -1
  23. package/dist/mem-create.js +10 -1
  24. package/dist/mem-create.js.map +1 -1
  25. package/dist/mem-signal.js +21 -4
  26. package/dist/mem-signal.js.map +1 -1
  27. package/dist/metrics-cli.js +19 -2
  28. package/dist/metrics-cli.js.map +1 -1
  29. package/dist/metrics-snapshot.js +25 -2
  30. package/dist/metrics-snapshot.js.map +1 -1
  31. package/dist/orchestrate-initiative.js +28 -3
  32. package/dist/orchestrate-initiative.js.map +1 -1
  33. package/dist/public-manifest.js +17 -0
  34. package/dist/public-manifest.js.map +1 -1
  35. package/dist/release.js +53 -18
  36. package/dist/release.js.map +1 -1
  37. package/dist/wu-done-gates.js +121 -8
  38. package/dist/wu-done-gates.js.map +1 -1
  39. package/dist/wu-done.js +30 -6
  40. package/dist/wu-done.js.map +1 -1
  41. package/dist/wu-edit-operations.js +74 -0
  42. package/dist/wu-edit-operations.js.map +1 -1
  43. package/dist/wu-edit-validators.js +58 -0
  44. package/dist/wu-edit-validators.js.map +1 -1
  45. package/dist/wu-edit.js +106 -4
  46. package/dist/wu-edit.js.map +1 -1
  47. package/dist/wu-prep.js +132 -8
  48. package/dist/wu-prep.js.map +1 -1
  49. package/dist/wu-recover.js +6 -0
  50. package/dist/wu-recover.js.map +1 -1
  51. package/dist/wu-release.js +120 -2
  52. package/dist/wu-release.js.map +1 -1
  53. package/dist/wu-sizing-validation.js +47 -17
  54. package/dist/wu-sizing-validation.js.map +1 -1
  55. package/dist/wu-status.js +33 -0
  56. package/dist/wu-status.js.map +1 -1
  57. package/package.json +13 -11
  58. package/packs/agent-runtime/package.json +1 -1
  59. package/packs/sidekick/package.json +1 -1
  60. package/packs/software-delivery/package.json +1 -1
  61. package/templates/core/AGENTS.md.template +162 -26
  62. package/templates/core/LUMENFLOW.md.template +381 -70
  63. package/templates/core/ai/onboarding/agent-invocation-guide.md.template +0 -5
  64. package/templates/core/ai/onboarding/agent-safety-card.md.template +63 -17
  65. package/templates/core/ai/onboarding/initiative-orchestration.md.template +4 -0
  66. package/templates/core/ai/onboarding/release-process.md.template +7 -7
  67. package/templates/core/ai/onboarding/vendor-support.md.template +74 -10
  68. package/templates/vendors/claude/.claude/skills/frontend-design/SKILL.md.template +1 -1
  69. package/templates/vendors/claude/.claude/skills/wu-lifecycle/SKILL.md.template +28 -0
  70. package/packs/agent-runtime/agent-heartbeat.ts +0 -163
  71. package/packs/agent-runtime/auto-session-integration.ts +0 -888
  72. package/packs/agent-runtime/capability-factory.ts +0 -104
  73. package/packs/agent-runtime/constants.ts +0 -21
  74. package/packs/agent-runtime/delegation-registry-schema.ts +0 -220
  75. package/packs/agent-runtime/delegation-registry-store.ts +0 -269
  76. package/packs/agent-runtime/delegation-tree.ts +0 -328
  77. package/packs/agent-runtime/index.ts +0 -20
  78. package/packs/agent-runtime/manifest.ts +0 -348
  79. package/packs/agent-runtime/memory-coordination-contract.ts +0 -86
  80. package/packs/agent-runtime/orchestration.ts +0 -2027
  81. package/packs/agent-runtime/pack-registration.ts +0 -110
  82. package/packs/agent-runtime/policy-factory.ts +0 -165
  83. package/packs/agent-runtime/remote-controls/index.ts +0 -7
  84. package/packs/agent-runtime/remote-controls/operations.ts +0 -405
  85. package/packs/agent-runtime/remote-controls/port.ts +0 -48
  86. package/packs/agent-runtime/remote-controls/state-store.ts +0 -258
  87. package/packs/agent-runtime/remote-controls/types.ts +0 -105
  88. package/packs/agent-runtime/session-schema.ts +0 -467
  89. package/packs/agent-runtime/tool-impl/agent-turn-tools.ts +0 -793
  90. package/packs/agent-runtime/tool-impl/index.ts +0 -6
  91. package/packs/agent-runtime/tool-impl/provider-adapters.ts +0 -1245
  92. package/packs/agent-runtime/tool-impl/remote-controls.mock.ts +0 -256
  93. package/packs/agent-runtime/tool-impl/remote-controls.ts +0 -273
  94. package/packs/agent-runtime/tools/index.ts +0 -4
  95. package/packs/agent-runtime/tools/types.ts +0 -47
  96. package/packs/agent-runtime/turn-lifecycle-events.ts +0 -590
  97. package/packs/agent-runtime/types.ts +0 -128
  98. package/packs/agent-runtime/vitest.config.ts +0 -11
  99. package/packs/sidekick/channel-ingress.ts +0 -137
  100. package/packs/sidekick/constants.ts +0 -10
  101. package/packs/sidekick/index.ts +0 -8
  102. package/packs/sidekick/manifest-schema.ts +0 -49
  103. package/packs/sidekick/manifest.ts +0 -512
  104. package/packs/sidekick/pack-registration.ts +0 -110
  105. package/packs/sidekick/policy-factory.ts +0 -38
  106. package/packs/sidekick/sidekick-events.ts +0 -694
  107. package/packs/sidekick/src/adapters/cloud-queue.ts +0 -101
  108. package/packs/sidekick/src/adapters/control-plane-bridge.adapter.ts +0 -386
  109. package/packs/sidekick/src/adapters/filesystem-bridge.adapter.ts +0 -228
  110. package/packs/sidekick/src/domain/channel.types.ts +0 -64
  111. package/packs/sidekick/src/ports/channel-bridge.port.ts +0 -92
  112. package/packs/sidekick/src/routines/commit.ts +0 -74
  113. package/packs/sidekick/tool-impl/channel-tools.ts +0 -577
  114. package/packs/sidekick/tool-impl/channel-transports.ts +0 -75
  115. package/packs/sidekick/tool-impl/index.ts +0 -29
  116. package/packs/sidekick/tool-impl/memory-tools.ts +0 -290
  117. package/packs/sidekick/tool-impl/routine-commit.ts +0 -102
  118. package/packs/sidekick/tool-impl/routine-tools.ts +0 -440
  119. package/packs/sidekick/tool-impl/runtime-context.ts +0 -28
  120. package/packs/sidekick/tool-impl/shared.ts +0 -125
  121. package/packs/sidekick/tool-impl/storage.ts +0 -325
  122. package/packs/sidekick/tool-impl/system-tools.ts +0 -160
  123. package/packs/sidekick/tool-impl/task-tools.ts +0 -506
  124. package/packs/sidekick/tools/channel-tools.ts +0 -53
  125. package/packs/sidekick/tools/index.ts +0 -9
  126. package/packs/sidekick/tools/memory-tools.ts +0 -53
  127. package/packs/sidekick/tools/routine-tools.ts +0 -53
  128. package/packs/sidekick/tools/system-tools.ts +0 -47
  129. package/packs/sidekick/tools/task-tools.ts +0 -61
  130. package/packs/sidekick/tools/types.ts +0 -57
  131. package/packs/sidekick/vitest.config.ts +0 -11
  132. package/packs/software-delivery/constants.ts +0 -10
  133. package/packs/software-delivery/extensions.ts +0 -140
  134. package/packs/software-delivery/gate-policies.ts +0 -134
  135. package/packs/software-delivery/index.ts +0 -8
  136. package/packs/software-delivery/manifest-schema.ts +0 -268
  137. package/packs/software-delivery/manifest.ts +0 -657
  138. package/packs/software-delivery/pack-registration.ts +0 -113
  139. package/packs/software-delivery/src/commands/index.ts +0 -5
  140. package/packs/software-delivery/src/config/delivery-review-contract.ts +0 -256
  141. package/packs/software-delivery/src/config/env-accessors.ts +0 -66
  142. package/packs/software-delivery/src/config/index.ts +0 -8
  143. package/packs/software-delivery/src/config/normalize-config-keys.ts +0 -9
  144. package/packs/software-delivery/src/config/schemas/lumenflow-config-schema-types.ts +0 -460
  145. package/packs/software-delivery/src/config/workspace-reader.ts +0 -375
  146. package/packs/software-delivery/src/constants/backlog-patterns.ts +0 -31
  147. package/packs/software-delivery/src/constants/client-ids.ts +0 -19
  148. package/packs/software-delivery/src/constants/config-contract.ts +0 -7
  149. package/packs/software-delivery/src/constants/docs-layout-presets.ts +0 -50
  150. package/packs/software-delivery/src/constants/duration-constants.ts +0 -20
  151. package/packs/software-delivery/src/constants/gate-constants.ts +0 -32
  152. package/packs/software-delivery/src/constants/index.ts +0 -29
  153. package/packs/software-delivery/src/constants/lock-constants.ts +0 -35
  154. package/packs/software-delivery/src/constants/object-guards.ts +0 -12
  155. package/packs/software-delivery/src/constants/section-headings.ts +0 -107
  156. package/packs/software-delivery/src/constants/wu-cli-constants.ts +0 -488
  157. package/packs/software-delivery/src/constants/wu-domain-constants.ts +0 -466
  158. package/packs/software-delivery/src/constants/wu-git-constants.ts +0 -7
  159. package/packs/software-delivery/src/constants/wu-id-format.ts +0 -327
  160. package/packs/software-delivery/src/constants/wu-paths-constants.ts +0 -384
  161. package/packs/software-delivery/src/constants/wu-statuses.ts +0 -287
  162. package/packs/software-delivery/src/constants/wu-type-helpers.ts +0 -67
  163. package/packs/software-delivery/src/constants/wu-ui-constants.ts +0 -267
  164. package/packs/software-delivery/src/constants/wu-validation-constants.ts +0 -73
  165. package/packs/software-delivery/src/domain/index.ts +0 -5
  166. package/packs/software-delivery/src/domain/orchestration.constants.ts +0 -166
  167. package/packs/software-delivery/src/domain/orchestration.schemas.ts +0 -238
  168. package/packs/software-delivery/src/domain/orchestration.types.ts +0 -176
  169. package/packs/software-delivery/src/methodology/incremental-test.ts +0 -122
  170. package/packs/software-delivery/src/methodology/index.ts +0 -6
  171. package/packs/software-delivery/src/methodology/manual-test-validator.ts +0 -292
  172. package/packs/software-delivery/src/policy/coverage-gate.ts +0 -270
  173. package/packs/software-delivery/src/policy/gates-agent-mode.ts +0 -223
  174. package/packs/software-delivery/src/policy/gates-config-internal.ts +0 -121
  175. package/packs/software-delivery/src/policy/gates-config.ts +0 -300
  176. package/packs/software-delivery/src/policy/gates-coverage.ts +0 -356
  177. package/packs/software-delivery/src/policy/gates-presets.ts +0 -134
  178. package/packs/software-delivery/src/policy/gates-schemas.ts +0 -173
  179. package/packs/software-delivery/src/policy/index.ts +0 -22
  180. package/packs/software-delivery/src/policy/package-manager-resolver.ts +0 -319
  181. package/packs/software-delivery/src/policy/resolve-policy.ts +0 -601
  182. package/packs/software-delivery/src/ports/config.ports.ts +0 -90
  183. package/packs/software-delivery/src/ports/dashboard-renderer.port.ts +0 -125
  184. package/packs/software-delivery/src/ports/index.ts +0 -10
  185. package/packs/software-delivery/src/ports/sync-validator.ports.ts +0 -59
  186. package/packs/software-delivery/src/ports/wu-helpers.ports.ts +0 -168
  187. package/packs/software-delivery/src/ports/wu-state.ports.ts +0 -241
  188. package/packs/software-delivery/src/primitives/index.ts +0 -5
  189. package/packs/software-delivery/src/runtime/index.ts +0 -6
  190. package/packs/software-delivery/src/runtime/work-classifier.ts +0 -561
  191. package/packs/software-delivery/src/sandbox/index.ts +0 -10
  192. package/packs/software-delivery/src/sandbox/sandbox-allowlist.ts +0 -118
  193. package/packs/software-delivery/src/sandbox/sandbox-backend-linux.ts +0 -88
  194. package/packs/software-delivery/src/sandbox/sandbox-backend-macos.ts +0 -154
  195. package/packs/software-delivery/src/sandbox/sandbox-backend-windows.ts +0 -47
  196. package/packs/software-delivery/src/sandbox/sandbox-profile.ts +0 -153
  197. package/packs/software-delivery/src/schemas/index.ts +0 -5
  198. package/packs/software-delivery/src/state/date-utils.ts +0 -158
  199. package/packs/software-delivery/src/state/index.ts +0 -15
  200. package/packs/software-delivery/src/state/state-machine.ts +0 -119
  201. package/packs/software-delivery/src/state/wu-doc-types.ts +0 -51
  202. package/packs/software-delivery/src/state/wu-paths.ts +0 -381
  203. package/packs/software-delivery/src/state/wu-schema.ts +0 -1139
  204. package/packs/software-delivery/src/state/wu-state-schema.ts +0 -255
  205. package/packs/software-delivery/src/state/wu-yaml.ts +0 -338
  206. package/packs/software-delivery/tool-impl/agent-tools.ts +0 -263
  207. package/packs/software-delivery/tool-impl/delegation-tools.ts +0 -66
  208. package/packs/software-delivery/tool-impl/flow-metrics-tools.ts +0 -219
  209. package/packs/software-delivery/tool-impl/git-runner.ts +0 -113
  210. package/packs/software-delivery/tool-impl/git-tools.ts +0 -316
  211. package/packs/software-delivery/tool-impl/index.ts +0 -15
  212. package/packs/software-delivery/tool-impl/initiative-orchestration-tools.ts +0 -720
  213. package/packs/software-delivery/tool-impl/lane-lock.ts +0 -246
  214. package/packs/software-delivery/tool-impl/memory-tools.ts +0 -470
  215. package/packs/software-delivery/tool-impl/pending-runtime-tools.ts +0 -21
  216. package/packs/software-delivery/tool-impl/runtime-cli-adapter.ts +0 -329
  217. package/packs/software-delivery/tool-impl/runtime-native-tools.ts +0 -687
  218. package/packs/software-delivery/tool-impl/worker-loader.ts +0 -52
  219. package/packs/software-delivery/tool-impl/worktree-tools.ts +0 -46
  220. package/packs/software-delivery/tool-impl/wu-lifecycle-tools.ts +0 -807
  221. package/packs/software-delivery/tools/delegation-tools.ts +0 -23
  222. package/packs/software-delivery/tools/git-tools.ts +0 -55
  223. package/packs/software-delivery/tools/index.ts +0 -8
  224. package/packs/software-delivery/tools/lane-lock-tool.ts +0 -37
  225. package/packs/software-delivery/tools/types.ts +0 -71
  226. package/packs/software-delivery/tools/worktree-tools.ts +0 -49
  227. package/packs/software-delivery/vitest.config.ts +0 -11
@@ -1,107 +0,0 @@
1
- // Copyright (c) 2026 Hellmai Ltd
2
- // SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
3
-
4
- /**
5
- * Section Headings Constants
6
- *
7
- * Centralized section heading defaults for backlog.md and status.md
8
- * Eliminates magic strings scattered throughout wu-* tools
9
- *
10
- * Usage: Use getSectionHeadingsWithDefaults() to get frontmatter-configured
11
- * headings with sensible fallbacks if frontmatter is missing/malformed
12
- *
13
- * WU-2698 (INIT-058 L4-prep narrow): moved from @lumenflow/core/src/section-headings.ts.
14
- * The `getSectionHeadings` helper (previously imported from core's backlog-parser) is
15
- * inlined here to keep the pack core-free.
16
- */
17
-
18
- import { BACKLOG_SECTIONS, STATUS_SECTIONS } from './wu-ui-constants.js';
19
-
20
- /**
21
- * Section configuration from frontmatter.
22
- */
23
- interface SectionConfig {
24
- heading?: string;
25
- }
26
-
27
- /**
28
- * Extract section headings from frontmatter.
29
- *
30
- * Inlined from @lumenflow/core/src/backlog-parser.ts (WU-2698) so that this
31
- * module does not depend on core during the INIT-058 L4-prep migration.
32
- *
33
- * @param {object|null} frontmatter - Parsed frontmatter object.
34
- * @returns {object} Map of section names to heading strings (e.g., {ready: "## 🚀 Ready"}).
35
- */
36
- function getSectionHeadings(frontmatter: Record<string, unknown> | null): Record<string, string> {
37
- if (!frontmatter) {
38
- return {};
39
- }
40
- const sections = (frontmatter as { sections?: Record<string, SectionConfig> }).sections;
41
- if (!sections) {
42
- return {};
43
- }
44
-
45
- const headings: Record<string, string> = {};
46
- for (const [sectionName, sectionConfig] of Object.entries(sections)) {
47
- if (sectionConfig && typeof sectionConfig.heading === 'string') {
48
- headings[sectionName] = sectionConfig.heading;
49
- }
50
- }
51
-
52
- return headings;
53
- }
54
-
55
- /**
56
- * Default section headings (fallbacks when frontmatter is missing)
57
- * Re-exports from wu-ui-constants.ts for backwards compatibility
58
- */
59
- export const DEFAULT_SECTION_HEADINGS = {
60
- backlog: {
61
- ready: BACKLOG_SECTIONS.READY,
62
- in_progress: BACKLOG_SECTIONS.IN_PROGRESS,
63
- blocked: BACKLOG_SECTIONS.BLOCKED,
64
- done: BACKLOG_SECTIONS.DONE,
65
- },
66
- status: {
67
- in_progress: STATUS_SECTIONS.IN_PROGRESS,
68
- completed: STATUS_SECTIONS.COMPLETED,
69
- blocked: STATUS_SECTIONS.BLOCKED,
70
- },
71
- };
72
-
73
- /**
74
- * Get section headings with frontmatter override + defaults
75
- *
76
- * Replaces scattered pattern: headings.done || '## ✅ Done'
77
- * Centralizes fallback logic for consistent heading resolution
78
- *
79
- * @param {object|null} frontmatter - Parsed frontmatter from backlog.md/status.md
80
- * @param {'backlog'|'status'} docType - Document type
81
- * @returns {object} Section headings (configured or default)
82
- */
83
- export function getSectionHeadingsWithDefaults(
84
- frontmatter: Record<string, unknown> | null,
85
- docType: keyof typeof DEFAULT_SECTION_HEADINGS = 'backlog',
86
- ) {
87
- const defaults = DEFAULT_SECTION_HEADINGS[docType] as {
88
- ready?: string;
89
- in_progress?: string;
90
- blocked?: string;
91
- done?: string;
92
- completed?: string;
93
- };
94
- const configured = frontmatter ? getSectionHeadings(frontmatter) : {};
95
-
96
- return {
97
- ready: configured.ready || defaults.ready || DEFAULT_SECTION_HEADINGS.backlog.ready,
98
- in_progress:
99
- configured.in_progress ||
100
- defaults.in_progress ||
101
- DEFAULT_SECTION_HEADINGS.backlog.in_progress,
102
- blocked: configured.blocked || defaults.blocked || DEFAULT_SECTION_HEADINGS.backlog.blocked,
103
- done: configured.done || defaults.done || DEFAULT_SECTION_HEADINGS.backlog.done,
104
- completed:
105
- configured.completed || defaults.completed || DEFAULT_SECTION_HEADINGS.status.completed,
106
- };
107
- }
@@ -1,488 +0,0 @@
1
- // Copyright (c) 2026 Hellmai Ltd
2
- // SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
3
-
4
- /**
5
- * CLI and Tooling Constants
6
- *
7
- * WU-1549: Extracted from wu-constants.ts for domain-specific modularity.
8
- * Contains CLI flags, package manager commands, ESLint configuration, gate names,
9
- * process constants, and external tool configurations.
10
- *
11
- * @module wu-cli-constants
12
- */
13
-
14
- /**
15
- * CLI argument flags
16
- *
17
- * Centralized command-line argument strings to eliminate hardcoded flags.
18
- * Used across wu-* scripts, gates, and validation tools.
19
- */
20
- export const CLI_FLAGS = {
21
- // Common flags
22
- DRY_RUN: '--dry-run',
23
- EXECUTE: '--execute',
24
- HELP: '--help',
25
- HELP_SHORT: '-h',
26
- VERBOSE: '--verbose',
27
- FIX: '--fix',
28
- JSON: '--json',
29
- FORCE: '--force',
30
-
31
- // Gate-specific flags
32
- DOCS_ONLY: '--docs-only',
33
- FULL_LINT: '--full-lint',
34
- FULL_TESTS: '--full-tests', // WU-1920: Force full test suite
35
- FULL_COVERAGE: '--full-coverage', // WU-2244: Force full coverage (deterministic)
36
- COVERAGE_MODE: '--coverage-mode=',
37
-
38
- // WU-specific flags
39
- WU: '--wu',
40
- ID: '--id',
41
- ALL: '--all',
42
- CHECK: '--check',
43
- TIER: '--tier',
44
- AGENT_TYPE: '--agent-type',
45
- DESCRIPTION: '--description',
46
- ACCEPTANCE: '--acceptance',
47
- VALIDATE: '--validate',
48
- REASON: '--reason',
49
- WEEK: '--week',
50
- SINCE: '--since',
51
- };
52
-
53
- /**
54
- * pnpm/npm command flags
55
- *
56
- * Centralized package manager flag strings.
57
- */
58
- export const PKG_FLAGS = {
59
- FILTER: '--filter',
60
- FROZEN_LOCKFILE: '--frozen-lockfile',
61
- /** WU-1527: Required for pnpm add at workspace root in monorepos */
62
- WORKSPACE_ROOT: '-w',
63
- SAVE_DEV: '--save-dev',
64
- SAVE_EXACT: '--save-exact',
65
- };
66
-
67
- /**
68
- * ESLint command flags
69
- *
70
- * Centralized ESLint CLI flag strings.
71
- */
72
- export const ESLINT_FLAGS = {
73
- MAX_WARNINGS: '--max-warnings',
74
- NO_WARN_IGNORED: '--no-warn-ignored',
75
- CACHE: '--cache',
76
- CACHE_STRATEGY: '--cache-strategy',
77
- CACHE_LOCATION: '--cache-location',
78
- PASS_ON_UNPRUNED: '--pass-on-unpruned-suppressions',
79
- };
80
-
81
- /**
82
- * pnpm script names
83
- *
84
- * Centralized script names for package.json commands.
85
- */
86
- export const SCRIPTS = {
87
- LINT: 'lint',
88
- TEST: 'test',
89
- TEST_UNIT: 'test:unit',
90
- BUILD: 'build',
91
- FORMAT: 'format',
92
- FORMAT_CHECK: 'format:check',
93
- TYPECHECK: 'typecheck',
94
- DEV: 'dev',
95
- SPEC_LINTER: 'spec:linter',
96
- /** WU-1467: Stub script -- not an enforced gate. Retained for script surface only. */
97
- PROMPTS_LINT: 'prompts:lint',
98
- RUN: 'run',
99
- GATES: 'gates',
100
- /** WU-1467: Stub script -- not an enforced gate. Retained for script surface only. */
101
- COS_GATES: 'cos:gates',
102
- PRETTIER: 'prettier',
103
- /** WU-1467: Root script surface for tasks:validate (delegates to wu:validate --all) */
104
- TASKS_VALIDATE: 'tasks:validate',
105
- };
106
-
107
- /**
108
- * Gate names for quality gates
109
- *
110
- * Centralized gate identifiers for gates.ts and telemetry.
111
- */
112
- export const GATE_NAMES = {
113
- /** WU-2252: Invariants check (runs first, non-bypassable) */
114
- INVARIANTS: 'invariants',
115
- FORMAT_CHECK: 'format:check',
116
- SPEC_LINTER: 'spec:linter',
117
- /** WU-1467: PROMPTS_LINT removed -- was a stub (exit 0), not an authoritative gate */
118
- BACKLOG_SYNC: 'backlog-sync',
119
- /** WU-2009: Spec-to-code absolute claim drift detector */
120
- CLAIM_VALIDATION: 'claim-validation',
121
- SUPABASE_DOCS_LINTER: 'supabase-docs:linter',
122
- LINT: 'lint',
123
- /** WU-2158: Generic co-change rule enforcement gate */
124
- CO_CHANGE: 'co-change',
125
- /** WU-2380: Optional migration-state verification gate */
126
- MIGRATION_VERIFY: 'migration-verify',
127
- TYPECHECK: 'typecheck',
128
- TEST: 'test',
129
- COVERAGE: 'coverage',
130
- /** WU-2062: Safety-critical tests (always run) */
131
- SAFETY_CRITICAL_TEST: 'safety-critical-test',
132
- /** WU-2062: Integration tests (for high-risk changes) */
133
- INTEGRATION_TEST: 'integration-test',
134
- /** WU-2533: Vendor-agnostic delivery review gate */
135
- DELIVERY_REVIEW: 'delivery_review',
136
- /** WU-1191: Lane health check (overlap detection) */
137
- LANE_HEALTH: 'lane-health',
138
- /** WU-1315: Onboarding smoke test (init + wu:create validation) */
139
- ONBOARDING_SMOKE_TEST: 'onboarding-smoke-test',
140
- };
141
-
142
- /**
143
- * Gate command sentinels (special values for non-shell commands)
144
- *
145
- * These are not shell commands but trigger special handling in gates.ts.
146
- */
147
- export const GATE_COMMANDS = {
148
- /** WU-2252: Triggers invariants check */
149
- INVARIANTS: 'invariants',
150
- /** Triggers incremental lint (only changed files) */
151
- INCREMENTAL: 'incremental',
152
- /** Triggers incremental tests (only tests related to changed files) - WU-1920 */
153
- INCREMENTAL_TEST: 'incremental-test',
154
- /** Triggers coverage gate check */
155
- COVERAGE_GATE: 'coverage-gate',
156
- /** WU-2062: Triggers safety-critical tests (always run) */
157
- SAFETY_CRITICAL_TEST: 'safety-critical-test',
158
- /** WU-2062: Triggers tiered test execution based on risk */
159
- TIERED_TEST: 'tiered-test',
160
- /** WU-1315: Triggers onboarding smoke test */
161
- ONBOARDING_SMOKE_TEST: 'onboarding-smoke-test',
162
- };
163
-
164
- /**
165
- * CLI mode flags
166
- *
167
- * Command-line mode arguments.
168
- */
169
- export const CLI_MODES = {
170
- LOCAL: '--mode=local',
171
- };
172
-
173
- /**
174
- * Prettier command flags
175
- *
176
- * Centralized prettier CLI flag strings.
177
- */
178
- export const PRETTIER_FLAGS = {
179
- WRITE: '--write',
180
- };
181
-
182
- /**
183
- * Package manager commands
184
- *
185
- * Centralized pnpm command strings.
186
- */
187
- export const PKG_MANAGER = 'pnpm';
188
-
189
- /**
190
- * Package manager subcommands
191
- *
192
- * Centralized pnpm subcommand strings.
193
- */
194
- export const PKG_COMMANDS = {
195
- INSTALL: 'install',
196
- /** WU-1527: Used by lumenflow-upgrade and deps-add */
197
- ADD: 'add',
198
- REMOVE: 'remove',
199
- };
200
-
201
- /**
202
- * Package names (monorepo workspaces)
203
- *
204
- * Centralized package names for --filter usage.
205
- * WU-1068: Changed from @exampleapp to @lumenflow for framework reusability.
206
- * Project-specific packages should be configured in workspace.yaml.
207
- */
208
- export const PACKAGES = {
209
- WEB: 'web',
210
- APPLICATION: '@lumenflow/core',
211
- DOMAIN: '@lumenflow/core',
212
- INFRASTRUCTURE: '@lumenflow/cli',
213
- };
214
-
215
- /**
216
- * Process stdio constants
217
- *
218
- * Standard values for child_process execSync stdio option.
219
- */
220
- export const STDIO = {
221
- /** Pipe stdout/stderr (capture output) */
222
- PIPE: 'pipe',
223
- /** Inherit stdio from parent process */
224
- INHERIT: 'inherit',
225
- /** Ignore stdio (silent execution) */
226
- IGNORE: 'ignore',
227
- } as const;
228
-
229
- /**
230
- * Process stdio modes
231
- *
232
- * Centralized stdio configuration values for child_process operations.
233
- */
234
- export const STDIO_MODES = {
235
- /** Inherit stdio from parent process (shows output in console) */
236
- INHERIT: 'inherit',
237
- /** Pipe stdio to parent process (capture output) */
238
- PIPE: 'pipe',
239
- /** Ignore stdio (discard output) */
240
- IGNORE: 'ignore',
241
- } as const;
242
-
243
- /**
244
- * Process exit codes
245
- *
246
- * Standard exit code values for CLI scripts.
247
- */
248
- export const EXIT_CODES = {
249
- /** Success exit code */
250
- SUCCESS: 0,
251
- /** Generic error exit code */
252
- ERROR: 1,
253
- /** Fatal or distinct failure exit code */
254
- FAILURE: 2,
255
- };
256
-
257
- /**
258
- * Stream error codes
259
- *
260
- * WU-1233: Error codes for stream operations (stdout/stderr).
261
- * Used by StreamErrorHandler for graceful pipe closure handling.
262
- */
263
- export const STREAM_ERRORS = {
264
- /**
265
- * EPIPE error code
266
- *
267
- * Occurs when writing to a pipe whose read end has been closed.
268
- * This is normal behavior when CLI output is piped through head/tail.
269
- * Unix convention: exit with code 0 on EPIPE (consumer got what it needed).
270
- */
271
- EPIPE: 'EPIPE',
272
- } as const;
273
-
274
- /**
275
- * ESLint command names
276
- *
277
- * Centralized ESLint command strings.
278
- */
279
- export const ESLINT_COMMANDS = {
280
- /** ESLint CLI command */
281
- ESLINT: 'eslint',
282
- };
283
-
284
- /**
285
- * ESLint default values
286
- *
287
- * Default configuration values for ESLint operations.
288
- */
289
- export const ESLINT_DEFAULTS = {
290
- /**
291
- * Maximum allowed warnings
292
- *
293
- * WU-1866: Temporarily increased from 0 to 100 to unblock gates.
294
- * There are ~82 pre-existing warnings that need proper fixes.
295
- */
296
- MAX_WARNINGS: '100',
297
- };
298
-
299
- /**
300
- * ESLint cache strategy values
301
- */
302
- export const CACHE_STRATEGIES = {
303
- CONTENT: 'content',
304
- METADATA: 'metadata',
305
- };
306
-
307
- /**
308
- * Prettier command arguments
309
- *
310
- * Centralized prettier CLI arguments.
311
- */
312
- export const PRETTIER_ARGS = {
313
- /** Check formatting without writing */
314
- CHECK: '--check',
315
- /** List files with formatting differences */
316
- LIST_DIFFERENT: '--list-different',
317
- };
318
-
319
- /**
320
- * Audit command arguments
321
- *
322
- * Centralized pnpm audit CLI arguments.
323
- */
324
- export const AUDIT_ARGS = {
325
- /** Audit subcommand */
326
- AUDIT: 'audit',
327
-
328
- /** Audit level flag */
329
- AUDIT_LEVEL_MODERATE: '--audit-level=moderate',
330
-
331
- /** Ignore registry errors */
332
- IGNORE_REGISTRY_ERRORS: '--ignore-registry-errors',
333
-
334
- /** Auto-fix flag */
335
- FIX: '--fix',
336
- };
337
-
338
- /**
339
- * Common shell commands
340
- *
341
- * Centralized command names for child_process operations.
342
- */
343
- export const SHELL_COMMANDS = {
344
- /** Which command (check if executable exists) */
345
- WHICH: 'which',
346
-
347
- /** Cat command (concatenate files) */
348
- CAT: 'cat',
349
-
350
- /** Node.js executable */
351
- NODE: 'node',
352
- };
353
-
354
- /**
355
- * External tool commands
356
- *
357
- * Centralized tool command names.
358
- */
359
- export const TOOLS = {
360
- /** Gitleaks secret scanner */
361
- GITLEAKS: 'gitleaks',
362
-
363
- /** ESLint linter */
364
- ESLINT: 'eslint',
365
-
366
- /** Prettier formatter */
367
- PRETTIER: 'prettier',
368
-
369
- /** TypeScript compiler */
370
- TSC: 'tsc',
371
- };
372
-
373
- /**
374
- * Gitleaks command arguments
375
- *
376
- * Centralized gitleaks CLI arguments.
377
- */
378
- export const GITLEAKS_ARGS = {
379
- /** Protect mode (scan staged files) */
380
- PROTECT: 'protect',
381
-
382
- /** Staged flag */
383
- STAGED: '--staged',
384
-
385
- /** Verbose output */
386
- VERBOSE: '--verbose',
387
- };
388
-
389
- /**
390
- * Known package names for vulnerability tracking
391
- *
392
- * Package identifiers used in dependency auditing.
393
- */
394
- export const KNOWN_PACKAGES = {
395
- /** node-forge crypto library */
396
- NODE_FORGE: 'node-forge',
397
-
398
- /** Next.js framework */
399
- NEXT: 'next',
400
-
401
- /** jsPDF PDF generation library */
402
- JSPDF: 'jspdf',
403
- };
404
-
405
- /**
406
- * Error codes and messages
407
- *
408
- * Centralized error identifiers for consistency.
409
- */
410
- export const ERROR_CODES = {
411
- /** Socket timeout error */
412
- ERR_SOCKET_TIMEOUT: 'ERR_SOCKET_TIMEOUT',
413
-
414
- /** Timeout error code */
415
- ETIMEDOUT: 'ETIMEDOUT',
416
- };
417
-
418
- /**
419
- * Micro-worktree operation identifiers
420
- *
421
- * WU-923: Centralized operation names for withMicroWorktree()
422
- */
423
- export const MICRO_WORKTREE_OPERATIONS = {
424
- WU_CREATE: 'wu-create',
425
- WU_EDIT: 'wu-edit',
426
- WU_DELETE: 'wu-delete', // WU-1809: Safe WU deletion
427
- WU_DONE: 'wu-done',
428
- WU_BLOCK: 'wu-block',
429
- WU_UNBLOCK: 'wu-unblock',
430
- WU_CLAIM: 'wu-claim',
431
- ORPHAN_REPAIR: 'orphan-repair', // WU-1437: Pre-claim orphan WU repair
432
- INITIATIVE_EDIT: 'initiative-edit', // WU-1451: Initiative edit operation
433
- INITIATIVE_BULK_ASSIGN: 'initiative-bulk-assign', // WU-2553: Bulk WU assignment
434
- LANE_EDIT: 'lane-edit', // WU-1854: Safe in-place lane definition editing
435
- WU_ESCALATE: 'wu-escalate', // WU-2225: Resolve escalation triggers
436
- };
437
-
438
- /**
439
- * Telemetry step identifiers
440
- *
441
- * WU-1584: Centralized telemetry step names to eliminate string literals.
442
- */
443
- export const TELEMETRY_STEPS = {
444
- GATES: 'gates',
445
- /** WU-1467: COS_GATES removed -- was a stub (exit 0), not an authoritative step */
446
- PARALLEL_DETECTION: 'parallel_detection',
447
- PARALLEL_AUTO_REBASE: 'parallel_auto_rebase',
448
- };
449
-
450
- /**
451
- * WU-1747: Skip gates reason constants
452
- */
453
- export const SKIP_GATES_REASONS = {
454
- CHECKPOINT_VALID: 'checkpoint_valid',
455
- };
456
-
457
- /**
458
- * WU-1747: Checkpoint-related log messages
459
- */
460
- export const CHECKPOINT_MESSAGES = {
461
- SKIPPING_GATES_VALID: 'Skipping gates - valid checkpoint found',
462
- CHECKPOINT_LABEL: 'Checkpoint',
463
- GATES_PASSED_AT: 'Gates passed at',
464
- COULD_NOT_CREATE: 'Could not create WU-1747 checkpoint',
465
- // WU-2888: Audit-trail strings for cross-session checkpoint reuse.
466
- REUSING_PREP_CHECKPOINT: 'Reusing pre-gates checkpoint from wu:prep',
467
- REUSE_REFUSED: 'pre-gates checkpoint found but invalid',
468
- };
469
-
470
- /**
471
- * Process detection constants for background process warning (WU-1381)
472
- *
473
- * Used by process-detector.ts to identify processes that may interfere
474
- * with wu:done gates execution.
475
- */
476
- export const PROCESS_DETECTION = {
477
- /**
478
- * Process names that commonly interfere with gates execution.
479
- * These processes may:
480
- * - Write to stdout/stderr (causing mixed output)
481
- * - Hold file locks that may cause test failures
482
- * - Consume resources that affect gate performance
483
- */
484
- INTERFERING_NAMES: ['node', 'pnpm', 'npm', 'vitest', 'tsx', 'eslint', 'prettier', 'tsc', 'turbo'],
485
-
486
- /** Maximum characters to display for command in warnings */
487
- CMD_DISPLAY_LIMIT: 60,
488
- };