@lumenflow/cli 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -35
- package/dist/agent-issues-query.js +13 -8
- package/dist/agent-log-issue.js +15 -4
- package/dist/agent-session-end.js +15 -4
- package/dist/agent-session.js +18 -6
- package/dist/backlog-prune.js +1 -1
- package/dist/commands/integrate.js +32 -18
- package/dist/config-get.js +27 -15
- package/dist/config-set.js +104 -37
- package/dist/delegation-list.js +1 -1
- package/dist/doctor.js +19 -13
- package/dist/file-delete.js +1 -1
- package/dist/file-edit.js +1 -1
- package/dist/file-read.js +1 -1
- package/dist/file-write.js +1 -1
- package/dist/flow-bottlenecks.js +1 -1
- package/dist/flow-report.js +10 -9
- package/dist/gates.js +3 -2
- package/dist/git-branch.js +1 -1
- package/dist/git-diff.js +1 -1
- package/dist/git-log.js +1 -1
- package/dist/init.js +238 -42
- package/dist/initiative-add-wu.js +1 -1
- package/dist/initiative-bulk-assign-wus.js +1 -1
- package/dist/initiative-create.js +2 -2
- package/dist/initiative-edit.js +1 -1
- package/dist/initiative-list.js +1 -1
- package/dist/initiative-plan.js +1 -3
- package/dist/initiative-status.js +47 -6
- package/dist/lane-edit.js +19 -10
- package/dist/lane-health.js +13 -24
- package/dist/lane-lock.js +4 -5
- package/dist/lane-setup.js +5 -5
- package/dist/lane-status.js +4 -5
- package/dist/lane-suggest.js +9 -7
- package/dist/lane-validate.js +4 -5
- package/dist/lumenflow-upgrade.js +17 -11
- package/dist/mem-checkpoint.js +1 -1
- package/dist/mem-cleanup.js +6 -23
- package/dist/mem-context.js +1 -1
- package/dist/mem-create.js +1 -1
- package/dist/mem-delete.js +1 -1
- package/dist/mem-export.js +1 -1
- package/dist/mem-inbox.js +1 -1
- package/dist/mem-init.js +1 -1
- package/dist/mem-ready.js +1 -1
- package/dist/mem-recover.js +1 -1
- package/dist/mem-signal.js +1 -1
- package/dist/mem-start.js +1 -1
- package/dist/mem-summarize.js +8 -7
- package/dist/mem-triage.js +7 -5
- package/dist/metrics-cli.js +1 -1
- package/dist/metrics-snapshot.js +1 -1
- package/dist/onboard.js +295 -120
- package/dist/orchestrate-init-status.js +12 -7
- package/dist/orchestrate-initiative.js +23 -12
- package/dist/orchestrate-monitor.js +20 -8
- package/dist/pack-scaffold.js +1 -1
- package/dist/plan-create.js +1 -3
- package/dist/plan-edit.js +1 -3
- package/dist/plan-link.js +1 -3
- package/dist/plan-promote.js +1 -3
- package/dist/release.js +27 -10
- package/dist/signal-cleanup.js +4 -18
- package/dist/state-bootstrap.js +11 -8
- package/dist/state-cleanup.js +5 -19
- package/dist/state-doctor.js +213 -9
- package/dist/task-claim.js +1 -1
- package/dist/validate.js +1 -1
- package/dist/workspace-init.js +61 -61
- package/dist/wu-block.js +1 -1
- package/dist/wu-brief.js +1 -1
- package/dist/wu-claim.js +1 -1
- package/dist/wu-cleanup.js +1 -1
- package/dist/wu-create.js +3 -3
- package/dist/wu-delegate.js +1 -1
- package/dist/wu-deps.js +1 -1
- package/dist/wu-done.js +66 -34
- package/dist/wu-edit.js +1 -1
- package/dist/wu-infer-lane.js +1 -1
- package/dist/wu-preflight.js +1 -1
- package/dist/wu-prep.js +1 -1
- package/dist/wu-proto.js +1 -1
- package/dist/wu-prune.js +1 -1
- package/dist/wu-recover.js +1 -1
- package/dist/wu-release.js +1 -1
- package/dist/wu-repair.js +1 -1
- package/dist/wu-sandbox.js +40 -27
- package/dist/wu-status.js +1 -1
- package/dist/wu-unblock.js +1 -1
- package/dist/wu-unlock-lane.js +1 -1
- package/dist/wu-validate.js +1 -1
- package/package.json +13 -8
- package/packs/software-delivery/constants.ts +10 -0
- package/packs/software-delivery/extensions.ts +140 -0
- package/packs/software-delivery/gate-policies.ts +134 -0
- package/packs/software-delivery/index.ts +8 -0
- package/packs/software-delivery/manifest-schema.ts +236 -0
- package/packs/software-delivery/manifest.ts +417 -0
- package/packs/software-delivery/manifest.yaml +711 -0
- package/packs/software-delivery/pack-registration.ts +113 -0
- package/packs/software-delivery/tool-impl/agent-tools.ts +263 -0
- package/packs/software-delivery/tool-impl/delegation-tools.ts +66 -0
- package/packs/software-delivery/tool-impl/flow-metrics-tools.ts +219 -0
- package/packs/software-delivery/tool-impl/git-runner.ts +113 -0
- package/packs/software-delivery/tool-impl/git-tools.ts +316 -0
- package/packs/software-delivery/tool-impl/index.ts +15 -0
- package/packs/software-delivery/tool-impl/initiative-orchestration-tools.ts +720 -0
- package/packs/software-delivery/tool-impl/lane-lock.ts +246 -0
- package/packs/software-delivery/tool-impl/memory-tools.ts +415 -0
- package/packs/software-delivery/tool-impl/pending-runtime-tools.ts +21 -0
- package/packs/software-delivery/tool-impl/runtime-cli-adapter.ts +328 -0
- package/packs/software-delivery/tool-impl/runtime-native-tools.ts +687 -0
- package/packs/software-delivery/tool-impl/worker-loader.ts +52 -0
- package/packs/software-delivery/tool-impl/worktree-tools.ts +46 -0
- package/packs/software-delivery/tool-impl/wu-lifecycle-tools.ts +759 -0
- package/packs/software-delivery/tools/delegation-tools.ts +23 -0
- package/packs/software-delivery/tools/git-tools.ts +55 -0
- package/packs/software-delivery/tools/index.ts +8 -0
- package/packs/software-delivery/tools/lane-lock-tool.ts +37 -0
- package/packs/software-delivery/tools/types.ts +71 -0
- package/packs/software-delivery/tools/worktree-tools.ts +49 -0
- package/templates/core/LUMENFLOW.md.template +3 -3
- package/templates/core/ai/onboarding/agent-invocation-guide.md.template +1 -1
- package/templates/core/ai/onboarding/lumenflow-force-usage.md.template +1 -1
- package/templates/core/ai/onboarding/quick-ref-commands.md.template +5 -5
- package/templates/core/ai/onboarding/starting-prompt.md.template +3 -3
- package/templates/core/ai/onboarding/vendor-support.md.template +1 -1
- package/templates/core/ai/onboarding/wu-create-checklist.md.template +1 -1
- package/dist/agent-issues-query.js.map +0 -1
- package/dist/agent-log-issue.js.map +0 -1
- package/dist/agent-session-end.js.map +0 -1
- package/dist/agent-session.js.map +0 -1
- package/dist/backlog-prune.js.map +0 -1
- package/dist/cli-entry-point.js +0 -149
- package/dist/cli-entry-point.js.map +0 -1
- package/dist/commands/integrate.js.map +0 -1
- package/dist/commands.js.map +0 -1
- package/dist/config-get.js.map +0 -1
- package/dist/config-set.js.map +0 -1
- package/dist/delegation-list.js.map +0 -1
- package/dist/deps-add.js +0 -259
- package/dist/deps-add.js.map +0 -1
- package/dist/deps-remove.js +0 -105
- package/dist/deps-remove.js.map +0 -1
- package/dist/docs-sync.js.map +0 -1
- package/dist/doctor.js.map +0 -1
- package/dist/file-delete.js.map +0 -1
- package/dist/file-edit.js.map +0 -1
- package/dist/file-read.js.map +0 -1
- package/dist/file-write.js.map +0 -1
- package/dist/flow-bottlenecks.js.map +0 -1
- package/dist/flow-report.js.map +0 -1
- package/dist/formatters.js +0 -151
- package/dist/formatters.js.map +0 -1
- package/dist/gate-defaults.js +0 -131
- package/dist/gate-defaults.js.map +0 -1
- package/dist/gate-registry.js +0 -73
- package/dist/gate-registry.js.map +0 -1
- package/dist/gates-graceful-degradation.js +0 -153
- package/dist/gates-graceful-degradation.js.map +0 -1
- package/dist/gates-plan-resolvers.js +0 -152
- package/dist/gates-plan-resolvers.js.map +0 -1
- package/dist/gates-runners.js +0 -509
- package/dist/gates-runners.js.map +0 -1
- package/dist/gates-types.js +0 -4
- package/dist/gates-types.js.map +0 -1
- package/dist/gates-utils.js +0 -323
- package/dist/gates-utils.js.map +0 -1
- package/dist/gates.js.map +0 -1
- package/dist/git-branch.js.map +0 -1
- package/dist/git-diff.js.map +0 -1
- package/dist/git-log.js.map +0 -1
- package/dist/git-status.js.map +0 -1
- package/dist/guard-locked.js +0 -172
- package/dist/guard-locked.js.map +0 -1
- package/dist/guard-main-branch.js +0 -217
- package/dist/guard-main-branch.js.map +0 -1
- package/dist/guard-worktree-commit.js +0 -163
- package/dist/guard-worktree-commit.js.map +0 -1
- package/dist/hooks/auto-checkpoint-utils.js +0 -54
- package/dist/hooks/auto-checkpoint-utils.js.map +0 -1
- package/dist/hooks/enforcement-checks.js +0 -399
- package/dist/hooks/enforcement-checks.js.map +0 -1
- package/dist/hooks/enforcement-generator.js +0 -139
- package/dist/hooks/enforcement-generator.js.map +0 -1
- package/dist/hooks/enforcement-sync.js +0 -385
- package/dist/hooks/enforcement-sync.js.map +0 -1
- package/dist/hooks/generators/auto-checkpoint.js +0 -125
- package/dist/hooks/generators/auto-checkpoint.js.map +0 -1
- package/dist/hooks/generators/enforce-worktree.js +0 -190
- package/dist/hooks/generators/enforce-worktree.js.map +0 -1
- package/dist/hooks/generators/index.js +0 -18
- package/dist/hooks/generators/index.js.map +0 -1
- package/dist/hooks/generators/pre-compact-checkpoint.js +0 -136
- package/dist/hooks/generators/pre-compact-checkpoint.js.map +0 -1
- package/dist/hooks/generators/require-wu.js +0 -117
- package/dist/hooks/generators/require-wu.js.map +0 -1
- package/dist/hooks/generators/session-start-recovery.js +0 -103
- package/dist/hooks/generators/session-start-recovery.js.map +0 -1
- package/dist/hooks/generators/signal-utils.js +0 -54
- package/dist/hooks/generators/signal-utils.js.map +0 -1
- package/dist/hooks/generators/warn-incomplete.js +0 -67
- package/dist/hooks/generators/warn-incomplete.js.map +0 -1
- package/dist/hooks/index.js +0 -10
- package/dist/hooks/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init-detection.js +0 -232
- package/dist/init-detection.js.map +0 -1
- package/dist/init-lane-validation.js +0 -143
- package/dist/init-lane-validation.js.map +0 -1
- package/dist/init-scaffolding.js +0 -158
- package/dist/init-scaffolding.js.map +0 -1
- package/dist/init-templates.js +0 -1982
- package/dist/init-templates.js.map +0 -1
- package/dist/init.js.map +0 -1
- package/dist/initiative-add-wu.js.map +0 -1
- package/dist/initiative-bulk-assign-wus.js.map +0 -1
- package/dist/initiative-create.js.map +0 -1
- package/dist/initiative-edit.js.map +0 -1
- package/dist/initiative-list.js.map +0 -1
- package/dist/initiative-plan.js.map +0 -1
- package/dist/initiative-remove-wu.js.map +0 -1
- package/dist/initiative-status.js.map +0 -1
- package/dist/lane-edit.js.map +0 -1
- package/dist/lane-health.js.map +0 -1
- package/dist/lane-lifecycle-process.js +0 -366
- package/dist/lane-lifecycle-process.js.map +0 -1
- package/dist/lane-lock.js.map +0 -1
- package/dist/lane-setup.js.map +0 -1
- package/dist/lane-status.js.map +0 -1
- package/dist/lane-suggest.js.map +0 -1
- package/dist/lane-validate.js.map +0 -1
- package/dist/lifecycle-regression-harness.js +0 -181
- package/dist/lifecycle-regression-harness.js.map +0 -1
- package/dist/lumenflow-upgrade.js.map +0 -1
- package/dist/mem-checkpoint.js.map +0 -1
- package/dist/mem-cleanup.js.map +0 -1
- package/dist/mem-context.js.map +0 -1
- package/dist/mem-create.js.map +0 -1
- package/dist/mem-delete.js.map +0 -1
- package/dist/mem-export.js.map +0 -1
- package/dist/mem-inbox.js.map +0 -1
- package/dist/mem-index.js +0 -214
- package/dist/mem-index.js.map +0 -1
- package/dist/mem-init.js.map +0 -1
- package/dist/mem-profile.js +0 -210
- package/dist/mem-profile.js.map +0 -1
- package/dist/mem-promote.js +0 -257
- package/dist/mem-promote.js.map +0 -1
- package/dist/mem-ready.js.map +0 -1
- package/dist/mem-recover.js.map +0 -1
- package/dist/mem-signal.js.map +0 -1
- package/dist/mem-start.js.map +0 -1
- package/dist/mem-summarize.js.map +0 -1
- package/dist/mem-triage.js.map +0 -1
- package/dist/merge-block.js +0 -225
- package/dist/merge-block.js.map +0 -1
- package/dist/metrics-cli.js.map +0 -1
- package/dist/metrics-snapshot.js.map +0 -1
- package/dist/onboard.js.map +0 -1
- package/dist/onboarding-smoke-test.js +0 -418
- package/dist/onboarding-smoke-test.js.map +0 -1
- package/dist/orchestrate-init-status.js.map +0 -1
- package/dist/orchestrate-initiative.js.map +0 -1
- package/dist/orchestrate-monitor.js.map +0 -1
- package/dist/pack-author.js.map +0 -1
- package/dist/pack-hash.js.map +0 -1
- package/dist/pack-install.js.map +0 -1
- package/dist/pack-publish.js.map +0 -1
- package/dist/pack-scaffold.js.map +0 -1
- package/dist/pack-search.js.map +0 -1
- package/dist/pack-validate.js.map +0 -1
- package/dist/plan-create.js.map +0 -1
- package/dist/plan-edit.js.map +0 -1
- package/dist/plan-link.js.map +0 -1
- package/dist/plan-promote.js.map +0 -1
- package/dist/public-manifest.js +0 -920
- package/dist/public-manifest.js.map +0 -1
- package/dist/release.js.map +0 -1
- package/dist/rotate-progress.js +0 -253
- package/dist/rotate-progress.js.map +0 -1
- package/dist/session-coordinator.js +0 -303
- package/dist/session-coordinator.js.map +0 -1
- package/dist/shared-validators.js +0 -81
- package/dist/shared-validators.js.map +0 -1
- package/dist/signal-cleanup.js.map +0 -1
- package/dist/state-bootstrap.js.map +0 -1
- package/dist/state-cleanup.js.map +0 -1
- package/dist/state-doctor-fix.js +0 -226
- package/dist/state-doctor-fix.js.map +0 -1
- package/dist/state-doctor-stamps.js +0 -23
- package/dist/state-doctor-stamps.js.map +0 -1
- package/dist/state-doctor.js.map +0 -1
- package/dist/strict-progress.js +0 -255
- package/dist/strict-progress.js.map +0 -1
- package/dist/sync-templates.js.map +0 -1
- package/dist/task-claim.js.map +0 -1
- package/dist/trace-gen.js +0 -401
- package/dist/trace-gen.js.map +0 -1
- package/dist/validate-agent-skills.js +0 -223
- package/dist/validate-agent-skills.js.map +0 -1
- package/dist/validate-agent-sync.js +0 -151
- package/dist/validate-agent-sync.js.map +0 -1
- package/dist/validate-backlog-sync.js +0 -77
- package/dist/validate-backlog-sync.js.map +0 -1
- package/dist/validate-skills-spec.js +0 -211
- package/dist/validate-skills-spec.js.map +0 -1
- package/dist/validate.js.map +0 -1
- package/dist/validator-defaults.js +0 -107
- package/dist/validator-defaults.js.map +0 -1
- package/dist/validator-registry.js +0 -71
- package/dist/validator-registry.js.map +0 -1
- package/dist/workspace-init.js.map +0 -1
- package/dist/wu-block.js.map +0 -1
- package/dist/wu-brief.js.map +0 -1
- package/dist/wu-claim-branch.js +0 -123
- package/dist/wu-claim-branch.js.map +0 -1
- package/dist/wu-claim-cloud.js +0 -79
- package/dist/wu-claim-cloud.js.map +0 -1
- package/dist/wu-claim-mode.js +0 -82
- package/dist/wu-claim-mode.js.map +0 -1
- package/dist/wu-claim-output.js +0 -85
- package/dist/wu-claim-output.js.map +0 -1
- package/dist/wu-claim-repair-guidance.js +0 -12
- package/dist/wu-claim-repair-guidance.js.map +0 -1
- package/dist/wu-claim-resume-handler.js +0 -87
- package/dist/wu-claim-resume-handler.js.map +0 -1
- package/dist/wu-claim-state.js +0 -581
- package/dist/wu-claim-state.js.map +0 -1
- package/dist/wu-claim-validation.js +0 -457
- package/dist/wu-claim-validation.js.map +0 -1
- package/dist/wu-claim-worktree.js +0 -223
- package/dist/wu-claim-worktree.js.map +0 -1
- package/dist/wu-claim.js.map +0 -1
- package/dist/wu-cleanup-cloud.js +0 -78
- package/dist/wu-cleanup-cloud.js.map +0 -1
- package/dist/wu-cleanup.js.map +0 -1
- package/dist/wu-code-path-coverage.js +0 -83
- package/dist/wu-code-path-coverage.js.map +0 -1
- package/dist/wu-create-cloud.js +0 -30
- package/dist/wu-create-cloud.js.map +0 -1
- package/dist/wu-create-content.js +0 -264
- package/dist/wu-create-content.js.map +0 -1
- package/dist/wu-create-readiness.js +0 -59
- package/dist/wu-create-readiness.js.map +0 -1
- package/dist/wu-create-validation.js +0 -128
- package/dist/wu-create-validation.js.map +0 -1
- package/dist/wu-create.js.map +0 -1
- package/dist/wu-delegate.js.map +0 -1
- package/dist/wu-delete.js.map +0 -1
- package/dist/wu-deps.js.map +0 -1
- package/dist/wu-done-auto-cleanup.js +0 -203
- package/dist/wu-done-auto-cleanup.js.map +0 -1
- package/dist/wu-done-check.js +0 -38
- package/dist/wu-done-check.js.map +0 -1
- package/dist/wu-done-cloud.js +0 -48
- package/dist/wu-done-cloud.js.map +0 -1
- package/dist/wu-done-decay.js +0 -86
- package/dist/wu-done-decay.js.map +0 -1
- package/dist/wu-done.js.map +0 -1
- package/dist/wu-edit-operations.js +0 -399
- package/dist/wu-edit-operations.js.map +0 -1
- package/dist/wu-edit-validators.js +0 -282
- package/dist/wu-edit-validators.js.map +0 -1
- package/dist/wu-edit.js.map +0 -1
- package/dist/wu-infer-lane.js.map +0 -1
- package/dist/wu-preflight.js.map +0 -1
- package/dist/wu-prep.js.map +0 -1
- package/dist/wu-proto.js.map +0 -1
- package/dist/wu-prune.js.map +0 -1
- package/dist/wu-recover.js.map +0 -1
- package/dist/wu-release.js.map +0 -1
- package/dist/wu-repair.js.map +0 -1
- package/dist/wu-sandbox.js.map +0 -1
- package/dist/wu-spawn-completion.js +0 -33
- package/dist/wu-spawn-completion.js.map +0 -1
- package/dist/wu-spawn-prompt-builders.js +0 -1197
- package/dist/wu-spawn-prompt-builders.js.map +0 -1
- package/dist/wu-spawn-strategy-resolver.js +0 -322
- package/dist/wu-spawn-strategy-resolver.js.map +0 -1
- package/dist/wu-spawn.js +0 -59
- package/dist/wu-spawn.js.map +0 -1
- package/dist/wu-state-cloud.js +0 -41
- package/dist/wu-state-cloud.js.map +0 -1
- package/dist/wu-status.js.map +0 -1
- package/dist/wu-unblock.js.map +0 -1
- package/dist/wu-unlock-lane.js.map +0 -1
- package/dist/wu-validate.js.map +0 -1
|
@@ -25,8 +25,10 @@ import { Command } from 'commander';
|
|
|
25
25
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
26
26
|
import { join } from 'node:path';
|
|
27
27
|
import { EXIT_CODES, LUMENFLOW_PATHS, DelegationRegistryStore, analyzeDelegations, detectStuckDelegations, checkZombieLocks, generateSuggestions, formatMonitorOutput, formatRecoveryResults, runRecovery, processDelegationFailureSignals, formatSignalHandlerOutput, DEFAULT_THRESHOLD_MINUTES, calculateBackoff, } from '@lumenflow/core';
|
|
28
|
+
import { ProcessExitError } from '@lumenflow/core/error-handler';
|
|
28
29
|
import chalk from 'chalk';
|
|
29
30
|
import ms, {} from 'ms';
|
|
31
|
+
import { runCLI } from './cli-entry-point.js';
|
|
30
32
|
// ============================================================================
|
|
31
33
|
// WU-1242: Watch Mode Constants
|
|
32
34
|
// ============================================================================
|
|
@@ -187,8 +189,9 @@ async function runDelegationMonitoring(opts) {
|
|
|
187
189
|
const baseDir = process.cwd();
|
|
188
190
|
const thresholdMinutes = parseInt(opts.threshold, 10);
|
|
189
191
|
if (isNaN(thresholdMinutes) || thresholdMinutes <= 0) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
const message = `${LOG_PREFIX} Invalid threshold: ${opts.threshold}`;
|
|
193
|
+
console.error(chalk.red(message));
|
|
194
|
+
throw new ProcessExitError(message, EXIT_CODES.FAILURE);
|
|
192
195
|
}
|
|
193
196
|
console.log(chalk.cyan(`${LOG_PREFIX} Analyzing delegation health...`));
|
|
194
197
|
console.log(chalk.gray(` Threshold: ${thresholdMinutes} minutes`));
|
|
@@ -209,7 +212,7 @@ async function runDelegationMonitoring(opts) {
|
|
|
209
212
|
console.log(formatSignalHandlerOutput(signalResult));
|
|
210
213
|
}
|
|
211
214
|
if (result.stuckDelegations.length > 0 || result.zombieLocks.length > 0) {
|
|
212
|
-
|
|
215
|
+
throw new ProcessExitError(`${LOG_PREFIX} Delegation monitor detected stuck delegations or zombie locks.`, EXIT_CODES.ERROR);
|
|
213
216
|
}
|
|
214
217
|
}
|
|
215
218
|
/**
|
|
@@ -378,8 +381,9 @@ async function runWatchMode(opts) {
|
|
|
378
381
|
const baseDir = process.cwd();
|
|
379
382
|
const thresholdMinutes = parseInt(opts.threshold, 10);
|
|
380
383
|
if (isNaN(thresholdMinutes) || thresholdMinutes <= 0) {
|
|
381
|
-
|
|
382
|
-
|
|
384
|
+
const message = `${LOG_PREFIX} Invalid threshold: ${opts.threshold}`;
|
|
385
|
+
console.error(chalk.red(message));
|
|
386
|
+
throw new ProcessExitError(message, EXIT_CODES.FAILURE);
|
|
383
387
|
}
|
|
384
388
|
const watchOptions = parseWatchOptions(opts);
|
|
385
389
|
console.log(chalk.cyan(`${LOG_PREFIX} Starting continuous patrol mode...`));
|
|
@@ -403,7 +407,7 @@ async function runWatchMode(opts) {
|
|
|
403
407
|
// Handle graceful shutdown
|
|
404
408
|
const shutdown = () => {
|
|
405
409
|
runner.stop();
|
|
406
|
-
process.
|
|
410
|
+
process.exitCode = EXIT_CODES.SUCCESS;
|
|
407
411
|
};
|
|
408
412
|
process.on('SIGINT', shutdown);
|
|
409
413
|
process.on('SIGTERM', shutdown);
|
|
@@ -438,10 +442,18 @@ const program = new Command()
|
|
|
438
442
|
await runDelegationMonitoring(opts);
|
|
439
443
|
}
|
|
440
444
|
catch (err) {
|
|
445
|
+
if (err instanceof ProcessExitError) {
|
|
446
|
+
throw err;
|
|
447
|
+
}
|
|
441
448
|
const message = err instanceof Error ? err.message : String(err);
|
|
442
449
|
console.error(chalk.red(`${LOG_PREFIX} Error: ${message}`));
|
|
443
|
-
|
|
450
|
+
throw new ProcessExitError(message, EXIT_CODES.ERROR);
|
|
444
451
|
}
|
|
445
452
|
});
|
|
446
|
-
|
|
453
|
+
export async function main() {
|
|
454
|
+
await program.parseAsync(process.argv);
|
|
455
|
+
}
|
|
456
|
+
if (import.meta.main) {
|
|
457
|
+
void runCLI(main);
|
|
458
|
+
}
|
|
447
459
|
//# sourceMappingURL=orchestrate-monitor.js.map
|
package/dist/pack-scaffold.js
CHANGED
|
@@ -112,7 +112,7 @@ LumenFlow domain pack - version ${version}
|
|
|
112
112
|
|
|
113
113
|
## Overview
|
|
114
114
|
|
|
115
|
-
This pack provides
|
|
115
|
+
This pack provides pack-specific tools and policies for the LumenFlow kernel.
|
|
116
116
|
|
|
117
117
|
## Structure
|
|
118
118
|
|
package/dist/plan-create.js
CHANGED
|
@@ -139,7 +139,7 @@ export function getCommitMessage(id, title) {
|
|
|
139
139
|
const idLower = id.toLowerCase();
|
|
140
140
|
return `docs: create plan for ${idLower} - ${title}`;
|
|
141
141
|
}
|
|
142
|
-
async function main() {
|
|
142
|
+
export async function main() {
|
|
143
143
|
const args = createWUParser({
|
|
144
144
|
name: 'plan-create',
|
|
145
145
|
description: 'Create a new plan file in repo plansDir',
|
|
@@ -195,6 +195,4 @@ import { runCLI } from './cli-entry-point.js';
|
|
|
195
195
|
if (import.meta.main) {
|
|
196
196
|
void runCLI(main);
|
|
197
197
|
}
|
|
198
|
-
// Export for testing
|
|
199
|
-
export { main };
|
|
200
198
|
//# sourceMappingURL=plan-create.js.map
|
package/dist/plan-edit.js
CHANGED
|
@@ -164,7 +164,7 @@ export function getCommitMessage(id, section) {
|
|
|
164
164
|
const idLower = id.toLowerCase();
|
|
165
165
|
return `docs: update ${section} section in ${idLower} plan`;
|
|
166
166
|
}
|
|
167
|
-
async function main() {
|
|
167
|
+
export async function main() {
|
|
168
168
|
const SECTION_OPTION = {
|
|
169
169
|
name: 'section',
|
|
170
170
|
flags: '--section <name>',
|
|
@@ -257,6 +257,4 @@ import { runCLI } from './cli-entry-point.js';
|
|
|
257
257
|
if (import.meta.main) {
|
|
258
258
|
void runCLI(main);
|
|
259
259
|
}
|
|
260
|
-
// Export for testing
|
|
261
|
-
export { main };
|
|
262
260
|
//# sourceMappingURL=plan-edit.js.map
|
package/dist/plan-link.js
CHANGED
|
@@ -200,7 +200,7 @@ export function getCommitMessage(id, planUri) {
|
|
|
200
200
|
const filename = planUri.replace(PLAN_URI_SCHEME, '');
|
|
201
201
|
return `docs: link plan ${filename} to ${idLower}`;
|
|
202
202
|
}
|
|
203
|
-
async function main() {
|
|
203
|
+
export async function main() {
|
|
204
204
|
const PLAN_OPTION = {
|
|
205
205
|
name: 'plan',
|
|
206
206
|
flags: '--plan <uri>',
|
|
@@ -269,6 +269,4 @@ import { runCLI } from './cli-entry-point.js';
|
|
|
269
269
|
if (import.meta.main) {
|
|
270
270
|
void runCLI(main);
|
|
271
271
|
}
|
|
272
|
-
// Export for testing
|
|
273
|
-
export { main };
|
|
274
272
|
//# sourceMappingURL=plan-link.js.map
|
package/dist/plan-promote.js
CHANGED
|
@@ -154,7 +154,7 @@ export function getCommitMessage(id) {
|
|
|
154
154
|
const idLower = id.toLowerCase();
|
|
155
155
|
return `docs: promote ${idLower} plan to approved`;
|
|
156
156
|
}
|
|
157
|
-
async function main() {
|
|
157
|
+
export async function main() {
|
|
158
158
|
const FORCE_OPTION = {
|
|
159
159
|
name: 'force',
|
|
160
160
|
flags: '-f, --force',
|
|
@@ -227,6 +227,4 @@ import { runCLI } from './cli-entry-point.js';
|
|
|
227
227
|
if (import.meta.main) {
|
|
228
228
|
void runCLI(main);
|
|
229
229
|
}
|
|
230
|
-
// Export for testing
|
|
231
|
-
export { main };
|
|
232
230
|
//# sourceMappingURL=plan-promote.js.map
|
package/dist/release.js
CHANGED
|
@@ -65,6 +65,14 @@ const CHANGESET_DIR = '.changeset';
|
|
|
65
65
|
const LUMENFLOW_FORCE_ENV = 'LUMENFLOW_FORCE';
|
|
66
66
|
/** Environment variable to provide reason for force bypass */
|
|
67
67
|
const LUMENFLOW_FORCE_REASON_ENV = 'LUMENFLOW_FORCE_REASON';
|
|
68
|
+
/** Release phase label for pre-release clean-tree validation */
|
|
69
|
+
const RELEASE_CLEAN_CHECK_PHASE_BEFORE_RELEASE = 'before release';
|
|
70
|
+
/** Release phase label for post-publish clean-tree validation */
|
|
71
|
+
const RELEASE_CLEAN_CHECK_PHASE_AFTER_PUBLISH = 'after npm publish';
|
|
72
|
+
/** Command shown when release fails due to dirty working tree */
|
|
73
|
+
const GIT_STATUS_SHORT_COMMAND = 'git status --short';
|
|
74
|
+
/** Guidance shown when generated artifacts dirty the repository */
|
|
75
|
+
const CLEAN_TREE_RECOVERY_GUIDANCE = 'Commit, stash, or clean generated files before retrying release.';
|
|
68
76
|
/**
|
|
69
77
|
* Environment variable for WU tool identification (WU-1296)
|
|
70
78
|
* Pre-push hook checks this to allow approved tool operations
|
|
@@ -101,6 +109,22 @@ export async function withReleaseEnv(fn) {
|
|
|
101
109
|
}
|
|
102
110
|
}
|
|
103
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Assert the current git working tree is clean.
|
|
114
|
+
*
|
|
115
|
+
* @param git - Git adapter with cleanliness check
|
|
116
|
+
* @param phase - Human-readable release phase label
|
|
117
|
+
*/
|
|
118
|
+
export async function assertWorkingTreeClean(git, phase) {
|
|
119
|
+
const isClean = await git.isClean();
|
|
120
|
+
if (isClean) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
die(`Working directory has uncommitted changes ${phase}.\n\n` +
|
|
124
|
+
`Run this command to inspect unexpected artifacts:\n` +
|
|
125
|
+
` ${GIT_STATUS_SHORT_COMMAND}\n` +
|
|
126
|
+
`${CLEAN_TREE_RECOVERY_GUIDANCE}`);
|
|
127
|
+
}
|
|
104
128
|
/**
|
|
105
129
|
* Validate that a string is a valid semver version
|
|
106
130
|
*
|
|
@@ -317,7 +341,7 @@ export async function pushTagWithForce(git, tagName, reason = 'release: tag push
|
|
|
317
341
|
* Main release function
|
|
318
342
|
* WU-1085: Renamed --version to --release-version to avoid conflict with CLI --version flag
|
|
319
343
|
*/
|
|
320
|
-
async function main() {
|
|
344
|
+
export async function main() {
|
|
321
345
|
const program = new Command()
|
|
322
346
|
.name('lumenflow-release')
|
|
323
347
|
.description('Release @lumenflow/* packages to npm with version bump, tag, and publish')
|
|
@@ -345,13 +369,7 @@ async function main() {
|
|
|
345
369
|
const git = getGitForCwd();
|
|
346
370
|
await ensureOnMain(git);
|
|
347
371
|
// Check for uncommitted changes
|
|
348
|
-
|
|
349
|
-
if (!isClean) {
|
|
350
|
-
die(`Working directory has uncommitted changes.\n\n` +
|
|
351
|
-
`Commit or stash changes before releasing:\n` +
|
|
352
|
-
` git status\n` +
|
|
353
|
-
` git stash # or git commit`);
|
|
354
|
-
}
|
|
372
|
+
await assertWorkingTreeClean(git, RELEASE_CLEAN_CHECK_PHASE_BEFORE_RELEASE);
|
|
355
373
|
// Find all @lumenflow/* packages to update
|
|
356
374
|
const packagePaths = findPackageJsonPaths();
|
|
357
375
|
if (packagePaths.length === 0) {
|
|
@@ -443,6 +461,7 @@ async function main() {
|
|
|
443
461
|
else {
|
|
444
462
|
console.log(`${LOG_PREFIX} Publishing packages to npm...`);
|
|
445
463
|
runCommand(`${PKG_MANAGER} -r publish --access public --no-git-checks`, { label: 'publish' });
|
|
464
|
+
await assertWorkingTreeClean(git, RELEASE_CLEAN_CHECK_PHASE_AFTER_PUBLISH);
|
|
446
465
|
console.log(`${LOG_PREFIX} ✅ Packages published to npm`);
|
|
447
466
|
}
|
|
448
467
|
}
|
|
@@ -468,8 +487,6 @@ async function main() {
|
|
|
468
487
|
console.log(` - Verify packages: npm view @lumenflow/cli version`);
|
|
469
488
|
}
|
|
470
489
|
}
|
|
471
|
-
// Export for testing
|
|
472
|
-
export { main };
|
|
473
490
|
// Guard main() for testability
|
|
474
491
|
if (import.meta.main) {
|
|
475
492
|
void runCLI(main);
|
package/dist/signal-cleanup.js
CHANGED
|
@@ -29,6 +29,7 @@ import { cleanupSignals } from '@lumenflow/memory/signal-cleanup-core';
|
|
|
29
29
|
import { createWUParser } from '@lumenflow/core/arg-parser';
|
|
30
30
|
import { EXIT_CODES, LUMENFLOW_PATHS, PROTECTED_WU_STATUSES } from '@lumenflow/core/wu-constants';
|
|
31
31
|
import { getConfig } from '@lumenflow/core/config';
|
|
32
|
+
import { formatBytes } from './constants.js';
|
|
32
33
|
import { runCLI } from './cli-entry-point.js';
|
|
33
34
|
/**
|
|
34
35
|
* Log prefix for signal:cleanup output
|
|
@@ -38,10 +39,7 @@ const LOG_PREFIX = '[signal:cleanup]';
|
|
|
38
39
|
* Tool name for audit logging
|
|
39
40
|
*/
|
|
40
41
|
const TOOL_NAME = 'signal:cleanup';
|
|
41
|
-
|
|
42
|
-
* Bytes per KB for formatting
|
|
43
|
-
*/
|
|
44
|
-
const BYTES_PER_KB = 1024;
|
|
42
|
+
// WU-2044: BYTES_PER_KB imported from ./constants.js
|
|
45
43
|
/**
|
|
46
44
|
* CLI argument options specific to signal:cleanup
|
|
47
45
|
*/
|
|
@@ -100,19 +98,7 @@ async function writeAuditLog(baseDir, entry) {
|
|
|
100
98
|
// Audit logging is non-fatal - silently ignore errors
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
|
-
|
|
104
|
-
* Format bytes as human-readable string
|
|
105
|
-
*
|
|
106
|
-
* @param bytes - Number of bytes
|
|
107
|
-
* @returns Formatted string (e.g., "1.5 KB")
|
|
108
|
-
*/
|
|
109
|
-
function formatBytes(bytes) {
|
|
110
|
-
if (bytes < BYTES_PER_KB) {
|
|
111
|
-
return `${bytes} B`;
|
|
112
|
-
}
|
|
113
|
-
const kb = (bytes / BYTES_PER_KB).toFixed(1);
|
|
114
|
-
return `${kb} KB`;
|
|
115
|
-
}
|
|
101
|
+
// WU-2044: formatBytes imported from ./constants.js
|
|
116
102
|
/**
|
|
117
103
|
* Format compaction ratio as percentage
|
|
118
104
|
*
|
|
@@ -227,7 +213,7 @@ function printResult(result, quiet) {
|
|
|
227
213
|
/**
|
|
228
214
|
* Main CLI entry point
|
|
229
215
|
*/
|
|
230
|
-
async function main() {
|
|
216
|
+
export async function main() {
|
|
231
217
|
const args = parseArguments();
|
|
232
218
|
const baseDir = args.baseDir || process.cwd();
|
|
233
219
|
const startedAt = new Date().toISOString();
|
package/dist/state-bootstrap.js
CHANGED
|
@@ -18,7 +18,8 @@ import path from 'node:path';
|
|
|
18
18
|
import { parse as parseYaml } from 'yaml';
|
|
19
19
|
import { readFileSync } from 'node:fs';
|
|
20
20
|
import { WU_PATHS } from '@lumenflow/core/wu-paths';
|
|
21
|
-
import { CLI_FLAGS, EXIT_CODES, EMOJI, STRING_LITERALS } from '@lumenflow/core/wu-constants';
|
|
21
|
+
import { CLI_FLAGS, EXIT_CODES, EMOJI, STRING_LITERALS, WU_STATUS, } from '@lumenflow/core/wu-constants';
|
|
22
|
+
import { WU_EVENT_TYPE } from '@lumenflow/core/wu-state-schema';
|
|
22
23
|
/** Log prefix for consistent output */
|
|
23
24
|
const LOG_PREFIX = '[state-bootstrap]';
|
|
24
25
|
/**
|
|
@@ -99,36 +100,38 @@ function toTimestamp(dateStr, fallback) {
|
|
|
99
100
|
export function inferEventsFromWu(wu) {
|
|
100
101
|
const events = [];
|
|
101
102
|
// Ready WUs have no events (not yet in the lifecycle)
|
|
102
|
-
if (wu.status ===
|
|
103
|
+
if (wu.status === WU_STATUS.READY ||
|
|
104
|
+
wu.status === WU_STATUS.BACKLOG ||
|
|
105
|
+
wu.status === WU_STATUS.TODO) {
|
|
103
106
|
return events;
|
|
104
107
|
}
|
|
105
108
|
// All other states start with a claim event
|
|
106
109
|
const claimTimestamp = toTimestamp(wu.claimed_at, wu.created);
|
|
107
110
|
events.push({
|
|
108
|
-
type:
|
|
111
|
+
type: WU_EVENT_TYPE.CLAIM,
|
|
109
112
|
wuId: wu.id,
|
|
110
113
|
lane: wu.lane,
|
|
111
114
|
title: wu.title,
|
|
112
115
|
timestamp: claimTimestamp,
|
|
113
116
|
});
|
|
114
117
|
// Handle completed/done status
|
|
115
|
-
if (wu.status ===
|
|
118
|
+
if (wu.status === WU_STATUS.DONE || wu.status === WU_STATUS.COMPLETED) {
|
|
116
119
|
const completeTimestamp = toTimestamp(wu.completed_at, wu.created);
|
|
117
120
|
events.push({
|
|
118
|
-
type:
|
|
121
|
+
type: WU_EVENT_TYPE.COMPLETE,
|
|
119
122
|
wuId: wu.id,
|
|
120
123
|
timestamp: completeTimestamp,
|
|
121
124
|
});
|
|
122
125
|
return events;
|
|
123
126
|
}
|
|
124
127
|
// Handle blocked status
|
|
125
|
-
if (wu.status ===
|
|
128
|
+
if (wu.status === WU_STATUS.BLOCKED) {
|
|
126
129
|
// Block event timestamp should be after claim
|
|
127
130
|
// We don't have exact block time, so use claim time + 1 second
|
|
128
131
|
const claimDate = new Date(claimTimestamp);
|
|
129
132
|
claimDate.setSeconds(claimDate.getSeconds() + 1);
|
|
130
133
|
events.push({
|
|
131
|
-
type:
|
|
134
|
+
type: WU_EVENT_TYPE.BLOCK,
|
|
132
135
|
wuId: wu.id,
|
|
133
136
|
timestamp: claimDate.toISOString(),
|
|
134
137
|
reason: 'Bootstrapped from WU YAML (original reason unknown)',
|
|
@@ -266,7 +269,7 @@ Supported WU statuses:
|
|
|
266
269
|
/**
|
|
267
270
|
* Main function
|
|
268
271
|
*/
|
|
269
|
-
async function main() {
|
|
272
|
+
export async function main() {
|
|
270
273
|
const args = parseStateBootstrapArgs(process.argv);
|
|
271
274
|
if (args.help) {
|
|
272
275
|
printHelp();
|
package/dist/state-cleanup.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Cleanup order: signals -> memory -> events (dependency order)
|
|
13
13
|
*
|
|
14
14
|
* Features:
|
|
15
|
-
* - Respects config from .
|
|
15
|
+
* - Respects config from workspace.yaml
|
|
16
16
|
* - Supports --dry-run for preview
|
|
17
17
|
* - Supports --signals-only, --memory-only, --events-only for selective cleanup
|
|
18
18
|
* - Non-fatal: warns on errors but continues with other cleanups
|
|
@@ -40,6 +40,7 @@ import { EXIT_CODES, LUMENFLOW_PATHS, PROTECTED_WU_STATUSES } from '@lumenflow/c
|
|
|
40
40
|
import { getConfig } from '@lumenflow/core/config';
|
|
41
41
|
import fg from 'fast-glob';
|
|
42
42
|
import { parse as parseYaml } from 'yaml';
|
|
43
|
+
import { formatBytes } from './constants.js';
|
|
43
44
|
import { runCLI } from './cli-entry-point.js';
|
|
44
45
|
/**
|
|
45
46
|
* Log prefix for state:cleanup output
|
|
@@ -49,10 +50,7 @@ const LOG_PREFIX = '[state:cleanup]';
|
|
|
49
50
|
* Tool name for audit logging
|
|
50
51
|
*/
|
|
51
52
|
const TOOL_NAME = 'state:cleanup';
|
|
52
|
-
|
|
53
|
-
* Bytes per KB for formatting
|
|
54
|
-
*/
|
|
55
|
-
const BYTES_PER_KB = 1024;
|
|
53
|
+
// WU-2044: BYTES_PER_KB imported from ./constants.js
|
|
56
54
|
/**
|
|
57
55
|
* Labels for output formatting
|
|
58
56
|
*/
|
|
@@ -117,19 +115,7 @@ async function writeAuditLog(baseDir, entry) {
|
|
|
117
115
|
// Audit logging is non-fatal - silently ignore errors
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
|
-
|
|
121
|
-
* Format bytes as human-readable string
|
|
122
|
-
*
|
|
123
|
-
* @param bytes - Number of bytes
|
|
124
|
-
* @returns Formatted string (e.g., "1.5 KB")
|
|
125
|
-
*/
|
|
126
|
-
function formatBytes(bytes) {
|
|
127
|
-
if (bytes < BYTES_PER_KB) {
|
|
128
|
-
return `${bytes} B`;
|
|
129
|
-
}
|
|
130
|
-
const kb = (bytes / BYTES_PER_KB).toFixed(1);
|
|
131
|
-
return `${kb} KB`;
|
|
132
|
-
}
|
|
118
|
+
// WU-2044: formatBytes imported from ./constants.js
|
|
133
119
|
/**
|
|
134
120
|
* Get active WU IDs (in_progress or blocked) by scanning WU YAML files.
|
|
135
121
|
*
|
|
@@ -264,7 +250,7 @@ function printResult(result, quiet) {
|
|
|
264
250
|
/**
|
|
265
251
|
* Main CLI entry point
|
|
266
252
|
*/
|
|
267
|
-
async function main() {
|
|
253
|
+
export async function main() {
|
|
268
254
|
const args = parseArguments();
|
|
269
255
|
const baseDir = args.baseDir || process.cwd();
|
|
270
256
|
const startedAt = new Date().toISOString();
|