@lumenflow/cli 1.3.4 → 1.3.6

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.
Files changed (122) hide show
  1. package/dist/__tests__/release.test.js +283 -0
  2. package/dist/agent-issues-query.js +3 -2
  3. package/dist/agent-log-issue.js +2 -2
  4. package/dist/init.js +1 -1
  5. package/dist/mem-checkpoint.js +3 -7
  6. package/dist/mem-cleanup.js +2 -6
  7. package/dist/mem-create.js +3 -7
  8. package/dist/mem-inbox.js +3 -7
  9. package/dist/mem-init.js +5 -9
  10. package/dist/mem-ready.js +3 -7
  11. package/dist/mem-signal.js +3 -7
  12. package/dist/mem-start.js +3 -7
  13. package/dist/mem-summarize.js +2 -6
  14. package/dist/mem-triage.js +2 -6
  15. package/dist/metrics-snapshot.js +2 -2
  16. package/dist/orchestrate-init-status.js +3 -4
  17. package/dist/orchestrate-monitor.js +4 -5
  18. package/dist/release.js +416 -0
  19. package/dist/spawn-list.js +3 -3
  20. package/dist/wu-block.js +2 -2
  21. package/dist/wu-claim.js +9 -4
  22. package/dist/wu-create.js +1 -1
  23. package/dist/wu-done.js +17 -17
  24. package/dist/wu-release.js +142 -0
  25. package/dist/wu-repair.js +3 -3
  26. package/dist/wu-spawn.js +6 -6
  27. package/dist/wu-unblock.js +2 -2
  28. package/package.json +9 -7
  29. package/dist/gates.d.ts +0 -41
  30. package/dist/gates.d.ts.map +0 -1
  31. package/dist/gates.js.map +0 -1
  32. package/dist/initiative-add-wu.d.ts +0 -22
  33. package/dist/initiative-add-wu.d.ts.map +0 -1
  34. package/dist/initiative-add-wu.js.map +0 -1
  35. package/dist/initiative-create.d.ts +0 -28
  36. package/dist/initiative-create.d.ts.map +0 -1
  37. package/dist/initiative-create.js.map +0 -1
  38. package/dist/initiative-edit.d.ts +0 -34
  39. package/dist/initiative-edit.d.ts.map +0 -1
  40. package/dist/initiative-edit.js.map +0 -1
  41. package/dist/initiative-list.d.ts +0 -12
  42. package/dist/initiative-list.d.ts.map +0 -1
  43. package/dist/initiative-list.js.map +0 -1
  44. package/dist/initiative-status.d.ts +0 -11
  45. package/dist/initiative-status.d.ts.map +0 -1
  46. package/dist/initiative-status.js.map +0 -1
  47. package/dist/mem-checkpoint.d.ts +0 -16
  48. package/dist/mem-checkpoint.d.ts.map +0 -1
  49. package/dist/mem-checkpoint.js.map +0 -1
  50. package/dist/mem-cleanup.d.ts +0 -29
  51. package/dist/mem-cleanup.d.ts.map +0 -1
  52. package/dist/mem-cleanup.js.map +0 -1
  53. package/dist/mem-create.d.ts +0 -17
  54. package/dist/mem-create.d.ts.map +0 -1
  55. package/dist/mem-create.js.map +0 -1
  56. package/dist/mem-inbox.d.ts +0 -35
  57. package/dist/mem-inbox.d.ts.map +0 -1
  58. package/dist/mem-inbox.js.map +0 -1
  59. package/dist/mem-init.d.ts +0 -15
  60. package/dist/mem-init.d.ts.map +0 -1
  61. package/dist/mem-init.js.map +0 -1
  62. package/dist/mem-ready.d.ts +0 -16
  63. package/dist/mem-ready.d.ts.map +0 -1
  64. package/dist/mem-ready.js.map +0 -1
  65. package/dist/mem-signal.d.ts +0 -16
  66. package/dist/mem-signal.d.ts.map +0 -1
  67. package/dist/mem-signal.js.map +0 -1
  68. package/dist/mem-start.d.ts +0 -16
  69. package/dist/mem-start.d.ts.map +0 -1
  70. package/dist/mem-start.js.map +0 -1
  71. package/dist/mem-summarize.d.ts +0 -22
  72. package/dist/mem-summarize.d.ts.map +0 -1
  73. package/dist/mem-summarize.js.map +0 -1
  74. package/dist/mem-triage.d.ts +0 -22
  75. package/dist/mem-triage.d.ts.map +0 -1
  76. package/dist/mem-triage.js.map +0 -1
  77. package/dist/spawn-list.d.ts +0 -16
  78. package/dist/spawn-list.d.ts.map +0 -1
  79. package/dist/spawn-list.js.map +0 -1
  80. package/dist/wu-block.d.ts +0 -16
  81. package/dist/wu-block.d.ts.map +0 -1
  82. package/dist/wu-block.js.map +0 -1
  83. package/dist/wu-claim.d.ts +0 -32
  84. package/dist/wu-claim.d.ts.map +0 -1
  85. package/dist/wu-claim.js.map +0 -1
  86. package/dist/wu-cleanup.d.ts +0 -17
  87. package/dist/wu-cleanup.d.ts.map +0 -1
  88. package/dist/wu-cleanup.js.map +0 -1
  89. package/dist/wu-create.d.ts +0 -38
  90. package/dist/wu-create.d.ts.map +0 -1
  91. package/dist/wu-create.js.map +0 -1
  92. package/dist/wu-deps.d.ts +0 -13
  93. package/dist/wu-deps.d.ts.map +0 -1
  94. package/dist/wu-deps.js.map +0 -1
  95. package/dist/wu-done.d.ts +0 -153
  96. package/dist/wu-done.d.ts.map +0 -1
  97. package/dist/wu-done.js.map +0 -1
  98. package/dist/wu-edit.d.ts +0 -29
  99. package/dist/wu-edit.d.ts.map +0 -1
  100. package/dist/wu-edit.js.map +0 -1
  101. package/dist/wu-infer-lane.d.ts +0 -17
  102. package/dist/wu-infer-lane.d.ts.map +0 -1
  103. package/dist/wu-infer-lane.js.map +0 -1
  104. package/dist/wu-preflight.d.ts +0 -47
  105. package/dist/wu-preflight.d.ts.map +0 -1
  106. package/dist/wu-preflight.js.map +0 -1
  107. package/dist/wu-prune.d.ts +0 -16
  108. package/dist/wu-prune.d.ts.map +0 -1
  109. package/dist/wu-prune.js.map +0 -1
  110. package/dist/wu-repair.d.ts +0 -60
  111. package/dist/wu-repair.d.ts.map +0 -1
  112. package/dist/wu-repair.js.map +0 -1
  113. package/dist/wu-spawn-completion.d.ts +0 -10
  114. package/dist/wu-spawn.d.ts +0 -168
  115. package/dist/wu-spawn.d.ts.map +0 -1
  116. package/dist/wu-spawn.js.map +0 -1
  117. package/dist/wu-unblock.d.ts +0 -16
  118. package/dist/wu-unblock.d.ts.map +0 -1
  119. package/dist/wu-unblock.js.map +0 -1
  120. package/dist/wu-validate.d.ts +0 -16
  121. package/dist/wu-validate.d.ts.map +0 -1
  122. package/dist/wu-validate.js.map +0 -1
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Tests for release command
3
+ *
4
+ * Verifies that the release command:
5
+ * - Validates version format (semver)
6
+ * - Bumps all @lumenflow/* package versions
7
+ * - Uses micro-worktree isolation for version commit
8
+ * - Builds all packages
9
+ * - Publishes to npm with proper auth
10
+ * - Creates git tag vX.Y.Z
11
+ *
12
+ * WU-1074: Add release command for npm publishing
13
+ */
14
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
15
+ import { existsSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
16
+ import { join } from 'node:path';
17
+ import { tmpdir } from 'node:os';
18
+ // Import functions under test
19
+ import { validateSemver, findPackageJsonPaths, updatePackageVersions, buildCommitMessage, buildTagName, } from '../release.js';
20
+ describe('release command', () => {
21
+ describe('validateSemver', () => {
22
+ it('should accept valid semver versions', () => {
23
+ expect(validateSemver('1.0.0')).toBe(true);
24
+ expect(validateSemver('1.2.3')).toBe(true);
25
+ expect(validateSemver('10.20.30')).toBe(true);
26
+ expect(validateSemver('0.0.1')).toBe(true);
27
+ });
28
+ it('should accept semver with pre-release identifiers', () => {
29
+ expect(validateSemver('1.0.0-alpha')).toBe(true);
30
+ expect(validateSemver('1.0.0-beta.1')).toBe(true);
31
+ expect(validateSemver('1.0.0-rc.1')).toBe(true);
32
+ });
33
+ it('should reject invalid versions', () => {
34
+ expect(validateSemver('1')).toBe(false);
35
+ expect(validateSemver('1.0')).toBe(false);
36
+ expect(validateSemver('v1.0.0')).toBe(false);
37
+ expect(validateSemver('1.0.0.0')).toBe(false);
38
+ expect(validateSemver('abc')).toBe(false);
39
+ expect(validateSemver('')).toBe(false);
40
+ });
41
+ });
42
+ describe('findPackageJsonPaths', () => {
43
+ let testDir;
44
+ beforeEach(() => {
45
+ // Create temp directory for test packages
46
+ testDir = join(tmpdir(), `release-test-${Date.now()}`);
47
+ mkdirSync(testDir, { recursive: true });
48
+ });
49
+ afterEach(() => {
50
+ // Clean up temp directory
51
+ rmSync(testDir, { recursive: true, force: true });
52
+ });
53
+ it('should find all @lumenflow/* package.json files', () => {
54
+ // Create mock package structure
55
+ const packagesDir = join(testDir, 'packages/@lumenflow');
56
+ mkdirSync(join(packagesDir, 'core'), { recursive: true });
57
+ mkdirSync(join(packagesDir, 'cli'), { recursive: true });
58
+ mkdirSync(join(packagesDir, 'memory'), { recursive: true });
59
+ writeFileSync(join(packagesDir, 'core/package.json'), JSON.stringify({ name: '@lumenflow/core', version: '1.0.0' }));
60
+ writeFileSync(join(packagesDir, 'cli/package.json'), JSON.stringify({ name: '@lumenflow/cli', version: '1.0.0' }));
61
+ writeFileSync(join(packagesDir, 'memory/package.json'), JSON.stringify({ name: '@lumenflow/memory', version: '1.0.0' }));
62
+ const paths = findPackageJsonPaths(testDir);
63
+ expect(paths).toHaveLength(3);
64
+ expect(paths).toContain(join(packagesDir, 'core/package.json'));
65
+ expect(paths).toContain(join(packagesDir, 'cli/package.json'));
66
+ expect(paths).toContain(join(packagesDir, 'memory/package.json'));
67
+ });
68
+ it('should not include packages with private: true', () => {
69
+ // Create mock package structure with private package
70
+ const packagesDir = join(testDir, 'packages/@lumenflow');
71
+ mkdirSync(join(packagesDir, 'core'), { recursive: true });
72
+ mkdirSync(join(packagesDir, 'internal'), { recursive: true });
73
+ writeFileSync(join(packagesDir, 'core/package.json'), JSON.stringify({ name: '@lumenflow/core', version: '1.0.0' }));
74
+ writeFileSync(join(packagesDir, 'internal/package.json'), JSON.stringify({ name: '@lumenflow/internal', version: '1.0.0', private: true }));
75
+ const paths = findPackageJsonPaths(testDir);
76
+ expect(paths).toHaveLength(1);
77
+ expect(paths).toContain(join(packagesDir, 'core/package.json'));
78
+ });
79
+ });
80
+ describe('updatePackageVersions', () => {
81
+ let testDir;
82
+ beforeEach(() => {
83
+ testDir = join(tmpdir(), `release-test-${Date.now()}`);
84
+ mkdirSync(testDir, { recursive: true });
85
+ });
86
+ afterEach(() => {
87
+ rmSync(testDir, { recursive: true, force: true });
88
+ });
89
+ it('should update version in all package.json files', async () => {
90
+ // Create mock package.json
91
+ const packagePath = join(testDir, 'package.json');
92
+ writeFileSync(packagePath, JSON.stringify({
93
+ name: '@lumenflow/core',
94
+ version: '1.0.0',
95
+ description: 'Core package',
96
+ }, null, 2));
97
+ await updatePackageVersions([packagePath], '1.2.3');
98
+ // Read back and verify
99
+ const content = JSON.parse(await import('node:fs/promises').then((fs) => fs.readFile(packagePath, 'utf-8')));
100
+ expect(content.version).toBe('1.2.3');
101
+ expect(content.name).toBe('@lumenflow/core'); // Other fields preserved
102
+ });
103
+ it('should preserve JSON formatting', async () => {
104
+ // Create mock package.json with specific formatting
105
+ const packagePath = join(testDir, 'package.json');
106
+ writeFileSync(packagePath, JSON.stringify({ name: '@lumenflow/core', version: '1.0.0' }, null, 2) + '\n');
107
+ await updatePackageVersions([packagePath], '1.2.3');
108
+ // Read back raw content and check formatting
109
+ const content = await import('node:fs/promises').then((fs) => fs.readFile(packagePath, 'utf-8'));
110
+ expect(content).toMatch(/{\n "name"/); // Preserve 2-space indent
111
+ });
112
+ });
113
+ describe('buildCommitMessage', () => {
114
+ it('should build correct commit message for version bump', () => {
115
+ const message = buildCommitMessage('1.3.0');
116
+ expect(message).toBe('chore: bump all packages to v1.3.0');
117
+ });
118
+ });
119
+ describe('buildTagName', () => {
120
+ it('should build correct tag name', () => {
121
+ expect(buildTagName('1.3.0')).toBe('v1.3.0');
122
+ expect(buildTagName('1.0.0-beta.1')).toBe('v1.0.0-beta.1');
123
+ });
124
+ });
125
+ });
126
+ describe('release command integration', () => {
127
+ // These tests verify the command exists and parses arguments correctly
128
+ // They don't actually run the full release process
129
+ it('should export main function from release.ts', async () => {
130
+ // This test verifies the module structure exists
131
+ const module = await import('../release.js');
132
+ expect(module).toBeDefined();
133
+ expect(typeof module.validateSemver).toBe('function');
134
+ expect(typeof module.findPackageJsonPaths).toBe('function');
135
+ expect(typeof module.updatePackageVersions).toBe('function');
136
+ });
137
+ });
138
+ /**
139
+ * WU-1077: Tests for release script bug fixes
140
+ *
141
+ * Verifies:
142
+ * - hasNpmAuth() detects auth from ~/.npmrc not just env vars
143
+ * - Changeset pre mode is detected and exited in micro-worktree
144
+ * - Tag push bypasses pre-push hooks via LUMENFLOW_FORCE
145
+ */
146
+ describe('WU-1077: release script bug fixes', () => {
147
+ describe('hasNpmAuth - ~/.npmrc detection', () => {
148
+ let testDir;
149
+ beforeEach(() => {
150
+ testDir = join(tmpdir(), `release-npmrc-test-${Date.now()}`);
151
+ mkdirSync(testDir, { recursive: true });
152
+ });
153
+ afterEach(() => {
154
+ rmSync(testDir, { recursive: true, force: true });
155
+ });
156
+ it('should detect auth from ~/.npmrc authToken line', async () => {
157
+ // Import the function we're testing
158
+ const { hasNpmAuth } = await import('../release.js');
159
+ // Create a mock .npmrc with auth token
160
+ const npmrcPath = join(testDir, '.npmrc');
161
+ writeFileSync(npmrcPath, '//registry.npmjs.org/:_authToken=npm_testToken123\n');
162
+ // Test that it detects auth from the file
163
+ const result = hasNpmAuth(npmrcPath);
164
+ expect(result).toBe(true);
165
+ });
166
+ it('should return false when ~/.npmrc has no auth token', async () => {
167
+ const { hasNpmAuth } = await import('../release.js');
168
+ // Create a mock .npmrc without auth token
169
+ const npmrcPath = join(testDir, '.npmrc');
170
+ writeFileSync(npmrcPath, 'registry=https://registry.npmjs.org\n');
171
+ const result = hasNpmAuth(npmrcPath);
172
+ expect(result).toBe(false);
173
+ });
174
+ it('should return false when ~/.npmrc does not exist', async () => {
175
+ const { hasNpmAuth } = await import('../release.js');
176
+ // Non-existent path
177
+ const npmrcPath = join(testDir, 'nonexistent', '.npmrc');
178
+ const result = hasNpmAuth(npmrcPath);
179
+ expect(result).toBe(false);
180
+ });
181
+ it('should still detect auth from NPM_TOKEN env var', async () => {
182
+ const { hasNpmAuth } = await import('../release.js');
183
+ // Set env var
184
+ const originalNpmToken = process.env.NPM_TOKEN;
185
+ process.env.NPM_TOKEN = 'test_token';
186
+ try {
187
+ // No npmrc file provided, should check env var
188
+ const result = hasNpmAuth();
189
+ expect(result).toBe(true);
190
+ }
191
+ finally {
192
+ // Restore
193
+ if (originalNpmToken === undefined) {
194
+ delete process.env.NPM_TOKEN;
195
+ }
196
+ else {
197
+ process.env.NPM_TOKEN = originalNpmToken;
198
+ }
199
+ }
200
+ });
201
+ });
202
+ describe('isInChangesetPreMode', () => {
203
+ let testDir;
204
+ beforeEach(() => {
205
+ testDir = join(tmpdir(), `release-pre-test-${Date.now()}`);
206
+ mkdirSync(testDir, { recursive: true });
207
+ });
208
+ afterEach(() => {
209
+ rmSync(testDir, { recursive: true, force: true });
210
+ });
211
+ it('should return true when .changeset/pre.json exists', async () => {
212
+ const { isInChangesetPreMode } = await import('../release.js');
213
+ // Create .changeset directory and pre.json
214
+ const changesetDir = join(testDir, '.changeset');
215
+ mkdirSync(changesetDir, { recursive: true });
216
+ writeFileSync(join(changesetDir, 'pre.json'), JSON.stringify({
217
+ mode: 'pre',
218
+ tag: 'next',
219
+ initialVersions: {},
220
+ changesets: [],
221
+ }));
222
+ const result = isInChangesetPreMode(testDir);
223
+ expect(result).toBe(true);
224
+ });
225
+ it('should return false when .changeset/pre.json does not exist', async () => {
226
+ const { isInChangesetPreMode } = await import('../release.js');
227
+ // Create .changeset directory without pre.json
228
+ const changesetDir = join(testDir, '.changeset');
229
+ mkdirSync(changesetDir, { recursive: true });
230
+ writeFileSync(join(changesetDir, 'config.json'), JSON.stringify({ access: 'public' }));
231
+ const result = isInChangesetPreMode(testDir);
232
+ expect(result).toBe(false);
233
+ });
234
+ it('should return false when .changeset directory does not exist', async () => {
235
+ const { isInChangesetPreMode } = await import('../release.js');
236
+ const result = isInChangesetPreMode(testDir);
237
+ expect(result).toBe(false);
238
+ });
239
+ });
240
+ describe('exitChangesetPreMode', () => {
241
+ let testDir;
242
+ beforeEach(() => {
243
+ testDir = join(tmpdir(), `release-exit-pre-test-${Date.now()}`);
244
+ mkdirSync(testDir, { recursive: true });
245
+ });
246
+ afterEach(() => {
247
+ rmSync(testDir, { recursive: true, force: true });
248
+ });
249
+ it('should delete .changeset/pre.json to exit pre mode', async () => {
250
+ const { exitChangesetPreMode, isInChangesetPreMode } = await import('../release.js');
251
+ // Create .changeset directory and pre.json
252
+ const changesetDir = join(testDir, '.changeset');
253
+ mkdirSync(changesetDir, { recursive: true });
254
+ const preJsonPath = join(changesetDir, 'pre.json');
255
+ writeFileSync(preJsonPath, JSON.stringify({
256
+ mode: 'pre',
257
+ tag: 'next',
258
+ initialVersions: {},
259
+ changesets: [],
260
+ }));
261
+ // Verify pre mode is active
262
+ expect(isInChangesetPreMode(testDir)).toBe(true);
263
+ // Exit pre mode
264
+ exitChangesetPreMode(testDir);
265
+ // Verify pre mode is no longer active
266
+ expect(isInChangesetPreMode(testDir)).toBe(false);
267
+ expect(existsSync(preJsonPath)).toBe(false);
268
+ });
269
+ it('should not throw when .changeset/pre.json does not exist', async () => {
270
+ const { exitChangesetPreMode } = await import('../release.js');
271
+ // No pre.json file exists
272
+ expect(() => exitChangesetPreMode(testDir)).not.toThrow();
273
+ });
274
+ });
275
+ describe('pushTagWithForce', () => {
276
+ it('should export pushTagWithForce function', async () => {
277
+ const { pushTagWithForce } = await import('../release.js');
278
+ expect(typeof pushTagWithForce).toBe('function');
279
+ });
280
+ // Integration test would require git setup - functional verification
281
+ // is done by checking the function uses LUMENFLOW_FORCE env var
282
+ });
283
+ });
@@ -19,12 +19,13 @@ import { join } from 'node:path';
19
19
  import { Command } from 'commander';
20
20
  import chalk from 'chalk';
21
21
  import { die } from '@lumenflow/core/dist/error-handler.js';
22
+ import { LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
22
23
  /** Log prefix for console output */
23
24
  const LOG_PREFIX = '[agent:issues-query]';
24
25
  /** Default days to query */
25
26
  const DEFAULT_SINCE_DAYS = 7;
26
- /** Issues log file path */
27
- const ISSUES_LOG_PATH = '.beacon/agent-issues.ndjson';
27
+ /** Issues log file path - under base .lumenflow directory */
28
+ const ISSUES_LOG_PATH = `${LUMENFLOW_PATHS.BASE}/agent-issues.ndjson`;
28
29
  /** Valid severity levels */
29
30
  const SEVERITY_LEVELS = ['blocker', 'major', 'minor', 'trivial'];
30
31
  /**
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import { Command } from 'commander';
11
11
  import { logIncident, getCurrentSession } from '@lumenflow/agent';
12
- import { EXIT_CODES, INCIDENT_SEVERITY } from '@lumenflow/core/dist/wu-constants.js';
12
+ import { EXIT_CODES, INCIDENT_SEVERITY, LUMENFLOW_PATHS, } from '@lumenflow/core/dist/wu-constants.js';
13
13
  import chalk from 'chalk';
14
14
  const program = new Command()
15
15
  .name('agent:log-issue')
@@ -46,7 +46,7 @@ const program = new Command()
46
46
  console.log(chalk.green(`✓ Issue logged`));
47
47
  console.log(` Category: ${chalk.cyan(opts.category)}`);
48
48
  console.log(` Severity: ${chalk.cyan(opts.severity)}`);
49
- console.log(` File: ${chalk.gray(`.beacon/incidents/${opts.category}.ndjson`)}`);
49
+ console.log(` File: ${chalk.gray(`${LUMENFLOW_PATHS.INCIDENTS}/${opts.category}.ndjson`)}`);
50
50
  if (opts.severity === INCIDENT_SEVERITY.MAJOR ||
51
51
  opts.severity === INCIDENT_SEVERITY.BLOCKER) {
52
52
  console.log();
package/dist/init.js CHANGED
@@ -113,7 +113,7 @@ const BACKLOG_TEMPLATE = `---\nsections:\n ready:\n heading: '## 🚀 Ready
113
113
  // Template for docs/04-operations/tasks/status.md
114
114
  const STATUS_TEMPLATE = `# Status (active work)\n\n## In Progress\n\n(No items in progress)\n\n## Blocked\n\n(No items blocked)\n\n## Completed\n\n(No items completed yet)\n`;
115
115
  // Template for docs/04-operations/tasks/templates/wu-template.yaml
116
- const WU_TEMPLATE_YAML = `# Work Unit Template (LumenFlow WU Schema)\n#\n# Copy this template when creating new WUs. Fill in all required fields and\n# remove optional fields if not needed.\n#\n# If you used "lumenflow init --full", this template lives at:\n# docs/04-operations/tasks/templates/wu-template.yaml\n\n# Required: Unique work unit identifier (format: WU-NNN)\nid: WU-XXX\n\n# Required: Short, descriptive title (max 80 chars)\ntitle: 'Your WU title here'\n\n# Required: Lane (Parent: Sublane format)\nlane: 'Framework: CLI'\n\n# Required: Type of work\ntype: 'feature' # feature | bug | documentation | process | tooling | chore | refactor\n\n# Required: Current status\nstatus: 'ready' # ready | in_progress | blocked | done | cancelled\n\n# Required: Priority\npriority: P2 # P0 | P1 | P2 | P3\n\n# Required: Creation date (YYYY-MM-DD)\ncreated: {{DATE}}\n\n# Required: Owner/assignee (email)\nassigned_to: 'unassigned@example.com'\n\n# Required: Description\ndescription: |\n Context: ...\n Problem: ...\n Solution: ...\n\n# Required: Acceptance criteria (testable, binary)\nacceptance:\n - Criterion 1 (specific, measurable, testable)\n - Criterion 2 (binary pass/fail)\n - Documentation updated\n\n# Required: References to plans/specs (required for type: feature)\nspec_refs:\n - docs/04-operations/plans/WU-XXX-plan.md\n\n# Required: Code files changed or created (empty only for docs/process WUs)\ncode_paths:\n - path/to/file.ts\n\n# Required: Test paths (at least one of manual/unit/e2e/integration for non-doc WUs)\ntests:\n manual:\n - Manual test: Verify behavior\n unit:\n - path/to/test.test.ts\n e2e: []\n integration: []\n\n# Required: Exposure level\nexposure: 'backend-only' # ui | api | backend-only | documentation\n\n# Optional: User journey (recommended for ui/api)\n# user_journey: |\n# User navigates to ...\n# User performs ...\n\n# Optional: UI pairing WUs (for api exposure)\n# ui_pairing_wus:\n# - WU-1234\n\n# Optional: Navigation path (required when exposure=ui and no page file)\n# navigation_path: '/settings'\n\n# Required: Deliverable artifacts (stamps, docs, etc.)\nartifacts:\n - .beacon/stamps/WU-XXX.done\n\n# Optional: Dependencies (other WUs that must complete first)\ndependencies: []\n\n# Optional: Risks\nrisks:\n - Risk 1\n\n# Optional: Notes\nnotes: ''\n\n# Optional: Requires human review\nrequires_review: false\n\n# Optional: Claimed mode (worktree or branch-only)\n# Automatically set by wu:claim, usually don't need to specify\n# claimed_mode: worktree\n\n# Optional: Assigned to (email of current claimant)\n# Automatically set by wu:claim\n# assigned_to: engineer@example.com\n\n# Optional: Locked status (prevents concurrent edits)\n# Automatically set by wu:claim and wu:done\n# locked: false\n\n# Optional: Completion date (ISO 8601 format)\n# Automatically set by wu:done\n# completed: 2025-10-23\n\n# Optional: Completion notes (added by wu:done)\n# completion_notes: |\n# Additional notes added during wu:done.\n# Any deviations from original plan.\n# Lessons learned.\n\n# ============================================================================\n# GOVERNANCE BLOCK (WU Schema v2.0)\n# ============================================================================\n# Optional: COS governance rules that apply to this WU\n# Only include if this WU needs specific governance enforcement\n\n# governance:\n# # Rules that apply to this WU (evaluated during cos:gates)\n# rules:\n# - rule_id: UPAIN-01\n# satisfied: false # Initially false, set true when evidence provided\n# evidence:\n# - type: link\n# value: docs/product/voc/feature-user-pain.md\n# description: "Voice of Customer analysis showing user pain"\n# notes: |\n# VOC analysis shows 40% of support tickets request this feature.\n# Average time wasted: 15min/user/week.\n#\n# - rule_id: CASH-03\n# satisfied: false\n# evidence:\n# - type: link\n# value: docs/finance/spend-reviews/2025-10-cloud-infra.md\n# description: "Spend review for £1200/month cloud infrastructure"\n# - type: approval\n# value: owner@example.com\n# description: "Owner approval for spend commitment"\n# notes: |\n# New cloud infrastructure commitment: £1200/month for 12 months.\n# ROI: Reduces latency by 50%, improves user retention.\n#\n# # Gate checks (enforced by cos-gates.mjs)\n# gates:\n# narrative: "pending" # Status: pending, passed, skipped, failed\n# finance: "pending"\n#\n# # Exemptions (only if rule doesn't apply)\n# exemptions:\n# - rule_id: FAIR-01\n# reason: "No user-facing pricing changes in this WU"\n# approved_by: product-owner@example.com\n# approved_at: 2025-10-23\n\n# ============================================================================\n# USAGE NOTES\n# ============================================================================\n#\n# 1. Remove this entire governance block if no COS rules apply to your WU\n# 2. Only include rules that require enforcement (not all rules apply to all WUs)\n# 3. Evidence types: link:, metric:, screenshot:, approval:\n# 4. Gates are checked during wu:done (before merge)\n# 5. Exemptions require approval from rule owner\n#\n# For more details, see:\n# - docs/04-operations/_frameworks/cos/system-prompt-v1.3.md\n# - docs/04-operations/_frameworks/cos/evidence-format.md\n`;
116
+ const WU_TEMPLATE_YAML = `# Work Unit Template (LumenFlow WU Schema)\n#\n# Copy this template when creating new WUs. Fill in all required fields and\n# remove optional fields if not needed.\n#\n# If you used "lumenflow init --full", this template lives at:\n# docs/04-operations/tasks/templates/wu-template.yaml\n\n# Required: Unique work unit identifier (format: WU-NNN)\nid: WU-XXX\n\n# Required: Short, descriptive title (max 80 chars)\ntitle: 'Your WU title here'\n\n# Required: Lane (Parent: Sublane format)\nlane: 'Framework: CLI'\n\n# Required: Type of work\ntype: 'feature' # feature | bug | documentation | process | tooling | chore | refactor\n\n# Required: Current status\nstatus: 'ready' # ready | in_progress | blocked | done | cancelled\n\n# Required: Priority\npriority: P2 # P0 | P1 | P2 | P3\n\n# Required: Creation date (YYYY-MM-DD)\ncreated: {{DATE}}\n\n# Required: Owner/assignee (email)\nassigned_to: 'unassigned@example.com'\n\n# Required: Description\ndescription: |\n Context: ...\n Problem: ...\n Solution: ...\n\n# Required: Acceptance criteria (testable, binary)\nacceptance:\n - Criterion 1 (specific, measurable, testable)\n - Criterion 2 (binary pass/fail)\n - Documentation updated\n\n# Required: References to plans/specs (required for type: feature)\nspec_refs:\n - docs/04-operations/plans/WU-XXX-plan.md\n\n# Required: Code files changed or created (empty only for docs/process WUs)\ncode_paths:\n - path/to/file.ts\n\n# Required: Test paths (at least one of manual/unit/e2e/integration for non-doc WUs)\ntests:\n manual:\n - Manual test: Verify behavior\n unit:\n - path/to/test.test.ts\n e2e: []\n integration: []\n\n# Required: Exposure level\nexposure: 'backend-only' # ui | api | backend-only | documentation\n\n# Optional: User journey (recommended for ui/api)\n# user_journey: |\n# User navigates to ...\n# User performs ...\n\n# Optional: UI pairing WUs (for api exposure)\n# ui_pairing_wus:\n# - WU-1234\n\n# Optional: Navigation path (required when exposure=ui and no page file)\n# navigation_path: '/settings'\n\n# Required: Deliverable artifacts (stamps, docs, etc.)\nartifacts:\n - .lumenflow/stamps/WU-XXX.done\n\n# Optional: Dependencies (other WUs that must complete first)\ndependencies: []\n\n# Optional: Risks\nrisks:\n - Risk 1\n\n# Optional: Notes\nnotes: ''\n\n# Optional: Requires human review\nrequires_review: false\n\n# Optional: Claimed mode (worktree or branch-only)\n# Automatically set by wu:claim, usually don't need to specify\n# claimed_mode: worktree\n\n# Optional: Assigned to (email of current claimant)\n# Automatically set by wu:claim\n# assigned_to: engineer@example.com\n\n# Optional: Locked status (prevents concurrent edits)\n# Automatically set by wu:claim and wu:done\n# locked: false\n\n# Optional: Completion date (ISO 8601 format)\n# Automatically set by wu:done\n# completed: 2025-10-23\n\n# Optional: Completion notes (added by wu:done)\n# completion_notes: |\n# Additional notes added during wu:done.\n# Any deviations from original plan.\n# Lessons learned.\n\n# ============================================================================\n# GOVERNANCE BLOCK (WU Schema v2.0)\n# ============================================================================\n# Optional: COS governance rules that apply to this WU\n# Only include if this WU needs specific governance enforcement\n\n# governance:\n# # Rules that apply to this WU (evaluated during cos:gates)\n# rules:\n# - rule_id: UPAIN-01\n# satisfied: false # Initially false, set true when evidence provided\n# evidence:\n# - type: link\n# value: docs/product/voc/feature-user-pain.md\n# description: "Voice of Customer analysis showing user pain"\n# notes: |\n# VOC analysis shows 40% of support tickets request this feature.\n# Average time wasted: 15min/user/week.\n#\n# - rule_id: CASH-03\n# satisfied: false\n# evidence:\n# - type: link\n# value: docs/finance/spend-reviews/2025-10-cloud-infra.md\n# description: "Spend review for £1200/month cloud infrastructure"\n# - type: approval\n# value: owner@example.com\n# description: "Owner approval for spend commitment"\n# notes: |\n# New cloud infrastructure commitment: £1200/month for 12 months.\n# ROI: Reduces latency by 50%, improves user retention.\n#\n# # Gate checks (enforced by cos-gates.mjs)\n# gates:\n# narrative: "pending" # Status: pending, passed, skipped, failed\n# finance: "pending"\n#\n# # Exemptions (only if rule doesn't apply)\n# exemptions:\n# - rule_id: FAIR-01\n# reason: "No user-facing pricing changes in this WU"\n# approved_by: product-owner@example.com\n# approved_at: 2025-10-23\n\n# ============================================================================\n# USAGE NOTES\n# ============================================================================\n#\n# 1. Remove this entire governance block if no COS rules apply to your WU\n# 2. Only include rules that require enforcement (not all rules apply to all WUs)\n# 3. Evidence types: link:, metric:, screenshot:, approval:\n# 4. Gates are checked during wu:done (before merge)\n# 5. Exemptions require approval from rule owner\n#\n# For more details, see:\n# - docs/04-operations/_frameworks/cos/system-prompt-v1.3.md\n# - docs/04-operations/_frameworks/cos/evidence-format.md\n`;
117
117
  // Template for .lumenflow.framework.yaml
118
118
  const FRAMEWORK_HINT_TEMPLATE = `# LumenFlow Framework Hint\n# Generated by: lumenflow init --framework {{FRAMEWORK_NAME}}\n\nframework: "{{FRAMEWORK_NAME}}"\nslug: "{{FRAMEWORK_SLUG}}"\n`;
119
119
  // Template for docs/04-operations/_frameworks/<framework>/README.md
@@ -5,7 +5,7 @@
5
5
  * Create a checkpoint node for context snapshots.
6
6
  * Used before /clear or session handoff to preserve progress state.
7
7
  *
8
- * Includes audit logging to .beacon/telemetry/tools.ndjson.
8
+ * Includes audit logging to .lumenflow/telemetry/tools.ndjson.
9
9
  *
10
10
  * Usage:
11
11
  * pnpm mem:checkpoint 'note' [--session <id>] [--wu <id>] [--progress <text>] [--next-steps <text>] [--trigger <type>] [--quiet]
@@ -17,7 +17,7 @@ import fs from 'node:fs/promises';
17
17
  import path from 'node:path';
18
18
  import { createCheckpoint } from '@lumenflow/memory/dist/mem-checkpoint-core.js';
19
19
  import { createWUParser, WU_OPTIONS } from '@lumenflow/core/dist/arg-parser.js';
20
- import { EXIT_CODES } from '@lumenflow/core/dist/wu-constants.js';
20
+ import { EXIT_CODES, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
21
21
  /**
22
22
  * Log prefix for mem:checkpoint output
23
23
  */
@@ -26,10 +26,6 @@ const LOG_PREFIX = '[mem:checkpoint]';
26
26
  * Tool name for audit logging
27
27
  */
28
28
  const TOOL_NAME = 'mem:checkpoint';
29
- /**
30
- * Audit log file path
31
- */
32
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
33
29
  /**
34
30
  * CLI argument options specific to mem:checkpoint
35
31
  */
@@ -78,7 +74,7 @@ const CLI_OPTIONS = {
78
74
  */
79
75
  async function writeAuditLog(baseDir, entry) {
80
76
  try {
81
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
77
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
82
78
  const logDir = path.dirname(logPath);
83
79
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory
84
80
  await fs.mkdir(logDir, { recursive: true });
@@ -30,7 +30,7 @@ import fs from 'node:fs/promises';
30
30
  import path from 'node:path';
31
31
  import { cleanupMemory } from '@lumenflow/memory/dist/mem-cleanup-core.js';
32
32
  import { createWUParser } from '@lumenflow/core/dist/arg-parser.js';
33
- import { EXIT_CODES } from '@lumenflow/core/dist/wu-constants.js';
33
+ import { EXIT_CODES, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
34
34
  /**
35
35
  * Log prefix for mem:cleanup output
36
36
  */
@@ -39,10 +39,6 @@ const LOG_PREFIX = '[mem:cleanup]';
39
39
  * Tool name for audit logging
40
40
  */
41
41
  const TOOL_NAME = 'mem:cleanup';
42
- /**
43
- * Audit log file path
44
- */
45
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
46
42
  /**
47
43
  * Bytes per KB for formatting
48
44
  */
@@ -90,7 +86,7 @@ const CLI_OPTIONS = {
90
86
  */
91
87
  async function writeAuditLog(baseDir, entry) {
92
88
  try {
93
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
89
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
94
90
  const logDir = path.dirname(logPath);
95
91
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory
96
92
  await fs.mkdir(logDir, { recursive: true });
@@ -6,7 +6,7 @@
6
6
  * KEY DIFFERENTIATOR: supports discovered-from relationship for scope-creep
7
7
  * forensics. Creates audit trail of WHY work expanded, not just WHAT changed.
8
8
  *
9
- * Includes audit logging to .beacon/telemetry/tools.ndjson.
9
+ * Includes audit logging to .lumenflow/telemetry/tools.ndjson.
10
10
  *
11
11
  * Usage:
12
12
  * pnpm mem:create 'title' [--type <type>] [--discovered-from <id>] [--wu <id>] [--quiet]
@@ -18,7 +18,7 @@ import fs from 'node:fs/promises';
18
18
  import path from 'node:path';
19
19
  import { createMemoryNode } from '@lumenflow/memory/dist/mem-create-core.js';
20
20
  import { createWUParser, WU_OPTIONS } from '@lumenflow/core/dist/arg-parser.js';
21
- import { EXIT_CODES } from '@lumenflow/core/dist/wu-constants.js';
21
+ import { EXIT_CODES, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
22
22
  import { MEMORY_NODE_TYPES } from '@lumenflow/memory/dist/memory-schema.js';
23
23
  /**
24
24
  * Log prefix for mem:create output
@@ -28,10 +28,6 @@ const LOG_PREFIX = '[mem:create]';
28
28
  * Tool name for audit logging
29
29
  */
30
30
  const TOOL_NAME = 'mem:create';
31
- /**
32
- * Audit log file path
33
- */
34
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
35
31
  /**
36
32
  * CLI argument options specific to mem:create
37
33
  */
@@ -85,7 +81,7 @@ const CLI_OPTIONS = {
85
81
  */
86
82
  async function writeAuditLog(baseDir, entry) {
87
83
  try {
88
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
84
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
89
85
  const logDir = path.dirname(logPath);
90
86
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory
91
87
  await fs.mkdir(logDir, { recursive: true });
package/dist/mem-inbox.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * of parallel agent progress. Filter by lane, WU, or time range.
7
7
  * Supports watch mode for continuous monitoring.
8
8
  *
9
- * Includes audit logging to .beacon/telemetry/tools.ndjson.
9
+ * Includes audit logging to .lumenflow/telemetry/tools.ndjson.
10
10
  *
11
11
  * WU-2202: Added dependency validation before operations to prevent silent
12
12
  * failures when node_modules is corrupted or incomplete.
@@ -22,7 +22,7 @@ import path from 'node:path';
22
22
  import ms from 'ms';
23
23
  import { loadSignals, markSignalsAsRead } from '@lumenflow/memory/dist/mem-signal-core.js';
24
24
  import { createWUParser, WU_OPTIONS } from '@lumenflow/core/dist/arg-parser.js';
25
- import { EXIT_CODES } from '@lumenflow/core/dist/wu-constants.js';
25
+ import { EXIT_CODES, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
26
26
  import { validateInboxDependencies, formatDependencyError, } from '@lumenflow/core/dist/dependency-validator.js';
27
27
  /**
28
28
  * Log prefix for mem:inbox output
@@ -32,10 +32,6 @@ const LOG_PREFIX = '[mem:inbox]';
32
32
  * Tool name for audit logging
33
33
  */
34
34
  const TOOL_NAME = 'mem:inbox';
35
- /**
36
- * Audit log file path
37
- */
38
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
39
35
  /**
40
36
  * Watch mode polling interval in milliseconds
41
37
  */
@@ -79,7 +75,7 @@ const CLI_OPTIONS = {
79
75
  */
80
76
  async function writeAuditLog(baseDir, entry) {
81
77
  try {
82
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
78
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
83
79
  const logDir = path.dirname(logPath);
84
80
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory
85
81
  await fs.mkdir(logDir, { recursive: true });
package/dist/mem-init.js CHANGED
@@ -3,9 +3,9 @@
3
3
  * Memory Init CLI (WU-1464)
4
4
  *
5
5
  * Initialize memory layer in the repository.
6
- * Creates .beacon/memory/ directory with memory.jsonl and config.yaml.
6
+ * Creates .lumenflow/memory/ directory with memory.jsonl and config.yaml.
7
7
  *
8
- * Includes audit logging to .beacon/telemetry/tools.ndjson.
8
+ * Includes audit logging to .lumenflow/telemetry/tools.ndjson.
9
9
  *
10
10
  * Usage:
11
11
  * pnpm mem:init [--base-dir <path>] [--quiet]
@@ -16,7 +16,7 @@ import fs from 'node:fs/promises';
16
16
  import path from 'node:path';
17
17
  import { initMemory } from '@lumenflow/memory/dist/mem-init-core.js';
18
18
  import { createWUParser } from '@lumenflow/core/dist/arg-parser.js';
19
- import { EXIT_CODES, STRING_LITERALS } from '@lumenflow/core/dist/wu-constants.js';
19
+ import { EXIT_CODES, STRING_LITERALS, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
20
20
  /**
21
21
  * Log prefix for mem:init output
22
22
  */
@@ -25,10 +25,6 @@ const LOG_PREFIX = '[mem:init]';
25
25
  * Tool name for audit logging
26
26
  */
27
27
  const TOOL_NAME = 'mem:init';
28
- /**
29
- * Audit log file path
30
- */
31
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
32
28
  /**
33
29
  * Write audit log entry for tool execution
34
30
  *
@@ -37,7 +33,7 @@ const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
37
33
  */
38
34
  async function writeAuditLog(baseDir, entry) {
39
35
  try {
40
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
36
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
41
37
  const logDir = path.dirname(logPath);
42
38
  // Ensure telemetry directory exists
43
39
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory
@@ -129,7 +125,7 @@ async function main() {
129
125
  console.log('');
130
126
  console.log('Created:');
131
127
  if (result.created.directory) {
132
- console.log(' - .beacon/memory/ directory');
128
+ console.log(' - .lumenflow/memory/ directory');
133
129
  }
134
130
  if (result.created.memoryJsonl) {
135
131
  console.log(' - memory.jsonl (empty)');
package/dist/mem-ready.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * Usage:
9
9
  * pnpm mem:ready --wu WU-1234 [--type <type>] [--format <json|human>] [--quiet]
10
10
  *
11
- * Includes audit logging to .beacon/telemetry/tools.ndjson.
11
+ * Includes audit logging to .lumenflow/telemetry/tools.ndjson.
12
12
  *
13
13
  * @see {@link tools/lib/mem-ready-core.mjs} - Core logic
14
14
  * @see {@link tools/__tests__/mem-ready.test.mjs} - Tests
@@ -17,7 +17,7 @@ import fs from 'node:fs/promises';
17
17
  import path from 'node:path';
18
18
  import { queryReadyNodes } from '@lumenflow/memory/dist/mem-ready-core.js';
19
19
  import { createWUParser, WU_OPTIONS } from '@lumenflow/core/dist/arg-parser.js';
20
- import { EXIT_CODES } from '@lumenflow/core/dist/wu-constants.js';
20
+ import { EXIT_CODES, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
21
21
  import { MEMORY_NODE_TYPES } from '@lumenflow/memory/dist/memory-schema.js';
22
22
  /**
23
23
  * Log prefix for mem:ready output
@@ -27,10 +27,6 @@ const LOG_PREFIX = '[mem:ready]';
27
27
  * Tool name for audit logging
28
28
  */
29
29
  const TOOL_NAME = 'mem:ready';
30
- /**
31
- * Audit log file path
32
- */
33
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
34
30
  /**
35
31
  * CLI argument options specific to mem:ready
36
32
  */
@@ -64,7 +60,7 @@ const CLI_OPTIONS = {
64
60
  */
65
61
  async function writeAuditLog(baseDir, entry) {
66
62
  try {
67
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
63
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
68
64
  const logDir = path.dirname(logPath);
69
65
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory
70
66
  await fs.mkdir(logDir, { recursive: true });
@@ -5,7 +5,7 @@
5
5
  * Send coordination signals between parallel agents for sub-100ms
6
6
  * multi-agent swarm coordination without git sync latency.
7
7
  *
8
- * Includes audit logging to .beacon/telemetry/tools.ndjson.
8
+ * Includes audit logging to .lumenflow/telemetry/tools.ndjson.
9
9
  *
10
10
  * Usage:
11
11
  * pnpm mem:signal 'message' [--wu <id>] [--lane <name>] [--quiet]
@@ -17,7 +17,7 @@ import fs from 'node:fs/promises';
17
17
  import path from 'node:path';
18
18
  import { createSignal } from '@lumenflow/memory/dist/mem-signal-core.js';
19
19
  import { createWUParser, WU_OPTIONS } from '@lumenflow/core/dist/arg-parser.js';
20
- import { EXIT_CODES } from '@lumenflow/core/dist/wu-constants.js';
20
+ import { EXIT_CODES, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
21
21
  /**
22
22
  * Log prefix for mem:signal output
23
23
  */
@@ -26,10 +26,6 @@ const LOG_PREFIX = '[mem:signal]';
26
26
  * Tool name for audit logging
27
27
  */
28
28
  const TOOL_NAME = 'mem:signal';
29
- /**
30
- * Audit log file path
31
- */
32
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
33
29
  /**
34
30
  * CLI argument options specific to mem:signal
35
31
  */
@@ -53,7 +49,7 @@ const CLI_OPTIONS = {
53
49
  */
54
50
  async function writeAuditLog(baseDir, entry) {
55
51
  try {
56
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
52
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
57
53
  const logDir = path.dirname(logPath);
58
54
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory
59
55
  await fs.mkdir(logDir, { recursive: true });
package/dist/mem-start.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Create a session node linked to a WU.
6
6
  * Called by wu:claim enhancement for context restoration after /clear.
7
7
  *
8
- * Includes audit logging to .beacon/telemetry/tools.ndjson.
8
+ * Includes audit logging to .lumenflow/telemetry/tools.ndjson.
9
9
  *
10
10
  * Usage:
11
11
  * pnpm mem:start --wu WU-1234 [--agent-type <type>] [--context-tier <tier>] [--quiet]
@@ -17,7 +17,7 @@ import fs from 'node:fs/promises';
17
17
  import path from 'node:path';
18
18
  import { startSession } from '@lumenflow/memory/dist/mem-start-core.js';
19
19
  import { createWUParser, WU_OPTIONS } from '@lumenflow/core/dist/arg-parser.js';
20
- import { EXIT_CODES } from '@lumenflow/core/dist/wu-constants.js';
20
+ import { EXIT_CODES, LUMENFLOW_PATHS } from '@lumenflow/core/dist/wu-constants.js';
21
21
  /**
22
22
  * Log prefix for mem:start output
23
23
  */
@@ -26,10 +26,6 @@ const LOG_PREFIX = '[mem:start]';
26
26
  * Tool name for audit logging
27
27
  */
28
28
  const TOOL_NAME = 'mem:start';
29
- /**
30
- * Audit log file path
31
- */
32
- const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
33
29
  /**
34
30
  * Write audit log entry for tool execution
35
31
  *
@@ -38,7 +34,7 @@ const AUDIT_LOG_PATH = '.beacon/telemetry/tools.ndjson';
38
34
  */
39
35
  async function writeAuditLog(baseDir, entry) {
40
36
  try {
41
- const logPath = path.join(baseDir, AUDIT_LOG_PATH);
37
+ const logPath = path.join(baseDir, LUMENFLOW_PATHS.AUDIT_LOG);
42
38
  const logDir = path.dirname(logPath);
43
39
  // Ensure telemetry directory exists
44
40
  // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI tool creates known directory