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