@lumenflow/core 2.9.0 → 2.11.0

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 (49) hide show
  1. package/dist/agent-patterns-registry.js +4 -2
  2. package/dist/arg-parser.js +5 -0
  3. package/dist/constants/linter-constants.d.ts +1 -1
  4. package/dist/constants/linter-constants.js +1 -1
  5. package/dist/docs-path-validator.js +3 -3
  6. package/dist/domain/context.schemas.d.ts +3 -3
  7. package/dist/domain/orchestration.constants.d.ts +1 -1
  8. package/dist/domain/orchestration.constants.js +1 -1
  9. package/dist/domain/orchestration.types.d.ts +2 -2
  10. package/dist/domain/validation.schemas.d.ts +4 -4
  11. package/dist/hardcoded-strings.js +1 -1
  12. package/dist/index.d.ts +3 -2
  13. package/dist/index.js +5 -3
  14. package/dist/invariants/check-automated-tests.js +3 -1
  15. package/dist/lumenflow-config-schema.d.ts +5 -5
  16. package/dist/lumenflow-config-schema.js +5 -5
  17. package/dist/lumenflow-config.d.ts +1 -1
  18. package/dist/lumenflow-config.js +7 -7
  19. package/dist/micro-worktree.d.ts +2 -2
  20. package/dist/micro-worktree.js +112 -77
  21. package/dist/orchestration-rules.js +1 -1
  22. package/dist/prompt-linter.js +5 -5
  23. package/dist/spawn-escalation.d.ts +2 -2
  24. package/dist/spawn-escalation.js +7 -3
  25. package/dist/spawn-monitor.js +3 -1
  26. package/dist/state-doctor-core.d.ts +29 -1
  27. package/dist/state-doctor-core.js +142 -2
  28. package/dist/telemetry.js +3 -3
  29. package/dist/template-loader.js +6 -3
  30. package/dist/test-baseline.d.ts +2 -2
  31. package/dist/test-baseline.js +3 -2
  32. package/dist/wu-constants.d.ts +69 -57
  33. package/dist/wu-constants.js +70 -8
  34. package/dist/wu-create-validators.d.ts +7 -0
  35. package/dist/wu-create-validators.js +12 -2
  36. package/dist/wu-done-concurrent-merge.js +2 -2
  37. package/dist/wu-done-metadata.js +2 -2
  38. package/dist/wu-done-validation.js +2 -2
  39. package/dist/wu-done-worktree.js +6 -5
  40. package/dist/wu-events-cleanup.js +2 -5
  41. package/dist/wu-list.d.ts +92 -0
  42. package/dist/wu-list.js +177 -0
  43. package/dist/wu-paths.js +4 -4
  44. package/dist/wu-spawn-context.js +3 -2
  45. package/dist/wu-spawn-skills.js +8 -5
  46. package/dist/wu-spawn.js +4 -5
  47. package/package.json +2 -2
  48. package/dist/beacon-migration.d.ts +0 -56
  49. package/dist/beacon-migration.js +0 -101
package/dist/wu-spawn.js CHANGED
@@ -1191,9 +1191,8 @@ export function emitMethodologyTelemetry(config, policy) {
1191
1191
  methodology_architecture: policy.architecture,
1192
1192
  event_context: 'spawn',
1193
1193
  };
1194
- // Use the telemetry emit function from telemetry.ts
1195
- const METHODOLOGY_LOG = '.lumenflow/telemetry/methodology.ndjson';
1196
- emitTelemetry(METHODOLOGY_LOG, event);
1194
+ // Use the telemetry emit function from telemetry.ts - WU-1430: Use centralized constant
1195
+ emitTelemetry(LUMENFLOW_PATHS.METHODOLOGY_LOG, event);
1197
1196
  }
1198
1197
  /**
1199
1198
  * Generate Lane Selection section (WU-2107)
@@ -1261,10 +1260,10 @@ When creating \`.lumenflow/\` stamps or other artifacts:
1261
1260
  # CORRECT: Create stamp in worktree
1262
1261
  WORKTREE_ROOT=$(git rev-parse --show-toplevel)
1263
1262
  mkdir -p "$WORKTREE_ROOT/.lumenflow/agent-runs"
1264
- touch "$WORKTREE_ROOT/.lumenflow/agent-runs/beacon-guardian.stamp"
1263
+ touch "$WORKTREE_ROOT/.lumenflow/agent-runs/code-reviewer.stamp"
1265
1264
 
1266
1265
  # WRONG: Hardcoded path to main
1267
- # touch /path/to/main/.lumenflow/agent-runs/beacon-guardian.stamp
1266
+ # touch /path/to/main/.lumenflow/agent-runs/code-reviewer.stamp
1268
1267
  \`\`\`
1269
1268
 
1270
1269
  ### Why This Matters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/core",
3
- "version": "2.9.0",
3
+ "version": "2.11.0",
4
4
  "description": "Core WU lifecycle tools for LumenFlow workflow framework",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -99,7 +99,7 @@
99
99
  "vitest": "^4.0.17"
100
100
  },
101
101
  "peerDependencies": {
102
- "@lumenflow/memory": "2.9.0"
102
+ "@lumenflow/memory": "2.11.0"
103
103
  },
104
104
  "peerDependenciesMeta": {
105
105
  "@lumenflow/memory": {
@@ -1,56 +0,0 @@
1
- /**
2
- * @file beacon-migration.ts
3
- * @description Migration utility for renaming .beacon directories to .lumenflow (WU-1075)
4
- *
5
- * This module provides a one-time migration function that renames the legacy
6
- * .beacon directory to .lumenflow. It's safe to run multiple times - it will
7
- * only migrate if .beacon exists and .lumenflow does not.
8
- *
9
- * @example
10
- * ```typescript
11
- * import { migrateBeaconToLumenflow } from '@lumenflow/core';
12
- *
13
- * // Run migration in project root
14
- * const result = migrateBeaconToLumenflow();
15
- * if (result.migrated) {
16
- * console.log('Successfully migrated .beacon/ → .lumenflow/');
17
- * }
18
- * ```
19
- */
20
- /**
21
- * Result of a migration attempt
22
- */
23
- export interface MigrationResult {
24
- /** Whether migration was performed */
25
- migrated: boolean;
26
- /** Reason for the result */
27
- reason: 'migrated' | 'already_migrated' | 'no_legacy_dir' | 'both_exist';
28
- /** Path that was migrated from (if migrated) */
29
- fromPath?: string;
30
- /** Path that was migrated to (if migrated) */
31
- toPath?: string;
32
- /** Error message if migration failed */
33
- error?: string;
34
- }
35
- /**
36
- * Migrate .beacon directory to .lumenflow
37
- *
38
- * This function safely renames the legacy .beacon directory to .lumenflow.
39
- * It handles the following scenarios:
40
- *
41
- * - .beacon exists, .lumenflow does not → Migrate (rename)
42
- * - .beacon does not exist, .lumenflow exists → Already migrated (no-op)
43
- * - Neither exists → No legacy directory (no-op)
44
- * - Both exist → Conflict, manual resolution needed
45
- *
46
- * @param {string} [baseDir=process.cwd()] - Base directory to check for migration
47
- * @returns {MigrationResult} Result of the migration attempt
48
- */
49
- export declare function migrateBeaconToLumenflow(baseDir?: string): MigrationResult;
50
- /**
51
- * Check if migration is needed without performing it
52
- *
53
- * @param {string} [baseDir=process.cwd()] - Base directory to check
54
- * @returns {boolean} True if .beacon exists and .lumenflow does not
55
- */
56
- export declare function needsMigration(baseDir?: string): boolean;
@@ -1,101 +0,0 @@
1
- /**
2
- * @file beacon-migration.ts
3
- * @description Migration utility for renaming .beacon directories to .lumenflow (WU-1075)
4
- *
5
- * This module provides a one-time migration function that renames the legacy
6
- * .beacon directory to .lumenflow. It's safe to run multiple times - it will
7
- * only migrate if .beacon exists and .lumenflow does not.
8
- *
9
- * @example
10
- * ```typescript
11
- * import { migrateBeaconToLumenflow } from '@lumenflow/core';
12
- *
13
- * // Run migration in project root
14
- * const result = migrateBeaconToLumenflow();
15
- * if (result.migrated) {
16
- * console.log('Successfully migrated .beacon/ → .lumenflow/');
17
- * }
18
- * ```
19
- */
20
- import * as fs from 'fs';
21
- import * as path from 'path';
22
- import { LUMENFLOW_PATHS } from './wu-constants.js';
23
- /** Legacy directory name that was used before v1.5.0 */
24
- const LEGACY_BEACON_DIR = '.beacon';
25
- /**
26
- * Migrate .beacon directory to .lumenflow
27
- *
28
- * This function safely renames the legacy .beacon directory to .lumenflow.
29
- * It handles the following scenarios:
30
- *
31
- * - .beacon exists, .lumenflow does not → Migrate (rename)
32
- * - .beacon does not exist, .lumenflow exists → Already migrated (no-op)
33
- * - Neither exists → No legacy directory (no-op)
34
- * - Both exist → Conflict, manual resolution needed
35
- *
36
- * @param {string} [baseDir=process.cwd()] - Base directory to check for migration
37
- * @returns {MigrationResult} Result of the migration attempt
38
- */
39
- export function migrateBeaconToLumenflow(baseDir = process.cwd()) {
40
- const legacyPath = path.join(baseDir, LEGACY_BEACON_DIR);
41
- const newPath = path.join(baseDir, LUMENFLOW_PATHS.BASE);
42
- const legacyExists = fs.existsSync(legacyPath);
43
- const newExists = fs.existsSync(newPath);
44
- // Both exist - conflict
45
- if (legacyExists && newExists) {
46
- return {
47
- migrated: false,
48
- reason: 'both_exist',
49
- fromPath: legacyPath,
50
- toPath: newPath,
51
- error: 'Both .beacon and .lumenflow directories exist. ' +
52
- 'Please manually resolve by removing or merging .beacon into .lumenflow.',
53
- };
54
- }
55
- // Already migrated
56
- if (!legacyExists && newExists) {
57
- return {
58
- migrated: false,
59
- reason: 'already_migrated',
60
- toPath: newPath,
61
- };
62
- }
63
- // No legacy directory
64
- if (!legacyExists && !newExists) {
65
- return {
66
- migrated: false,
67
- reason: 'no_legacy_dir',
68
- };
69
- }
70
- // Migrate: rename .beacon → .lumenflow
71
- try {
72
- fs.renameSync(legacyPath, newPath);
73
- return {
74
- migrated: true,
75
- reason: 'migrated',
76
- fromPath: legacyPath,
77
- toPath: newPath,
78
- };
79
- }
80
- catch (err) {
81
- const error = err instanceof Error ? err.message : String(err);
82
- return {
83
- migrated: false,
84
- reason: 'migrated',
85
- fromPath: legacyPath,
86
- toPath: newPath,
87
- error: `Failed to rename: ${error}`,
88
- };
89
- }
90
- }
91
- /**
92
- * Check if migration is needed without performing it
93
- *
94
- * @param {string} [baseDir=process.cwd()] - Base directory to check
95
- * @returns {boolean} True if .beacon exists and .lumenflow does not
96
- */
97
- export function needsMigration(baseDir = process.cwd()) {
98
- const legacyPath = path.join(baseDir, LEGACY_BEACON_DIR);
99
- const newPath = path.join(baseDir, LUMENFLOW_PATHS.BASE);
100
- return fs.existsSync(legacyPath) && !fs.existsSync(newPath);
101
- }