@lumenflow/cli 5.5.0 → 5.7.12
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/README.md +42 -40
- package/dist/db-journal-recover.js +400 -0
- package/dist/db-journal-recover.js.map +1 -0
- package/dist/docs-sync.js +8 -3
- package/dist/docs-sync.js.map +1 -1
- package/dist/gate-defaults.js +37 -0
- package/dist/gate-defaults.js.map +1 -1
- package/dist/gates/monolithic-file-contention-guard.js +167 -0
- package/dist/gates/monolithic-file-contention-guard.js.map +1 -0
- package/dist/gates/prod-migration-drift.js +207 -0
- package/dist/gates/prod-migration-drift.js.map +1 -0
- package/dist/gates/test-over-deletion-guard.js +255 -0
- package/dist/gates/test-over-deletion-guard.js.map +1 -0
- package/dist/gates-runners.js +44 -3
- package/dist/gates-runners.js.map +1 -1
- package/dist/gates.js +3 -2
- package/dist/gates.js.map +1 -1
- package/dist/lumenflow-setup.js +144 -0
- package/dist/lumenflow-setup.js.map +1 -0
- package/dist/lumenflow-upgrade.js +2 -1
- package/dist/lumenflow-upgrade.js.map +1 -1
- package/dist/mem-create.js +10 -1
- package/dist/mem-create.js.map +1 -1
- package/dist/mem-signal.js +21 -4
- package/dist/mem-signal.js.map +1 -1
- package/dist/orchestrate-initiative.js +28 -3
- package/dist/orchestrate-initiative.js.map +1 -1
- package/dist/public-manifest.js +17 -0
- package/dist/public-manifest.js.map +1 -1
- package/dist/release.js +53 -18
- package/dist/release.js.map +1 -1
- package/dist/wu-done-gates.js +13 -9
- package/dist/wu-done-gates.js.map +1 -1
- package/dist/wu-edit-operations.js +74 -0
- package/dist/wu-edit-operations.js.map +1 -1
- package/dist/wu-edit-validators.js +58 -0
- package/dist/wu-edit-validators.js.map +1 -1
- package/dist/wu-edit.js +106 -4
- package/dist/wu-edit.js.map +1 -1
- package/dist/wu-prep.js +41 -7
- package/dist/wu-prep.js.map +1 -1
- package/dist/wu-recover.js +6 -0
- package/dist/wu-recover.js.map +1 -1
- package/dist/wu-release.js +120 -2
- package/dist/wu-release.js.map +1 -1
- package/dist/wu-sizing-validation.js +47 -17
- package/dist/wu-sizing-validation.js.map +1 -1
- package/dist/wu-status.js +33 -0
- package/dist/wu-status.js.map +1 -1
- package/package.json +13 -11
- package/packs/agent-runtime/package.json +1 -1
- package/packs/sidekick/package.json +1 -1
- package/packs/software-delivery/package.json +1 -1
- package/templates/core/AGENTS.md.template +67 -3
- package/templates/core/LUMENFLOW.md.template +197 -47
- package/packs/agent-runtime/agent-heartbeat.ts +0 -163
- package/packs/agent-runtime/auto-session-integration.ts +0 -888
- package/packs/agent-runtime/capability-factory.ts +0 -104
- package/packs/agent-runtime/constants.ts +0 -21
- package/packs/agent-runtime/delegation-registry-schema.ts +0 -220
- package/packs/agent-runtime/delegation-registry-store.ts +0 -269
- package/packs/agent-runtime/delegation-tree.ts +0 -328
- package/packs/agent-runtime/index.ts +0 -20
- package/packs/agent-runtime/manifest.ts +0 -348
- package/packs/agent-runtime/memory-coordination-contract.ts +0 -86
- package/packs/agent-runtime/orchestration.ts +0 -2027
- package/packs/agent-runtime/pack-registration.ts +0 -110
- package/packs/agent-runtime/policy-factory.ts +0 -165
- package/packs/agent-runtime/remote-controls/index.ts +0 -7
- package/packs/agent-runtime/remote-controls/operations.ts +0 -405
- package/packs/agent-runtime/remote-controls/port.ts +0 -48
- package/packs/agent-runtime/remote-controls/state-store.ts +0 -258
- package/packs/agent-runtime/remote-controls/types.ts +0 -105
- package/packs/agent-runtime/session-schema.ts +0 -467
- package/packs/agent-runtime/tool-impl/agent-turn-tools.ts +0 -793
- package/packs/agent-runtime/tool-impl/index.ts +0 -6
- package/packs/agent-runtime/tool-impl/provider-adapters.ts +0 -1245
- package/packs/agent-runtime/tool-impl/remote-controls.mock.ts +0 -256
- package/packs/agent-runtime/tool-impl/remote-controls.ts +0 -273
- package/packs/agent-runtime/tools/index.ts +0 -4
- package/packs/agent-runtime/tools/types.ts +0 -47
- package/packs/agent-runtime/turn-lifecycle-events.ts +0 -590
- package/packs/agent-runtime/types.ts +0 -128
- package/packs/agent-runtime/vitest.config.ts +0 -11
- package/packs/sidekick/channel-ingress.ts +0 -137
- package/packs/sidekick/constants.ts +0 -10
- package/packs/sidekick/index.ts +0 -8
- package/packs/sidekick/manifest-schema.ts +0 -49
- package/packs/sidekick/manifest.ts +0 -512
- package/packs/sidekick/pack-registration.ts +0 -110
- package/packs/sidekick/policy-factory.ts +0 -38
- package/packs/sidekick/sidekick-events.ts +0 -694
- package/packs/sidekick/src/adapters/cloud-queue.ts +0 -101
- package/packs/sidekick/src/adapters/control-plane-bridge.adapter.ts +0 -386
- package/packs/sidekick/src/adapters/filesystem-bridge.adapter.ts +0 -228
- package/packs/sidekick/src/domain/channel.types.ts +0 -64
- package/packs/sidekick/src/ports/channel-bridge.port.ts +0 -92
- package/packs/sidekick/src/routines/commit.ts +0 -74
- package/packs/sidekick/tool-impl/channel-tools.ts +0 -577
- package/packs/sidekick/tool-impl/channel-transports.ts +0 -75
- package/packs/sidekick/tool-impl/index.ts +0 -29
- package/packs/sidekick/tool-impl/memory-tools.ts +0 -290
- package/packs/sidekick/tool-impl/routine-commit.ts +0 -102
- package/packs/sidekick/tool-impl/routine-tools.ts +0 -440
- package/packs/sidekick/tool-impl/runtime-context.ts +0 -28
- package/packs/sidekick/tool-impl/shared.ts +0 -125
- package/packs/sidekick/tool-impl/storage.ts +0 -325
- package/packs/sidekick/tool-impl/system-tools.ts +0 -160
- package/packs/sidekick/tool-impl/task-tools.ts +0 -506
- package/packs/sidekick/tools/channel-tools.ts +0 -53
- package/packs/sidekick/tools/index.ts +0 -9
- package/packs/sidekick/tools/memory-tools.ts +0 -53
- package/packs/sidekick/tools/routine-tools.ts +0 -53
- package/packs/sidekick/tools/system-tools.ts +0 -47
- package/packs/sidekick/tools/task-tools.ts +0 -61
- package/packs/sidekick/tools/types.ts +0 -57
- package/packs/sidekick/vitest.config.ts +0 -11
- package/packs/software-delivery/constants.ts +0 -10
- package/packs/software-delivery/extensions.ts +0 -140
- package/packs/software-delivery/gate-policies.ts +0 -134
- package/packs/software-delivery/index.ts +0 -8
- package/packs/software-delivery/manifest-schema.ts +0 -268
- package/packs/software-delivery/manifest.ts +0 -657
- package/packs/software-delivery/pack-registration.ts +0 -113
- package/packs/software-delivery/src/commands/index.ts +0 -5
- package/packs/software-delivery/src/config/delivery-review-contract.ts +0 -256
- package/packs/software-delivery/src/config/env-accessors.ts +0 -66
- package/packs/software-delivery/src/config/index.ts +0 -8
- package/packs/software-delivery/src/config/normalize-config-keys.ts +0 -9
- package/packs/software-delivery/src/config/schemas/lumenflow-config-schema-types.ts +0 -460
- package/packs/software-delivery/src/config/workspace-reader.ts +0 -375
- package/packs/software-delivery/src/constants/backlog-patterns.ts +0 -31
- package/packs/software-delivery/src/constants/client-ids.ts +0 -19
- package/packs/software-delivery/src/constants/config-contract.ts +0 -7
- package/packs/software-delivery/src/constants/docs-layout-presets.ts +0 -50
- package/packs/software-delivery/src/constants/duration-constants.ts +0 -20
- package/packs/software-delivery/src/constants/gate-constants.ts +0 -32
- package/packs/software-delivery/src/constants/index.ts +0 -29
- package/packs/software-delivery/src/constants/lock-constants.ts +0 -35
- package/packs/software-delivery/src/constants/object-guards.ts +0 -12
- package/packs/software-delivery/src/constants/section-headings.ts +0 -107
- package/packs/software-delivery/src/constants/wu-cli-constants.ts +0 -500
- package/packs/software-delivery/src/constants/wu-domain-constants.ts +0 -466
- package/packs/software-delivery/src/constants/wu-git-constants.ts +0 -7
- package/packs/software-delivery/src/constants/wu-id-format.ts +0 -327
- package/packs/software-delivery/src/constants/wu-paths-constants.ts +0 -384
- package/packs/software-delivery/src/constants/wu-statuses.ts +0 -287
- package/packs/software-delivery/src/constants/wu-type-helpers.ts +0 -67
- package/packs/software-delivery/src/constants/wu-ui-constants.ts +0 -267
- package/packs/software-delivery/src/constants/wu-validation-constants.ts +0 -73
- package/packs/software-delivery/src/domain/index.ts +0 -5
- package/packs/software-delivery/src/domain/orchestration.constants.ts +0 -166
- package/packs/software-delivery/src/domain/orchestration.schemas.ts +0 -238
- package/packs/software-delivery/src/domain/orchestration.types.ts +0 -176
- package/packs/software-delivery/src/methodology/incremental-test.ts +0 -122
- package/packs/software-delivery/src/methodology/index.ts +0 -6
- package/packs/software-delivery/src/methodology/manual-test-validator.ts +0 -292
- package/packs/software-delivery/src/policy/coverage-gate.ts +0 -270
- package/packs/software-delivery/src/policy/gates-agent-mode.ts +0 -223
- package/packs/software-delivery/src/policy/gates-config-internal.ts +0 -121
- package/packs/software-delivery/src/policy/gates-config.ts +0 -300
- package/packs/software-delivery/src/policy/gates-coverage.ts +0 -356
- package/packs/software-delivery/src/policy/gates-presets.ts +0 -134
- package/packs/software-delivery/src/policy/gates-schemas.ts +0 -173
- package/packs/software-delivery/src/policy/index.ts +0 -22
- package/packs/software-delivery/src/policy/package-manager-resolver.ts +0 -319
- package/packs/software-delivery/src/policy/resolve-policy.ts +0 -601
- package/packs/software-delivery/src/ports/config.ports.ts +0 -90
- package/packs/software-delivery/src/ports/dashboard-renderer.port.ts +0 -125
- package/packs/software-delivery/src/ports/index.ts +0 -10
- package/packs/software-delivery/src/ports/sync-validator.ports.ts +0 -59
- package/packs/software-delivery/src/ports/wu-helpers.ports.ts +0 -168
- package/packs/software-delivery/src/ports/wu-state.ports.ts +0 -241
- package/packs/software-delivery/src/primitives/index.ts +0 -5
- package/packs/software-delivery/src/runtime/index.ts +0 -6
- package/packs/software-delivery/src/runtime/work-classifier.ts +0 -561
- package/packs/software-delivery/src/sandbox/index.ts +0 -10
- package/packs/software-delivery/src/sandbox/sandbox-allowlist.ts +0 -118
- package/packs/software-delivery/src/sandbox/sandbox-backend-linux.ts +0 -88
- package/packs/software-delivery/src/sandbox/sandbox-backend-macos.ts +0 -154
- package/packs/software-delivery/src/sandbox/sandbox-backend-windows.ts +0 -47
- package/packs/software-delivery/src/sandbox/sandbox-profile.ts +0 -153
- package/packs/software-delivery/src/schemas/index.ts +0 -5
- package/packs/software-delivery/src/state/date-utils.ts +0 -158
- package/packs/software-delivery/src/state/index.ts +0 -15
- package/packs/software-delivery/src/state/state-machine.ts +0 -119
- package/packs/software-delivery/src/state/wu-doc-types.ts +0 -51
- package/packs/software-delivery/src/state/wu-paths.ts +0 -381
- package/packs/software-delivery/src/state/wu-schema.ts +0 -1139
- package/packs/software-delivery/src/state/wu-state-schema.ts +0 -255
- package/packs/software-delivery/src/state/wu-yaml.ts +0 -338
- package/packs/software-delivery/tool-impl/agent-tools.ts +0 -263
- package/packs/software-delivery/tool-impl/delegation-tools.ts +0 -66
- package/packs/software-delivery/tool-impl/flow-metrics-tools.ts +0 -219
- package/packs/software-delivery/tool-impl/git-runner.ts +0 -113
- package/packs/software-delivery/tool-impl/git-tools.ts +0 -316
- package/packs/software-delivery/tool-impl/index.ts +0 -15
- package/packs/software-delivery/tool-impl/initiative-orchestration-tools.ts +0 -720
- package/packs/software-delivery/tool-impl/lane-lock.ts +0 -246
- package/packs/software-delivery/tool-impl/memory-tools.ts +0 -470
- package/packs/software-delivery/tool-impl/pending-runtime-tools.ts +0 -21
- package/packs/software-delivery/tool-impl/runtime-cli-adapter.ts +0 -329
- package/packs/software-delivery/tool-impl/runtime-native-tools.ts +0 -687
- package/packs/software-delivery/tool-impl/worker-loader.ts +0 -52
- package/packs/software-delivery/tool-impl/worktree-tools.ts +0 -46
- package/packs/software-delivery/tool-impl/wu-lifecycle-tools.ts +0 -807
- package/packs/software-delivery/tools/delegation-tools.ts +0 -23
- package/packs/software-delivery/tools/git-tools.ts +0 -55
- package/packs/software-delivery/tools/index.ts +0 -8
- package/packs/software-delivery/tools/lane-lock-tool.ts +0 -37
- package/packs/software-delivery/tools/types.ts +0 -71
- package/packs/software-delivery/tools/worktree-tools.ts +0 -49
- package/packs/software-delivery/vitest.config.ts +0 -11
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* WU Status Constants
|
|
6
|
-
*
|
|
7
|
-
* WU-1549: Extracted from wu-constants.ts for domain-specific modularity.
|
|
8
|
-
* Contains WU status values, groups, exposure types, claimed modes, and incident severity.
|
|
9
|
-
*
|
|
10
|
-
* @module wu-statuses
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* WU status values
|
|
15
|
-
*
|
|
16
|
-
* Centralized status strings to avoid magic strings in wu-* scripts.
|
|
17
|
-
* Includes both canonical statuses and legacy variants found in YAML files.
|
|
18
|
-
*/
|
|
19
|
-
export const WU_STATUS = {
|
|
20
|
-
// Unclaimed statuses (not yet entered state machine)
|
|
21
|
-
// WU-1374: Legacy backlog status value
|
|
22
|
-
TODO: 'todo',
|
|
23
|
-
READY: 'ready', // Canonical unclaimed status
|
|
24
|
-
BACKLOG: 'backlog', // Legacy variant of ready
|
|
25
|
-
|
|
26
|
-
// Active statuses (in state machine)
|
|
27
|
-
IN_PROGRESS: 'in_progress',
|
|
28
|
-
BLOCKED: 'blocked',
|
|
29
|
-
|
|
30
|
-
// Terminal statuses (work finished, no further transitions)
|
|
31
|
-
DONE: 'done', // Canonical terminal status
|
|
32
|
-
COMPLETED: 'completed', // Legacy variant of done
|
|
33
|
-
CANCELLED: 'cancelled',
|
|
34
|
-
ABANDONED: 'abandoned',
|
|
35
|
-
DEFERRED: 'deferred',
|
|
36
|
-
CLOSED: 'closed',
|
|
37
|
-
SUPERSEDED: 'superseded',
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type WUStatus = (typeof WU_STATUS)[keyof typeof WU_STATUS];
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Display-only fallback labels for non-canonical status values.
|
|
44
|
-
*/
|
|
45
|
-
export const WU_STATUS_FALLBACK = {
|
|
46
|
-
UNKNOWN: 'unknown',
|
|
47
|
-
} as const;
|
|
48
|
-
|
|
49
|
-
export type WUStatusDisplay =
|
|
50
|
-
| WUStatus
|
|
51
|
-
| (typeof WU_STATUS_FALLBACK)[keyof typeof WU_STATUS_FALLBACK];
|
|
52
|
-
|
|
53
|
-
const WU_STATUS_SET = new Set<string>(Object.values(WU_STATUS));
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Type guard for canonical WU statuses.
|
|
57
|
-
*/
|
|
58
|
-
export function isWUStatus(value: unknown): value is WUStatus {
|
|
59
|
-
return typeof value === 'string' && WU_STATUS_SET.has(value);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Resolve arbitrary status values to canonical WU statuses.
|
|
64
|
-
*/
|
|
65
|
-
export function resolveWUStatus(value: unknown, fallback: WUStatus = WU_STATUS.READY): WUStatus {
|
|
66
|
-
return isWUStatus(value) ? value : fallback;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Resolve status values for logs/UI where unknown is an allowed display state.
|
|
71
|
-
*/
|
|
72
|
-
export function getWUStatusDisplay(value: unknown): WUStatusDisplay {
|
|
73
|
-
return isWUStatus(value) ? value : WU_STATUS_FALLBACK.UNKNOWN;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* WU-1540: Protected WU statuses for cleanup and signal protection.
|
|
78
|
-
*
|
|
79
|
-
* WUs in these statuses should NOT have their signals, memory, or state
|
|
80
|
-
* cleaned up. Both in_progress and blocked WUs need protection because
|
|
81
|
-
* blocked WUs will resume work after the blocker is resolved.
|
|
82
|
-
*
|
|
83
|
-
* Used by: wu-done-auto-cleanup.ts, signal-cleanup.ts, state-cleanup.ts
|
|
84
|
-
*/
|
|
85
|
-
export const PROTECTED_WU_STATUSES: readonly string[] = [
|
|
86
|
-
WU_STATUS.IN_PROGRESS,
|
|
87
|
-
WU_STATUS.BLOCKED,
|
|
88
|
-
] as const;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* WU-1540: Progressable WU statuses for initiative advancement.
|
|
92
|
-
*
|
|
93
|
-
* Only WUs in these statuses indicate active work that should trigger
|
|
94
|
-
* initiative status progression (e.g., draft -> in_progress).
|
|
95
|
-
* Blocked WUs are explicitly excluded because a blocked WU does not
|
|
96
|
-
* represent forward progress on the initiative.
|
|
97
|
-
*
|
|
98
|
-
* Used by: initiative-validation.ts (shouldProgressInitiativeStatus)
|
|
99
|
-
*/
|
|
100
|
-
export const PROGRESSABLE_WU_STATUSES: readonly string[] = [WU_STATUS.IN_PROGRESS] as const;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* WU status groups for state management (WU-1742)
|
|
104
|
-
*
|
|
105
|
-
* Used by state-bootstrap.ts to categorize YAML statuses.
|
|
106
|
-
*/
|
|
107
|
-
export const WU_STATUS_GROUPS = {
|
|
108
|
-
/** Statuses representing unclaimed work (not tracked in state store) */
|
|
109
|
-
UNCLAIMED: [WU_STATUS.READY, WU_STATUS.TODO, WU_STATUS.BACKLOG],
|
|
110
|
-
|
|
111
|
-
/** Terminal statuses (all map to 'done' in state store) */
|
|
112
|
-
TERMINAL: [
|
|
113
|
-
WU_STATUS.DONE,
|
|
114
|
-
WU_STATUS.COMPLETED,
|
|
115
|
-
WU_STATUS.CANCELLED,
|
|
116
|
-
WU_STATUS.ABANDONED,
|
|
117
|
-
WU_STATUS.DEFERRED,
|
|
118
|
-
WU_STATUS.CLOSED,
|
|
119
|
-
WU_STATUS.SUPERSEDED,
|
|
120
|
-
],
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* WU claimed workspace modes
|
|
125
|
-
*
|
|
126
|
-
* Centralized workspace mode strings for wu:claim operations.
|
|
127
|
-
*/
|
|
128
|
-
export const CLAIMED_MODES = {
|
|
129
|
-
/** Standard worktree mode (isolated worktree per WU) */
|
|
130
|
-
WORKTREE: 'worktree',
|
|
131
|
-
|
|
132
|
-
/** Branch-only mode (no worktree, direct branch work) */
|
|
133
|
-
BRANCH_ONLY: 'branch-only',
|
|
134
|
-
|
|
135
|
-
/** Worktree PR mode (worktree with manual PR workflow) */
|
|
136
|
-
WORKTREE_PR: 'worktree-pr',
|
|
137
|
-
|
|
138
|
-
/** Branch PR mode (no worktree, PR-based completion for cloud agents) */
|
|
139
|
-
BRANCH_PR: 'branch-pr',
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Agent incident severity levels
|
|
144
|
-
*
|
|
145
|
-
* Centralized severity strings for agent incident reporting.
|
|
146
|
-
*/
|
|
147
|
-
export const INCIDENT_SEVERITY = {
|
|
148
|
-
BLOCKER: 'blocker',
|
|
149
|
-
MAJOR: 'major',
|
|
150
|
-
MINOR: 'minor',
|
|
151
|
-
INFO: 'info',
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Canonical internal mapping for supported WU types.
|
|
156
|
-
*
|
|
157
|
-
* Exported consumers should import WU_TYPES/WU_TYPE_VALUES rather than relying
|
|
158
|
-
* on this internal literal object directly. Keeping this object literal-local
|
|
159
|
-
* lets us preserve the exact union for type derivation while widening the
|
|
160
|
-
* public WU_TYPES surface for backwards-compatible downstream consumers.
|
|
161
|
-
*/
|
|
162
|
-
const WU_TYPE_VALUE_BY_KEY = {
|
|
163
|
-
FEATURE: 'feature',
|
|
164
|
-
BUG: 'bug',
|
|
165
|
-
DOCUMENTATION: 'documentation',
|
|
166
|
-
PROCESS: 'process',
|
|
167
|
-
TOOLING: 'tooling',
|
|
168
|
-
CHORE: 'chore',
|
|
169
|
-
REFACTOR: 'refactor',
|
|
170
|
-
} as const;
|
|
171
|
-
|
|
172
|
-
export type WUType = (typeof WU_TYPE_VALUE_BY_KEY)[keyof typeof WU_TYPE_VALUE_BY_KEY];
|
|
173
|
-
export type WUTypeKey = keyof typeof WU_TYPE_VALUE_BY_KEY;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* WU type values
|
|
177
|
-
*
|
|
178
|
-
* WU-1281: Centralized from hardcoded strings in validators.
|
|
179
|
-
* Exposed as a widened record so existing consumers can treat individual
|
|
180
|
-
* entries as generic WUType values instead of overly narrow literals.
|
|
181
|
-
*/
|
|
182
|
-
export const WU_TYPES: Record<WUTypeKey, WUType> = {
|
|
183
|
-
...WU_TYPE_VALUE_BY_KEY,
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Canonical WU type values in their intended display/help order.
|
|
188
|
-
*
|
|
189
|
-
* Consumers should iterate this array instead of retyping WU types.
|
|
190
|
-
*/
|
|
191
|
-
export const WU_TYPE_VALUES = [
|
|
192
|
-
WU_TYPE_VALUE_BY_KEY.FEATURE,
|
|
193
|
-
WU_TYPE_VALUE_BY_KEY.BUG,
|
|
194
|
-
WU_TYPE_VALUE_BY_KEY.DOCUMENTATION,
|
|
195
|
-
WU_TYPE_VALUE_BY_KEY.PROCESS,
|
|
196
|
-
WU_TYPE_VALUE_BY_KEY.TOOLING,
|
|
197
|
-
WU_TYPE_VALUE_BY_KEY.CHORE,
|
|
198
|
-
WU_TYPE_VALUE_BY_KEY.REFACTOR,
|
|
199
|
-
] as const satisfies readonly WUType[];
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Canonical WU type metadata for help surfaces and validation consumers.
|
|
203
|
-
*/
|
|
204
|
-
export const WU_TYPE_DEFINITIONS = [
|
|
205
|
-
{
|
|
206
|
-
key: 'FEATURE',
|
|
207
|
-
value: WU_TYPES.FEATURE,
|
|
208
|
-
description: 'Net-new user or system capability',
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
key: 'BUG',
|
|
212
|
-
value: WU_TYPES.BUG,
|
|
213
|
-
description: 'Broken or regressed behavior fix',
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
key: 'DOCUMENTATION',
|
|
217
|
-
value: WU_TYPES.DOCUMENTATION,
|
|
218
|
-
description: 'Documentation-only change',
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
key: 'PROCESS',
|
|
222
|
-
value: WU_TYPES.PROCESS,
|
|
223
|
-
description: 'Workflow or operating-process maintenance',
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
key: 'TOOLING',
|
|
227
|
-
value: WU_TYPES.TOOLING,
|
|
228
|
-
description: 'Tooling, automation, or developer-experience change',
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
key: 'CHORE',
|
|
232
|
-
value: WU_TYPES.CHORE,
|
|
233
|
-
description: 'Repository upkeep or housekeeping change',
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
key: 'REFACTOR',
|
|
237
|
-
value: WU_TYPES.REFACTOR,
|
|
238
|
-
description: 'Behavior-preserving code restructure',
|
|
239
|
-
},
|
|
240
|
-
] as const satisfies readonly {
|
|
241
|
-
key: WUTypeKey;
|
|
242
|
-
value: WUType;
|
|
243
|
-
description: string;
|
|
244
|
-
}[];
|
|
245
|
-
|
|
246
|
-
export type WUTypeDefinition = (typeof WU_TYPE_DEFINITIONS)[number];
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* WU exposure values (WU-1998)
|
|
250
|
-
*
|
|
251
|
-
* Defines how a WU exposes its functionality to users.
|
|
252
|
-
* Used to ensure backend features have corresponding UI coverage.
|
|
253
|
-
*
|
|
254
|
-
* @see {@link packages/@lumenflow/cli/src/lib/wu-schema.ts} - Schema validation
|
|
255
|
-
* @see {@link packages/linters/wu-schema-linter.ts} - Linter validation
|
|
256
|
-
*/
|
|
257
|
-
export const WU_EXPOSURE = {
|
|
258
|
-
/** User-facing UI changes (pages, components, widgets) */
|
|
259
|
-
UI: 'ui',
|
|
260
|
-
|
|
261
|
-
/** API endpoints that are called by UI or external clients */
|
|
262
|
-
API: 'api',
|
|
263
|
-
|
|
264
|
-
/** Backend-only changes (no user visibility) */
|
|
265
|
-
BACKEND_ONLY: 'backend-only',
|
|
266
|
-
|
|
267
|
-
/** Documentation changes only */
|
|
268
|
-
DOCUMENTATION: 'documentation',
|
|
269
|
-
} as const;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Array of valid exposure values for schema validation
|
|
273
|
-
* Note: Defined as tuple for Zod enum compatibility
|
|
274
|
-
*/
|
|
275
|
-
export const WU_EXPOSURE_VALUES = ['ui', 'api', 'backend-only', 'documentation'] as const;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Test type keys
|
|
279
|
-
*
|
|
280
|
-
* WU-1281: Centralized from hardcoded keys in validators
|
|
281
|
-
*/
|
|
282
|
-
export const TEST_TYPES = {
|
|
283
|
-
UNIT: 'unit',
|
|
284
|
-
E2E: 'e2e',
|
|
285
|
-
MANUAL: 'manual',
|
|
286
|
-
INTEGRATION: 'integration',
|
|
287
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
3
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
4
|
-
/**
|
|
5
|
-
* WU type/test helper predicates (WU-1444)
|
|
6
|
-
*
|
|
7
|
-
* Purpose: avoid duplicating policy via string literals across CLI/MCP.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { TEST_TYPES, WU_TYPES, WU_TYPE_VALUES, type WUType } from './wu-statuses.js';
|
|
11
|
-
|
|
12
|
-
function isNonEmptyArray(value: unknown): value is unknown[] {
|
|
13
|
-
return Array.isArray(value) && value.length > 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const WU_TYPE_SET = new Set<string>(WU_TYPE_VALUES);
|
|
17
|
-
|
|
18
|
-
export function isWUType(type: unknown): type is WUType {
|
|
19
|
-
return typeof type === 'string' && WU_TYPE_SET.has(type);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function isDocumentationType(type: unknown): boolean {
|
|
23
|
-
return typeof type === 'string' && type === WU_TYPES.DOCUMENTATION;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function isProcessType(type: unknown): boolean {
|
|
27
|
-
return typeof type === 'string' && type === WU_TYPES.PROCESS;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function isDocsOrProcessType(type: unknown): boolean {
|
|
31
|
-
return isDocumentationType(type) || isProcessType(type);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type TestsLike =
|
|
35
|
-
| {
|
|
36
|
-
manual?: unknown;
|
|
37
|
-
unit?: unknown;
|
|
38
|
-
e2e?: unknown;
|
|
39
|
-
integration?: unknown;
|
|
40
|
-
}
|
|
41
|
-
| undefined;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* True when UnsafeAny supported test array has at least one item.
|
|
45
|
-
* Supports the canonical tests object shape from WU YAML.
|
|
46
|
-
*/
|
|
47
|
-
export function hasAnyTests(tests: TestsLike): boolean {
|
|
48
|
-
if (!tests || typeof tests !== 'object') return false;
|
|
49
|
-
|
|
50
|
-
const t = tests as Record<string, unknown>;
|
|
51
|
-
return (
|
|
52
|
-
isNonEmptyArray(t[TEST_TYPES.MANUAL]) ||
|
|
53
|
-
isNonEmptyArray(t[TEST_TYPES.UNIT]) ||
|
|
54
|
-
isNonEmptyArray(t[TEST_TYPES.E2E]) ||
|
|
55
|
-
isNonEmptyArray(t[TEST_TYPES.INTEGRATION])
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* True when tests.manual has at least one item.
|
|
61
|
-
* Used for early lifecycle enforcement where manual verification is mandatory.
|
|
62
|
-
*/
|
|
63
|
-
export function hasManualTests(tests: TestsLike): boolean {
|
|
64
|
-
if (!tests || typeof tests !== 'object') return false;
|
|
65
|
-
const t = tests as Record<string, unknown>;
|
|
66
|
-
return isNonEmptyArray(t[TEST_TYPES.MANUAL]);
|
|
67
|
-
}
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* UI and Display Constants
|
|
6
|
-
*
|
|
7
|
-
* WU-1549: Extracted from wu-constants.ts for domain-specific modularity.
|
|
8
|
-
* Contains backlog sections, status sections, log prefixes, emoji, box drawing,
|
|
9
|
-
* display limits, string literals, YAML options, and readiness UI.
|
|
10
|
-
*
|
|
11
|
-
* @module wu-ui-constants
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Backlog section headings (with emojis)
|
|
16
|
-
*
|
|
17
|
-
* These match the frontmatter config in backlog.md
|
|
18
|
-
*/
|
|
19
|
-
export const BACKLOG_SECTIONS = {
|
|
20
|
-
READY: '## 🚀 Ready (pull from here)',
|
|
21
|
-
IN_PROGRESS: '## 🔧 In progress',
|
|
22
|
-
BLOCKED: '## ⛔ Blocked',
|
|
23
|
-
DONE: '## ✅ Done',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Backlog bullet format types (WU-1444)
|
|
28
|
-
*
|
|
29
|
-
* Used by BacklogManager to format list items in each section.
|
|
30
|
-
* Each format produces a different markdown bullet style.
|
|
31
|
-
*/
|
|
32
|
-
export const BACKLOG_BULLET_FORMAT = {
|
|
33
|
-
/** Ready format: '- [ ] [WU-ID -- Title](link)' */
|
|
34
|
-
READY: 'ready',
|
|
35
|
-
/** Progress format: '- [WU-ID -- Title](link)' */
|
|
36
|
-
PROGRESS: 'progress',
|
|
37
|
-
/** Blocked format: '- [ ] [WU-ID -- Title](link) -- Reason' */
|
|
38
|
-
BLOCKED: 'blocked',
|
|
39
|
-
/** Done format: '- [x] [WU-ID -- Title](link) (YYYY-MM-DD)' */
|
|
40
|
-
DONE: 'done',
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Status.md section headings (simpler format)
|
|
45
|
-
*/
|
|
46
|
-
export const STATUS_SECTIONS = {
|
|
47
|
-
IN_PROGRESS: '## In Progress',
|
|
48
|
-
BLOCKED: '## Blocked',
|
|
49
|
-
COMPLETED: '## Completed',
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Log prefixes for wu- scripts
|
|
54
|
-
*
|
|
55
|
-
* Consistent prefixes for console output
|
|
56
|
-
*/
|
|
57
|
-
export const LOG_PREFIX = {
|
|
58
|
-
DONE: '[wu-done]',
|
|
59
|
-
CLAIM: '[wu-claim]',
|
|
60
|
-
CREATE: '[wu:create]',
|
|
61
|
-
EDIT: '[wu:edit]',
|
|
62
|
-
DELETE: '[wu:delete]',
|
|
63
|
-
BLOCK: '[wu-block]',
|
|
64
|
-
UNBLOCK: '[wu-unblock]',
|
|
65
|
-
UNLOCK_LANE: '[wu-unlock-lane]',
|
|
66
|
-
CLEANUP: '[wu-cleanup]',
|
|
67
|
-
PRUNE: '[wu-prune]',
|
|
68
|
-
REPAIR: '[wu:repair]',
|
|
69
|
-
CONSISTENCY: '[wu-consistency]',
|
|
70
|
-
PREFLIGHT: '[wu-preflight]',
|
|
71
|
-
INITIATIVE_PLAN: '[initiative:plan]',
|
|
72
|
-
PLAN_CREATE: '[plan:create]',
|
|
73
|
-
PLAN_LINK: '[plan:link]',
|
|
74
|
-
PLAN_EDIT: '[plan:edit]',
|
|
75
|
-
PLAN_PROMOTE: '[plan:promote]',
|
|
76
|
-
ESCALATE: '[wu:escalate]',
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Emoji constants for consistent console output
|
|
81
|
-
*
|
|
82
|
-
* WU-1281: Centralized from hardcoded emojis across wu-* scripts
|
|
83
|
-
*/
|
|
84
|
-
export const EMOJI = {
|
|
85
|
-
SUCCESS: '✅',
|
|
86
|
-
FAILURE: '❌',
|
|
87
|
-
WARNING: '⚠️',
|
|
88
|
-
INFO: 'ℹ️',
|
|
89
|
-
BLOCKED: '⛔',
|
|
90
|
-
ROCKET: '🚀',
|
|
91
|
-
WRENCH: '🔧',
|
|
92
|
-
TARGET: '🎯',
|
|
93
|
-
MEMO: '📝',
|
|
94
|
-
FOLDER: '📍',
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Box drawing characters for console output
|
|
99
|
-
*
|
|
100
|
-
* Emergency fix (Session 2): Centralized to eliminate sonarjs/no-duplicate-string errors
|
|
101
|
-
* Used for recovery dialogs and error boxes in wu-* scripts
|
|
102
|
-
*/
|
|
103
|
-
export const BOX = {
|
|
104
|
-
/** Top border: ╔══...══╗ (66 chars inside + corners = 68 total) */
|
|
105
|
-
TOP: '╔══════════════════════════════════════════════════════════════════╗',
|
|
106
|
-
|
|
107
|
-
/** Middle separator: ╠══...══╣ */
|
|
108
|
-
MID: '╠══════════════════════════════════════════════════════════════════╣',
|
|
109
|
-
|
|
110
|
-
/** Bottom border: ╚══...══╝ */
|
|
111
|
-
BOT: '╚══════════════════════════════════════════════════════════════════╝',
|
|
112
|
-
|
|
113
|
-
/** Side border for content lines */
|
|
114
|
-
SIDE: '║',
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* UI display constants
|
|
119
|
-
*
|
|
120
|
-
* WU-1281: Centralized from hardcoded values in wu-done.ts
|
|
121
|
-
*/
|
|
122
|
-
export const UI = {
|
|
123
|
-
/** Width for error/info boxes in console output */
|
|
124
|
-
ERROR_BOX_WIDTH: 70,
|
|
125
|
-
|
|
126
|
-
/** Number of lines to show in status file preview */
|
|
127
|
-
STATUS_PREVIEW_LINES: 5,
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Display limits for CLI output (WU-1068)
|
|
132
|
-
*
|
|
133
|
-
* Centralized limits for truncating display strings to avoid magic numbers.
|
|
134
|
-
*/
|
|
135
|
-
export const DISPLAY_LIMITS = {
|
|
136
|
-
/** Maximum items to show in lists before truncating */
|
|
137
|
-
LIST_ITEMS: 5,
|
|
138
|
-
/** Maximum items to show in short lists */
|
|
139
|
-
SHORT_LIST: 3,
|
|
140
|
-
/** Maximum characters for content preview */
|
|
141
|
-
CONTENT_PREVIEW: 200,
|
|
142
|
-
/** Maximum characters for short preview */
|
|
143
|
-
SHORT_PREVIEW: 60,
|
|
144
|
-
/** Maximum characters for title display */
|
|
145
|
-
TITLE: 50,
|
|
146
|
-
/** Maximum characters for truncated title */
|
|
147
|
-
TRUNCATED_TITLE: 40,
|
|
148
|
-
/** Maximum characters for command preview */
|
|
149
|
-
CMD_PREVIEW: 60,
|
|
150
|
-
/** Maximum lines to preview from files */
|
|
151
|
-
FILE_LINES: 10,
|
|
152
|
-
/** Maximum commits to show in lists */
|
|
153
|
-
COMMITS: 50,
|
|
154
|
-
/** Maximum overlaps to display */
|
|
155
|
-
OVERLAPS: 3,
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* YAML serialization options
|
|
160
|
-
*
|
|
161
|
-
* Centralized from duplicated { lineWidth: 100 } across wu-* scripts (WU-1256).
|
|
162
|
-
* Use with yaml stringify() options.
|
|
163
|
-
*/
|
|
164
|
-
export const YAML_OPTIONS = {
|
|
165
|
-
/** Standard line width for YAML dump (100 chars) */
|
|
166
|
-
LINE_WIDTH: 100,
|
|
167
|
-
|
|
168
|
-
/** No line wrapping (-1 disables wrapping) */
|
|
169
|
-
NO_WRAP: -1,
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Process argv indices (WU-1068)
|
|
174
|
-
*
|
|
175
|
-
* Centralized indices for process.argv access to eliminate magic numbers.
|
|
176
|
-
* In Node.js: argv[0] = node, argv[1] = script, argv[2+] = args
|
|
177
|
-
*/
|
|
178
|
-
export const ARGV_INDICES = {
|
|
179
|
-
/** Node executable path */
|
|
180
|
-
NODE: 0,
|
|
181
|
-
/** Script path */
|
|
182
|
-
SCRIPT: 1,
|
|
183
|
-
/** First user argument */
|
|
184
|
-
FIRST_ARG: 2,
|
|
185
|
-
/** Second user argument */
|
|
186
|
-
SECOND_ARG: 3,
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* String formatting constants
|
|
191
|
-
*
|
|
192
|
-
* Centralized string literals for consistent formatting across scripts.
|
|
193
|
-
* Eliminates hardcoded '\n', ' ', etc. throughout the codebase.
|
|
194
|
-
*/
|
|
195
|
-
export const STRING_LITERALS = {
|
|
196
|
-
/** Newline character */
|
|
197
|
-
NEWLINE: '\n',
|
|
198
|
-
|
|
199
|
-
/** Double newline (paragraph separator) */
|
|
200
|
-
DOUBLE_NEWLINE: '\n\n',
|
|
201
|
-
|
|
202
|
-
/** Space character */
|
|
203
|
-
SPACE: ' ',
|
|
204
|
-
|
|
205
|
-
/** Empty string */
|
|
206
|
-
EMPTY: '',
|
|
207
|
-
|
|
208
|
-
/** Tab character */
|
|
209
|
-
TAB: '\t',
|
|
210
|
-
|
|
211
|
-
/** Comma separator */
|
|
212
|
-
COMMA: ',',
|
|
213
|
-
|
|
214
|
-
/** Colon separator */
|
|
215
|
-
COLON: ':',
|
|
216
|
-
|
|
217
|
-
/** Dash/hyphen */
|
|
218
|
-
DASH: '-',
|
|
219
|
-
|
|
220
|
-
/** Forward slash */
|
|
221
|
-
SLASH: '/',
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Readiness summary UI constants (WU-1620)
|
|
226
|
-
*
|
|
227
|
-
* Constants for the readiness summary box displayed after wu:create and wu:edit.
|
|
228
|
-
* Provides visual feedback on whether WU is ready for wu:claim.
|
|
229
|
-
*
|
|
230
|
-
* @see tools/wu-create.ts - displayReadinessSummary()
|
|
231
|
-
* @see tools/wu-edit.ts - displayReadinessSummary()
|
|
232
|
-
*/
|
|
233
|
-
export const READINESS_UI = {
|
|
234
|
-
/** Box width (inner content area) */
|
|
235
|
-
BOX_WIDTH: 50,
|
|
236
|
-
|
|
237
|
-
/** Box drawing characters */
|
|
238
|
-
BOX: {
|
|
239
|
-
TOP_LEFT: '┌',
|
|
240
|
-
TOP_RIGHT: '┐',
|
|
241
|
-
BOTTOM_LEFT: '└',
|
|
242
|
-
BOTTOM_RIGHT: '┘',
|
|
243
|
-
HORIZONTAL: '─',
|
|
244
|
-
VERTICAL: '│',
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
/** Status messages */
|
|
248
|
-
MESSAGES: {
|
|
249
|
-
READY_YES: '✅ Ready to claim: YES',
|
|
250
|
-
READY_NO: '⚠️ Ready to claim: NO',
|
|
251
|
-
MISSING_HEADER: 'Missing:',
|
|
252
|
-
BULLET: '•',
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
/** Error truncation length */
|
|
256
|
-
ERROR_MAX_LENGTH: 46,
|
|
257
|
-
ERROR_TRUNCATE_LENGTH: 43,
|
|
258
|
-
TRUNCATION_SUFFIX: '...',
|
|
259
|
-
|
|
260
|
-
/** Padding calculations (relative to BOX_WIDTH) */
|
|
261
|
-
PADDING: {
|
|
262
|
-
READY_YES: 27, // 50 - len("... Ready to claim: YES") - 1
|
|
263
|
-
READY_NO: 28, // 50 - len("... Ready to claim: NO") - 1
|
|
264
|
-
MISSING_HEADER: 41, // 50 - len("Missing:") - 1
|
|
265
|
-
ERROR_BULLET: 45, // 50 - len(" ... ") - 1
|
|
266
|
-
},
|
|
267
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* WU Validation Constants (WU-1243)
|
|
6
|
-
*
|
|
7
|
-
* Centralizes magic numbers for lane inference and incident validation.
|
|
8
|
-
* Extracted from lane-inference.ts and agent-incidents.ts for DRY compliance.
|
|
9
|
-
*
|
|
10
|
-
* @module wu-validation-constants
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Lane inference scoring weights.
|
|
15
|
-
* Code path matches are weighted higher than keywords because
|
|
16
|
-
* file paths are more reliable signals for lane classification.
|
|
17
|
-
*
|
|
18
|
-
* The 10:3 ratio (~3.3x) reflects that a code path match is approximately
|
|
19
|
-
* 3x more indicative of the correct lane than a keyword match.
|
|
20
|
-
*/
|
|
21
|
-
export const WEIGHTS = {
|
|
22
|
-
/** Weight for code path pattern matches (more reliable signal) */
|
|
23
|
-
CODE_PATH_MATCH: 10,
|
|
24
|
-
/** Weight for keyword matches in description (less specific signal) */
|
|
25
|
-
KEYWORD_MATCH: 3,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Confidence score configuration for lane inference.
|
|
30
|
-
*
|
|
31
|
-
* WU-2438: Changed from percentage-based (0-100) to absolute scoring.
|
|
32
|
-
* Raw scores (sum of WEIGHTS) are now returned directly.
|
|
33
|
-
* Higher score = better match, regardless of config size.
|
|
34
|
-
*/
|
|
35
|
-
export const CONFIDENCE = {
|
|
36
|
-
/** Minimum confidence value (no matches) */
|
|
37
|
-
MIN: 0,
|
|
38
|
-
/** Maximum confidence value (legacy, kept for backward compatibility) */
|
|
39
|
-
MAX: 100,
|
|
40
|
-
/**
|
|
41
|
-
* Minimum confidence threshold to return a suggestion.
|
|
42
|
-
* Set to 0 to always return best match (even low confidence).
|
|
43
|
-
* Note: With absolute scoring, this threshold is compared against raw scores.
|
|
44
|
-
*/
|
|
45
|
-
THRESHOLD: 0,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* String length validation limits for incident logging.
|
|
50
|
-
* Prevents abuse while allowing meaningful content.
|
|
51
|
-
*/
|
|
52
|
-
export const VALIDATION_LIMITS = {
|
|
53
|
-
/** Minimum title length (prevents truncated/empty titles) */
|
|
54
|
-
TITLE_MIN: 5,
|
|
55
|
-
/** Maximum title length (keeps logs readable) */
|
|
56
|
-
TITLE_MAX: 100,
|
|
57
|
-
/** Minimum description length (prevents one-liners) */
|
|
58
|
-
DESCRIPTION_MIN: 10,
|
|
59
|
-
/** Maximum description length (prevents unbounded logging) */
|
|
60
|
-
DESCRIPTION_MAX: 2000,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Valid incident categories for agent issue logging.
|
|
65
|
-
* Duplicated from agent-incidents.ts z.enum for use in default arrays.
|
|
66
|
-
*/
|
|
67
|
-
export const INCIDENT_CATEGORIES = [
|
|
68
|
-
'workflow',
|
|
69
|
-
'tooling',
|
|
70
|
-
'confusion',
|
|
71
|
-
'violation',
|
|
72
|
-
'error',
|
|
73
|
-
] as const;
|