@lumenflow/cli 1.0.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.
- package/LICENSE +190 -0
- package/README.md +116 -0
- package/dist/gates.d.ts +41 -0
- package/dist/gates.d.ts.map +1 -0
- package/dist/gates.js +684 -0
- package/dist/gates.js.map +1 -0
- package/dist/initiative-add-wu.d.ts +22 -0
- package/dist/initiative-add-wu.d.ts.map +1 -0
- package/dist/initiative-add-wu.js +234 -0
- package/dist/initiative-add-wu.js.map +1 -0
- package/dist/initiative-create.d.ts +28 -0
- package/dist/initiative-create.d.ts.map +1 -0
- package/dist/initiative-create.js +172 -0
- package/dist/initiative-create.js.map +1 -0
- package/dist/initiative-edit.d.ts +34 -0
- package/dist/initiative-edit.d.ts.map +1 -0
- package/dist/initiative-edit.js +440 -0
- package/dist/initiative-edit.js.map +1 -0
- package/dist/initiative-list.d.ts +12 -0
- package/dist/initiative-list.d.ts.map +1 -0
- package/dist/initiative-list.js +101 -0
- package/dist/initiative-list.js.map +1 -0
- package/dist/initiative-status.d.ts +11 -0
- package/dist/initiative-status.d.ts.map +1 -0
- package/dist/initiative-status.js +221 -0
- package/dist/initiative-status.js.map +1 -0
- package/dist/mem-checkpoint.d.ts +16 -0
- package/dist/mem-checkpoint.d.ts.map +1 -0
- package/dist/mem-checkpoint.js +237 -0
- package/dist/mem-checkpoint.js.map +1 -0
- package/dist/mem-cleanup.d.ts +29 -0
- package/dist/mem-cleanup.d.ts.map +1 -0
- package/dist/mem-cleanup.js +267 -0
- package/dist/mem-cleanup.js.map +1 -0
- package/dist/mem-create.d.ts +17 -0
- package/dist/mem-create.d.ts.map +1 -0
- package/dist/mem-create.js +265 -0
- package/dist/mem-create.js.map +1 -0
- package/dist/mem-inbox.d.ts +35 -0
- package/dist/mem-inbox.d.ts.map +1 -0
- package/dist/mem-inbox.js +373 -0
- package/dist/mem-inbox.js.map +1 -0
- package/dist/mem-init.d.ts +15 -0
- package/dist/mem-init.d.ts.map +1 -0
- package/dist/mem-init.js +146 -0
- package/dist/mem-init.js.map +1 -0
- package/dist/mem-ready.d.ts +16 -0
- package/dist/mem-ready.d.ts.map +1 -0
- package/dist/mem-ready.js +224 -0
- package/dist/mem-ready.js.map +1 -0
- package/dist/mem-signal.d.ts +16 -0
- package/dist/mem-signal.d.ts.map +1 -0
- package/dist/mem-signal.js +204 -0
- package/dist/mem-signal.js.map +1 -0
- package/dist/mem-start.d.ts +16 -0
- package/dist/mem-start.d.ts.map +1 -0
- package/dist/mem-start.js +158 -0
- package/dist/mem-start.js.map +1 -0
- package/dist/mem-summarize.d.ts +22 -0
- package/dist/mem-summarize.d.ts.map +1 -0
- package/dist/mem-summarize.js +213 -0
- package/dist/mem-summarize.js.map +1 -0
- package/dist/mem-triage.d.ts +22 -0
- package/dist/mem-triage.d.ts.map +1 -0
- package/dist/mem-triage.js +328 -0
- package/dist/mem-triage.js.map +1 -0
- package/dist/spawn-list.d.ts +16 -0
- package/dist/spawn-list.d.ts.map +1 -0
- package/dist/spawn-list.js +140 -0
- package/dist/spawn-list.js.map +1 -0
- package/dist/wu-block.d.ts +16 -0
- package/dist/wu-block.d.ts.map +1 -0
- package/dist/wu-block.js +241 -0
- package/dist/wu-block.js.map +1 -0
- package/dist/wu-claim.d.ts +32 -0
- package/dist/wu-claim.d.ts.map +1 -0
- package/dist/wu-claim.js +1106 -0
- package/dist/wu-claim.js.map +1 -0
- package/dist/wu-cleanup.d.ts +17 -0
- package/dist/wu-cleanup.d.ts.map +1 -0
- package/dist/wu-cleanup.js +194 -0
- package/dist/wu-cleanup.js.map +1 -0
- package/dist/wu-create.d.ts +38 -0
- package/dist/wu-create.d.ts.map +1 -0
- package/dist/wu-create.js +520 -0
- package/dist/wu-create.js.map +1 -0
- package/dist/wu-deps.d.ts +13 -0
- package/dist/wu-deps.d.ts.map +1 -0
- package/dist/wu-deps.js +119 -0
- package/dist/wu-deps.js.map +1 -0
- package/dist/wu-done.d.ts +153 -0
- package/dist/wu-done.d.ts.map +1 -0
- package/dist/wu-done.js +2096 -0
- package/dist/wu-done.js.map +1 -0
- package/dist/wu-edit.d.ts +29 -0
- package/dist/wu-edit.d.ts.map +1 -0
- package/dist/wu-edit.js +852 -0
- package/dist/wu-edit.js.map +1 -0
- package/dist/wu-infer-lane.d.ts +17 -0
- package/dist/wu-infer-lane.d.ts.map +1 -0
- package/dist/wu-infer-lane.js +135 -0
- package/dist/wu-infer-lane.js.map +1 -0
- package/dist/wu-preflight.d.ts +47 -0
- package/dist/wu-preflight.d.ts.map +1 -0
- package/dist/wu-preflight.js +167 -0
- package/dist/wu-preflight.js.map +1 -0
- package/dist/wu-prune.d.ts +16 -0
- package/dist/wu-prune.d.ts.map +1 -0
- package/dist/wu-prune.js +259 -0
- package/dist/wu-prune.js.map +1 -0
- package/dist/wu-repair.d.ts +60 -0
- package/dist/wu-repair.d.ts.map +1 -0
- package/dist/wu-repair.js +226 -0
- package/dist/wu-repair.js.map +1 -0
- package/dist/wu-spawn-completion.d.ts +10 -0
- package/dist/wu-spawn-completion.js +30 -0
- package/dist/wu-spawn.d.ts +168 -0
- package/dist/wu-spawn.d.ts.map +1 -0
- package/dist/wu-spawn.js +1327 -0
- package/dist/wu-spawn.js.map +1 -0
- package/dist/wu-unblock.d.ts +16 -0
- package/dist/wu-unblock.d.ts.map +1 -0
- package/dist/wu-unblock.js +234 -0
- package/dist/wu-unblock.js.map +1 -0
- package/dist/wu-validate.d.ts +16 -0
- package/dist/wu-validate.d.ts.map +1 -0
- package/dist/wu-validate.js +193 -0
- package/dist/wu-validate.js.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* WU Create Helper (WU-1262, WU-1439)
|
|
4
|
+
*
|
|
5
|
+
* Race-safe WU creation using shared micro-worktree isolation.
|
|
6
|
+
*
|
|
7
|
+
* Canonical sequence:
|
|
8
|
+
* 1) Validate inputs (id, lane, title)
|
|
9
|
+
* 2) Ensure on main branch
|
|
10
|
+
* 3) Use withMicroWorktree() to atomically:
|
|
11
|
+
* a) Create temp branch without switching main checkout
|
|
12
|
+
* b) Create WU-{id}.yaml and update backlog.md in micro-worktree
|
|
13
|
+
* c) Commit with "docs: create wu-{id} for <title>" message
|
|
14
|
+
* d) Merge to main with ff-only (retry with rebase if needed)
|
|
15
|
+
* e) Push to origin/main
|
|
16
|
+
* f) Cleanup temp branch and micro-worktree
|
|
17
|
+
*
|
|
18
|
+
* Benefits:
|
|
19
|
+
* - Main checkout never switches branches (no impact on other agents)
|
|
20
|
+
* - Race conditions handled via rebase+retry (up to 3 attempts)
|
|
21
|
+
* - Cleanup guaranteed even on failure
|
|
22
|
+
*
|
|
23
|
+
* Usage:
|
|
24
|
+
* pnpm wu:create --id WU-706 --lane Intelligence --title "Fix XYZ issue"
|
|
25
|
+
*
|
|
26
|
+
* Context: WU-705 (fix agent coordination failures), WU-1262 (micro-worktree isolation),
|
|
27
|
+
* WU-1439 (refactor to shared helper)
|
|
28
|
+
*/
|
|
29
|
+
import { getGitForCwd } from '@lumenflow/core/dist/git-adapter.js';
|
|
30
|
+
import { die } from '@lumenflow/core/dist/error-handler.js';
|
|
31
|
+
import { existsSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
32
|
+
import { join } from 'node:path';
|
|
33
|
+
// WU-1352: Use centralized YAML functions from wu-yaml.mjs
|
|
34
|
+
import { stringifyYAML } from '@lumenflow/core/dist/wu-yaml.js';
|
|
35
|
+
// WU-1428: Use date-utils for consistent YYYY-MM-DD format (library-first)
|
|
36
|
+
import { todayISO } from '@lumenflow/core/dist/date-utils.js';
|
|
37
|
+
import { validateLaneFormat, extractParent } from '@lumenflow/core/dist/lane-checker.js';
|
|
38
|
+
// WU-2330: Import lane inference for sub-lane suggestions
|
|
39
|
+
import { inferSubLane } from '@lumenflow/core/dist/lane-inference.js';
|
|
40
|
+
import { parseBacklogFrontmatter } from '@lumenflow/core/dist/backlog-parser.js';
|
|
41
|
+
import { createWUParser, WU_OPTIONS } from '@lumenflow/core/dist/arg-parser.js';
|
|
42
|
+
import { WU_PATHS } from '@lumenflow/core/dist/wu-paths.js';
|
|
43
|
+
import { PLACEHOLDER_SENTINEL, validateReadyWU } from '@lumenflow/core/dist/wu-schema.js';
|
|
44
|
+
import { COMMIT_FORMATS, FILE_SYSTEM, STRING_LITERALS, READINESS_UI, } from '@lumenflow/core/dist/wu-constants.js';
|
|
45
|
+
// WU-1593: Use centralized validateWUIDFormat (DRY)
|
|
46
|
+
import { ensureOnMain, validateWUIDFormat } from '@lumenflow/core/dist/wu-helpers.js';
|
|
47
|
+
// WU-1439: Use shared micro-worktree helper
|
|
48
|
+
import { withMicroWorktree } from '@lumenflow/core/dist/micro-worktree.js';
|
|
49
|
+
// WU-1620: Import spec completeness validator for readiness summary
|
|
50
|
+
import { validateSpecCompleteness } from '@lumenflow/core/dist/wu-done-validators.js';
|
|
51
|
+
// WU-1620: Import readWU to read back created YAML for validation
|
|
52
|
+
import { readWU } from '@lumenflow/core/dist/wu-yaml.js';
|
|
53
|
+
// WU-2253: Import WU spec linter for acceptance/code_paths validation
|
|
54
|
+
import { lintWUSpec, formatLintErrors } from '@lumenflow/core/dist/wu-lint.js';
|
|
55
|
+
/** Log prefix for console output */
|
|
56
|
+
const LOG_PREFIX = '[wu:create]';
|
|
57
|
+
/** Micro-worktree operation name */
|
|
58
|
+
const OPERATION_NAME = 'wu-create';
|
|
59
|
+
/** Default WU priority */
|
|
60
|
+
const DEFAULT_PRIORITY = 'P2';
|
|
61
|
+
/** Default WU type */
|
|
62
|
+
const DEFAULT_TYPE = 'feature';
|
|
63
|
+
/** Maximum title length before truncation */
|
|
64
|
+
const MAX_TITLE_LENGTH = 60;
|
|
65
|
+
/** Truncation suffix */
|
|
66
|
+
const TRUNCATION_SUFFIX = '...';
|
|
67
|
+
/** Truncated title length (MAX_TITLE_LENGTH - TRUNCATION_SUFFIX.length) */
|
|
68
|
+
const TRUNCATED_TITLE_LENGTH = MAX_TITLE_LENGTH - TRUNCATION_SUFFIX.length;
|
|
69
|
+
/** Minimum confidence threshold to show lane suggestion warning (WU-2438: lowered from 50 to 30) */
|
|
70
|
+
const MIN_CONFIDENCE_FOR_WARNING = 30;
|
|
71
|
+
/**
|
|
72
|
+
* WU-2330: Check if a more specific sub-lane matches the provided inputs.
|
|
73
|
+
* Non-blocking - just logs a warning if a better lane is suggested.
|
|
74
|
+
*
|
|
75
|
+
* @param {string} providedLane - Lane provided by the user
|
|
76
|
+
* @param {string|undefined} codePathsRaw - Comma-separated code paths
|
|
77
|
+
* @param {string} title - WU title (used as fallback description)
|
|
78
|
+
* @param {string|undefined} description - WU description
|
|
79
|
+
*/
|
|
80
|
+
export function warnIfBetterLaneExists(providedLane, codePathsRaw, title, description) {
|
|
81
|
+
if (!codePathsRaw && !description) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const codePaths = codePathsRaw
|
|
86
|
+
? codePathsRaw
|
|
87
|
+
.split(',')
|
|
88
|
+
.map((s) => s.trim())
|
|
89
|
+
.filter(Boolean)
|
|
90
|
+
: [];
|
|
91
|
+
const descForInference = description || title;
|
|
92
|
+
const suggestion = inferSubLane(codePaths, descForInference);
|
|
93
|
+
// Only warn if suggestion differs and confidence is meaningful
|
|
94
|
+
if (suggestion.lane === providedLane || suggestion.confidence < MIN_CONFIDENCE_FOR_WARNING) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
// Check if suggestion is more specific (a sub-lane of the provided parent)
|
|
98
|
+
const providedParent = extractParent(providedLane);
|
|
99
|
+
const suggestedParent = extractParent(suggestion.lane);
|
|
100
|
+
const isMoreSpecific = providedParent === suggestedParent && suggestion.lane !== providedLane;
|
|
101
|
+
const isDifferentLane = providedParent !== suggestedParent;
|
|
102
|
+
if (isMoreSpecific || isDifferentLane) {
|
|
103
|
+
console.warn(`${LOG_PREFIX} Consider using "${suggestion.lane}" (${suggestion.confidence}% match) instead of "${providedLane}"`);
|
|
104
|
+
console.warn(`${LOG_PREFIX} Run: pnpm wu:infer-lane --paths "${codePathsRaw || ''}" --desc "${title}"`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Non-blocking - if inference fails, continue silently
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Check if WU already exists
|
|
113
|
+
* @param {string} id - WU ID to check
|
|
114
|
+
*/
|
|
115
|
+
function checkWUExists(id) {
|
|
116
|
+
const wuPath = WU_PATHS.WU(id);
|
|
117
|
+
if (existsSync(wuPath)) {
|
|
118
|
+
die(`WU already exists: ${wuPath}\n\n` +
|
|
119
|
+
`Options:\n` +
|
|
120
|
+
` 1. Choose a different WU ID\n` +
|
|
121
|
+
` 2. Edit existing WU: pnpm wu:edit --id ${id} --title "..." --acceptance "..."\n` +
|
|
122
|
+
` 3. Delete existing WU: pnpm wu:delete --id ${id} (if obsolete)`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Truncate title for commit message if needed
|
|
127
|
+
* @param {string} title - Original title
|
|
128
|
+
* @returns {string} Truncated title
|
|
129
|
+
*/
|
|
130
|
+
function truncateTitle(title) {
|
|
131
|
+
return title.length > MAX_TITLE_LENGTH
|
|
132
|
+
? `${title.substring(0, TRUNCATED_TITLE_LENGTH)}${TRUNCATION_SUFFIX}`
|
|
133
|
+
: title;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* WU-1620: Display readiness summary after create/edit
|
|
137
|
+
*
|
|
138
|
+
* Shows whether WU is ready for wu:claim based on spec completeness.
|
|
139
|
+
* Non-blocking - just informational to help agents understand what's missing.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} id - WU ID
|
|
142
|
+
*/
|
|
143
|
+
function displayReadinessSummary(id) {
|
|
144
|
+
try {
|
|
145
|
+
const wuPath = WU_PATHS.WU(id);
|
|
146
|
+
const wuDoc = readWU(wuPath, id);
|
|
147
|
+
const { valid, errors } = validateSpecCompleteness(wuDoc, id);
|
|
148
|
+
const { BOX, BOX_WIDTH, MESSAGES, ERROR_MAX_LENGTH, ERROR_TRUNCATE_LENGTH, TRUNCATION_SUFFIX, PADDING, } = READINESS_UI;
|
|
149
|
+
console.log(`\n${BOX.TOP_LEFT}${BOX.HORIZONTAL.repeat(BOX_WIDTH)}${BOX.TOP_RIGHT}`);
|
|
150
|
+
if (valid) {
|
|
151
|
+
console.log(`${BOX.VERTICAL} ${MESSAGES.READY_YES}${''.padEnd(PADDING.READY_YES)}${BOX.VERTICAL}`);
|
|
152
|
+
console.log(`${BOX.VERTICAL}${''.padEnd(BOX_WIDTH)}${BOX.VERTICAL}`);
|
|
153
|
+
const claimCmd = `Run: pnpm wu:claim --id ${id}`;
|
|
154
|
+
console.log(`${BOX.VERTICAL} ${claimCmd}${''.padEnd(BOX_WIDTH - claimCmd.length - 1)}${BOX.VERTICAL}`);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
console.log(`${BOX.VERTICAL} ${MESSAGES.READY_NO}${''.padEnd(PADDING.READY_NO)}${BOX.VERTICAL}`);
|
|
158
|
+
console.log(`${BOX.VERTICAL}${''.padEnd(BOX_WIDTH)}${BOX.VERTICAL}`);
|
|
159
|
+
console.log(`${BOX.VERTICAL} ${MESSAGES.MISSING_HEADER}${''.padEnd(PADDING.MISSING_HEADER)}${BOX.VERTICAL}`);
|
|
160
|
+
for (const error of errors) {
|
|
161
|
+
// Truncate long error messages to fit box
|
|
162
|
+
const truncated = error.length > ERROR_MAX_LENGTH
|
|
163
|
+
? `${error.substring(0, ERROR_TRUNCATE_LENGTH)}${TRUNCATION_SUFFIX}`
|
|
164
|
+
: error;
|
|
165
|
+
console.log(`${BOX.VERTICAL} ${MESSAGES.BULLET} ${truncated}${''.padEnd(Math.max(0, PADDING.ERROR_BULLET - truncated.length))}${BOX.VERTICAL}`);
|
|
166
|
+
}
|
|
167
|
+
console.log(`${BOX.VERTICAL}${''.padEnd(BOX_WIDTH)}${BOX.VERTICAL}`);
|
|
168
|
+
const editCmd = `Run: pnpm wu:edit --id ${id} --help`;
|
|
169
|
+
console.log(`${BOX.VERTICAL} ${editCmd}${''.padEnd(BOX_WIDTH - editCmd.length - 1)}${BOX.VERTICAL}`);
|
|
170
|
+
}
|
|
171
|
+
console.log(`${BOX.BOTTOM_LEFT}${BOX.HORIZONTAL.repeat(BOX_WIDTH)}${BOX.BOTTOM_RIGHT}`);
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
// Non-blocking - if validation fails, just warn
|
|
175
|
+
console.warn(`${LOG_PREFIX} ⚠️ Could not validate readiness: ${err.message}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Create WU YAML file in micro-worktree
|
|
180
|
+
*
|
|
181
|
+
* @param {string} worktreePath - Path to micro-worktree
|
|
182
|
+
* @param {string} id - WU ID
|
|
183
|
+
* @param {string} lane - WU lane
|
|
184
|
+
* @param {string} title - WU title
|
|
185
|
+
* @param {string} priority - WU priority
|
|
186
|
+
* @param {string} type - WU type
|
|
187
|
+
* @param {Object} opts - Additional options
|
|
188
|
+
* @returns {string} Relative path to created YAML file
|
|
189
|
+
*/
|
|
190
|
+
function createWUYamlInWorktree(worktreePath, id, lane, title, priority, type, opts = {}) {
|
|
191
|
+
const wuRelativePath = WU_PATHS.WU(id);
|
|
192
|
+
const wuAbsolutePath = join(worktreePath, wuRelativePath);
|
|
193
|
+
const wuDir = join(worktreePath, WU_PATHS.WU_DIR());
|
|
194
|
+
mkdirSync(wuDir, { recursive: true });
|
|
195
|
+
// WU-1428: Use todayISO() for consistent YYYY-MM-DD format (library-first)
|
|
196
|
+
const today = todayISO();
|
|
197
|
+
// Parse initiative system fields from opts (WU-1247) and assigned_to (WU-1368)
|
|
198
|
+
const { initiative, phase, blockedBy, blocks, labels, assignedTo } = opts;
|
|
199
|
+
// WU-1364: Parse full spec inline options
|
|
200
|
+
const { description: inlineDescription, acceptance: inlineAcceptance, codePaths, testPathsManual, testPathsUnit, testPathsE2e, } = opts;
|
|
201
|
+
// WU-1998: Parse exposure field options
|
|
202
|
+
const { exposure, userJourney, uiPairingWus } = opts;
|
|
203
|
+
// WU-2320: Parse spec_refs option
|
|
204
|
+
const { specRefs } = opts;
|
|
205
|
+
// Helper to parse comma-separated strings into arrays (DRY)
|
|
206
|
+
const parseCommaSeparated = (value) => value
|
|
207
|
+
? value
|
|
208
|
+
.split(',')
|
|
209
|
+
.map((s) => s.trim())
|
|
210
|
+
.filter(Boolean)
|
|
211
|
+
: [];
|
|
212
|
+
// WU-1364: Build description (inline or placeholder)
|
|
213
|
+
const description = inlineDescription
|
|
214
|
+
? inlineDescription
|
|
215
|
+
: `${PLACEHOLDER_SENTINEL} Describe the work to be done.\n\nContext: ...\nProblem: ...\nSolution: ...\n`;
|
|
216
|
+
// WU-1364: Build acceptance (inline array or placeholder)
|
|
217
|
+
const acceptance = inlineAcceptance && inlineAcceptance.length > 0
|
|
218
|
+
? inlineAcceptance
|
|
219
|
+
: [
|
|
220
|
+
`${PLACEHOLDER_SENTINEL} Define acceptance criteria`,
|
|
221
|
+
'pnpm format, lint, typecheck → PASS',
|
|
222
|
+
];
|
|
223
|
+
// WU-1364: Build code_paths from inline flag
|
|
224
|
+
const code_paths = parseCommaSeparated(codePaths);
|
|
225
|
+
// WU-1364: Build tests object from inline flags
|
|
226
|
+
const tests = {
|
|
227
|
+
manual: parseCommaSeparated(testPathsManual),
|
|
228
|
+
unit: parseCommaSeparated(testPathsUnit),
|
|
229
|
+
e2e: parseCommaSeparated(testPathsE2e),
|
|
230
|
+
};
|
|
231
|
+
const wuContent = {
|
|
232
|
+
id,
|
|
233
|
+
title,
|
|
234
|
+
lane,
|
|
235
|
+
type,
|
|
236
|
+
status: 'ready',
|
|
237
|
+
priority,
|
|
238
|
+
created: today,
|
|
239
|
+
description,
|
|
240
|
+
acceptance,
|
|
241
|
+
code_paths,
|
|
242
|
+
tests,
|
|
243
|
+
artifacts: [`.beacon/stamps/${id}.done`],
|
|
244
|
+
dependencies: [],
|
|
245
|
+
risks: [],
|
|
246
|
+
notes: '',
|
|
247
|
+
requires_review: false,
|
|
248
|
+
// Initiative system fields - only include if provided (WU-1247)
|
|
249
|
+
...(initiative && { initiative }),
|
|
250
|
+
...(phase && { phase: parseInt(phase, 10) }),
|
|
251
|
+
...(blockedBy && { blocked_by: blockedBy.split(',').map((s) => s.trim()) }),
|
|
252
|
+
...(blocks && { blocks: blocks.split(',').map((s) => s.trim()) }),
|
|
253
|
+
...(labels && { labels: labels.split(',').map((s) => s.trim()) }),
|
|
254
|
+
// WU-1368: Default assigned_to from git config user.email
|
|
255
|
+
...(assignedTo && { assigned_to: assignedTo }),
|
|
256
|
+
// WU-1998: Exposure field options - only include if provided
|
|
257
|
+
...(exposure && { exposure }),
|
|
258
|
+
...(userJourney && { user_journey: userJourney }),
|
|
259
|
+
...(uiPairingWus && { ui_pairing_wus: parseCommaSeparated(uiPairingWus) }),
|
|
260
|
+
// WU-2320: Spec references - only include if provided
|
|
261
|
+
...(specRefs && { spec_refs: parseCommaSeparated(specRefs) }),
|
|
262
|
+
};
|
|
263
|
+
// WU-1539: Validate WU structure before writing (fail-fast, allows placeholders)
|
|
264
|
+
// WU-1750: Zod transforms normalize embedded newlines in arrays and strings
|
|
265
|
+
const validationResult = validateReadyWU(wuContent);
|
|
266
|
+
if (!validationResult.success) {
|
|
267
|
+
const errors = validationResult.error.issues
|
|
268
|
+
.map((issue) => ` • ${issue.path.join('.')}: ${issue.message}`)
|
|
269
|
+
.join(STRING_LITERALS.NEWLINE);
|
|
270
|
+
die(`${LOG_PREFIX} ❌ WU YAML validation failed:\n\n${errors}\n\n` +
|
|
271
|
+
`Fix the issues above and retry.`);
|
|
272
|
+
}
|
|
273
|
+
// WU-2253: Validate acceptance/code_paths consistency and invariants compliance
|
|
274
|
+
// This blocks WU creation if acceptance references paths not in code_paths
|
|
275
|
+
// or if code_paths conflicts with tools/invariants.yml
|
|
276
|
+
const invariantsPath = join(process.cwd(), 'tools/invariants.yml');
|
|
277
|
+
const lintResult = lintWUSpec(wuContent, { invariantsPath });
|
|
278
|
+
if (!lintResult.valid) {
|
|
279
|
+
const formatted = formatLintErrors(lintResult.errors);
|
|
280
|
+
die(`${LOG_PREFIX} ❌ WU SPEC LINT FAILED:\n\n${formatted}\n` +
|
|
281
|
+
`Fix the issues above before creating this WU.`);
|
|
282
|
+
}
|
|
283
|
+
// WU-1352: Use centralized stringify (lineWidth: -1 = no wrapping for WU creation)
|
|
284
|
+
// WU-1750: CRITICAL - Use validationResult.data (transformed) NOT wuContent (raw input)
|
|
285
|
+
// This ensures embedded newlines are normalized before YAML output
|
|
286
|
+
const yamlContent = stringifyYAML(validationResult.data, { lineWidth: -1 });
|
|
287
|
+
writeFileSync(wuAbsolutePath, yamlContent, { encoding: FILE_SYSTEM.UTF8 });
|
|
288
|
+
console.log(`${LOG_PREFIX} ✅ Created ${id}.yaml in micro-worktree`);
|
|
289
|
+
return wuRelativePath;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Update backlog.md in micro-worktree
|
|
293
|
+
*
|
|
294
|
+
* @param {string} worktreePath - Path to micro-worktree
|
|
295
|
+
* @param {string} id - WU ID
|
|
296
|
+
* @param {string} lane - WU lane
|
|
297
|
+
* @param {string} title - WU title
|
|
298
|
+
* @returns {string} Relative path to backlog.md
|
|
299
|
+
*/
|
|
300
|
+
function updateBacklogInWorktree(worktreePath, id, lane, title) {
|
|
301
|
+
const backlogRelativePath = WU_PATHS.BACKLOG();
|
|
302
|
+
const backlogAbsolutePath = join(worktreePath, backlogRelativePath);
|
|
303
|
+
if (!existsSync(backlogAbsolutePath)) {
|
|
304
|
+
die(`Backlog not found in micro-worktree: ${backlogAbsolutePath}\n\n` +
|
|
305
|
+
`Options:\n` +
|
|
306
|
+
` 1. Ensure backlog.md exists at docs/04-operations/tasks/backlog.md\n` +
|
|
307
|
+
` 2. Run from repository root directory`);
|
|
308
|
+
}
|
|
309
|
+
const { frontmatter, markdown } = parseBacklogFrontmatter(backlogAbsolutePath);
|
|
310
|
+
if (!frontmatter) {
|
|
311
|
+
die('Backlog frontmatter missing in micro-worktree.\n\n' +
|
|
312
|
+
'The backlog.md file requires YAML frontmatter to define section headings.\n\n' +
|
|
313
|
+
'Options:\n' +
|
|
314
|
+
' 1. Check backlog.md has valid YAML frontmatter between --- markers\n' +
|
|
315
|
+
' 2. Ensure sections.ready.heading is defined in frontmatter');
|
|
316
|
+
}
|
|
317
|
+
if (!frontmatter.sections?.ready?.heading) {
|
|
318
|
+
die('Invalid backlog frontmatter: Missing sections.ready.heading\n\n' +
|
|
319
|
+
'Options:\n' +
|
|
320
|
+
' 1. Add sections.ready.heading to backlog.md frontmatter\n' +
|
|
321
|
+
' 2. Check frontmatter YAML structure');
|
|
322
|
+
}
|
|
323
|
+
const readyHeading = frontmatter.sections.ready.heading;
|
|
324
|
+
const insertionStrategy = frontmatter.sections.ready.insertion || 'after_heading_blank_line';
|
|
325
|
+
const lines = markdown.split(STRING_LITERALS.NEWLINE);
|
|
326
|
+
const headingIndex = lines.findIndex((line) => line === readyHeading);
|
|
327
|
+
if (headingIndex === -1) {
|
|
328
|
+
die(`Could not find Ready section heading: '${readyHeading}'\n\n` +
|
|
329
|
+
`Options:\n` +
|
|
330
|
+
` 1. Add the heading '${readyHeading}' to backlog.md\n` +
|
|
331
|
+
` 2. Update sections.ready.heading in backlog.md frontmatter`);
|
|
332
|
+
}
|
|
333
|
+
let insertionIndex;
|
|
334
|
+
if (insertionStrategy === 'after_heading_blank_line') {
|
|
335
|
+
const LINES_AFTER_HEADING = 2;
|
|
336
|
+
insertionIndex = headingIndex + LINES_AFTER_HEADING;
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
die(`Unknown insertion strategy: ${insertionStrategy}\n\n` +
|
|
340
|
+
`Options:\n` +
|
|
341
|
+
` 1. Use 'after_heading_blank_line' in backlog.md frontmatter\n` +
|
|
342
|
+
` 2. Check sections.ready.insertion value`);
|
|
343
|
+
}
|
|
344
|
+
const newEntry = `- [${id} — ${title}](wu/${id}.yaml) — ${lane}`;
|
|
345
|
+
lines.splice(insertionIndex, 0, newEntry);
|
|
346
|
+
const updatedMarkdown = lines.join(STRING_LITERALS.NEWLINE);
|
|
347
|
+
// WU-1352: Use centralized stringify for frontmatter
|
|
348
|
+
const updatedBacklog = `---\n${stringifyYAML(frontmatter, { lineWidth: -1 })}---\n${updatedMarkdown}`;
|
|
349
|
+
writeFileSync(backlogAbsolutePath, updatedBacklog, {
|
|
350
|
+
encoding: FILE_SYSTEM.UTF8,
|
|
351
|
+
});
|
|
352
|
+
console.log(`${LOG_PREFIX} ✅ Updated backlog.md in micro-worktree`);
|
|
353
|
+
return backlogRelativePath;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Get default assigned_to value from git config user.email (WU-1368)
|
|
357
|
+
* @returns {Promise<string>} User email or empty string if not configured
|
|
358
|
+
*/
|
|
359
|
+
async function getDefaultAssignedTo() {
|
|
360
|
+
try {
|
|
361
|
+
const email = await getGitForCwd().getConfigValue('user.email');
|
|
362
|
+
return email || '';
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
console.warn(`${LOG_PREFIX} ⚠️ git config user.email not set - assigned_to will be empty`);
|
|
366
|
+
return '';
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
async function main() {
|
|
370
|
+
const args = createWUParser({
|
|
371
|
+
name: 'wu-create',
|
|
372
|
+
description: 'Create a new Work Unit with micro-worktree isolation (race-safe)',
|
|
373
|
+
options: [
|
|
374
|
+
WU_OPTIONS.id,
|
|
375
|
+
WU_OPTIONS.lane,
|
|
376
|
+
WU_OPTIONS.title,
|
|
377
|
+
WU_OPTIONS.priority,
|
|
378
|
+
WU_OPTIONS.type,
|
|
379
|
+
// Initiative system options (WU-1247)
|
|
380
|
+
WU_OPTIONS.initiative,
|
|
381
|
+
WU_OPTIONS.phase,
|
|
382
|
+
WU_OPTIONS.blockedBy,
|
|
383
|
+
WU_OPTIONS.blocks,
|
|
384
|
+
WU_OPTIONS.labels,
|
|
385
|
+
// WU-1368: Default assigned_to from git config
|
|
386
|
+
WU_OPTIONS.assignedTo,
|
|
387
|
+
// WU-1364: Full spec inline options
|
|
388
|
+
WU_OPTIONS.description,
|
|
389
|
+
WU_OPTIONS.acceptance,
|
|
390
|
+
WU_OPTIONS.codePaths,
|
|
391
|
+
WU_OPTIONS.testPathsManual,
|
|
392
|
+
WU_OPTIONS.testPathsUnit,
|
|
393
|
+
WU_OPTIONS.testPathsE2e,
|
|
394
|
+
WU_OPTIONS.validate,
|
|
395
|
+
// WU-2320: Spec reference for feature WUs
|
|
396
|
+
WU_OPTIONS.specRefs,
|
|
397
|
+
// WU-1998: Exposure field options
|
|
398
|
+
WU_OPTIONS.exposure,
|
|
399
|
+
WU_OPTIONS.userJourney,
|
|
400
|
+
WU_OPTIONS.uiPairingWus,
|
|
401
|
+
],
|
|
402
|
+
required: ['id', 'lane', 'title'],
|
|
403
|
+
allowPositionalId: false,
|
|
404
|
+
});
|
|
405
|
+
console.log(`${LOG_PREFIX} Creating WU ${args.id} in ${args.lane} lane...`);
|
|
406
|
+
// Pre-flight checks (validation only - no main modification)
|
|
407
|
+
validateWUIDFormat(args.id);
|
|
408
|
+
// Validate lane format (sub-lane or parent-only)
|
|
409
|
+
try {
|
|
410
|
+
validateLaneFormat(args.lane);
|
|
411
|
+
}
|
|
412
|
+
catch (error) {
|
|
413
|
+
die(`Invalid lane format: ${error.message}\n\n` +
|
|
414
|
+
`Valid formats:\n` +
|
|
415
|
+
` - Parent-only: "Operations", "Intelligence", "Experience", etc.\n` +
|
|
416
|
+
` - Sub-lane: "Operations: Tooling", "Intelligence: Prompts", etc.\n\n` +
|
|
417
|
+
`Format rules:\n` +
|
|
418
|
+
` - Single colon with EXACTLY one space after (e.g., "Parent: Subdomain")\n` +
|
|
419
|
+
` - No spaces before colon\n` +
|
|
420
|
+
` - No multiple colons\n\n` +
|
|
421
|
+
`See .lumenflow.config.yaml for valid parent lanes.`);
|
|
422
|
+
}
|
|
423
|
+
// WU-2330: Warn if a more specific sub-lane matches code_paths or description
|
|
424
|
+
warnIfBetterLaneExists(args.lane, args.codePaths, args.title, args.description);
|
|
425
|
+
checkWUExists(args.id);
|
|
426
|
+
await ensureOnMain(getGitForCwd());
|
|
427
|
+
// WU-1368: Get assigned_to from flag or git config user.email
|
|
428
|
+
const assignedTo = args.assignedTo || (await getDefaultAssignedTo());
|
|
429
|
+
if (!assignedTo) {
|
|
430
|
+
console.warn(`${LOG_PREFIX} ⚠️ No assigned_to set - WU will need manual assignment`);
|
|
431
|
+
}
|
|
432
|
+
// WU-1364: Validate spec completeness when --validate is set
|
|
433
|
+
if (args.validate) {
|
|
434
|
+
const validationErrors = [];
|
|
435
|
+
if (!args.description) {
|
|
436
|
+
validationErrors.push('--description is required when --validate is set');
|
|
437
|
+
}
|
|
438
|
+
// acceptance is an array from repeatable flag (empty array if not provided)
|
|
439
|
+
if (!args.acceptance || args.acceptance.length === 0) {
|
|
440
|
+
validationErrors.push('--acceptance is required when --validate is set (use multiple times)');
|
|
441
|
+
}
|
|
442
|
+
const hasTestPaths = args.testPathsManual || args.testPathsUnit || args.testPathsE2e;
|
|
443
|
+
if (!hasTestPaths) {
|
|
444
|
+
validationErrors.push('--validate requires at least one test path flag (--test-paths-manual, --test-paths-unit, or --test-paths-e2e)');
|
|
445
|
+
}
|
|
446
|
+
// WU-2320: spec_refs required for feature WUs (type defaults to feature)
|
|
447
|
+
const effectiveType = args.type || DEFAULT_TYPE;
|
|
448
|
+
if (effectiveType === 'feature' && !args.specRefs) {
|
|
449
|
+
validationErrors.push('--spec-refs is required for type: feature WUs (link to plan file in docs/04-operations/plans/)');
|
|
450
|
+
}
|
|
451
|
+
if (validationErrors.length > 0) {
|
|
452
|
+
const errorList = validationErrors.map((e) => ` • ${e}`).join(STRING_LITERALS.NEWLINE);
|
|
453
|
+
die(`Spec validation failed:\n\n${errorList}\n\nTo create without validation, omit the --validate flag.`);
|
|
454
|
+
}
|
|
455
|
+
console.log(`${LOG_PREFIX} ✅ Spec validation passed`);
|
|
456
|
+
}
|
|
457
|
+
// Transaction: micro-worktree isolation (WU-1439)
|
|
458
|
+
try {
|
|
459
|
+
const priority = args.priority || DEFAULT_PRIORITY;
|
|
460
|
+
const type = args.type || DEFAULT_TYPE;
|
|
461
|
+
await withMicroWorktree({
|
|
462
|
+
operation: OPERATION_NAME,
|
|
463
|
+
id: args.id,
|
|
464
|
+
logPrefix: LOG_PREFIX,
|
|
465
|
+
execute: async ({ worktreePath }) => {
|
|
466
|
+
// Create WU YAML in micro-worktree
|
|
467
|
+
const wuPath = createWUYamlInWorktree(worktreePath, args.id, args.lane, args.title, priority, type, {
|
|
468
|
+
// Initiative system fields (WU-1247)
|
|
469
|
+
initiative: args.initiative,
|
|
470
|
+
phase: args.phase,
|
|
471
|
+
blockedBy: args.blockedBy,
|
|
472
|
+
blocks: args.blocks,
|
|
473
|
+
labels: args.labels,
|
|
474
|
+
// WU-1368: Assigned to
|
|
475
|
+
assignedTo,
|
|
476
|
+
// WU-1364: Full spec inline options
|
|
477
|
+
description: args.description,
|
|
478
|
+
acceptance: args.acceptance,
|
|
479
|
+
codePaths: args.codePaths,
|
|
480
|
+
testPathsManual: args.testPathsManual,
|
|
481
|
+
testPathsUnit: args.testPathsUnit,
|
|
482
|
+
testPathsE2e: args.testPathsE2e,
|
|
483
|
+
// WU-1998: Exposure field options
|
|
484
|
+
exposure: args.exposure,
|
|
485
|
+
userJourney: args.userJourney,
|
|
486
|
+
uiPairingWus: args.uiPairingWus,
|
|
487
|
+
// WU-2320: Spec references
|
|
488
|
+
specRefs: args.specRefs,
|
|
489
|
+
});
|
|
490
|
+
// Update backlog.md in micro-worktree
|
|
491
|
+
const backlogPath = updateBacklogInWorktree(worktreePath, args.id, args.lane, args.title);
|
|
492
|
+
// Build commit message
|
|
493
|
+
const shortTitle = truncateTitle(args.title);
|
|
494
|
+
const commitMessage = COMMIT_FORMATS.CREATE(args.id, shortTitle);
|
|
495
|
+
// Return commit message and files to commit
|
|
496
|
+
return {
|
|
497
|
+
commitMessage,
|
|
498
|
+
files: [wuPath, backlogPath],
|
|
499
|
+
};
|
|
500
|
+
},
|
|
501
|
+
});
|
|
502
|
+
console.log(`\n${LOG_PREFIX} ✅ Transaction complete!`);
|
|
503
|
+
console.log(`\nWU ${args.id} created successfully:`);
|
|
504
|
+
console.log(` File: ${WU_PATHS.WU(args.id)}`);
|
|
505
|
+
console.log(` Lane: ${args.lane}`);
|
|
506
|
+
console.log(` Status: ready`);
|
|
507
|
+
// WU-1620: Display readiness summary
|
|
508
|
+
displayReadinessSummary(args.id);
|
|
509
|
+
}
|
|
510
|
+
catch (error) {
|
|
511
|
+
die(`Transaction failed: ${error.message}\n\n` +
|
|
512
|
+
`Micro-worktree cleanup was attempted automatically.\n` +
|
|
513
|
+
`If issue persists, check for orphaned branches: git branch | grep tmp/${OPERATION_NAME}`);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
// Guard main() for testability (WU-1366)
|
|
517
|
+
import { fileURLToPath } from 'node:url';
|
|
518
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
519
|
+
main();
|
|
520
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wu-create.js","sourceRoot":"","sources":["../src/wu-create.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,2DAA2D;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,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
|
8
|
+
* pnpm wu:deps WU-1247 # ASCII format
|
|
9
|
+
* pnpm wu:deps WU-1247 --format mermaid # Mermaid diagram
|
|
10
|
+
* pnpm wu:deps WU-1247 --depth 5 # Deeper traversal
|
|
11
|
+
* pnpm wu:deps WU-1247 --direction up # Only upstream deps
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wu-deps.d.ts","sourceRoot":"","sources":["../src/wu-deps.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG"}
|