@lumenflow/core 1.3.0 → 1.3.3
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/arg-parser.d.ts +6 -0
- package/dist/arg-parser.js +16 -0
- package/dist/core/tool.schemas.d.ts +1 -1
- package/dist/coverage-gate.d.ts +3 -0
- package/dist/coverage-gate.js +7 -4
- package/dist/force-bypass-audit.d.ts +63 -0
- package/dist/force-bypass-audit.js +140 -0
- package/dist/gates-config.d.ts +132 -0
- package/dist/gates-config.js +229 -0
- package/dist/git-adapter.d.ts +7 -0
- package/dist/git-adapter.js +15 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/lumenflow-config-schema.d.ts +97 -0
- package/dist/lumenflow-config-schema.js +9 -0
- package/dist/lumenflow-home.d.ts +130 -0
- package/dist/lumenflow-home.js +211 -0
- package/dist/manual-test-validator.d.ts +3 -0
- package/dist/manual-test-validator.js +7 -4
- package/dist/orphan-detector.d.ts +16 -0
- package/dist/orphan-detector.js +24 -0
- package/dist/prompt-linter.js +2 -1
- package/dist/prompt-monitor.js +3 -1
- package/dist/spec-branch-helpers.d.ts +118 -0
- package/dist/spec-branch-helpers.js +199 -0
- package/dist/user-normalizer.d.ts +5 -1
- package/dist/user-normalizer.js +6 -1
- package/dist/validators/phi-scanner.js +6 -0
- package/dist/worktree-symlink.d.ts +4 -0
- package/dist/worktree-symlink.js +14 -20
- package/dist/wu-consistency-checker.d.ts +2 -0
- package/dist/wu-consistency-checker.js +35 -1
- package/dist/wu-constants.d.ts +193 -0
- package/dist/wu-constants.js +200 -4
- package/dist/wu-create-validators.d.ts +57 -2
- package/dist/wu-create-validators.js +111 -2
- package/dist/wu-done-branch-only.js +9 -0
- package/dist/wu-done-docs-generate.d.ts +73 -0
- package/dist/wu-done-docs-generate.js +108 -0
- package/dist/wu-done-worktree.js +12 -0
- package/dist/wu-schema.js +3 -1
- package/dist/wu-spawn.js +15 -2
- package/dist/wu-yaml-fixer.js +6 -3
- package/package.json +12 -11
|
@@ -1,16 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* WU Create Validators (WU-2107)
|
|
2
|
+
* WU Create Validators (WU-2107, WU-1062)
|
|
3
3
|
*
|
|
4
|
-
* Validation helpers for wu:create, including
|
|
4
|
+
* Validation helpers for wu:create, including:
|
|
5
|
+
* - Lane inference surfacing (WU-2107)
|
|
6
|
+
* - External spec_refs validation (WU-1062)
|
|
5
7
|
*
|
|
6
8
|
* When agents create WUs, this module helps surface lane inference suggestions
|
|
7
9
|
* to guide better lane selection and improve parallelization.
|
|
8
10
|
*
|
|
11
|
+
* WU-1062: Validates spec_refs paths, accepting both repo-relative paths
|
|
12
|
+
* and external paths (lumenflow://, ~/.lumenflow/, $LUMENFLOW_HOME/).
|
|
13
|
+
*
|
|
9
14
|
* NOTE: This is domain-specific WU workflow code, not a general utility.
|
|
10
15
|
* No external library exists for LumenFlow lane inference validation.
|
|
11
16
|
*/
|
|
17
|
+
import { isExternalPath, normalizeSpecRef } from './lumenflow-home.js';
|
|
12
18
|
/** Confidence threshold for showing suggestion (percentage) */
|
|
13
19
|
const CONFIDENCE_THRESHOLD_LOW = 30;
|
|
20
|
+
/** Prefixes that indicate repo-internal paths (WU-1069) */
|
|
21
|
+
const REPO_INTERNAL_PREFIXES = ['./', '.lumenflow/'];
|
|
22
|
+
/**
|
|
23
|
+
* WU-1069: Check if a path is a repo-internal path that should be rejected
|
|
24
|
+
*
|
|
25
|
+
* Repo-internal paths start with ./ or .lumenflow/ and indicate the agent
|
|
26
|
+
* is attempting to store plans inside the repository instead of externally.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} path - Path to check
|
|
29
|
+
* @returns {boolean} True if path is repo-internal and should be rejected
|
|
30
|
+
*/
|
|
31
|
+
export function isRepoInternalPath(path) {
|
|
32
|
+
return REPO_INTERNAL_PREFIXES.some((prefix) => path.startsWith(prefix));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* WU-1069: Build error message for repo-internal path rejection
|
|
36
|
+
*
|
|
37
|
+
* @param {string} path - The rejected path
|
|
38
|
+
* @returns {string} Error message with correct format examples
|
|
39
|
+
*/
|
|
40
|
+
export function buildRepoInternalPathError(path) {
|
|
41
|
+
return (`Rejected repo-internal spec_ref path: "${path}"\n` +
|
|
42
|
+
`Plans must be stored externally, not inside the repository.\n\n` +
|
|
43
|
+
`Valid path formats:\n` +
|
|
44
|
+
` - lumenflow://plans/WU-XXXX-plan.md (recommended)\n` +
|
|
45
|
+
` - ~/.lumenflow/plans/WU-XXXX-plan.md\n` +
|
|
46
|
+
` - $LUMENFLOW_HOME/plans/WU-XXXX-plan.md\n\n` +
|
|
47
|
+
`Use --plan flag to auto-create: pnpm wu:create --plan --id WU-XXXX ...`);
|
|
48
|
+
}
|
|
14
49
|
/**
|
|
15
50
|
* Generate a warning message when provided lane differs from inferred lane.
|
|
16
51
|
*
|
|
@@ -91,3 +126,77 @@ export function validateLaneWithInference(providedLane, codePaths, description,
|
|
|
91
126
|
return { shouldWarn: false, warning: '' };
|
|
92
127
|
}
|
|
93
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* WU-1062: Validate spec_refs paths
|
|
131
|
+
*
|
|
132
|
+
* Accepts:
|
|
133
|
+
* - Repo-relative paths: docs/04-operations/plans/WU-XXX-plan.md
|
|
134
|
+
* - External paths: lumenflow://plans/WU-XXX-plan.md
|
|
135
|
+
* - Tilde paths: ~/.lumenflow/plans/WU-XXX-plan.md
|
|
136
|
+
* - Env var paths: $LUMENFLOW_HOME/plans/WU-XXX-plan.md
|
|
137
|
+
*
|
|
138
|
+
* @param {string[]} specRefs - Array of spec reference paths
|
|
139
|
+
* @returns {{ valid: boolean, errors: string[], warnings: string[] }} Validation result
|
|
140
|
+
*/
|
|
141
|
+
export function validateSpecRefs(specRefs) {
|
|
142
|
+
const errors = [];
|
|
143
|
+
const warnings = [];
|
|
144
|
+
if (!specRefs || specRefs.length === 0) {
|
|
145
|
+
return { valid: true, errors, warnings };
|
|
146
|
+
}
|
|
147
|
+
for (const ref of specRefs) {
|
|
148
|
+
// Check for empty refs
|
|
149
|
+
if (!ref || ref.trim().length === 0) {
|
|
150
|
+
errors.push('Empty spec_ref detected');
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
// WU-1069: Reject repo-internal paths (paths starting with ./ or .lumenflow/)
|
|
154
|
+
// This prevents agents from storing plans inside the repository
|
|
155
|
+
if (isRepoInternalPath(ref)) {
|
|
156
|
+
errors.push(buildRepoInternalPathError(ref));
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
// External paths are valid (will be resolved at runtime)
|
|
160
|
+
if (isExternalPath(ref)) {
|
|
161
|
+
// Add informational warning about external paths
|
|
162
|
+
warnings.push(`External spec_ref: "${ref}" - ensure plan exists at ${normalizeSpecRef(ref)}`);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
// Repo-relative paths should follow conventions (docs/ without ./ prefix)
|
|
166
|
+
const isValidRepoPath = ref.startsWith('docs/') || ref.endsWith('.md');
|
|
167
|
+
if (!isValidRepoPath) {
|
|
168
|
+
warnings.push(`Unconventional spec_ref path: "${ref}" - consider using docs/04-operations/plans/ or lumenflow://plans/`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
valid: errors.length === 0,
|
|
173
|
+
errors,
|
|
174
|
+
warnings,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* WU-1062: Check if spec_refs contains external paths
|
|
179
|
+
*
|
|
180
|
+
* @param {string[]} specRefs - Array of spec reference paths
|
|
181
|
+
* @returns {boolean} True if any spec_ref is an external path
|
|
182
|
+
*/
|
|
183
|
+
export function hasExternalSpecRefs(specRefs) {
|
|
184
|
+
if (!specRefs || specRefs.length === 0) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
return specRefs.some((ref) => isExternalPath(ref));
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* WU-1062: Normalize all spec_refs paths
|
|
191
|
+
*
|
|
192
|
+
* Expands external paths to absolute paths while keeping repo-relative paths unchanged.
|
|
193
|
+
*
|
|
194
|
+
* @param {string[]} specRefs - Array of spec reference paths
|
|
195
|
+
* @returns {string[]} Normalized paths
|
|
196
|
+
*/
|
|
197
|
+
export function normalizeSpecRefs(specRefs) {
|
|
198
|
+
if (!specRefs || specRefs.length === 0) {
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
return specRefs.map((ref) => normalizeSpecRef(ref));
|
|
202
|
+
}
|
|
@@ -23,6 +23,8 @@ import { die, createError, ErrorCodes } from './error-handler.js';
|
|
|
23
23
|
import { validateWU, validateDoneWU } from './wu-schema.js';
|
|
24
24
|
import { assertTransition } from './state-machine.js';
|
|
25
25
|
import { detectZombieState, recoverZombieState } from './wu-recovery.js';
|
|
26
|
+
// WU-1061: Import docs regeneration utilities
|
|
27
|
+
import { maybeRegenerateAndStageDocs } from './wu-done-docs-generate.js';
|
|
26
28
|
/**
|
|
27
29
|
* @typedef {Object} BranchOnlyContext
|
|
28
30
|
* @property {string} id - WU ID (e.g., "WU-1215")
|
|
@@ -119,6 +121,13 @@ export async function executeBranchOnlyCompletion(context) {
|
|
|
119
121
|
statusPath: metadataStatusPath,
|
|
120
122
|
backlogPath: metadataBacklogPath,
|
|
121
123
|
});
|
|
124
|
+
// WU-1061: Regenerate docs if doc-source files changed
|
|
125
|
+
// This runs BEFORE stageAndFormatMetadata to include doc outputs
|
|
126
|
+
// in the single atomic commit
|
|
127
|
+
await maybeRegenerateAndStageDocs({
|
|
128
|
+
baseBranch: BRANCHES.MAIN,
|
|
129
|
+
repoRoot: metadataBasePath,
|
|
130
|
+
});
|
|
122
131
|
// Step 7: Stage and format files
|
|
123
132
|
await stageAndFormatMetadata({
|
|
124
133
|
id,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file wu-done-docs-generate.ts
|
|
3
|
+
* @description Documentation regeneration utilities for wu:done
|
|
4
|
+
*
|
|
5
|
+
* WU-1061: Integrate docs:generate into wu:done for @lumenflow/* changes
|
|
6
|
+
*
|
|
7
|
+
* Detects changes to files that affect generated documentation and triggers
|
|
8
|
+
* regeneration during wu:done (after gates pass, before metadata commit).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Pathspecs for files that affect generated documentation.
|
|
12
|
+
* When any of these files change, docs:generate should be run.
|
|
13
|
+
*
|
|
14
|
+
* Based on .husky/hooks/docs-sync.mjs patterns, expanded to match
|
|
15
|
+
* all files that can affect CLI/config documentation.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DOC_SOURCE_PATHSPECS: readonly ["tools/generate-cli-docs.ts", "packages/@lumenflow/core/src/arg-parser.ts", "packages/@lumenflow/core/src/lumenflow-config-schema.ts", "packages/@lumenflow/core/src/index.ts", "packages/@lumenflow/cli/package.json", "packages/@lumenflow/cli/src/"];
|
|
18
|
+
/**
|
|
19
|
+
* Output files generated by docs:generate.
|
|
20
|
+
* These files are staged before the metadata commit.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DOC_OUTPUT_FILES: readonly ["apps/docs/src/content/docs/reference/cli.mdx", "apps/docs/src/content/docs/reference/config.mdx"];
|
|
23
|
+
/**
|
|
24
|
+
* Check if any doc-source files changed compared to the base branch.
|
|
25
|
+
* Uses git diff with pathspecs for efficient detection.
|
|
26
|
+
*
|
|
27
|
+
* @param baseBranch - Base branch for comparison (e.g., 'main', 'origin/main')
|
|
28
|
+
* @returns Promise<boolean> - True if doc-source files changed
|
|
29
|
+
*/
|
|
30
|
+
export declare function hasDocSourceChanges(baseBranch: string): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Stage doc output files for the metadata commit.
|
|
33
|
+
*
|
|
34
|
+
* @returns Promise<void>
|
|
35
|
+
*/
|
|
36
|
+
export declare function stageDocOutputs(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Run turbo docs:generate to regenerate documentation.
|
|
39
|
+
* Turbo handles build dependencies and caching.
|
|
40
|
+
*
|
|
41
|
+
* @param repoRoot - Repository root directory
|
|
42
|
+
* @returns void
|
|
43
|
+
*/
|
|
44
|
+
export declare function runDocsGenerate(repoRoot: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Result of the docs regeneration check.
|
|
47
|
+
*/
|
|
48
|
+
export interface DocsRegenerationResult {
|
|
49
|
+
/** Whether doc-source files changed */
|
|
50
|
+
docsChanged: boolean;
|
|
51
|
+
/** Whether docs were regenerated */
|
|
52
|
+
regenerated: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Options for maybeRegenerateAndStageDocs.
|
|
56
|
+
*/
|
|
57
|
+
export interface MaybeRegenerateDocsOptions {
|
|
58
|
+
/** Base branch for comparison (e.g., 'main', calculated from defaultBranchFrom) */
|
|
59
|
+
baseBranch: string;
|
|
60
|
+
/** Repository root directory for running turbo */
|
|
61
|
+
repoRoot: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Detect doc-source changes and regenerate docs if needed.
|
|
65
|
+
* This is the main integration point for wu:done.
|
|
66
|
+
*
|
|
67
|
+
* Call this BEFORE stageAndFormatMetadata() to include doc outputs
|
|
68
|
+
* in the single atomic commit.
|
|
69
|
+
*
|
|
70
|
+
* @param options - Detection and regeneration options
|
|
71
|
+
* @returns Promise<DocsRegenerationResult> - Whether docs changed and were regenerated
|
|
72
|
+
*/
|
|
73
|
+
export declare function maybeRegenerateAndStageDocs(options: MaybeRegenerateDocsOptions): Promise<DocsRegenerationResult>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file wu-done-docs-generate.ts
|
|
3
|
+
* @description Documentation regeneration utilities for wu:done
|
|
4
|
+
*
|
|
5
|
+
* WU-1061: Integrate docs:generate into wu:done for @lumenflow/* changes
|
|
6
|
+
*
|
|
7
|
+
* Detects changes to files that affect generated documentation and triggers
|
|
8
|
+
* regeneration during wu:done (after gates pass, before metadata commit).
|
|
9
|
+
*/
|
|
10
|
+
import { execSync } from 'node:child_process';
|
|
11
|
+
import { getGitForCwd } from './git-adapter.js';
|
|
12
|
+
import { STDIO } from './wu-constants.js';
|
|
13
|
+
/**
|
|
14
|
+
* Pathspecs for files that affect generated documentation.
|
|
15
|
+
* When any of these files change, docs:generate should be run.
|
|
16
|
+
*
|
|
17
|
+
* Based on .husky/hooks/docs-sync.mjs patterns, expanded to match
|
|
18
|
+
* all files that can affect CLI/config documentation.
|
|
19
|
+
*/
|
|
20
|
+
export const DOC_SOURCE_PATHSPECS = [
|
|
21
|
+
'tools/generate-cli-docs.ts',
|
|
22
|
+
'packages/@lumenflow/core/src/arg-parser.ts',
|
|
23
|
+
'packages/@lumenflow/core/src/lumenflow-config-schema.ts',
|
|
24
|
+
'packages/@lumenflow/core/src/index.ts',
|
|
25
|
+
'packages/@lumenflow/cli/package.json',
|
|
26
|
+
'packages/@lumenflow/cli/src/',
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* Output files generated by docs:generate.
|
|
30
|
+
* These files are staged before the metadata commit.
|
|
31
|
+
*/
|
|
32
|
+
export const DOC_OUTPUT_FILES = [
|
|
33
|
+
'apps/docs/src/content/docs/reference/cli.mdx',
|
|
34
|
+
'apps/docs/src/content/docs/reference/config.mdx',
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Check if any doc-source files changed compared to the base branch.
|
|
38
|
+
* Uses git diff with pathspecs for efficient detection.
|
|
39
|
+
*
|
|
40
|
+
* @param baseBranch - Base branch for comparison (e.g., 'main', 'origin/main')
|
|
41
|
+
* @returns Promise<boolean> - True if doc-source files changed
|
|
42
|
+
*/
|
|
43
|
+
export async function hasDocSourceChanges(baseBranch) {
|
|
44
|
+
try {
|
|
45
|
+
const gitAdapter = getGitForCwd();
|
|
46
|
+
const diff = await gitAdapter.raw([
|
|
47
|
+
'diff',
|
|
48
|
+
`${baseBranch}...HEAD`,
|
|
49
|
+
'--name-only',
|
|
50
|
+
'--',
|
|
51
|
+
...DOC_SOURCE_PATHSPECS,
|
|
52
|
+
]);
|
|
53
|
+
return diff.trim().length > 0;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Fail-safe: don't regenerate on git errors
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Stage doc output files for the metadata commit.
|
|
62
|
+
*
|
|
63
|
+
* @returns Promise<void>
|
|
64
|
+
*/
|
|
65
|
+
export async function stageDocOutputs() {
|
|
66
|
+
const gitAdapter = getGitForCwd();
|
|
67
|
+
await gitAdapter.add([...DOC_OUTPUT_FILES]);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Run turbo docs:generate to regenerate documentation.
|
|
71
|
+
* Turbo handles build dependencies and caching.
|
|
72
|
+
*
|
|
73
|
+
* @param repoRoot - Repository root directory
|
|
74
|
+
* @returns void
|
|
75
|
+
*/
|
|
76
|
+
export function runDocsGenerate(repoRoot) {
|
|
77
|
+
execSync('pnpm turbo docs:generate', {
|
|
78
|
+
cwd: repoRoot,
|
|
79
|
+
stdio: STDIO.INHERIT,
|
|
80
|
+
encoding: 'utf-8',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Detect doc-source changes and regenerate docs if needed.
|
|
85
|
+
* This is the main integration point for wu:done.
|
|
86
|
+
*
|
|
87
|
+
* Call this BEFORE stageAndFormatMetadata() to include doc outputs
|
|
88
|
+
* in the single atomic commit.
|
|
89
|
+
*
|
|
90
|
+
* @param options - Detection and regeneration options
|
|
91
|
+
* @returns Promise<DocsRegenerationResult> - Whether docs changed and were regenerated
|
|
92
|
+
*/
|
|
93
|
+
export async function maybeRegenerateAndStageDocs(options) {
|
|
94
|
+
const { baseBranch, repoRoot } = options;
|
|
95
|
+
// Check if doc-source files changed
|
|
96
|
+
const docsChanged = await hasDocSourceChanges(baseBranch);
|
|
97
|
+
if (!docsChanged) {
|
|
98
|
+
console.log('[wu:done] No doc-source changes detected, skipping docs:generate');
|
|
99
|
+
return { docsChanged: false, regenerated: false };
|
|
100
|
+
}
|
|
101
|
+
console.log('[wu:done] Doc-source changes detected, running turbo docs:generate...');
|
|
102
|
+
// Run turbo docs:generate (Turbo handles caching and dependencies)
|
|
103
|
+
runDocsGenerate(repoRoot);
|
|
104
|
+
// Stage the doc output files
|
|
105
|
+
await stageDocOutputs();
|
|
106
|
+
console.log('[wu:done] Documentation regenerated and staged');
|
|
107
|
+
return { docsChanged: true, regenerated: true };
|
|
108
|
+
}
|
package/dist/wu-done-worktree.js
CHANGED
|
@@ -36,6 +36,8 @@ import { isPRModeEnabled, createPR, printPRCreatedMessage } from './wu-done-pr.j
|
|
|
36
36
|
import { isBranchAlreadyMerged } from './wu-done-branch-utils.js';
|
|
37
37
|
// WU-1371: Import rebase artifact cleanup functions
|
|
38
38
|
import { detectRebasedArtifacts, cleanupRebasedArtifacts } from './rebase-artifact-cleanup.js';
|
|
39
|
+
// WU-1061: Import docs regeneration utilities
|
|
40
|
+
import { maybeRegenerateAndStageDocs } from './wu-done-docs-generate.js';
|
|
39
41
|
import { WUTransaction, createTransactionSnapshot, restoreFromSnapshot } from './wu-transaction.js';
|
|
40
42
|
// WU-1506: Import backlog invariant repair
|
|
41
43
|
// WU-1574: Removed repairBacklogInvariants - no longer needed with state store architecture
|
|
@@ -261,6 +263,16 @@ export async function executeWorktreeCompletion(context) {
|
|
|
261
263
|
// PHASE 4: GIT OPERATIONS (stage, format, commit)
|
|
262
264
|
// Files are now written - proceed with git operations
|
|
263
265
|
// ======================================================================
|
|
266
|
+
// ======================================================================
|
|
267
|
+
// WU-1061: Regenerate docs if doc-source files changed
|
|
268
|
+
// This runs BEFORE stageAndFormatMetadata to include doc outputs
|
|
269
|
+
// in the single atomic commit
|
|
270
|
+
// Uses main as base to detect changes introduced by this WU
|
|
271
|
+
// ======================================================================
|
|
272
|
+
await maybeRegenerateAndStageDocs({
|
|
273
|
+
baseBranch: BRANCHES.MAIN,
|
|
274
|
+
repoRoot: worktreePath,
|
|
275
|
+
});
|
|
264
276
|
// Stage and format files
|
|
265
277
|
await stageAndFormatMetadata({
|
|
266
278
|
id,
|
package/dist/wu-schema.js
CHANGED
|
@@ -826,10 +826,12 @@ export function validateWUCompleteness(wu) {
|
|
|
826
826
|
warnings.push(`${wu.id}: Missing 'tests.manual' field. Add manual verification steps for acceptance criteria.`);
|
|
827
827
|
}
|
|
828
828
|
// Check for spec_refs (features should link to plans/specs)
|
|
829
|
+
// WU-1062: Accepts both repo-relative paths (docs/04-operations/plans/) and
|
|
830
|
+
// external paths (~/.lumenflow/plans/, $LUMENFLOW_HOME/plans/, lumenflow://plans/)
|
|
829
831
|
if (type === 'feature') {
|
|
830
832
|
const hasSpecRefs = wu.spec_refs && wu.spec_refs.length > 0;
|
|
831
833
|
if (!hasSpecRefs) {
|
|
832
|
-
warnings.push(`${wu.id}: Missing 'spec_refs' field. Link to plan file
|
|
834
|
+
warnings.push(`${wu.id}: Missing 'spec_refs' field. Link to plan file (docs/04-operations/plans/, lumenflow://plans/, or ~/.lumenflow/plans/) for traceability.`);
|
|
833
835
|
}
|
|
834
836
|
}
|
|
835
837
|
return { warnings };
|
package/dist/wu-spawn.js
CHANGED
|
@@ -89,6 +89,9 @@ function formatAcceptance(acceptance) {
|
|
|
89
89
|
/**
|
|
90
90
|
* Format spec_refs as markdown links
|
|
91
91
|
*
|
|
92
|
+
* WU-1062: Handles external paths (lumenflow://, ~/.lumenflow/, $LUMENFLOW_HOME/)
|
|
93
|
+
* by expanding them to absolute paths and adding a note about reading them.
|
|
94
|
+
*
|
|
92
95
|
* @param {string[]|undefined} specRefs - Spec references array
|
|
93
96
|
* @returns {string} Formatted references or empty string if none
|
|
94
97
|
*/
|
|
@@ -96,7 +99,17 @@ function formatSpecRefs(specRefs) {
|
|
|
96
99
|
if (!specRefs || specRefs.length === 0) {
|
|
97
100
|
return '';
|
|
98
101
|
}
|
|
99
|
-
|
|
102
|
+
const formattedRefs = specRefs.map((ref) => {
|
|
103
|
+
// WU-1062: Add note for external paths
|
|
104
|
+
if (ref.startsWith('lumenflow://') ||
|
|
105
|
+
ref.startsWith('~/') ||
|
|
106
|
+
ref.startsWith('$LUMENFLOW_HOME') ||
|
|
107
|
+
(ref.startsWith('/') && ref.includes('.lumenflow'))) {
|
|
108
|
+
return `- ${ref} (external - read with filesystem access)`;
|
|
109
|
+
}
|
|
110
|
+
return `- ${ref}`;
|
|
111
|
+
});
|
|
112
|
+
return formattedRefs.join('\n');
|
|
100
113
|
}
|
|
101
114
|
/**
|
|
102
115
|
* Format risks as markdown list
|
|
@@ -733,7 +746,7 @@ function generateLaneGuidance(lane) {
|
|
|
733
746
|
- Follow prompt versioning guidelines in ai/prompts/README.md`,
|
|
734
747
|
Experience: `## Lane-Specific: Experience
|
|
735
748
|
|
|
736
|
-
- Follow design system tokens in
|
|
749
|
+
- Follow design system tokens defined in the project
|
|
737
750
|
- Ensure accessibility compliance (WCAG 2.1 AA)`,
|
|
738
751
|
Core: `## Lane-Specific: Core
|
|
739
752
|
|
package/dist/wu-yaml-fixer.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { readFileSync, writeFileSync, copyFileSync } from 'node:fs';
|
|
17
17
|
import { parseYAML, stringifyYAML } from './wu-yaml.js';
|
|
18
|
-
import { STRING_LITERALS } from './wu-constants.js';
|
|
18
|
+
import { DEFAULTS, STRING_LITERALS } from './wu-constants.js';
|
|
19
19
|
// Valid type values from wu-schema.mjs
|
|
20
20
|
const VALID_TYPES = ['feature', 'bug', 'documentation', 'process', 'tooling', 'chore', 'refactor'];
|
|
21
21
|
// Common type aliases that should be auto-fixed
|
|
@@ -30,8 +30,11 @@ const TYPE_ALIASES = {
|
|
|
30
30
|
ref: 'refactor',
|
|
31
31
|
proc: 'process',
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Default email domain for username -> email conversion
|
|
35
|
+
* WU-1068: Changed from hardcoded 'patientpath.co.uk' to configurable default
|
|
36
|
+
*/
|
|
37
|
+
const DEFAULT_EMAIL_DOMAIN = DEFAULTS.EMAIL_DOMAIN;
|
|
35
38
|
/**
|
|
36
39
|
* Issue types that can be detected and auto-fixed
|
|
37
40
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumenflow/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Core WU lifecycle tools for LumenFlow workflow framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lumenflow",
|
|
@@ -65,6 +65,13 @@
|
|
|
65
65
|
"LICENSE",
|
|
66
66
|
"README.md"
|
|
67
67
|
],
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "tsc",
|
|
70
|
+
"build:dist": "tsc -p tsconfig.build.json",
|
|
71
|
+
"pack:dist": "pnpm pack",
|
|
72
|
+
"clean": "rm -rf dist *.tgz",
|
|
73
|
+
"test": "vitest run"
|
|
74
|
+
},
|
|
68
75
|
"dependencies": {
|
|
69
76
|
"change-case": "^5.4.4",
|
|
70
77
|
"cli-progress": "^3.12.0",
|
|
@@ -76,6 +83,7 @@
|
|
|
76
83
|
"gray-matter": "^4.0.3",
|
|
77
84
|
"micromatch": "^4.0.8",
|
|
78
85
|
"minimatch": "^10.1.1",
|
|
86
|
+
"ms": "^2.1.3",
|
|
79
87
|
"picocolors": "^1.1.1",
|
|
80
88
|
"pretty-ms": "^9.2.0",
|
|
81
89
|
"ps-list": "^8.1.1",
|
|
@@ -90,8 +98,8 @@
|
|
|
90
98
|
"vitest": "^4.0.17"
|
|
91
99
|
},
|
|
92
100
|
"peerDependencies": {
|
|
93
|
-
"@lumenflow/memory": "
|
|
94
|
-
"@lumenflow/initiatives": "
|
|
101
|
+
"@lumenflow/memory": "workspace:*",
|
|
102
|
+
"@lumenflow/initiatives": "workspace:*"
|
|
95
103
|
},
|
|
96
104
|
"peerDependenciesMeta": {
|
|
97
105
|
"@lumenflow/memory": {
|
|
@@ -106,12 +114,5 @@
|
|
|
106
114
|
},
|
|
107
115
|
"publishConfig": {
|
|
108
116
|
"access": "public"
|
|
109
|
-
},
|
|
110
|
-
"scripts": {
|
|
111
|
-
"build": "tsc",
|
|
112
|
-
"build:dist": "tsc -p tsconfig.build.json",
|
|
113
|
-
"pack:dist": "pnpm pack",
|
|
114
|
-
"clean": "rm -rf dist *.tgz",
|
|
115
|
-
"test": "vitest run"
|
|
116
117
|
}
|
|
117
|
-
}
|
|
118
|
+
}
|