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