@lumenflow/core 1.3.2 → 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 +1 -1
- package/dist/arg-parser.js +3 -13
- 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/index.d.ts +2 -1
- package/dist/index.js +5 -2
- package/dist/lumenflow-config-schema.d.ts +97 -0
- package/dist/lumenflow-config-schema.js +9 -0
- package/dist/lumenflow-home.js +14 -11
- package/dist/manual-test-validator.d.ts +3 -0
- package/dist/manual-test-validator.js +6 -3
- package/dist/prompt-linter.js +2 -1
- package/dist/prompt-monitor.js +3 -1
- package/dist/spec-branch-helpers.d.ts +8 -8
- package/dist/spec-branch-helpers.js +18 -11
- 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-constants.d.ts +116 -0
- package/dist/wu-constants.js +120 -4
- package/dist/wu-create-validators.d.ts +17 -0
- package/dist/wu-create-validators.js +37 -2
- package/dist/wu-spawn.js +1 -1
- package/dist/wu-yaml-fixer.js +6 -3
- package/package.json +11 -11
package/dist/wu-constants.d.ts
CHANGED
|
@@ -384,6 +384,55 @@ export declare const DEFAULTS: {
|
|
|
384
384
|
MAX_COMMIT_SUBJECT: number;
|
|
385
385
|
/** Parent directory traversal depth from tools/lib to project root */
|
|
386
386
|
PROJECT_ROOT_DEPTH: number;
|
|
387
|
+
/**
|
|
388
|
+
* Default email domain for username -> email conversion
|
|
389
|
+
* WU-1068: Made configurable, no longer hardcoded to patientpath.co.uk
|
|
390
|
+
* @see user-normalizer.ts - Infers from git config first
|
|
391
|
+
*/
|
|
392
|
+
EMAIL_DOMAIN: string;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* Process argv indices (WU-1068)
|
|
396
|
+
*
|
|
397
|
+
* Centralized indices for process.argv access to eliminate magic numbers.
|
|
398
|
+
* In Node.js: argv[0] = node, argv[1] = script, argv[2+] = args
|
|
399
|
+
*/
|
|
400
|
+
export declare const ARGV_INDICES: {
|
|
401
|
+
/** Node executable path */
|
|
402
|
+
NODE: number;
|
|
403
|
+
/** Script path */
|
|
404
|
+
SCRIPT: number;
|
|
405
|
+
/** First user argument */
|
|
406
|
+
FIRST_ARG: number;
|
|
407
|
+
/** Second user argument */
|
|
408
|
+
SECOND_ARG: number;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* Display limits for CLI output (WU-1068)
|
|
412
|
+
*
|
|
413
|
+
* Centralized limits for truncating display strings to avoid magic numbers.
|
|
414
|
+
*/
|
|
415
|
+
export declare const DISPLAY_LIMITS: {
|
|
416
|
+
/** Maximum items to show in lists before truncating */
|
|
417
|
+
LIST_ITEMS: number;
|
|
418
|
+
/** Maximum items to show in short lists */
|
|
419
|
+
SHORT_LIST: number;
|
|
420
|
+
/** Maximum characters for content preview */
|
|
421
|
+
CONTENT_PREVIEW: number;
|
|
422
|
+
/** Maximum characters for short preview */
|
|
423
|
+
SHORT_PREVIEW: number;
|
|
424
|
+
/** Maximum characters for title display */
|
|
425
|
+
TITLE: number;
|
|
426
|
+
/** Maximum characters for truncated title */
|
|
427
|
+
TRUNCATED_TITLE: number;
|
|
428
|
+
/** Maximum characters for command preview */
|
|
429
|
+
CMD_PREVIEW: number;
|
|
430
|
+
/** Maximum lines to preview from files */
|
|
431
|
+
FILE_LINES: number;
|
|
432
|
+
/** Maximum commits to show in lists */
|
|
433
|
+
COMMITS: number;
|
|
434
|
+
/** Maximum overlaps to display */
|
|
435
|
+
OVERLAPS: number;
|
|
387
436
|
};
|
|
388
437
|
/**
|
|
389
438
|
* YAML serialization options
|
|
@@ -532,6 +581,8 @@ export declare const GIT_FLAGS: {
|
|
|
532
581
|
DELETE: string;
|
|
533
582
|
/** Delete branch (force - even if not merged) */
|
|
534
583
|
DELETE_FORCE: string;
|
|
584
|
+
/** Delete remote branch flag (for git push --delete) */
|
|
585
|
+
DELETE_REMOTE: string;
|
|
535
586
|
/** Hard reset flag */
|
|
536
587
|
HARD: string;
|
|
537
588
|
/** Soft reset flag */
|
|
@@ -546,6 +597,10 @@ export declare const GIT_FLAGS: {
|
|
|
546
597
|
NO_GPG_SIGN: string;
|
|
547
598
|
/** One-line log format */
|
|
548
599
|
ONELINE: string;
|
|
600
|
+
/** List heads only (for ls-remote) */
|
|
601
|
+
HEADS: string;
|
|
602
|
+
/** Path separator (separates git options from file paths) */
|
|
603
|
+
PATH_SEPARATOR: string;
|
|
549
604
|
};
|
|
550
605
|
/**
|
|
551
606
|
* Git commands
|
|
@@ -560,6 +615,10 @@ export declare const GIT_COMMANDS: {
|
|
|
560
615
|
RESET: string;
|
|
561
616
|
/** List tree objects (check file existence on branch) */
|
|
562
617
|
LS_TREE: string;
|
|
618
|
+
/** List remote references */
|
|
619
|
+
LS_REMOTE: string;
|
|
620
|
+
/** Push command */
|
|
621
|
+
PUSH: string;
|
|
563
622
|
/** Git diff command */
|
|
564
623
|
DIFF: string;
|
|
565
624
|
/** Git log command */
|
|
@@ -731,6 +790,9 @@ export declare const WU_DEFAULTS: {
|
|
|
731
790
|
*
|
|
732
791
|
* Validation is advisory only - never blocks wu:claim or wu:done.
|
|
733
792
|
*
|
|
793
|
+
* WU-1068: Removed hardcoded @patientpath references. These patterns
|
|
794
|
+
* should be configured in .lumenflow.config.yaml per-project.
|
|
795
|
+
*
|
|
734
796
|
* @see {@link tools/lib/lane-validator.mjs} - Validation logic
|
|
735
797
|
*/
|
|
736
798
|
export declare const LANE_PATH_PATTERNS: {
|
|
@@ -933,6 +995,8 @@ export declare const PKG_COMMANDS: {
|
|
|
933
995
|
* Package names (monorepo workspaces)
|
|
934
996
|
*
|
|
935
997
|
* Centralized package names for --filter usage.
|
|
998
|
+
* WU-1068: Changed from @patientpath to @lumenflow for framework reusability.
|
|
999
|
+
* Project-specific packages should be configured in .lumenflow.config.yaml.
|
|
936
1000
|
*/
|
|
937
1001
|
export declare const PACKAGES: {
|
|
938
1002
|
WEB: string;
|
|
@@ -1210,6 +1274,32 @@ export declare const STRING_LITERALS: {
|
|
|
1210
1274
|
/** Forward slash */
|
|
1211
1275
|
SLASH: string;
|
|
1212
1276
|
};
|
|
1277
|
+
/**
|
|
1278
|
+
* Path-related constants
|
|
1279
|
+
*
|
|
1280
|
+
* WU-1062: Centralized path literals for lumenflow-home and spec-branch operations.
|
|
1281
|
+
*/
|
|
1282
|
+
export declare const PATH_LITERALS: {
|
|
1283
|
+
/** Tilde prefix for home directory expansion (e.g., ~/path) */
|
|
1284
|
+
TILDE_PREFIX: string;
|
|
1285
|
+
/** Tilde character for home directory */
|
|
1286
|
+
TILDE: string;
|
|
1287
|
+
/** Plan file suffix for WU plans */
|
|
1288
|
+
PLAN_FILE_SUFFIX: string;
|
|
1289
|
+
/** Trailing slash regex pattern */
|
|
1290
|
+
TRAILING_SLASH_REGEX: RegExp;
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* Slice lengths for path operations
|
|
1294
|
+
*
|
|
1295
|
+
* WU-1062: Magic numbers extracted for path manipulation.
|
|
1296
|
+
*/
|
|
1297
|
+
export declare const PATH_SLICE_LENGTHS: {
|
|
1298
|
+
/** Length of '~/' prefix for tilde expansion */
|
|
1299
|
+
TILDE_PREFIX_LENGTH: number;
|
|
1300
|
+
/** Length of '/' for leading slash removal */
|
|
1301
|
+
LEADING_SLASH_LENGTH: number;
|
|
1302
|
+
};
|
|
1213
1303
|
/**
|
|
1214
1304
|
* Convert lane name to kebab-case using change-case library
|
|
1215
1305
|
*
|
|
@@ -1276,6 +1366,9 @@ export declare const FILE_TOOLS: {
|
|
|
1276
1366
|
*
|
|
1277
1367
|
* Error codes for PHI detection in file tools.
|
|
1278
1368
|
* Used by file:write and file:edit to block PHI leakage.
|
|
1369
|
+
*
|
|
1370
|
+
* WU-1068: PHI scanning is healthcare-specific functionality.
|
|
1371
|
+
* Enable via PHI_CONFIG.ENABLED flag or .lumenflow.config.yaml phi.enabled: true
|
|
1279
1372
|
*/
|
|
1280
1373
|
export declare const PHI_ERRORS: {
|
|
1281
1374
|
/** PHI detected in content - write blocked */
|
|
@@ -1283,6 +1376,29 @@ export declare const PHI_ERRORS: {
|
|
|
1283
1376
|
/** PHI override requested - audit logged */
|
|
1284
1377
|
PHI_OVERRIDE_ALLOWED: string;
|
|
1285
1378
|
};
|
|
1379
|
+
/**
|
|
1380
|
+
* PHI scanning configuration (WU-1068)
|
|
1381
|
+
*
|
|
1382
|
+
* Controls whether PHI (Protected Health Information) scanning is enabled.
|
|
1383
|
+
* This is healthcare-specific functionality (NHS numbers, UK postcodes)
|
|
1384
|
+
* that should only be enabled for healthcare projects.
|
|
1385
|
+
*
|
|
1386
|
+
* Projects can enable via:
|
|
1387
|
+
* 1. Setting PHI_CONFIG.ENABLED = true in code
|
|
1388
|
+
* 2. Setting LUMENFLOW_PHI_ENABLED=1 environment variable
|
|
1389
|
+
* 3. Adding phi.enabled: true to .lumenflow.config.yaml
|
|
1390
|
+
*/
|
|
1391
|
+
export declare const PHI_CONFIG: {
|
|
1392
|
+
/**
|
|
1393
|
+
* Whether PHI scanning is enabled
|
|
1394
|
+
* Default: false - projects must explicitly opt-in
|
|
1395
|
+
*/
|
|
1396
|
+
ENABLED: boolean;
|
|
1397
|
+
/**
|
|
1398
|
+
* Whether to block on PHI detection (true) or just warn (false)
|
|
1399
|
+
*/
|
|
1400
|
+
BLOCKING: boolean;
|
|
1401
|
+
};
|
|
1286
1402
|
/**
|
|
1287
1403
|
* Readiness summary UI constants (WU-1620)
|
|
1288
1404
|
*
|
package/dist/wu-constants.js
CHANGED
|
@@ -406,6 +406,55 @@ export const DEFAULTS = {
|
|
|
406
406
|
MAX_COMMIT_SUBJECT: 100,
|
|
407
407
|
/** Parent directory traversal depth from tools/lib to project root */
|
|
408
408
|
PROJECT_ROOT_DEPTH: 2,
|
|
409
|
+
/**
|
|
410
|
+
* Default email domain for username -> email conversion
|
|
411
|
+
* WU-1068: Made configurable, no longer hardcoded to patientpath.co.uk
|
|
412
|
+
* @see user-normalizer.ts - Infers from git config first
|
|
413
|
+
*/
|
|
414
|
+
EMAIL_DOMAIN: 'example.com',
|
|
415
|
+
};
|
|
416
|
+
/**
|
|
417
|
+
* Process argv indices (WU-1068)
|
|
418
|
+
*
|
|
419
|
+
* Centralized indices for process.argv access to eliminate magic numbers.
|
|
420
|
+
* In Node.js: argv[0] = node, argv[1] = script, argv[2+] = args
|
|
421
|
+
*/
|
|
422
|
+
export const ARGV_INDICES = {
|
|
423
|
+
/** Node executable path */
|
|
424
|
+
NODE: 0,
|
|
425
|
+
/** Script path */
|
|
426
|
+
SCRIPT: 1,
|
|
427
|
+
/** First user argument */
|
|
428
|
+
FIRST_ARG: 2,
|
|
429
|
+
/** Second user argument */
|
|
430
|
+
SECOND_ARG: 3,
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Display limits for CLI output (WU-1068)
|
|
434
|
+
*
|
|
435
|
+
* Centralized limits for truncating display strings to avoid magic numbers.
|
|
436
|
+
*/
|
|
437
|
+
export const DISPLAY_LIMITS = {
|
|
438
|
+
/** Maximum items to show in lists before truncating */
|
|
439
|
+
LIST_ITEMS: 5,
|
|
440
|
+
/** Maximum items to show in short lists */
|
|
441
|
+
SHORT_LIST: 3,
|
|
442
|
+
/** Maximum characters for content preview */
|
|
443
|
+
CONTENT_PREVIEW: 200,
|
|
444
|
+
/** Maximum characters for short preview */
|
|
445
|
+
SHORT_PREVIEW: 60,
|
|
446
|
+
/** Maximum characters for title display */
|
|
447
|
+
TITLE: 50,
|
|
448
|
+
/** Maximum characters for truncated title */
|
|
449
|
+
TRUNCATED_TITLE: 40,
|
|
450
|
+
/** Maximum characters for command preview */
|
|
451
|
+
CMD_PREVIEW: 60,
|
|
452
|
+
/** Maximum lines to preview from files */
|
|
453
|
+
FILE_LINES: 10,
|
|
454
|
+
/** Maximum commits to show in lists */
|
|
455
|
+
COMMITS: 50,
|
|
456
|
+
/** Maximum overlaps to display */
|
|
457
|
+
OVERLAPS: 3,
|
|
409
458
|
};
|
|
410
459
|
/**
|
|
411
460
|
* YAML serialization options
|
|
@@ -557,6 +606,8 @@ export const GIT_FLAGS = {
|
|
|
557
606
|
DELETE: '-d',
|
|
558
607
|
/** Delete branch (force - even if not merged) */
|
|
559
608
|
DELETE_FORCE: '-D',
|
|
609
|
+
/** Delete remote branch flag (for git push --delete) */
|
|
610
|
+
DELETE_REMOTE: '--delete',
|
|
560
611
|
/** Hard reset flag */
|
|
561
612
|
HARD: '--hard',
|
|
562
613
|
/** Soft reset flag */
|
|
@@ -571,6 +622,10 @@ export const GIT_FLAGS = {
|
|
|
571
622
|
NO_GPG_SIGN: '--no-gpg-sign',
|
|
572
623
|
/** One-line log format */
|
|
573
624
|
ONELINE: '--oneline',
|
|
625
|
+
/** List heads only (for ls-remote) */
|
|
626
|
+
HEADS: '--heads',
|
|
627
|
+
/** Path separator (separates git options from file paths) */
|
|
628
|
+
PATH_SEPARATOR: '--',
|
|
574
629
|
};
|
|
575
630
|
/**
|
|
576
631
|
* Git commands
|
|
@@ -585,6 +640,10 @@ export const GIT_COMMANDS = {
|
|
|
585
640
|
RESET: 'reset',
|
|
586
641
|
/** List tree objects (check file existence on branch) */
|
|
587
642
|
LS_TREE: 'ls-tree',
|
|
643
|
+
/** List remote references */
|
|
644
|
+
LS_REMOTE: 'ls-remote',
|
|
645
|
+
/** Push command */
|
|
646
|
+
PUSH: 'push',
|
|
588
647
|
/** Git diff command */
|
|
589
648
|
DIFF: 'diff',
|
|
590
649
|
/** Git log command */
|
|
@@ -770,6 +829,9 @@ export const WU_DEFAULTS = {
|
|
|
770
829
|
*
|
|
771
830
|
* Validation is advisory only - never blocks wu:claim or wu:done.
|
|
772
831
|
*
|
|
832
|
+
* WU-1068: Removed hardcoded @patientpath references. These patterns
|
|
833
|
+
* should be configured in .lumenflow.config.yaml per-project.
|
|
834
|
+
*
|
|
773
835
|
* @see {@link tools/lib/lane-validator.mjs} - Validation logic
|
|
774
836
|
*/
|
|
775
837
|
export const LANE_PATH_PATTERNS = {
|
|
@@ -778,7 +840,7 @@ export const LANE_PATH_PATTERNS = {
|
|
|
778
840
|
* These paths belong to the Intelligence lane.
|
|
779
841
|
*/
|
|
780
842
|
Operations: {
|
|
781
|
-
exclude: ['ai/prompts/**', '
|
|
843
|
+
exclude: ['ai/prompts/**', 'apps/web/src/lib/prompts/**'],
|
|
782
844
|
allowExceptions: [],
|
|
783
845
|
},
|
|
784
846
|
/**
|
|
@@ -975,12 +1037,14 @@ export const PKG_COMMANDS = {
|
|
|
975
1037
|
* Package names (monorepo workspaces)
|
|
976
1038
|
*
|
|
977
1039
|
* Centralized package names for --filter usage.
|
|
1040
|
+
* WU-1068: Changed from @patientpath to @lumenflow for framework reusability.
|
|
1041
|
+
* Project-specific packages should be configured in .lumenflow.config.yaml.
|
|
978
1042
|
*/
|
|
979
1043
|
export const PACKAGES = {
|
|
980
1044
|
WEB: 'web',
|
|
981
|
-
APPLICATION: '@
|
|
982
|
-
DOMAIN: '@
|
|
983
|
-
INFRASTRUCTURE: '@
|
|
1045
|
+
APPLICATION: '@lumenflow/core',
|
|
1046
|
+
DOMAIN: '@lumenflow/core',
|
|
1047
|
+
INFRASTRUCTURE: '@lumenflow/cli',
|
|
984
1048
|
};
|
|
985
1049
|
/**
|
|
986
1050
|
* Directory paths within the monorepo
|
|
@@ -1253,6 +1317,32 @@ export const STRING_LITERALS = {
|
|
|
1253
1317
|
/** Forward slash */
|
|
1254
1318
|
SLASH: '/',
|
|
1255
1319
|
};
|
|
1320
|
+
/**
|
|
1321
|
+
* Path-related constants
|
|
1322
|
+
*
|
|
1323
|
+
* WU-1062: Centralized path literals for lumenflow-home and spec-branch operations.
|
|
1324
|
+
*/
|
|
1325
|
+
export const PATH_LITERALS = {
|
|
1326
|
+
/** Tilde prefix for home directory expansion (e.g., ~/path) */
|
|
1327
|
+
TILDE_PREFIX: '~/',
|
|
1328
|
+
/** Tilde character for home directory */
|
|
1329
|
+
TILDE: '~',
|
|
1330
|
+
/** Plan file suffix for WU plans */
|
|
1331
|
+
PLAN_FILE_SUFFIX: '-plan.md',
|
|
1332
|
+
/** Trailing slash regex pattern */
|
|
1333
|
+
TRAILING_SLASH_REGEX: /\/+$/,
|
|
1334
|
+
};
|
|
1335
|
+
/**
|
|
1336
|
+
* Slice lengths for path operations
|
|
1337
|
+
*
|
|
1338
|
+
* WU-1062: Magic numbers extracted for path manipulation.
|
|
1339
|
+
*/
|
|
1340
|
+
export const PATH_SLICE_LENGTHS = {
|
|
1341
|
+
/** Length of '~/' prefix for tilde expansion */
|
|
1342
|
+
TILDE_PREFIX_LENGTH: 2,
|
|
1343
|
+
/** Length of '/' for leading slash removal */
|
|
1344
|
+
LEADING_SLASH_LENGTH: 1,
|
|
1345
|
+
};
|
|
1256
1346
|
/**
|
|
1257
1347
|
* Convert lane name to kebab-case using change-case library
|
|
1258
1348
|
*
|
|
@@ -1337,6 +1427,9 @@ export const FILE_TOOLS = {
|
|
|
1337
1427
|
*
|
|
1338
1428
|
* Error codes for PHI detection in file tools.
|
|
1339
1429
|
* Used by file:write and file:edit to block PHI leakage.
|
|
1430
|
+
*
|
|
1431
|
+
* WU-1068: PHI scanning is healthcare-specific functionality.
|
|
1432
|
+
* Enable via PHI_CONFIG.ENABLED flag or .lumenflow.config.yaml phi.enabled: true
|
|
1340
1433
|
*/
|
|
1341
1434
|
export const PHI_ERRORS = {
|
|
1342
1435
|
/** PHI detected in content - write blocked */
|
|
@@ -1344,6 +1437,29 @@ export const PHI_ERRORS = {
|
|
|
1344
1437
|
/** PHI override requested - audit logged */
|
|
1345
1438
|
PHI_OVERRIDE_ALLOWED: 'PHI_OVERRIDE_ALLOWED',
|
|
1346
1439
|
};
|
|
1440
|
+
/**
|
|
1441
|
+
* PHI scanning configuration (WU-1068)
|
|
1442
|
+
*
|
|
1443
|
+
* Controls whether PHI (Protected Health Information) scanning is enabled.
|
|
1444
|
+
* This is healthcare-specific functionality (NHS numbers, UK postcodes)
|
|
1445
|
+
* that should only be enabled for healthcare projects.
|
|
1446
|
+
*
|
|
1447
|
+
* Projects can enable via:
|
|
1448
|
+
* 1. Setting PHI_CONFIG.ENABLED = true in code
|
|
1449
|
+
* 2. Setting LUMENFLOW_PHI_ENABLED=1 environment variable
|
|
1450
|
+
* 3. Adding phi.enabled: true to .lumenflow.config.yaml
|
|
1451
|
+
*/
|
|
1452
|
+
export const PHI_CONFIG = {
|
|
1453
|
+
/**
|
|
1454
|
+
* Whether PHI scanning is enabled
|
|
1455
|
+
* Default: false - projects must explicitly opt-in
|
|
1456
|
+
*/
|
|
1457
|
+
ENABLED: process.env.LUMENFLOW_PHI_ENABLED === '1',
|
|
1458
|
+
/**
|
|
1459
|
+
* Whether to block on PHI detection (true) or just warn (false)
|
|
1460
|
+
*/
|
|
1461
|
+
BLOCKING: process.env.LUMENFLOW_PHI_BLOCKING === '1',
|
|
1462
|
+
};
|
|
1347
1463
|
/**
|
|
1348
1464
|
* Readiness summary UI constants (WU-1620)
|
|
1349
1465
|
*
|
|
@@ -14,6 +14,23 @@
|
|
|
14
14
|
* NOTE: This is domain-specific WU workflow code, not a general utility.
|
|
15
15
|
* No external library exists for LumenFlow lane inference validation.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* WU-1069: Check if a path is a repo-internal path that should be rejected
|
|
19
|
+
*
|
|
20
|
+
* Repo-internal paths start with ./ or .lumenflow/ and indicate the agent
|
|
21
|
+
* is attempting to store plans inside the repository instead of externally.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} path - Path to check
|
|
24
|
+
* @returns {boolean} True if path is repo-internal and should be rejected
|
|
25
|
+
*/
|
|
26
|
+
export declare function isRepoInternalPath(path: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* WU-1069: Build error message for repo-internal path rejection
|
|
29
|
+
*
|
|
30
|
+
* @param {string} path - The rejected path
|
|
31
|
+
* @returns {string} Error message with correct format examples
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildRepoInternalPathError(path: string): string;
|
|
17
34
|
/**
|
|
18
35
|
* Generate a warning message when provided lane differs from inferred lane.
|
|
19
36
|
*
|
|
@@ -17,6 +17,35 @@
|
|
|
17
17
|
import { isExternalPath, normalizeSpecRef } from './lumenflow-home.js';
|
|
18
18
|
/** Confidence threshold for showing suggestion (percentage) */
|
|
19
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
|
+
}
|
|
20
49
|
/**
|
|
21
50
|
* Generate a warning message when provided lane differs from inferred lane.
|
|
22
51
|
*
|
|
@@ -121,14 +150,20 @@ export function validateSpecRefs(specRefs) {
|
|
|
121
150
|
errors.push('Empty spec_ref detected');
|
|
122
151
|
continue;
|
|
123
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
|
+
}
|
|
124
159
|
// External paths are valid (will be resolved at runtime)
|
|
125
160
|
if (isExternalPath(ref)) {
|
|
126
161
|
// Add informational warning about external paths
|
|
127
162
|
warnings.push(`External spec_ref: "${ref}" - ensure plan exists at ${normalizeSpecRef(ref)}`);
|
|
128
163
|
continue;
|
|
129
164
|
}
|
|
130
|
-
// Repo-relative paths should follow conventions
|
|
131
|
-
const isValidRepoPath = ref.startsWith('docs/') || ref.
|
|
165
|
+
// Repo-relative paths should follow conventions (docs/ without ./ prefix)
|
|
166
|
+
const isValidRepoPath = ref.startsWith('docs/') || ref.endsWith('.md');
|
|
132
167
|
if (!isValidRepoPath) {
|
|
133
168
|
warnings.push(`Unconventional spec_ref path: "${ref}" - consider using docs/04-operations/plans/ or lumenflow://plans/`);
|
|
134
169
|
}
|
package/dist/wu-spawn.js
CHANGED
|
@@ -746,7 +746,7 @@ function generateLaneGuidance(lane) {
|
|
|
746
746
|
- Follow prompt versioning guidelines in ai/prompts/README.md`,
|
|
747
747
|
Experience: `## Lane-Specific: Experience
|
|
748
748
|
|
|
749
|
-
- Follow design system tokens in
|
|
749
|
+
- Follow design system tokens defined in the project
|
|
750
750
|
- Ensure accessibility compliance (WCAG 2.1 AA)`,
|
|
751
751
|
Core: `## Lane-Specific: Core
|
|
752
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",
|
|
@@ -91,8 +98,8 @@
|
|
|
91
98
|
"vitest": "^4.0.17"
|
|
92
99
|
},
|
|
93
100
|
"peerDependencies": {
|
|
94
|
-
"@lumenflow/memory": "
|
|
95
|
-
"@lumenflow/initiatives": "
|
|
101
|
+
"@lumenflow/memory": "workspace:*",
|
|
102
|
+
"@lumenflow/initiatives": "workspace:*"
|
|
96
103
|
},
|
|
97
104
|
"peerDependenciesMeta": {
|
|
98
105
|
"@lumenflow/memory": {
|
|
@@ -107,12 +114,5 @@
|
|
|
107
114
|
},
|
|
108
115
|
"publishConfig": {
|
|
109
116
|
"access": "public"
|
|
110
|
-
},
|
|
111
|
-
"scripts": {
|
|
112
|
-
"build": "tsc",
|
|
113
|
-
"build:dist": "tsc -p tsconfig.build.json",
|
|
114
|
-
"pack:dist": "pnpm pack",
|
|
115
|
-
"clean": "rm -rf dist *.tgz",
|
|
116
|
-
"test": "vitest run"
|
|
117
117
|
}
|
|
118
|
-
}
|
|
118
|
+
}
|