@lumenflow/core 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 +16 -16
- package/dist/cli/is-agent-branch.js +31 -10
- package/dist/index.js +3 -0
- package/package.json +5 -2
- package/dist/active-wu-detector.d.ts +0 -25
- package/dist/active-wu-detector.d.ts.map +0 -1
- package/dist/active-wu-detector.js +0 -109
- package/dist/active-wu-detector.js.map +0 -1
- package/dist/adapters/context-adapters.d.ts +0 -101
- package/dist/adapters/context-adapters.d.ts.map +0 -1
- package/dist/adapters/context-adapters.js +0 -98
- package/dist/adapters/context-adapters.js.map +0 -1
- package/dist/adapters/filesystem-metrics.adapter.d.ts +0 -91
- package/dist/adapters/filesystem-metrics.adapter.d.ts.map +0 -1
- package/dist/adapters/filesystem-metrics.adapter.js +0 -530
- package/dist/adapters/filesystem-metrics.adapter.js.map +0 -1
- package/dist/adapters/index.d.ts +0 -15
- package/dist/adapters/index.d.ts.map +0 -1
- package/dist/adapters/index.js +0 -21
- package/dist/adapters/index.js.map +0 -1
- package/dist/adapters/mock-dashboard-renderer.adapter.d.ts +0 -86
- package/dist/adapters/mock-dashboard-renderer.adapter.d.ts.map +0 -1
- package/dist/adapters/mock-dashboard-renderer.adapter.js +0 -93
- package/dist/adapters/mock-dashboard-renderer.adapter.js.map +0 -1
- package/dist/adapters/recovery-adapters.d.ts +0 -41
- package/dist/adapters/recovery-adapters.d.ts.map +0 -1
- package/dist/adapters/recovery-adapters.js +0 -32
- package/dist/adapters/recovery-adapters.js.map +0 -1
- package/dist/adapters/terminal-renderer.adapter.d.ts +0 -86
- package/dist/adapters/terminal-renderer.adapter.d.ts.map +0 -1
- package/dist/adapters/terminal-renderer.adapter.js +0 -342
- package/dist/adapters/terminal-renderer.adapter.js.map +0 -1
- package/dist/adapters/validation-adapters.d.ts +0 -53
- package/dist/adapters/validation-adapters.d.ts.map +0 -1
- package/dist/adapters/validation-adapters.js +0 -48
- package/dist/adapters/validation-adapters.js.map +0 -1
- package/dist/agent-patterns-registry.d.ts +0 -141
- package/dist/agent-patterns-registry.d.ts.map +0 -1
- package/dist/agent-patterns-registry.js +0 -319
- package/dist/agent-patterns-registry.js.map +0 -1
- package/dist/arg-parser.d.ts +0 -94
- package/dist/arg-parser.d.ts.map +0 -1
- package/dist/arg-parser.js +0 -774
- package/dist/arg-parser.js.map +0 -1
- package/dist/atomic-merge.d.ts +0 -21
- package/dist/atomic-merge.d.ts.map +0 -1
- package/dist/atomic-merge.js +0 -87
- package/dist/atomic-merge.js.map +0 -1
- package/dist/backlog-editor.d.ts +0 -103
- package/dist/backlog-editor.d.ts.map +0 -1
- package/dist/backlog-editor.js +0 -158
- package/dist/backlog-editor.js.map +0 -1
- package/dist/backlog-generator.d.ts +0 -90
- package/dist/backlog-generator.d.ts.map +0 -1
- package/dist/backlog-generator.js +0 -536
- package/dist/backlog-generator.js.map +0 -1
- package/dist/backlog-parser.d.ts +0 -46
- package/dist/backlog-parser.d.ts.map +0 -1
- package/dist/backlog-parser.js +0 -105
- package/dist/backlog-parser.js.map +0 -1
- package/dist/backlog-sync-validator.d.ts +0 -88
- package/dist/backlog-sync-validator.d.ts.map +0 -1
- package/dist/backlog-sync-validator.js +0 -324
- package/dist/backlog-sync-validator.js.map +0 -1
- package/dist/beacon-migration.d.ts +0 -56
- package/dist/beacon-migration.js +0 -101
- package/dist/branch-check.d.ts +0 -63
- package/dist/branch-check.d.ts.map +0 -1
- package/dist/branch-check.js +0 -197
- package/dist/branch-check.js.map +0 -1
- package/dist/branch-drift.d.ts +0 -24
- package/dist/branch-drift.d.ts.map +0 -1
- package/dist/branch-drift.js +0 -54
- package/dist/branch-drift.js.map +0 -1
- package/dist/cleanup-install-config.d.ts +0 -24
- package/dist/cleanup-install-config.d.ts.map +0 -1
- package/dist/cleanup-install-config.js +0 -40
- package/dist/cleanup-install-config.js.map +0 -1
- package/dist/cleanup-lock.d.ts +0 -125
- package/dist/cleanup-lock.d.ts.map +0 -1
- package/dist/cleanup-lock.js +0 -325
- package/dist/cleanup-lock.js.map +0 -1
- package/dist/cli/is-agent-branch.d.ts +0 -15
- package/dist/cli/is-agent-branch.d.ts.map +0 -1
- package/dist/cli/is-agent-branch.js.map +0 -1
- package/dist/cloud-detect.d.ts +0 -145
- package/dist/cloud-detect.d.ts.map +0 -1
- package/dist/cloud-detect.js +0 -116
- package/dist/cloud-detect.js.map +0 -1
- package/dist/code-path-validator.d.ts +0 -147
- package/dist/code-path-validator.d.ts.map +0 -1
- package/dist/code-path-validator.js +0 -551
- package/dist/code-path-validator.js.map +0 -1
- package/dist/code-paths-overlap.d.ts +0 -50
- package/dist/code-paths-overlap.d.ts.map +0 -1
- package/dist/code-paths-overlap.js +0 -248
- package/dist/code-paths-overlap.js.map +0 -1
- package/dist/color-support.d.ts +0 -21
- package/dist/color-support.d.ts.map +0 -1
- package/dist/color-support.js +0 -67
- package/dist/color-support.js.map +0 -1
- package/dist/commands-logger.d.ts +0 -71
- package/dist/commands-logger.d.ts.map +0 -1
- package/dist/commands-logger.js +0 -256
- package/dist/commands-logger.js.map +0 -1
- package/dist/commit-message-utils.d.ts +0 -26
- package/dist/commit-message-utils.d.ts.map +0 -1
- package/dist/commit-message-utils.js +0 -44
- package/dist/commit-message-utils.js.map +0 -1
- package/dist/compliance-parser.d.ts +0 -125
- package/dist/compliance-parser.d.ts.map +0 -1
- package/dist/compliance-parser.js +0 -457
- package/dist/compliance-parser.js.map +0 -1
- package/dist/constants/backlog-patterns.d.ts +0 -21
- package/dist/constants/backlog-patterns.d.ts.map +0 -1
- package/dist/constants/backlog-patterns.js +0 -26
- package/dist/constants/backlog-patterns.js.map +0 -1
- package/dist/constants/dora-constants.d.ts +0 -50
- package/dist/constants/dora-constants.d.ts.map +0 -1
- package/dist/constants/dora-constants.js +0 -56
- package/dist/constants/dora-constants.js.map +0 -1
- package/dist/constants/gate-constants.d.ts +0 -16
- package/dist/constants/gate-constants.d.ts.map +0 -1
- package/dist/constants/gate-constants.js +0 -18
- package/dist/constants/gate-constants.js.map +0 -1
- package/dist/constants/linter-constants.d.ts +0 -17
- package/dist/constants/linter-constants.d.ts.map +0 -1
- package/dist/constants/linter-constants.js +0 -19
- package/dist/constants/linter-constants.js.map +0 -1
- package/dist/constants/tokenizer-constants.d.ts +0 -16
- package/dist/constants/tokenizer-constants.d.ts.map +0 -1
- package/dist/constants/tokenizer-constants.js +0 -18
- package/dist/constants/tokenizer-constants.js.map +0 -1
- package/dist/context/context-computer.d.ts +0 -36
- package/dist/context/context-computer.d.ts.map +0 -1
- package/dist/context/context-computer.js +0 -128
- package/dist/context/context-computer.js.map +0 -1
- package/dist/context/git-state-reader.d.ts +0 -37
- package/dist/context/git-state-reader.d.ts.map +0 -1
- package/dist/context/git-state-reader.js +0 -64
- package/dist/context/git-state-reader.js.map +0 -1
- package/dist/context/index.d.ts +0 -18
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -20
- package/dist/context/index.js.map +0 -1
- package/dist/context/location-resolver.d.ts +0 -34
- package/dist/context/location-resolver.d.ts.map +0 -1
- package/dist/context/location-resolver.js +0 -179
- package/dist/context/location-resolver.js.map +0 -1
- package/dist/context/wu-state-reader.d.ts +0 -30
- package/dist/context/wu-state-reader.d.ts.map +0 -1
- package/dist/context/wu-state-reader.js +0 -126
- package/dist/context/wu-state-reader.js.map +0 -1
- package/dist/context-di.d.ts +0 -185
- package/dist/context-di.d.ts.map +0 -1
- package/dist/context-di.js +0 -165
- package/dist/context-di.js.map +0 -1
- package/dist/context-validation-integration.d.ts +0 -69
- package/dist/context-validation-integration.d.ts.map +0 -1
- package/dist/context-validation-integration.js +0 -161
- package/dist/context-validation-integration.js.map +0 -1
- package/dist/core/scope-checker.d.ts +0 -80
- package/dist/core/scope-checker.d.ts.map +0 -1
- package/dist/core/scope-checker.js +0 -166
- package/dist/core/scope-checker.js.map +0 -1
- package/dist/core/tool-runner.d.ts +0 -136
- package/dist/core/tool-runner.d.ts.map +0 -1
- package/dist/core/tool-runner.js +0 -396
- package/dist/core/tool-runner.js.map +0 -1
- package/dist/core/tool.constants.d.ts +0 -106
- package/dist/core/tool.constants.d.ts.map +0 -1
- package/dist/core/tool.constants.js +0 -104
- package/dist/core/tool.constants.js.map +0 -1
- package/dist/core/tool.schemas.d.ts +0 -227
- package/dist/core/tool.schemas.d.ts.map +0 -1
- package/dist/core/tool.schemas.js +0 -229
- package/dist/core/tool.schemas.js.map +0 -1
- package/dist/core/worktree-guard.d.ts +0 -115
- package/dist/core/worktree-guard.d.ts.map +0 -1
- package/dist/core/worktree-guard.js +0 -245
- package/dist/core/worktree-guard.js.map +0 -1
- package/dist/coverage-gate.d.ts +0 -126
- package/dist/coverage-gate.d.ts.map +0 -1
- package/dist/coverage-gate.js +0 -209
- package/dist/coverage-gate.js.map +0 -1
- package/dist/cycle-detector.d.ts +0 -52
- package/dist/cycle-detector.d.ts.map +0 -1
- package/dist/cycle-detector.js +0 -84
- package/dist/cycle-detector.js.map +0 -1
- package/dist/date-utils.d.ts +0 -66
- package/dist/date-utils.d.ts.map +0 -1
- package/dist/date-utils.js +0 -143
- package/dist/date-utils.js.map +0 -1
- package/dist/delegation-escalation.d.ts +0 -71
- package/dist/delegation-escalation.d.ts.map +0 -1
- package/dist/delegation-escalation.js +0 -264
- package/dist/delegation-escalation.js.map +0 -1
- package/dist/delegation-monitor.d.ts +0 -262
- package/dist/delegation-monitor.d.ts.map +0 -1
- package/dist/delegation-monitor.js +0 -678
- package/dist/delegation-monitor.js.map +0 -1
- package/dist/delegation-recovery.d.ts +0 -62
- package/dist/delegation-recovery.d.ts.map +0 -1
- package/dist/delegation-recovery.js +0 -304
- package/dist/delegation-recovery.js.map +0 -1
- package/dist/delegation-registry-schema.d.ts +0 -75
- package/dist/delegation-registry-schema.d.ts.map +0 -1
- package/dist/delegation-registry-schema.js +0 -93
- package/dist/delegation-registry-schema.js.map +0 -1
- package/dist/delegation-registry-store.d.ts +0 -145
- package/dist/delegation-registry-store.d.ts.map +0 -1
- package/dist/delegation-registry-store.js +0 -308
- package/dist/delegation-registry-store.js.map +0 -1
- package/dist/delegation-tree.d.ts +0 -52
- package/dist/delegation-tree.d.ts.map +0 -1
- package/dist/delegation-tree.js +0 -205
- package/dist/delegation-tree.js.map +0 -1
- package/dist/dependency-graph.d.ts +0 -169
- package/dist/dependency-graph.d.ts.map +0 -1
- package/dist/dependency-graph.js +0 -612
- package/dist/dependency-graph.js.map +0 -1
- package/dist/dependency-guard.d.ts +0 -41
- package/dist/dependency-guard.d.ts.map +0 -1
- package/dist/dependency-guard.js +0 -145
- package/dist/dependency-guard.js.map +0 -1
- package/dist/dependency-validator.d.ts +0 -89
- package/dist/dependency-validator.d.ts.map +0 -1
- package/dist/dependency-validator.js +0 -155
- package/dist/dependency-validator.js.map +0 -1
- package/dist/docs-path-validator.d.ts +0 -16
- package/dist/docs-path-validator.d.ts.map +0 -1
- package/dist/docs-path-validator.js +0 -98
- package/dist/docs-path-validator.js.map +0 -1
- package/dist/domain/context.schemas.d.ts +0 -170
- package/dist/domain/context.schemas.d.ts.map +0 -1
- package/dist/domain/context.schemas.js +0 -151
- package/dist/domain/context.schemas.js.map +0 -1
- package/dist/domain/index.d.ts +0 -15
- package/dist/domain/index.d.ts.map +0 -1
- package/dist/domain/index.js +0 -23
- package/dist/domain/index.js.map +0 -1
- package/dist/domain/orchestration.constants.d.ts +0 -111
- package/dist/domain/orchestration.constants.d.ts.map +0 -1
- package/dist/domain/orchestration.constants.js +0 -130
- package/dist/domain/orchestration.constants.js.map +0 -1
- package/dist/domain/orchestration.schemas.d.ts +0 -307
- package/dist/domain/orchestration.schemas.d.ts.map +0 -1
- package/dist/domain/orchestration.schemas.js +0 -214
- package/dist/domain/orchestration.schemas.js.map +0 -1
- package/dist/domain/orchestration.types.d.ts +0 -134
- package/dist/domain/orchestration.types.d.ts.map +0 -1
- package/dist/domain/orchestration.types.js +0 -5
- package/dist/domain/orchestration.types.js.map +0 -1
- package/dist/domain/recovery.schemas.d.ts +0 -164
- package/dist/domain/recovery.schemas.d.ts.map +0 -1
- package/dist/domain/recovery.schemas.js +0 -134
- package/dist/domain/recovery.schemas.js.map +0 -1
- package/dist/domain/validation.schemas.d.ts +0 -147
- package/dist/domain/validation.schemas.d.ts.map +0 -1
- package/dist/domain/validation.schemas.js +0 -117
- package/dist/domain/validation.schemas.js.map +0 -1
- package/dist/error-handler.d.ts +0 -144
- package/dist/error-handler.d.ts.map +0 -1
- package/dist/error-handler.js +0 -214
- package/dist/error-handler.js.map +0 -1
- package/dist/file-classifiers.d.ts +0 -63
- package/dist/file-classifiers.d.ts.map +0 -1
- package/dist/file-classifiers.js +0 -111
- package/dist/file-classifiers.js.map +0 -1
- package/dist/force-bypass-audit.d.ts +0 -47
- package/dist/force-bypass-audit.d.ts.map +0 -1
- package/dist/force-bypass-audit.js +0 -146
- package/dist/force-bypass-audit.js.map +0 -1
- package/dist/gates-agent-mode.d.ts +0 -107
- package/dist/gates-agent-mode.d.ts.map +0 -1
- package/dist/gates-agent-mode.js +0 -138
- package/dist/gates-agent-mode.js.map +0 -1
- package/dist/gates-config.d.ts +0 -268
- package/dist/gates-config.d.ts.map +0 -1
- package/dist/gates-config.js +0 -644
- package/dist/gates-config.js.map +0 -1
- package/dist/generate-traceability.d.ts +0 -106
- package/dist/generate-traceability.d.ts.map +0 -1
- package/dist/generate-traceability.js +0 -387
- package/dist/generate-traceability.js.map +0 -1
- package/dist/git-adapter.d.ts +0 -406
- package/dist/git-adapter.d.ts.map +0 -1
- package/dist/git-adapter.js +0 -686
- package/dist/git-adapter.js.map +0 -1
- package/dist/git-context-extractor.d.ts +0 -102
- package/dist/git-context-extractor.d.ts.map +0 -1
- package/dist/git-context-extractor.js +0 -571
- package/dist/git-context-extractor.js.map +0 -1
- package/dist/git-staged-validator.d.ts +0 -33
- package/dist/git-staged-validator.d.ts.map +0 -1
- package/dist/git-staged-validator.js +0 -52
- package/dist/git-staged-validator.js.map +0 -1
- package/dist/hardcoded-strings.d.ts +0 -67
- package/dist/hardcoded-strings.d.ts.map +0 -1
- package/dist/hardcoded-strings.js +0 -276
- package/dist/hardcoded-strings.js.map +0 -1
- package/dist/incremental-lint.d.ts +0 -71
- package/dist/incremental-lint.d.ts.map +0 -1
- package/dist/incremental-lint.js +0 -132
- package/dist/incremental-lint.js.map +0 -1
- package/dist/incremental-test.d.ts +0 -33
- package/dist/incremental-test.d.ts.map +0 -1
- package/dist/incremental-test.js +0 -64
- package/dist/incremental-test.js.map +0 -1
- package/dist/index.d.ts +0 -104
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/invariants/check-automated-tests.d.ts +0 -42
- package/dist/invariants/check-automated-tests.d.ts.map +0 -1
- package/dist/invariants/check-automated-tests.js +0 -171
- package/dist/invariants/check-automated-tests.js.map +0 -1
- package/dist/invariants-runner.d.ts +0 -108
- package/dist/invariants-runner.d.ts.map +0 -1
- package/dist/invariants-runner.js +0 -547
- package/dist/invariants-runner.js.map +0 -1
- package/dist/lane-checker.d.ts +0 -132
- package/dist/lane-checker.d.ts.map +0 -1
- package/dist/lane-checker.js +0 -743
- package/dist/lane-checker.js.map +0 -1
- package/dist/lane-inference.d.ts +0 -29
- package/dist/lane-inference.d.ts.map +0 -1
- package/dist/lane-inference.js +0 -210
- package/dist/lane-inference.js.map +0 -1
- package/dist/lane-lock.d.ts +0 -220
- package/dist/lane-lock.d.ts.map +0 -1
- package/dist/lane-lock.js +0 -499
- package/dist/lane-lock.js.map +0 -1
- package/dist/lane-suggest-prompt.d.ts +0 -97
- package/dist/lane-suggest-prompt.d.ts.map +0 -1
- package/dist/lane-suggest-prompt.js +0 -362
- package/dist/lane-suggest-prompt.js.map +0 -1
- package/dist/lane-validator.d.ts +0 -49
- package/dist/lane-validator.d.ts.map +0 -1
- package/dist/lane-validator.js +0 -117
- package/dist/lane-validator.js.map +0 -1
- package/dist/logs-lib.d.ts +0 -89
- package/dist/logs-lib.d.ts.map +0 -1
- package/dist/logs-lib.js +0 -214
- package/dist/logs-lib.js.map +0 -1
- package/dist/lumenflow-config-schema.d.ts +0 -1428
- package/dist/lumenflow-config-schema.d.ts.map +0 -1
- package/dist/lumenflow-config-schema.js +0 -1255
- package/dist/lumenflow-config-schema.js.map +0 -1
- package/dist/lumenflow-config.d.ts +0 -94
- package/dist/lumenflow-config.d.ts.map +0 -1
- package/dist/lumenflow-config.js +0 -253
- package/dist/lumenflow-config.js.map +0 -1
- package/dist/lumenflow-home.d.ts +0 -118
- package/dist/lumenflow-home.d.ts.map +0 -1
- package/dist/lumenflow-home.js +0 -214
- package/dist/lumenflow-home.js.map +0 -1
- package/dist/manual-test-validator.d.ts +0 -84
- package/dist/manual-test-validator.d.ts.map +0 -1
- package/dist/manual-test-validator.js +0 -206
- package/dist/manual-test-validator.js.map +0 -1
- package/dist/merge-lock.d.ts +0 -107
- package/dist/merge-lock.d.ts.map +0 -1
- package/dist/merge-lock.js +0 -263
- package/dist/merge-lock.js.map +0 -1
- package/dist/micro-worktree-shared.d.ts +0 -128
- package/dist/micro-worktree-shared.d.ts.map +0 -1
- package/dist/micro-worktree-shared.js +0 -352
- package/dist/micro-worktree-shared.js.map +0 -1
- package/dist/micro-worktree.d.ts +0 -165
- package/dist/micro-worktree.d.ts.map +0 -1
- package/dist/micro-worktree.js +0 -463
- package/dist/micro-worktree.js.map +0 -1
- package/dist/migration-deployer.d.ts +0 -70
- package/dist/migration-deployer.d.ts.map +0 -1
- package/dist/migration-deployer.js +0 -152
- package/dist/migration-deployer.js.map +0 -1
- package/dist/normalize-config-keys.d.ts +0 -10
- package/dist/normalize-config-keys.d.ts.map +0 -1
- package/dist/normalize-config-keys.js +0 -70
- package/dist/normalize-config-keys.js.map +0 -1
- package/dist/orchestration-advisory-loader.d.ts +0 -19
- package/dist/orchestration-advisory-loader.d.ts.map +0 -1
- package/dist/orchestration-advisory-loader.js +0 -94
- package/dist/orchestration-advisory-loader.js.map +0 -1
- package/dist/orchestration-advisory.d.ts +0 -49
- package/dist/orchestration-advisory.d.ts.map +0 -1
- package/dist/orchestration-advisory.js +0 -97
- package/dist/orchestration-advisory.js.map +0 -1
- package/dist/orchestration-di.d.ts +0 -36
- package/dist/orchestration-di.d.ts.map +0 -1
- package/dist/orchestration-di.js +0 -60
- package/dist/orchestration-di.js.map +0 -1
- package/dist/orchestration-rules.d.ts +0 -60
- package/dist/orchestration-rules.d.ts.map +0 -1
- package/dist/orchestration-rules.js +0 -212
- package/dist/orchestration-rules.js.map +0 -1
- package/dist/orphan-detector.d.ts +0 -148
- package/dist/orphan-detector.d.ts.map +0 -1
- package/dist/orphan-detector.js +0 -253
- package/dist/orphan-detector.js.map +0 -1
- package/dist/pack-authoring-template-engine.d.ts +0 -54
- package/dist/pack-authoring-template-engine.d.ts.map +0 -1
- package/dist/pack-authoring-template-engine.js +0 -510
- package/dist/pack-authoring-template-engine.js.map +0 -1
- package/dist/path-classifiers.d.ts +0 -58
- package/dist/path-classifiers.d.ts.map +0 -1
- package/dist/path-classifiers.js +0 -96
- package/dist/path-classifiers.js.map +0 -1
- package/dist/patrol-loop.d.ts +0 -171
- package/dist/patrol-loop.d.ts.map +0 -1
- package/dist/patrol-loop.js +0 -197
- package/dist/patrol-loop.js.map +0 -1
- package/dist/piped-command-detector.d.ts +0 -25
- package/dist/piped-command-detector.d.ts.map +0 -1
- package/dist/piped-command-detector.js +0 -67
- package/dist/piped-command-detector.js.map +0 -1
- package/dist/ports/context.ports.d.ts +0 -136
- package/dist/ports/context.ports.d.ts.map +0 -1
- package/dist/ports/context.ports.js +0 -4
- package/dist/ports/context.ports.js.map +0 -1
- package/dist/ports/core-tools.ports.d.ts +0 -282
- package/dist/ports/core-tools.ports.d.ts.map +0 -1
- package/dist/ports/core-tools.ports.js +0 -4
- package/dist/ports/core-tools.ports.js.map +0 -1
- package/dist/ports/dashboard-renderer.port.d.ts +0 -113
- package/dist/ports/dashboard-renderer.port.d.ts.map +0 -1
- package/dist/ports/dashboard-renderer.port.js +0 -4
- package/dist/ports/dashboard-renderer.port.js.map +0 -1
- package/dist/ports/git-validator.ports.d.ts +0 -114
- package/dist/ports/git-validator.ports.d.ts.map +0 -1
- package/dist/ports/git-validator.ports.js +0 -4
- package/dist/ports/git-validator.ports.js.map +0 -1
- package/dist/ports/index.d.ts +0 -21
- package/dist/ports/index.d.ts.map +0 -1
- package/dist/ports/index.js +0 -23
- package/dist/ports/index.js.map +0 -1
- package/dist/ports/metrics-collector.port.d.ts +0 -133
- package/dist/ports/metrics-collector.port.d.ts.map +0 -1
- package/dist/ports/metrics-collector.port.js +0 -4
- package/dist/ports/metrics-collector.port.js.map +0 -1
- package/dist/ports/recovery.ports.d.ts +0 -59
- package/dist/ports/recovery.ports.d.ts.map +0 -1
- package/dist/ports/recovery.ports.js +0 -4
- package/dist/ports/recovery.ports.js.map +0 -1
- package/dist/ports/validation.ports.d.ts +0 -75
- package/dist/ports/validation.ports.d.ts.map +0 -1
- package/dist/ports/validation.ports.js +0 -4
- package/dist/ports/validation.ports.js.map +0 -1
- package/dist/ports/wu-helpers.ports.d.ts +0 -227
- package/dist/ports/wu-helpers.ports.d.ts.map +0 -1
- package/dist/ports/wu-helpers.ports.js +0 -4
- package/dist/ports/wu-helpers.ports.js.map +0 -1
- package/dist/process-detector.d.ts +0 -69
- package/dist/process-detector.d.ts.map +0 -1
- package/dist/process-detector.js +0 -175
- package/dist/process-detector.js.map +0 -1
- package/dist/prompt-linter.d.ts +0 -66
- package/dist/prompt-linter.d.ts.map +0 -1
- package/dist/prompt-linter.js +0 -323
- package/dist/prompt-linter.js.map +0 -1
- package/dist/prompt-monitor.d.ts +0 -6
- package/dist/prompt-monitor.d.ts.map +0 -1
- package/dist/prompt-monitor.js +0 -218
- package/dist/prompt-monitor.js.map +0 -1
- package/dist/rebase-artifact-cleanup.d.ts +0 -156
- package/dist/rebase-artifact-cleanup.d.ts.map +0 -1
- package/dist/rebase-artifact-cleanup.js +0 -475
- package/dist/rebase-artifact-cleanup.js.map +0 -1
- package/dist/recovery/index.d.ts +0 -12
- package/dist/recovery/index.d.ts.map +0 -1
- package/dist/recovery/index.js +0 -14
- package/dist/recovery/index.js.map +0 -1
- package/dist/recovery/recovery-analyzer.d.ts +0 -49
- package/dist/recovery/recovery-analyzer.d.ts.map +0 -1
- package/dist/recovery/recovery-analyzer.js +0 -149
- package/dist/recovery/recovery-analyzer.js.map +0 -1
- package/dist/resolve-policy.d.ts +0 -257
- package/dist/resolve-policy.d.ts.map +0 -1
- package/dist/resolve-policy.js +0 -269
- package/dist/resolve-policy.js.map +0 -1
- package/dist/retry-strategy.d.ts +0 -191
- package/dist/retry-strategy.d.ts.map +0 -1
- package/dist/retry-strategy.js +0 -286
- package/dist/retry-strategy.js.map +0 -1
- package/dist/risk-detector.d.ts +0 -109
- package/dist/risk-detector.d.ts.map +0 -1
- package/dist/risk-detector.js +0 -253
- package/dist/risk-detector.js.map +0 -1
- package/dist/rollback-utils.d.ts +0 -129
- package/dist/rollback-utils.d.ts.map +0 -1
- package/dist/rollback-utils.js +0 -217
- package/dist/rollback-utils.js.map +0 -1
- package/dist/sandbox-allowlist.d.ts +0 -16
- package/dist/sandbox-allowlist.d.ts.map +0 -1
- package/dist/sandbox-allowlist.js +0 -77
- package/dist/sandbox-allowlist.js.map +0 -1
- package/dist/sandbox-backend-linux.d.ts +0 -6
- package/dist/sandbox-backend-linux.d.ts.map +0 -1
- package/dist/sandbox-backend-linux.js +0 -67
- package/dist/sandbox-backend-linux.js.map +0 -1
- package/dist/sandbox-backend-macos.d.ts +0 -6
- package/dist/sandbox-backend-macos.d.ts.map +0 -1
- package/dist/sandbox-backend-macos.js +0 -66
- package/dist/sandbox-backend-macos.js.map +0 -1
- package/dist/sandbox-backend-windows.d.ts +0 -6
- package/dist/sandbox-backend-windows.d.ts.map +0 -1
- package/dist/sandbox-backend-windows.js +0 -30
- package/dist/sandbox-backend-windows.js.map +0 -1
- package/dist/sandbox-profile.d.ts +0 -53
- package/dist/sandbox-profile.d.ts.map +0 -1
- package/dist/sandbox-profile.js +0 -64
- package/dist/sandbox-profile.js.map +0 -1
- package/dist/schemas/arg-validators.d.ts +0 -58
- package/dist/schemas/arg-validators.d.ts.map +0 -1
- package/dist/schemas/arg-validators.js +0 -193
- package/dist/schemas/arg-validators.js.map +0 -1
- package/dist/schemas/command-schemas.d.ts +0 -171
- package/dist/schemas/command-schemas.d.ts.map +0 -1
- package/dist/schemas/command-schemas.js +0 -145
- package/dist/schemas/command-schemas.js.map +0 -1
- package/dist/schemas/flow-arg-validators.d.ts +0 -32
- package/dist/schemas/flow-arg-validators.d.ts.map +0 -1
- package/dist/schemas/flow-arg-validators.js +0 -57
- package/dist/schemas/flow-arg-validators.js.map +0 -1
- package/dist/schemas/flow-schemas.d.ts +0 -152
- package/dist/schemas/flow-schemas.d.ts.map +0 -1
- package/dist/schemas/flow-schemas.js +0 -105
- package/dist/schemas/flow-schemas.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -33
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -96
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/initiative-arg-validators.d.ts +0 -64
- package/dist/schemas/initiative-arg-validators.d.ts.map +0 -1
- package/dist/schemas/initiative-arg-validators.js +0 -65
- package/dist/schemas/initiative-arg-validators.js.map +0 -1
- package/dist/schemas/initiative-schemas.d.ts +0 -256
- package/dist/schemas/initiative-schemas.d.ts.map +0 -1
- package/dist/schemas/initiative-schemas.js +0 -186
- package/dist/schemas/initiative-schemas.js.map +0 -1
- package/dist/schemas/memory-arg-validators.d.ts +0 -91
- package/dist/schemas/memory-arg-validators.d.ts.map +0 -1
- package/dist/schemas/memory-arg-validators.js +0 -75
- package/dist/schemas/memory-arg-validators.js.map +0 -1
- package/dist/schemas/memory-schemas.d.ts +0 -287
- package/dist/schemas/memory-schemas.d.ts.map +0 -1
- package/dist/schemas/memory-schemas.js +0 -242
- package/dist/schemas/memory-schemas.js.map +0 -1
- package/dist/schemas/schema-utils.d.ts +0 -87
- package/dist/schemas/schema-utils.d.ts.map +0 -1
- package/dist/schemas/schema-utils.js +0 -320
- package/dist/schemas/schema-utils.js.map +0 -1
- package/dist/schemas/setup-arg-validators.d.ts +0 -91
- package/dist/schemas/setup-arg-validators.d.ts.map +0 -1
- package/dist/schemas/setup-arg-validators.js +0 -98
- package/dist/schemas/setup-arg-validators.js.map +0 -1
- package/dist/schemas/setup-schemas.d.ts +0 -335
- package/dist/schemas/setup-schemas.d.ts.map +0 -1
- package/dist/schemas/setup-schemas.js +0 -260
- package/dist/schemas/setup-schemas.js.map +0 -1
- package/dist/schemas/validation-arg-validators.d.ts +0 -18
- package/dist/schemas/validation-arg-validators.d.ts.map +0 -1
- package/dist/schemas/validation-arg-validators.js +0 -59
- package/dist/schemas/validation-arg-validators.js.map +0 -1
- package/dist/schemas/validation-schemas.d.ts +0 -80
- package/dist/schemas/validation-schemas.d.ts.map +0 -1
- package/dist/schemas/validation-schemas.js +0 -88
- package/dist/schemas/validation-schemas.js.map +0 -1
- package/dist/schemas/wu-lifecycle-arg-validators.d.ts +0 -118
- package/dist/schemas/wu-lifecycle-arg-validators.d.ts.map +0 -1
- package/dist/schemas/wu-lifecycle-arg-validators.js +0 -82
- package/dist/schemas/wu-lifecycle-arg-validators.js.map +0 -1
- package/dist/schemas/wu-lifecycle-schemas.d.ts +0 -362
- package/dist/schemas/wu-lifecycle-schemas.d.ts.map +0 -1
- package/dist/schemas/wu-lifecycle-schemas.js +0 -284
- package/dist/schemas/wu-lifecycle-schemas.js.map +0 -1
- package/dist/section-headings.d.ts +0 -35
- package/dist/section-headings.d.ts.map +0 -1
- package/dist/section-headings.js +0 -54
- package/dist/section-headings.js.map +0 -1
- package/dist/spawn-escalation.d.ts +0 -91
- package/dist/spawn-escalation.d.ts.map +0 -1
- package/dist/spawn-escalation.js +0 -258
- package/dist/spawn-escalation.js.map +0 -1
- package/dist/spawn-monitor.d.ts +0 -230
- package/dist/spawn-monitor.d.ts.map +0 -1
- package/dist/spawn-monitor.js +0 -675
- package/dist/spawn-monitor.js.map +0 -1
- package/dist/spawn-prompt-schema.d.ts +0 -107
- package/dist/spawn-prompt-schema.d.ts.map +0 -1
- package/dist/spawn-prompt-schema.js +0 -163
- package/dist/spawn-prompt-schema.js.map +0 -1
- package/dist/spawn-recovery.d.ts +0 -83
- package/dist/spawn-recovery.d.ts.map +0 -1
- package/dist/spawn-recovery.js +0 -299
- package/dist/spawn-recovery.js.map +0 -1
- package/dist/spawn-registry-schema.d.ts +0 -122
- package/dist/spawn-registry-schema.d.ts.map +0 -1
- package/dist/spawn-registry-schema.js +0 -129
- package/dist/spawn-registry-schema.js.map +0 -1
- package/dist/spawn-registry-store.d.ts +0 -161
- package/dist/spawn-registry-store.d.ts.map +0 -1
- package/dist/spawn-registry-store.js +0 -301
- package/dist/spawn-registry-store.js.map +0 -1
- package/dist/spawn-strategy.d.ts +0 -60
- package/dist/spawn-strategy.d.ts.map +0 -1
- package/dist/spawn-strategy.js +0 -112
- package/dist/spawn-strategy.js.map +0 -1
- package/dist/spawn-tree.d.ts +0 -125
- package/dist/spawn-tree.d.ts.map +0 -1
- package/dist/spawn-tree.js +0 -286
- package/dist/spawn-tree.js.map +0 -1
- package/dist/stamp-status-validator.d.ts +0 -77
- package/dist/stamp-status-validator.d.ts.map +0 -1
- package/dist/stamp-status-validator.js +0 -138
- package/dist/stamp-status-validator.js.map +0 -1
- package/dist/stamp-tracking.d.ts +0 -12
- package/dist/stamp-tracking.d.ts.map +0 -1
- package/dist/stamp-tracking.js +0 -43
- package/dist/stamp-tracking.js.map +0 -1
- package/dist/stamp-utils.d.ts +0 -94
- package/dist/stamp-utils.d.ts.map +0 -1
- package/dist/stamp-utils.js +0 -245
- package/dist/stamp-utils.js.map +0 -1
- package/dist/state-cleanup-core.d.ts +0 -206
- package/dist/state-cleanup-core.d.ts.map +0 -1
- package/dist/state-cleanup-core.js +0 -225
- package/dist/state-cleanup-core.js.map +0 -1
- package/dist/state-doctor-core.d.ts +0 -177
- package/dist/state-doctor-core.d.ts.map +0 -1
- package/dist/state-doctor-core.js +0 -395
- package/dist/state-doctor-core.js.map +0 -1
- package/dist/state-machine.d.ts +0 -10
- package/dist/state-machine.d.ts.map +0 -1
- package/dist/state-machine.js +0 -89
- package/dist/state-machine.js.map +0 -1
- package/dist/stream-error-handler.d.ts +0 -68
- package/dist/stream-error-handler.d.ts.map +0 -1
- package/dist/stream-error-handler.js +0 -77
- package/dist/stream-error-handler.js.map +0 -1
- package/dist/system-map-validator.d.ts +0 -111
- package/dist/system-map-validator.d.ts.map +0 -1
- package/dist/system-map-validator.js +0 -383
- package/dist/system-map-validator.js.map +0 -1
- package/dist/telemetry.d.ts +0 -81
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/telemetry.js +0 -219
- package/dist/telemetry.js.map +0 -1
- package/dist/template-loader.d.ts +0 -151
- package/dist/template-loader.d.ts.map +0 -1
- package/dist/template-loader.js +0 -400
- package/dist/template-loader.js.map +0 -1
- package/dist/test-baseline.d.ts +0 -177
- package/dist/test-baseline.d.ts.map +0 -1
- package/dist/test-baseline.js +0 -286
- package/dist/test-baseline.js.map +0 -1
- package/dist/token-counter.d.ts +0 -50
- package/dist/token-counter.d.ts.map +0 -1
- package/dist/token-counter.js +0 -144
- package/dist/token-counter.js.map +0 -1
- package/dist/usecases/analyze-recovery.usecase.d.ts +0 -43
- package/dist/usecases/analyze-recovery.usecase.d.ts.map +0 -1
- package/dist/usecases/analyze-recovery.usecase.js +0 -34
- package/dist/usecases/analyze-recovery.usecase.js.map +0 -1
- package/dist/usecases/compute-context.usecase.d.ts +0 -63
- package/dist/usecases/compute-context.usecase.d.ts.map +0 -1
- package/dist/usecases/compute-context.usecase.js +0 -91
- package/dist/usecases/compute-context.usecase.js.map +0 -1
- package/dist/usecases/get-dashboard-data.usecase.d.ts +0 -53
- package/dist/usecases/get-dashboard-data.usecase.d.ts.map +0 -1
- package/dist/usecases/get-dashboard-data.usecase.js +0 -54
- package/dist/usecases/get-dashboard-data.usecase.js.map +0 -1
- package/dist/usecases/get-suggestions.usecase.d.ts +0 -101
- package/dist/usecases/get-suggestions.usecase.d.ts.map +0 -1
- package/dist/usecases/get-suggestions.usecase.js +0 -148
- package/dist/usecases/get-suggestions.usecase.js.map +0 -1
- package/dist/usecases/index.d.ts +0 -15
- package/dist/usecases/index.d.ts.map +0 -1
- package/dist/usecases/index.js +0 -21
- package/dist/usecases/index.js.map +0 -1
- package/dist/usecases/validate-command.usecase.d.ts +0 -56
- package/dist/usecases/validate-command.usecase.d.ts.map +0 -1
- package/dist/usecases/validate-command.usecase.js +0 -143
- package/dist/usecases/validate-command.usecase.js.map +0 -1
- package/dist/user-normalizer.d.ts +0 -36
- package/dist/user-normalizer.d.ts.map +0 -1
- package/dist/user-normalizer.js +0 -149
- package/dist/user-normalizer.js.map +0 -1
- package/dist/validation/command-registry.d.ts +0 -26
- package/dist/validation/command-registry.d.ts.map +0 -1
- package/dist/validation/command-registry.js +0 -269
- package/dist/validation/command-registry.js.map +0 -1
- package/dist/validation/index.d.ts +0 -16
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js +0 -18
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/types.d.ts +0 -140
- package/dist/validation/types.d.ts.map +0 -1
- package/dist/validation/types.js +0 -4
- package/dist/validation/types.js.map +0 -1
- package/dist/validation/validate-command.d.ts +0 -16
- package/dist/validation/validate-command.d.ts.map +0 -1
- package/dist/validation/validate-command.js +0 -163
- package/dist/validation/validate-command.js.map +0 -1
- package/dist/validators/backlog-sync.d.ts +0 -11
- package/dist/validators/backlog-sync.d.ts.map +0 -1
- package/dist/validators/backlog-sync.js +0 -65
- package/dist/validators/backlog-sync.js.map +0 -1
- package/dist/validators/phi-constants.d.ts +0 -98
- package/dist/validators/phi-constants.d.ts.map +0 -1
- package/dist/validators/phi-constants.js +0 -153
- package/dist/validators/phi-constants.js.map +0 -1
- package/dist/validators/phi-scanner.d.ts +0 -59
- package/dist/validators/phi-scanner.d.ts.map +0 -1
- package/dist/validators/phi-scanner.js +0 -222
- package/dist/validators/phi-scanner.js.map +0 -1
- package/dist/validators/supabase-docs-linter.d.ts +0 -15
- package/dist/validators/supabase-docs-linter.d.ts.map +0 -1
- package/dist/validators/supabase-docs-linter.js +0 -45
- package/dist/validators/supabase-docs-linter.js.map +0 -1
- package/dist/validators/wu-tasks.d.ts +0 -21
- package/dist/validators/wu-tasks.d.ts.map +0 -1
- package/dist/validators/wu-tasks.js +0 -93
- package/dist/validators/wu-tasks.js.map +0 -1
- package/dist/work-classifier.d.ts +0 -95
- package/dist/work-classifier.d.ts.map +0 -1
- package/dist/work-classifier.js +0 -408
- package/dist/work-classifier.js.map +0 -1
- package/dist/worktree-ownership.d.ts +0 -51
- package/dist/worktree-ownership.d.ts.map +0 -1
- package/dist/worktree-ownership.js +0 -77
- package/dist/worktree-ownership.js.map +0 -1
- package/dist/worktree-scanner.d.ts +0 -118
- package/dist/worktree-scanner.d.ts.map +0 -1
- package/dist/worktree-scanner.js +0 -171
- package/dist/worktree-scanner.js.map +0 -1
- package/dist/worktree-symlink.d.ts +0 -86
- package/dist/worktree-symlink.d.ts.map +0 -1
- package/dist/worktree-symlink.js +0 -349
- package/dist/worktree-symlink.js.map +0 -1
- package/dist/wu-backlog-updater.d.ts +0 -10
- package/dist/wu-backlog-updater.d.ts.map +0 -1
- package/dist/wu-backlog-updater.js +0 -40
- package/dist/wu-backlog-updater.js.map +0 -1
- package/dist/wu-checkpoint.d.ts +0 -110
- package/dist/wu-checkpoint.d.ts.map +0 -1
- package/dist/wu-checkpoint.js +0 -236
- package/dist/wu-checkpoint.js.map +0 -1
- package/dist/wu-claim-helpers.d.ts +0 -21
- package/dist/wu-claim-helpers.d.ts.map +0 -1
- package/dist/wu-claim-helpers.js +0 -66
- package/dist/wu-claim-helpers.js.map +0 -1
- package/dist/wu-claim-resume.d.ts +0 -106
- package/dist/wu-claim-resume.d.ts.map +0 -1
- package/dist/wu-claim-resume.js +0 -279
- package/dist/wu-claim-resume.js.map +0 -1
- package/dist/wu-cli-constants.d.ts +0 -425
- package/dist/wu-cli-constants.d.ts.map +0 -1
- package/dist/wu-cli-constants.js +0 -430
- package/dist/wu-cli-constants.js.map +0 -1
- package/dist/wu-consistency-checker.d.ts +0 -189
- package/dist/wu-consistency-checker.d.ts.map +0 -1
- package/dist/wu-consistency-checker.js +0 -1026
- package/dist/wu-consistency-checker.js.map +0 -1
- package/dist/wu-constants.d.ts +0 -29
- package/dist/wu-constants.d.ts.map +0 -1
- package/dist/wu-constants.js +0 -37
- package/dist/wu-constants.js.map +0 -1
- package/dist/wu-context-constants.d.ts +0 -270
- package/dist/wu-context-constants.d.ts.map +0 -1
- package/dist/wu-context-constants.js +0 -267
- package/dist/wu-context-constants.js.map +0 -1
- package/dist/wu-create-defaults.d.ts +0 -11
- package/dist/wu-create-defaults.d.ts.map +0 -1
- package/dist/wu-create-defaults.js +0 -13
- package/dist/wu-create-defaults.js.map +0 -1
- package/dist/wu-create-validators.d.ts +0 -89
- package/dist/wu-create-validators.d.ts.map +0 -1
- package/dist/wu-create-validators.js +0 -215
- package/dist/wu-create-validators.js.map +0 -1
- package/dist/wu-domain-constants.d.ts +0 -295
- package/dist/wu-domain-constants.d.ts.map +0 -1
- package/dist/wu-domain-constants.js +0 -399
- package/dist/wu-domain-constants.js.map +0 -1
- package/dist/wu-done-branch-only.d.ts +0 -120
- package/dist/wu-done-branch-only.d.ts.map +0 -1
- package/dist/wu-done-branch-only.js +0 -412
- package/dist/wu-done-branch-only.js.map +0 -1
- package/dist/wu-done-branch-utils.d.ts +0 -8
- package/dist/wu-done-branch-utils.d.ts.map +0 -1
- package/dist/wu-done-branch-utils.js +0 -34
- package/dist/wu-done-branch-utils.js.map +0 -1
- package/dist/wu-done-cleanup.d.ts +0 -6
- package/dist/wu-done-cleanup.d.ts.map +0 -1
- package/dist/wu-done-cleanup.js +0 -161
- package/dist/wu-done-cleanup.js.map +0 -1
- package/dist/wu-done-concurrent-merge.d.ts +0 -103
- package/dist/wu-done-concurrent-merge.d.ts.map +0 -1
- package/dist/wu-done-concurrent-merge.js +0 -375
- package/dist/wu-done-concurrent-merge.js.map +0 -1
- package/dist/wu-done-docs-generate.d.ts +0 -72
- package/dist/wu-done-docs-generate.d.ts.map +0 -1
- package/dist/wu-done-docs-generate.js +0 -129
- package/dist/wu-done-docs-generate.js.map +0 -1
- package/dist/wu-done-docs-only.d.ts +0 -16
- package/dist/wu-done-docs-only.d.ts.map +0 -1
- package/dist/wu-done-docs-only.js +0 -68
- package/dist/wu-done-docs-only.js.map +0 -1
- package/dist/wu-done-errors.d.ts +0 -13
- package/dist/wu-done-errors.d.ts.map +0 -1
- package/dist/wu-done-errors.js +0 -27
- package/dist/wu-done-errors.js.map +0 -1
- package/dist/wu-done-initiative-sync.d.ts +0 -13
- package/dist/wu-done-initiative-sync.d.ts.map +0 -1
- package/dist/wu-done-initiative-sync.js +0 -235
- package/dist/wu-done-initiative-sync.js.map +0 -1
- package/dist/wu-done-inputs.d.ts +0 -10
- package/dist/wu-done-inputs.d.ts.map +0 -1
- package/dist/wu-done-inputs.js +0 -55
- package/dist/wu-done-inputs.js.map +0 -1
- package/dist/wu-done-machine.d.ts +0 -175
- package/dist/wu-done-machine.d.ts.map +0 -1
- package/dist/wu-done-machine.js +0 -227
- package/dist/wu-done-machine.js.map +0 -1
- package/dist/wu-done-merged-worktree.d.ts +0 -65
- package/dist/wu-done-merged-worktree.d.ts.map +0 -1
- package/dist/wu-done-merged-worktree.js +0 -197
- package/dist/wu-done-merged-worktree.js.map +0 -1
- package/dist/wu-done-messages.d.ts +0 -120
- package/dist/wu-done-messages.d.ts.map +0 -1
- package/dist/wu-done-messages.js +0 -191
- package/dist/wu-done-messages.js.map +0 -1
- package/dist/wu-done-metadata.d.ts +0 -123
- package/dist/wu-done-metadata.d.ts.map +0 -1
- package/dist/wu-done-metadata.js +0 -240
- package/dist/wu-done-metadata.js.map +0 -1
- package/dist/wu-done-paths.d.ts +0 -87
- package/dist/wu-done-paths.d.ts.map +0 -1
- package/dist/wu-done-paths.js +0 -263
- package/dist/wu-done-paths.js.map +0 -1
- package/dist/wu-done-pr.d.ts +0 -76
- package/dist/wu-done-pr.d.ts.map +0 -1
- package/dist/wu-done-pr.js +0 -189
- package/dist/wu-done-pr.js.map +0 -1
- package/dist/wu-done-preflight.d.ts +0 -65
- package/dist/wu-done-preflight.d.ts.map +0 -1
- package/dist/wu-done-preflight.js +0 -205
- package/dist/wu-done-preflight.js.map +0 -1
- package/dist/wu-done-retry-helpers.d.ts +0 -75
- package/dist/wu-done-retry-helpers.d.ts.map +0 -1
- package/dist/wu-done-retry-helpers.js +0 -175
- package/dist/wu-done-retry-helpers.js.map +0 -1
- package/dist/wu-done-ui.d.ts +0 -29
- package/dist/wu-done-ui.d.ts.map +0 -1
- package/dist/wu-done-ui.js +0 -74
- package/dist/wu-done-ui.js.map +0 -1
- package/dist/wu-done-validation.d.ts +0 -128
- package/dist/wu-done-validation.d.ts.map +0 -1
- package/dist/wu-done-validation.js +0 -530
- package/dist/wu-done-validation.js.map +0 -1
- package/dist/wu-done-validators.d.ts +0 -16
- package/dist/wu-done-validators.d.ts.map +0 -1
- package/dist/wu-done-validators.js +0 -16
- package/dist/wu-done-validators.js.map +0 -1
- package/dist/wu-done-worktree-services.d.ts +0 -174
- package/dist/wu-done-worktree-services.d.ts.map +0 -1
- package/dist/wu-done-worktree-services.js +0 -274
- package/dist/wu-done-worktree-services.js.map +0 -1
- package/dist/wu-done-worktree.d.ts +0 -229
- package/dist/wu-done-worktree.d.ts.map +0 -1
- package/dist/wu-done-worktree.js +0 -1290
- package/dist/wu-done-worktree.js.map +0 -1
- package/dist/wu-events-cleanup.d.ts +0 -131
- package/dist/wu-events-cleanup.d.ts.map +0 -1
- package/dist/wu-events-cleanup.js +0 -404
- package/dist/wu-events-cleanup.js.map +0 -1
- package/dist/wu-git-constants.d.ts +0 -176
- package/dist/wu-git-constants.d.ts.map +0 -1
- package/dist/wu-git-constants.js +0 -178
- package/dist/wu-git-constants.js.map +0 -1
- package/dist/wu-helpers.d.ts +0 -133
- package/dist/wu-helpers.d.ts.map +0 -1
- package/dist/wu-helpers.js +0 -268
- package/dist/wu-helpers.js.map +0 -1
- package/dist/wu-id-generator.d.ts +0 -51
- package/dist/wu-id-generator.d.ts.map +0 -1
- package/dist/wu-id-generator.js +0 -110
- package/dist/wu-id-generator.js.map +0 -1
- package/dist/wu-lint.d.ts +0 -191
- package/dist/wu-lint.d.ts.map +0 -1
- package/dist/wu-lint.js +0 -338
- package/dist/wu-lint.js.map +0 -1
- package/dist/wu-list.d.ts +0 -76
- package/dist/wu-list.d.ts.map +0 -1
- package/dist/wu-list.js +0 -181
- package/dist/wu-list.js.map +0 -1
- package/dist/wu-paths-constants.d.ts +0 -264
- package/dist/wu-paths-constants.d.ts.map +0 -1
- package/dist/wu-paths-constants.js +0 -272
- package/dist/wu-paths-constants.js.map +0 -1
- package/dist/wu-paths.d.ts +0 -211
- package/dist/wu-paths.d.ts.map +0 -1
- package/dist/wu-paths.js +0 -223
- package/dist/wu-paths.js.map +0 -1
- package/dist/wu-preflight-validators.d.ts +0 -64
- package/dist/wu-preflight-validators.d.ts.map +0 -1
- package/dist/wu-preflight-validators.js +0 -277
- package/dist/wu-preflight-validators.js.map +0 -1
- package/dist/wu-recovery.d.ts +0 -220
- package/dist/wu-recovery.d.ts.map +0 -1
- package/dist/wu-recovery.js +0 -470
- package/dist/wu-recovery.js.map +0 -1
- package/dist/wu-repair-core.d.ts +0 -150
- package/dist/wu-repair-core.d.ts.map +0 -1
- package/dist/wu-repair-core.js +0 -718
- package/dist/wu-repair-core.js.map +0 -1
- package/dist/wu-rules-core.d.ts +0 -95
- package/dist/wu-rules-core.d.ts.map +0 -1
- package/dist/wu-rules-core.js +0 -401
- package/dist/wu-rules-core.js.map +0 -1
- package/dist/wu-rules-engine.d.ts +0 -29
- package/dist/wu-rules-engine.d.ts.map +0 -1
- package/dist/wu-rules-engine.js +0 -61
- package/dist/wu-rules-engine.js.map +0 -1
- package/dist/wu-rules-resolvers.d.ts +0 -19
- package/dist/wu-rules-resolvers.d.ts.map +0 -1
- package/dist/wu-rules-resolvers.js +0 -210
- package/dist/wu-rules-resolvers.js.map +0 -1
- package/dist/wu-schema-normalization.d.ts +0 -18
- package/dist/wu-schema-normalization.d.ts.map +0 -1
- package/dist/wu-schema-normalization.js +0 -87
- package/dist/wu-schema-normalization.js.map +0 -1
- package/dist/wu-schema.d.ts +0 -772
- package/dist/wu-schema.d.ts.map +0 -1
- package/dist/wu-schema.js +0 -897
- package/dist/wu-schema.js.map +0 -1
- package/dist/wu-spawn-context.d.ts +0 -66
- package/dist/wu-spawn-context.d.ts.map +0 -1
- package/dist/wu-spawn-context.js +0 -185
- package/dist/wu-spawn-context.js.map +0 -1
- package/dist/wu-spawn-helpers.d.ts +0 -110
- package/dist/wu-spawn-helpers.d.ts.map +0 -1
- package/dist/wu-spawn-helpers.js +0 -276
- package/dist/wu-spawn-helpers.js.map +0 -1
- package/dist/wu-spawn-skills.d.ts +0 -39
- package/dist/wu-spawn-skills.d.ts.map +0 -1
- package/dist/wu-spawn-skills.js +0 -214
- package/dist/wu-spawn-skills.js.map +0 -1
- package/dist/wu-spawn.d.ts +0 -394
- package/dist/wu-spawn.d.ts.map +0 -1
- package/dist/wu-spawn.js +0 -1977
- package/dist/wu-spawn.js.map +0 -1
- package/dist/wu-state-schema.d.ts +0 -237
- package/dist/wu-state-schema.d.ts.map +0 -1
- package/dist/wu-state-schema.js +0 -172
- package/dist/wu-state-schema.js.map +0 -1
- package/dist/wu-state-store.d.ts +0 -275
- package/dist/wu-state-store.d.ts.map +0 -1
- package/dist/wu-state-store.js +0 -1057
- package/dist/wu-state-store.js.map +0 -1
- package/dist/wu-status-transition.d.ts +0 -58
- package/dist/wu-status-transition.d.ts.map +0 -1
- package/dist/wu-status-transition.js +0 -370
- package/dist/wu-status-transition.js.map +0 -1
- package/dist/wu-status-updater.d.ts +0 -18
- package/dist/wu-status-updater.d.ts.map +0 -1
- package/dist/wu-status-updater.js +0 -123
- package/dist/wu-status-updater.js.map +0 -1
- package/dist/wu-statuses.d.ts +0 -154
- package/dist/wu-statuses.d.ts.map +0 -1
- package/dist/wu-statuses.js +0 -176
- package/dist/wu-statuses.js.map +0 -1
- package/dist/wu-transaction-collectors.d.ts +0 -116
- package/dist/wu-transaction-collectors.d.ts.map +0 -1
- package/dist/wu-transaction-collectors.js +0 -273
- package/dist/wu-transaction-collectors.js.map +0 -1
- package/dist/wu-transaction.d.ts +0 -172
- package/dist/wu-transaction.d.ts.map +0 -1
- package/dist/wu-transaction.js +0 -288
- package/dist/wu-transaction.js.map +0 -1
- package/dist/wu-type-helpers.d.ts +0 -26
- package/dist/wu-type-helpers.d.ts.map +0 -1
- package/dist/wu-type-helpers.js +0 -45
- package/dist/wu-type-helpers.js.map +0 -1
- package/dist/wu-ui-constants.d.ts +0 -235
- package/dist/wu-ui-constants.d.ts.map +0 -1
- package/dist/wu-ui-constants.js +0 -237
- package/dist/wu-ui-constants.js.map +0 -1
- package/dist/wu-validation-constants.d.ts +0 -61
- package/dist/wu-validation-constants.d.ts.map +0 -1
- package/dist/wu-validation-constants.js +0 -69
- package/dist/wu-validation-constants.js.map +0 -1
- package/dist/wu-validation.d.ts +0 -121
- package/dist/wu-validation.d.ts.map +0 -1
- package/dist/wu-validation.js +0 -266
- package/dist/wu-validation.js.map +0 -1
- package/dist/wu-validator.d.ts +0 -128
- package/dist/wu-validator.d.ts.map +0 -1
- package/dist/wu-validator.js +0 -445
- package/dist/wu-validator.js.map +0 -1
- package/dist/wu-yaml-fixer.d.ts +0 -74
- package/dist/wu-yaml-fixer.d.ts.map +0 -1
- package/dist/wu-yaml-fixer.js +0 -273
- package/dist/wu-yaml-fixer.js.map +0 -1
- package/dist/wu-yaml.d.ts +0 -110
- package/dist/wu-yaml.d.ts.map +0 -1
- package/dist/wu-yaml.js +0 -300
- package/dist/wu-yaml.js.map +0 -1
|
@@ -1,1026 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
-
/**
|
|
4
|
-
* WU Consistency Checker (WU-1276, WU-2412)
|
|
5
|
-
*
|
|
6
|
-
* Layer 2 defense-in-depth: Detect and repair WU state inconsistencies.
|
|
7
|
-
*
|
|
8
|
-
* Detects five types of inconsistencies:
|
|
9
|
-
* - YAML_DONE_STATUS_IN_PROGRESS: WU YAML done but in status.md In Progress
|
|
10
|
-
* - BACKLOG_DUAL_SECTION: WU in both Done and In Progress sections
|
|
11
|
-
* - YAML_DONE_NO_STAMP: WU YAML done but no stamp file
|
|
12
|
-
* - ORPHAN_WORKTREE_DONE: Done WU still has worktree
|
|
13
|
-
* - STAMP_EXISTS_YAML_NOT_DONE: Stamp exists but YAML status is not done (WU-2412)
|
|
14
|
-
*
|
|
15
|
-
* @see {@link ../wu-repair.ts} CLI interface
|
|
16
|
-
*/
|
|
17
|
-
import { readFile, writeFile, readdir, mkdir, access } from 'node:fs/promises';
|
|
18
|
-
import { constants, existsSync, mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
19
|
-
import path from 'node:path';
|
|
20
|
-
import { parseYAML, stringifyYAML } from './wu-yaml.js';
|
|
21
|
-
import { createWuPaths, WU_PATHS } from './wu-paths.js';
|
|
22
|
-
import { CONSISTENCY_TYPES, CONSISTENCY_MESSAGES, LUMENFLOW_PATHS, LOG_PREFIX, REMOTES, STRING_LITERALS, toKebab, WU_STATUS, YAML_OPTIONS, } from './wu-constants.js';
|
|
23
|
-
import { todayISO, normalizeToDateString } from './date-utils.js';
|
|
24
|
-
import { createGitForPath } from './git-adapter.js';
|
|
25
|
-
import { withMicroWorktree } from './micro-worktree.js';
|
|
26
|
-
import { listTrackedWUStampIds } from './stamp-tracking.js';
|
|
27
|
-
/**
|
|
28
|
-
* Check a single WU for state inconsistencies
|
|
29
|
-
*
|
|
30
|
-
* @param {string} id - WU ID (e.g., 'WU-123')
|
|
31
|
-
* @param {string} [projectRoot=process.cwd()] - Project root directory
|
|
32
|
-
* @param {CheckWUConsistencyOptions} [options] - Optional precomputed context
|
|
33
|
-
* @returns {Promise<object>} Consistency report with valid, errors, and stats
|
|
34
|
-
*/
|
|
35
|
-
export async function checkWUConsistency(id, projectRoot = process.cwd(), options = {}) {
|
|
36
|
-
const errors = [];
|
|
37
|
-
const paths = createWuPaths({ projectRoot });
|
|
38
|
-
const wuPath = path.join(projectRoot, paths.WU(id));
|
|
39
|
-
const stampPath = path.join(projectRoot, paths.STAMP(id));
|
|
40
|
-
const backlogPath = path.join(projectRoot, paths.BACKLOG());
|
|
41
|
-
const statusPath = path.join(projectRoot, paths.STATUS());
|
|
42
|
-
// Handle missing WU YAML gracefully
|
|
43
|
-
try {
|
|
44
|
-
await access(wuPath, constants.R_OK);
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
return { valid: true, errors: [], stats: { wuExists: false } };
|
|
48
|
-
}
|
|
49
|
-
const wuContent = await readFile(wuPath, { encoding: 'utf-8' });
|
|
50
|
-
const wuDoc = parseYAML(wuContent);
|
|
51
|
-
const yamlStatus = wuDoc?.status || 'unknown';
|
|
52
|
-
const lane = wuDoc?.lane || '';
|
|
53
|
-
const title = wuDoc?.title || '';
|
|
54
|
-
const worktreePathFromYaml = wuDoc?.worktree_path || '';
|
|
55
|
-
// Check stamp existence (guard against untracked local stamp artifacts)
|
|
56
|
-
let hasStampFile;
|
|
57
|
-
try {
|
|
58
|
-
await access(stampPath, constants.R_OK);
|
|
59
|
-
hasStampFile = true;
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
hasStampFile = false;
|
|
63
|
-
}
|
|
64
|
-
const trackedStampIds = options.trackedStampIds ??
|
|
65
|
-
(await listTrackedWUStampIds({ projectRoot, stampsDir: paths.STAMPS_DIR() }));
|
|
66
|
-
const hasStamp = hasStampFile && (trackedStampIds === null || trackedStampIds.has(id));
|
|
67
|
-
// Parse backlog sections
|
|
68
|
-
let backlogContent;
|
|
69
|
-
try {
|
|
70
|
-
backlogContent = await readFile(backlogPath, { encoding: 'utf-8' });
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
backlogContent = '';
|
|
74
|
-
}
|
|
75
|
-
const { inDone: backlogInDone, inProgress: backlogInProgress } = parseBacklogSections(backlogContent, id);
|
|
76
|
-
// Parse status.md sections
|
|
77
|
-
let statusContent;
|
|
78
|
-
try {
|
|
79
|
-
statusContent = await readFile(statusPath, { encoding: 'utf-8' });
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
statusContent = '';
|
|
83
|
-
}
|
|
84
|
-
const { inProgress: statusInProgress } = parseStatusSections(statusContent, id);
|
|
85
|
-
// Check for worktree
|
|
86
|
-
const normalizedId = id.toUpperCase();
|
|
87
|
-
const hasWorktree = options.activeWorktreeIds !== undefined
|
|
88
|
-
? options.activeWorktreeIds !== null && options.activeWorktreeIds.has(normalizedId)
|
|
89
|
-
: await checkWorktreeExists(id, projectRoot);
|
|
90
|
-
const worktreePathExists = await checkWorktreePathExists(worktreePathFromYaml);
|
|
91
|
-
// Detection logic
|
|
92
|
-
// 1. YAML done but in status.md In Progress
|
|
93
|
-
if (yamlStatus === WU_STATUS.DONE && statusInProgress) {
|
|
94
|
-
errors.push({
|
|
95
|
-
type: CONSISTENCY_TYPES.YAML_DONE_STATUS_IN_PROGRESS,
|
|
96
|
-
wuId: id,
|
|
97
|
-
description: `WU ${id} has status '${WU_STATUS.DONE}' in YAML but still appears in status.md In Progress section`,
|
|
98
|
-
repairAction: 'Remove from status.md In Progress section',
|
|
99
|
-
canAutoRepair: true,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
// 2. Backlog dual section (Done AND In Progress)
|
|
103
|
-
if (backlogInDone && backlogInProgress) {
|
|
104
|
-
errors.push({
|
|
105
|
-
type: CONSISTENCY_TYPES.BACKLOG_DUAL_SECTION,
|
|
106
|
-
wuId: id,
|
|
107
|
-
description: `WU ${id} appears in both Done and In Progress sections of backlog.md`,
|
|
108
|
-
repairAction: 'Remove from In Progress section (Done wins)',
|
|
109
|
-
canAutoRepair: true,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
// 3. YAML done but no stamp
|
|
113
|
-
if (yamlStatus === WU_STATUS.DONE && !hasStamp) {
|
|
114
|
-
errors.push({
|
|
115
|
-
type: CONSISTENCY_TYPES.YAML_DONE_NO_STAMP,
|
|
116
|
-
wuId: id,
|
|
117
|
-
title,
|
|
118
|
-
description: `WU ${id} has status '${WU_STATUS.DONE}' but no stamp file exists`,
|
|
119
|
-
repairAction: 'Create stamp file',
|
|
120
|
-
canAutoRepair: true,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
// 4. Orphan worktree for done WU
|
|
124
|
-
if (yamlStatus === WU_STATUS.DONE && hasWorktree) {
|
|
125
|
-
errors.push({
|
|
126
|
-
type: CONSISTENCY_TYPES.ORPHAN_WORKTREE_DONE,
|
|
127
|
-
wuId: id,
|
|
128
|
-
lane,
|
|
129
|
-
description: `WU ${id} has status '${WU_STATUS.DONE}' but still has an associated worktree`,
|
|
130
|
-
repairAction: 'Remove orphan worktree and lane branch',
|
|
131
|
-
canAutoRepair: true,
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
// 5. Stamp exists but YAML not done (inverse of YAML_DONE_NO_STAMP)
|
|
135
|
-
// This catches partial wu:done failures where stamp was created but YAML update failed
|
|
136
|
-
if (hasStamp && yamlStatus !== WU_STATUS.DONE) {
|
|
137
|
-
errors.push({
|
|
138
|
-
type: CONSISTENCY_TYPES.STAMP_EXISTS_YAML_NOT_DONE,
|
|
139
|
-
wuId: id,
|
|
140
|
-
title,
|
|
141
|
-
description: `WU ${id} has stamp file but YAML status is '${yamlStatus}' (not done)`,
|
|
142
|
-
repairAction: 'Update YAML to done+locked+completed',
|
|
143
|
-
canAutoRepair: true,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
// 6. Claimed WU missing worktree directory
|
|
147
|
-
if (worktreePathFromYaml &&
|
|
148
|
-
!worktreePathExists &&
|
|
149
|
-
(yamlStatus === WU_STATUS.IN_PROGRESS || yamlStatus === WU_STATUS.BLOCKED)) {
|
|
150
|
-
errors.push({
|
|
151
|
-
type: CONSISTENCY_TYPES.MISSING_WORKTREE_CLAIMED,
|
|
152
|
-
wuId: id,
|
|
153
|
-
title,
|
|
154
|
-
description: CONSISTENCY_MESSAGES.MISSING_WORKTREE_CLAIMED(id, yamlStatus, worktreePathFromYaml),
|
|
155
|
-
repairAction: CONSISTENCY_MESSAGES.MISSING_WORKTREE_CLAIMED_REPAIR,
|
|
156
|
-
canAutoRepair: false,
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
valid: errors.length === 0,
|
|
161
|
-
errors,
|
|
162
|
-
stats: {
|
|
163
|
-
yamlStatus,
|
|
164
|
-
hasStamp,
|
|
165
|
-
backlogInDone,
|
|
166
|
-
backlogInProgress,
|
|
167
|
-
statusInProgress,
|
|
168
|
-
hasWorktree,
|
|
169
|
-
worktreePathExists,
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Check all WUs for consistency
|
|
175
|
-
*
|
|
176
|
-
* @param {string} [projectRoot=process.cwd()] - Project root directory
|
|
177
|
-
* @returns {Promise<object>} Aggregated report with valid, errors, and checked count
|
|
178
|
-
*/
|
|
179
|
-
export async function checkAllWUConsistency(projectRoot = process.cwd()) {
|
|
180
|
-
const paths = createWuPaths({ projectRoot });
|
|
181
|
-
const wuDir = path.join(projectRoot, paths.WU_DIR());
|
|
182
|
-
try {
|
|
183
|
-
await access(wuDir, constants.R_OK);
|
|
184
|
-
}
|
|
185
|
-
catch {
|
|
186
|
-
return { valid: true, errors: [], checked: 0 };
|
|
187
|
-
}
|
|
188
|
-
const allErrors = [];
|
|
189
|
-
const wuFiles = (await readdir(wuDir)).filter((f) => /^WU-\d+\.yaml$/.test(f));
|
|
190
|
-
const trackedStampIds = await listTrackedWUStampIds({
|
|
191
|
-
projectRoot,
|
|
192
|
-
stampsDir: paths.STAMPS_DIR(),
|
|
193
|
-
});
|
|
194
|
-
const activeWorktreeIds = await listActiveWorktreeIds(projectRoot);
|
|
195
|
-
for (const file of wuFiles) {
|
|
196
|
-
const id = file.replace('.yaml', '');
|
|
197
|
-
const report = await checkWUConsistency(id, projectRoot, {
|
|
198
|
-
trackedStampIds,
|
|
199
|
-
activeWorktreeIds,
|
|
200
|
-
});
|
|
201
|
-
allErrors.push(...report.errors);
|
|
202
|
-
}
|
|
203
|
-
return {
|
|
204
|
-
valid: allErrors.length === 0,
|
|
205
|
-
errors: allErrors,
|
|
206
|
-
checked: wuFiles.length,
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Check lane for orphan done WUs (pre-flight for wu:claim)
|
|
211
|
-
*
|
|
212
|
-
* @param {string} lane - Lane name to check
|
|
213
|
-
* @param {string} excludeId - WU ID to exclude from check (the one being claimed)
|
|
214
|
-
* @param {string} [projectRoot=process.cwd()] - Project root directory
|
|
215
|
-
* @returns {Promise<object>} Result with valid, orphans list, and reports
|
|
216
|
-
*/
|
|
217
|
-
export async function checkLaneForOrphanDoneWU(lane, excludeId, projectRoot = process.cwd()) {
|
|
218
|
-
const paths = createWuPaths({ projectRoot });
|
|
219
|
-
const wuDir = path.join(projectRoot, paths.WU_DIR());
|
|
220
|
-
const trackedStampIds = await listTrackedWUStampIds({
|
|
221
|
-
projectRoot,
|
|
222
|
-
stampsDir: paths.STAMPS_DIR(),
|
|
223
|
-
});
|
|
224
|
-
try {
|
|
225
|
-
await access(wuDir, constants.R_OK);
|
|
226
|
-
}
|
|
227
|
-
catch {
|
|
228
|
-
return { valid: true, orphans: [] };
|
|
229
|
-
}
|
|
230
|
-
const orphans = [];
|
|
231
|
-
const wuFiles = (await readdir(wuDir)).filter((f) => /^WU-\d+\.yaml$/.test(f));
|
|
232
|
-
for (const file of wuFiles) {
|
|
233
|
-
const id = file.replace('.yaml', '');
|
|
234
|
-
if (id === excludeId)
|
|
235
|
-
continue;
|
|
236
|
-
const wuPath = path.join(wuDir, file);
|
|
237
|
-
let wuContent;
|
|
238
|
-
try {
|
|
239
|
-
wuContent = await readFile(wuPath, { encoding: 'utf-8' });
|
|
240
|
-
}
|
|
241
|
-
catch {
|
|
242
|
-
// Skip unreadable files
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
let wuDoc;
|
|
246
|
-
try {
|
|
247
|
-
wuDoc = parseYAML(wuContent);
|
|
248
|
-
}
|
|
249
|
-
catch {
|
|
250
|
-
// Skip malformed YAML files - they're a separate issue
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
if (wuDoc?.lane === lane && wuDoc?.status === WU_STATUS.DONE) {
|
|
254
|
-
const report = await checkWUConsistency(id, projectRoot, { trackedStampIds });
|
|
255
|
-
if (!report.valid) {
|
|
256
|
-
orphans.push({ id, errors: report.errors });
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
valid: orphans.length === 0,
|
|
262
|
-
orphans: orphans.map((o) => o.id),
|
|
263
|
-
reports: orphans,
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Categorize errors into file-based repairs (need micro-worktree) and git-only repairs
|
|
268
|
-
*/
|
|
269
|
-
function categorizeErrors(errors) {
|
|
270
|
-
const fileRepairs = [];
|
|
271
|
-
const gitOnlyRepairs = [];
|
|
272
|
-
const nonRepairable = [];
|
|
273
|
-
for (const error of errors) {
|
|
274
|
-
if (!error.canAutoRepair) {
|
|
275
|
-
nonRepairable.push(error);
|
|
276
|
-
continue;
|
|
277
|
-
}
|
|
278
|
-
// Git-only repairs: worktree/branch cleanup doesn't need micro-worktree
|
|
279
|
-
if (error.type === CONSISTENCY_TYPES.ORPHAN_WORKTREE_DONE) {
|
|
280
|
-
gitOnlyRepairs.push(error);
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
// All file-based repairs need micro-worktree isolation
|
|
284
|
-
fileRepairs.push(error);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
return { fileRepairs, gitOnlyRepairs, nonRepairable };
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Repair WU inconsistencies using micro-worktree isolation (WU-1078)
|
|
291
|
-
*
|
|
292
|
-
* All file modifications (stamps, YAML, markdown) are made atomically
|
|
293
|
-
* in a micro-worktree, then committed and pushed to origin/main.
|
|
294
|
-
* This prevents direct writes to the main checkout.
|
|
295
|
-
*
|
|
296
|
-
* WU-1370: When projectRoot is explicitly provided (not process.cwd()), the caller
|
|
297
|
-
* is already inside a micro-worktree context (e.g., handleOrphanCheck during wu:claim).
|
|
298
|
-
* In this case, skip creating a nested micro-worktree and work directly in projectRoot.
|
|
299
|
-
* This prevents local main drift from nested micro-worktrees merging before pushing.
|
|
300
|
-
*
|
|
301
|
-
* @param {object} report - Report from checkWUConsistency()
|
|
302
|
-
* @param {RepairWUInconsistencyOptions} [options={}] - Repair options
|
|
303
|
-
* @returns {Promise<object>} Result with repaired, skipped, and failed counts
|
|
304
|
-
*/
|
|
305
|
-
export async function repairWUInconsistency(report, options = {}) {
|
|
306
|
-
const { dryRun = false, projectRoot } = options;
|
|
307
|
-
// WU-1370: Detect if projectRoot was explicitly provided
|
|
308
|
-
// If provided, we're inside a micro-worktree and should work directly in projectRoot
|
|
309
|
-
const isInsideMicroWorktree = projectRoot !== undefined;
|
|
310
|
-
const effectiveProjectRoot = projectRoot ?? process.cwd();
|
|
311
|
-
if (report.valid) {
|
|
312
|
-
return { repaired: 0, skipped: 0, failed: 0 };
|
|
313
|
-
}
|
|
314
|
-
const { fileRepairs, gitOnlyRepairs, nonRepairable } = categorizeErrors(report.errors);
|
|
315
|
-
let repaired = 0;
|
|
316
|
-
let skipped = nonRepairable.length;
|
|
317
|
-
let failed = 0;
|
|
318
|
-
// Dry run mode: just count
|
|
319
|
-
if (dryRun) {
|
|
320
|
-
return {
|
|
321
|
-
repaired: fileRepairs.length + gitOnlyRepairs.length,
|
|
322
|
-
skipped,
|
|
323
|
-
failed: 0,
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
// Step 1: Process file-based repairs
|
|
327
|
-
if (fileRepairs.length > 0) {
|
|
328
|
-
// WU-1370: When projectRoot is provided, we're already in a micro-worktree context
|
|
329
|
-
// (e.g., called from handleOrphanCheck during wu:claim). Work directly in projectRoot
|
|
330
|
-
// instead of creating a nested micro-worktree.
|
|
331
|
-
if (isInsideMicroWorktree) {
|
|
332
|
-
// Direct repair mode: work in the provided projectRoot
|
|
333
|
-
for (const error of fileRepairs) {
|
|
334
|
-
try {
|
|
335
|
-
// When inside a micro-worktree, worktreePath === projectRoot
|
|
336
|
-
// We're both reading from and writing to the same location
|
|
337
|
-
const result = await repairSingleErrorInWorktree(error, effectiveProjectRoot, effectiveProjectRoot);
|
|
338
|
-
if (result.success && result.files) {
|
|
339
|
-
repaired++;
|
|
340
|
-
}
|
|
341
|
-
else if (result.skipped) {
|
|
342
|
-
skipped++;
|
|
343
|
-
if (result.reason) {
|
|
344
|
-
console.warn(`${LOG_PREFIX.REPAIR} Skipped ${error.type}: ${result.reason}`);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
failed++;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
catch (err) {
|
|
352
|
-
const errMessage = err instanceof Error ? err.message : String(err);
|
|
353
|
-
console.error(`${LOG_PREFIX.REPAIR} Failed to repair ${error.type}: ${errMessage}`);
|
|
354
|
-
failed++;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
// Standard mode: create micro-worktree for isolation
|
|
360
|
-
try {
|
|
361
|
-
// Generate a batch ID from the WU IDs being repaired
|
|
362
|
-
const batchId = `batch-${fileRepairs.map((e) => e.wuId).join('-')}`.slice(0, 50);
|
|
363
|
-
await withMicroWorktree({
|
|
364
|
-
operation: 'wu-repair',
|
|
365
|
-
id: batchId,
|
|
366
|
-
logPrefix: LOG_PREFIX.REPAIR,
|
|
367
|
-
execute: async ({ worktreePath }) => {
|
|
368
|
-
const filesModified = [];
|
|
369
|
-
for (const error of fileRepairs) {
|
|
370
|
-
try {
|
|
371
|
-
const result = await repairSingleErrorInWorktree(error, worktreePath, worktreePath);
|
|
372
|
-
if (result.success && result.files) {
|
|
373
|
-
filesModified.push(...result.files);
|
|
374
|
-
repaired++;
|
|
375
|
-
}
|
|
376
|
-
else if (result.skipped) {
|
|
377
|
-
skipped++;
|
|
378
|
-
if (result.reason) {
|
|
379
|
-
console.warn(`${LOG_PREFIX.REPAIR} Skipped ${error.type}: ${result.reason}`);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
failed++;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
catch (err) {
|
|
387
|
-
const errMessage = err instanceof Error ? err.message : String(err);
|
|
388
|
-
console.error(`${LOG_PREFIX.REPAIR} Failed to repair ${error.type}: ${errMessage}`);
|
|
389
|
-
failed++;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
// Deduplicate files
|
|
393
|
-
const uniqueFiles = [...new Set(filesModified)];
|
|
394
|
-
return {
|
|
395
|
-
commitMessage: `fix: repair ${repaired} WU inconsistencies`,
|
|
396
|
-
files: uniqueFiles,
|
|
397
|
-
};
|
|
398
|
-
},
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
catch (err) {
|
|
402
|
-
// If micro-worktree fails, mark all file repairs as failed
|
|
403
|
-
const errMessage = err instanceof Error ? err.message : String(err);
|
|
404
|
-
console.error(`${LOG_PREFIX.REPAIR} Micro-worktree operation failed: ${errMessage}`);
|
|
405
|
-
failed += fileRepairs.length - repaired;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
// Step 2: Process git-only repairs (worktree/branch cleanup) directly
|
|
410
|
-
for (const error of gitOnlyRepairs) {
|
|
411
|
-
try {
|
|
412
|
-
const result = await repairGitOnlyError(error, effectiveProjectRoot);
|
|
413
|
-
if (result.success) {
|
|
414
|
-
repaired++;
|
|
415
|
-
}
|
|
416
|
-
else if (result.skipped) {
|
|
417
|
-
skipped++;
|
|
418
|
-
if (result.reason) {
|
|
419
|
-
console.warn(`${LOG_PREFIX.REPAIR} Skipped ${error.type}: ${result.reason}`);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
else {
|
|
423
|
-
failed++;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
catch (err) {
|
|
427
|
-
const errMessage = err instanceof Error ? err.message : String(err);
|
|
428
|
-
console.error(`${LOG_PREFIX.REPAIR} Failed to repair ${error.type}: ${errMessage}`);
|
|
429
|
-
failed++;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
return { repaired, skipped, failed };
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Repair a single file-based error inside a micro-worktree (WU-1078)
|
|
436
|
-
*
|
|
437
|
-
* This function performs file modifications inside the worktree path,
|
|
438
|
-
* which is then committed and pushed atomically by withMicroWorktree.
|
|
439
|
-
*
|
|
440
|
-
* @param {ConsistencyError} error - Error object from checkWUConsistency()
|
|
441
|
-
* @param {string} worktreePath - Path to the micro-worktree
|
|
442
|
-
* @param {string} projectRoot - Original project root (for reading source files)
|
|
443
|
-
* @returns {Promise<RepairResult>} Result with success, skipped, reason, and files modified
|
|
444
|
-
*/
|
|
445
|
-
async function repairSingleErrorInWorktree(error, worktreePath, projectRoot) {
|
|
446
|
-
switch (error.type) {
|
|
447
|
-
case CONSISTENCY_TYPES.YAML_DONE_NO_STAMP: {
|
|
448
|
-
const files = await createStampInWorktree(error.wuId, error.title || `WU ${error.wuId}`, worktreePath);
|
|
449
|
-
return { success: true, files };
|
|
450
|
-
}
|
|
451
|
-
case CONSISTENCY_TYPES.YAML_DONE_STATUS_IN_PROGRESS: {
|
|
452
|
-
const files = await removeWUFromSectionInWorktree(WU_PATHS.STATUS(), error.wuId, '## In Progress', worktreePath, projectRoot);
|
|
453
|
-
return { success: true, files };
|
|
454
|
-
}
|
|
455
|
-
case CONSISTENCY_TYPES.BACKLOG_DUAL_SECTION: {
|
|
456
|
-
const files = await removeWUFromSectionInWorktree(WU_PATHS.BACKLOG(), error.wuId, '## 🔧 In progress', worktreePath, projectRoot);
|
|
457
|
-
return { success: true, files };
|
|
458
|
-
}
|
|
459
|
-
case CONSISTENCY_TYPES.STAMP_EXISTS_YAML_NOT_DONE: {
|
|
460
|
-
const files = await updateYamlToDoneInWorktree(error.wuId, worktreePath, projectRoot);
|
|
461
|
-
return { success: true, files };
|
|
462
|
-
}
|
|
463
|
-
default:
|
|
464
|
-
return { skipped: true, reason: `Unknown error type: ${error.type}` };
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Repair git-only errors (worktree/branch cleanup) without micro-worktree
|
|
469
|
-
*
|
|
470
|
-
* These operations don't modify files in the repo, they only manage git worktrees
|
|
471
|
-
* and branches, so they can run directly.
|
|
472
|
-
*
|
|
473
|
-
* @param {ConsistencyError} error - Error object
|
|
474
|
-
* @param {string} projectRoot - Project root directory
|
|
475
|
-
* @returns {Promise<RepairResult>} Result with success, skipped, and reason
|
|
476
|
-
*/
|
|
477
|
-
async function repairGitOnlyError(error, projectRoot) {
|
|
478
|
-
switch (error.type) {
|
|
479
|
-
case CONSISTENCY_TYPES.ORPHAN_WORKTREE_DONE:
|
|
480
|
-
if (!error.lane) {
|
|
481
|
-
return { skipped: true, reason: 'Missing lane metadata for orphan worktree cleanup' };
|
|
482
|
-
}
|
|
483
|
-
return await removeOrphanWorktree(error.wuId, error.lane, projectRoot);
|
|
484
|
-
default:
|
|
485
|
-
return { skipped: true, reason: `Unknown git-only error type: ${error.type}` };
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Create stamp file inside a micro-worktree (WU-1078)
|
|
490
|
-
*
|
|
491
|
-
* @param {string} id - WU ID
|
|
492
|
-
* @param {string} title - WU title
|
|
493
|
-
* @param {string} worktreePath - Path to the micro-worktree
|
|
494
|
-
* @returns {Promise<string[]>} List of files created (relative paths)
|
|
495
|
-
*/
|
|
496
|
-
async function createStampInWorktree(id, title, worktreePath) {
|
|
497
|
-
const stampsDir = path.join(worktreePath, WU_PATHS.STAMPS_DIR());
|
|
498
|
-
const stampRelPath = WU_PATHS.STAMP(id);
|
|
499
|
-
const stampAbsPath = path.join(worktreePath, stampRelPath);
|
|
500
|
-
// Ensure stamps directory exists
|
|
501
|
-
if (!existsSync(stampsDir)) {
|
|
502
|
-
mkdirSync(stampsDir, { recursive: true });
|
|
503
|
-
}
|
|
504
|
-
// Don't overwrite existing stamp
|
|
505
|
-
if (existsSync(stampAbsPath)) {
|
|
506
|
-
return []; // Stamp already exists
|
|
507
|
-
}
|
|
508
|
-
// Create stamp file
|
|
509
|
-
const body = `WU ${id} — ${title}\nCompleted: ${todayISO()}\n`;
|
|
510
|
-
writeFileSync(stampAbsPath, body, { encoding: 'utf-8' });
|
|
511
|
-
return [stampRelPath];
|
|
512
|
-
}
|
|
513
|
-
/**
|
|
514
|
-
* Create stamp file in a specific project root (DEPRECATED - use createStampInWorktree)
|
|
515
|
-
*
|
|
516
|
-
* Kept for backwards compatibility with code that doesn't use micro-worktree.
|
|
517
|
-
*
|
|
518
|
-
* @param {string} id - WU ID
|
|
519
|
-
* @param {string} title - WU title
|
|
520
|
-
* @param {string} projectRoot - Project root directory
|
|
521
|
-
* @returns {Promise<void>}
|
|
522
|
-
*/
|
|
523
|
-
async function _createStampInProject(id, title, projectRoot) {
|
|
524
|
-
const stampsDir = path.join(projectRoot, WU_PATHS.STAMPS_DIR());
|
|
525
|
-
const stampPath = path.join(projectRoot, WU_PATHS.STAMP(id));
|
|
526
|
-
// Ensure stamps directory exists
|
|
527
|
-
try {
|
|
528
|
-
await access(stampsDir, constants.R_OK);
|
|
529
|
-
}
|
|
530
|
-
catch {
|
|
531
|
-
await mkdir(stampsDir, { recursive: true });
|
|
532
|
-
}
|
|
533
|
-
// Don't overwrite existing stamp
|
|
534
|
-
try {
|
|
535
|
-
await access(stampPath, constants.R_OK);
|
|
536
|
-
return; // Stamp already exists
|
|
537
|
-
}
|
|
538
|
-
catch {
|
|
539
|
-
// Stamp doesn't exist, continue to create it
|
|
540
|
-
}
|
|
541
|
-
// Create stamp file
|
|
542
|
-
const body = `WU ${id} — ${title}\nCompleted: ${todayISO()}\n`;
|
|
543
|
-
await writeFile(stampPath, body, { encoding: 'utf-8' });
|
|
544
|
-
}
|
|
545
|
-
/**
|
|
546
|
-
* Update WU YAML to done+locked+completed state inside a micro-worktree (WU-1078)
|
|
547
|
-
*
|
|
548
|
-
* Repairs STAMP_EXISTS_YAML_NOT_DONE by setting:
|
|
549
|
-
* - status: done
|
|
550
|
-
* - locked: true
|
|
551
|
-
* - completed: YYYY-MM-DD (today, unless already set)
|
|
552
|
-
*
|
|
553
|
-
* @param {string} id - WU ID
|
|
554
|
-
* @param {string} worktreePath - Path to the micro-worktree
|
|
555
|
-
* @param {string} projectRoot - Original project root (for reading source file)
|
|
556
|
-
* @returns {Promise<string[]>} List of files modified (relative paths)
|
|
557
|
-
*/
|
|
558
|
-
async function updateYamlToDoneInWorktree(id, worktreePath, projectRoot) {
|
|
559
|
-
const paths = createWuPaths({ projectRoot });
|
|
560
|
-
const wuRelPath = paths.WU(id);
|
|
561
|
-
const wuSrcPath = path.join(projectRoot, wuRelPath);
|
|
562
|
-
const wuDestPath = path.join(worktreePath, wuRelPath);
|
|
563
|
-
const wuReadPath = existsSync(wuDestPath) ? wuDestPath : wuSrcPath;
|
|
564
|
-
// Read current YAML (prefer destination copy if already modified in this batch)
|
|
565
|
-
const content = readFileSync(wuReadPath, { encoding: 'utf-8' });
|
|
566
|
-
const wuDoc = parseYAML(content);
|
|
567
|
-
if (!wuDoc) {
|
|
568
|
-
throw new Error(`Failed to parse WU YAML: ${wuReadPath}`);
|
|
569
|
-
}
|
|
570
|
-
// Update fields
|
|
571
|
-
wuDoc.status = WU_STATUS.DONE;
|
|
572
|
-
wuDoc.locked = true;
|
|
573
|
-
const existingCompletedAt = wuDoc.completed_at;
|
|
574
|
-
const completionTimestamp = typeof existingCompletedAt === 'string'
|
|
575
|
-
? existingCompletedAt
|
|
576
|
-
: existingCompletedAt instanceof Date
|
|
577
|
-
? existingCompletedAt.toISOString()
|
|
578
|
-
: new Date().toISOString();
|
|
579
|
-
wuDoc.completed_at = completionTimestamp;
|
|
580
|
-
// Keep legacy completed date in sync with completed_at for compatibility.
|
|
581
|
-
wuDoc.completed =
|
|
582
|
-
normalizeToDateString(wuDoc.completed ?? completionTimestamp) ??
|
|
583
|
-
completionTimestamp.slice(0, 10);
|
|
584
|
-
// Ensure directory exists in worktree
|
|
585
|
-
const wuDir = path.dirname(wuDestPath);
|
|
586
|
-
if (!existsSync(wuDir)) {
|
|
587
|
-
mkdirSync(wuDir, { recursive: true });
|
|
588
|
-
}
|
|
589
|
-
// Write updated YAML to worktree
|
|
590
|
-
const updatedContent = stringifyYAML(wuDoc, { lineWidth: YAML_OPTIONS.LINE_WIDTH });
|
|
591
|
-
writeFileSync(wuDestPath, updatedContent, { encoding: 'utf-8' });
|
|
592
|
-
const eventFiles = appendReconciliationEventsInWorktree({
|
|
593
|
-
id,
|
|
594
|
-
lane: wuDoc.lane,
|
|
595
|
-
title: wuDoc.title,
|
|
596
|
-
projectRoot,
|
|
597
|
-
worktreePath,
|
|
598
|
-
});
|
|
599
|
-
return [wuRelPath, ...eventFiles];
|
|
600
|
-
}
|
|
601
|
-
function deriveStatusFromEvents(eventsContent, wuId) {
|
|
602
|
-
let status;
|
|
603
|
-
const lines = eventsContent.split(/\r?\n/);
|
|
604
|
-
for (const line of lines) {
|
|
605
|
-
if (!line.trim())
|
|
606
|
-
continue;
|
|
607
|
-
try {
|
|
608
|
-
const event = JSON.parse(line);
|
|
609
|
-
if (event.wuId !== wuId || !event.type)
|
|
610
|
-
continue;
|
|
611
|
-
switch (event.type) {
|
|
612
|
-
case 'claim':
|
|
613
|
-
case 'create':
|
|
614
|
-
status = WU_STATUS.IN_PROGRESS;
|
|
615
|
-
break;
|
|
616
|
-
case 'release':
|
|
617
|
-
status = WU_STATUS.READY;
|
|
618
|
-
break;
|
|
619
|
-
case 'complete':
|
|
620
|
-
status = WU_STATUS.DONE;
|
|
621
|
-
break;
|
|
622
|
-
case 'block':
|
|
623
|
-
status = WU_STATUS.BLOCKED;
|
|
624
|
-
break;
|
|
625
|
-
case 'unblock':
|
|
626
|
-
status = WU_STATUS.IN_PROGRESS;
|
|
627
|
-
break;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
catch {
|
|
631
|
-
// Ignore malformed lines; preserve file as-is and append corrective events.
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
return status;
|
|
635
|
-
}
|
|
636
|
-
function appendReconciliationEventsInWorktree({ id, lane, title, projectRoot, worktreePath, }) {
|
|
637
|
-
const eventsRelPath = LUMENFLOW_PATHS.WU_EVENTS;
|
|
638
|
-
const eventsSrcPath = path.join(projectRoot, eventsRelPath);
|
|
639
|
-
const eventsDestPath = path.join(worktreePath, eventsRelPath);
|
|
640
|
-
const eventsReadPath = existsSync(eventsDestPath) ? eventsDestPath : eventsSrcPath;
|
|
641
|
-
const existingContent = existsSync(eventsReadPath)
|
|
642
|
-
? readFileSync(eventsReadPath, { encoding: 'utf-8' })
|
|
643
|
-
: '';
|
|
644
|
-
const derivedStatus = deriveStatusFromEvents(existingContent, id);
|
|
645
|
-
if (derivedStatus === WU_STATUS.DONE) {
|
|
646
|
-
return [];
|
|
647
|
-
}
|
|
648
|
-
const now = new Date().toISOString();
|
|
649
|
-
const appendEvents = [];
|
|
650
|
-
if (derivedStatus !== WU_STATUS.IN_PROGRESS) {
|
|
651
|
-
appendEvents.push({
|
|
652
|
-
type: 'claim',
|
|
653
|
-
wuId: id,
|
|
654
|
-
lane: typeof lane === 'string' && lane.trim().length > 0 ? lane : 'Operations: Tooling',
|
|
655
|
-
title: typeof title === 'string' && title.trim().length > 0 ? title : `WU ${id}`,
|
|
656
|
-
timestamp: now,
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
appendEvents.push({
|
|
660
|
-
type: 'complete',
|
|
661
|
-
wuId: id,
|
|
662
|
-
reason: 'wu:repair consistency reconciliation for stamp/yaml mismatch',
|
|
663
|
-
timestamp: now,
|
|
664
|
-
});
|
|
665
|
-
const destDir = path.dirname(eventsDestPath);
|
|
666
|
-
if (!existsSync(destDir)) {
|
|
667
|
-
mkdirSync(destDir, { recursive: true });
|
|
668
|
-
}
|
|
669
|
-
const suffix = appendEvents.map((event) => JSON.stringify(event)).join(STRING_LITERALS.NEWLINE);
|
|
670
|
-
const normalizedExisting = existingContent
|
|
671
|
-
? existingContent.endsWith(STRING_LITERALS.NEWLINE)
|
|
672
|
-
? existingContent
|
|
673
|
-
: `${existingContent}${STRING_LITERALS.NEWLINE}`
|
|
674
|
-
: '';
|
|
675
|
-
writeFileSync(eventsDestPath, `${normalizedExisting}${suffix}${STRING_LITERALS.NEWLINE}`, {
|
|
676
|
-
encoding: 'utf-8',
|
|
677
|
-
});
|
|
678
|
-
return [eventsRelPath];
|
|
679
|
-
}
|
|
680
|
-
/**
|
|
681
|
-
* Update WU YAML to done+locked+completed state (DEPRECATED - use updateYamlToDoneInWorktree)
|
|
682
|
-
*
|
|
683
|
-
* Kept for backwards compatibility.
|
|
684
|
-
*
|
|
685
|
-
* @param {string} id - WU ID
|
|
686
|
-
* @param {string} projectRoot - Project root directory
|
|
687
|
-
* @returns {Promise<void>}
|
|
688
|
-
*/
|
|
689
|
-
async function _updateYamlToDone(id, projectRoot) {
|
|
690
|
-
const paths = createWuPaths({ projectRoot });
|
|
691
|
-
const wuPath = path.join(projectRoot, paths.WU(id));
|
|
692
|
-
// Read current YAML
|
|
693
|
-
const content = await readFile(wuPath, { encoding: 'utf-8' });
|
|
694
|
-
const wuDoc = parseYAML(content);
|
|
695
|
-
if (!wuDoc) {
|
|
696
|
-
throw new Error(`Failed to parse WU YAML: ${wuPath}`);
|
|
697
|
-
}
|
|
698
|
-
// Update fields
|
|
699
|
-
wuDoc.status = WU_STATUS.DONE;
|
|
700
|
-
wuDoc.locked = true;
|
|
701
|
-
// Preserve existing completed date if present, otherwise set to today
|
|
702
|
-
if (!wuDoc.completed) {
|
|
703
|
-
wuDoc.completed = todayISO();
|
|
704
|
-
}
|
|
705
|
-
// Write updated YAML
|
|
706
|
-
const updatedContent = stringifyYAML(wuDoc, { lineWidth: YAML_OPTIONS.LINE_WIDTH });
|
|
707
|
-
await writeFile(wuPath, updatedContent, { encoding: 'utf-8' });
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Remove WU entry from a specific section in a markdown file inside a micro-worktree (WU-1078)
|
|
711
|
-
*
|
|
712
|
-
* @param {string} relFilePath - Relative path to the markdown file
|
|
713
|
-
* @param {string} id - WU ID to remove
|
|
714
|
-
* @param {string} sectionHeading - Section heading to target
|
|
715
|
-
* @param {string} worktreePath - Path to the micro-worktree
|
|
716
|
-
* @param {string} projectRoot - Original project root (for reading source file)
|
|
717
|
-
* @returns {Promise<string[]>} List of files modified (relative paths)
|
|
718
|
-
*/
|
|
719
|
-
async function removeWUFromSectionInWorktree(relFilePath, id, sectionHeading, worktreePath, projectRoot) {
|
|
720
|
-
const srcPath = path.join(projectRoot, relFilePath);
|
|
721
|
-
const destPath = path.join(worktreePath, relFilePath);
|
|
722
|
-
// Check if source file exists
|
|
723
|
-
if (!existsSync(srcPath)) {
|
|
724
|
-
return []; // File doesn't exist
|
|
725
|
-
}
|
|
726
|
-
const content = readFileSync(srcPath, { encoding: 'utf-8' });
|
|
727
|
-
const lines = content.split(/\r?\n/);
|
|
728
|
-
let inTargetSection = false;
|
|
729
|
-
let nextSectionIdx = -1;
|
|
730
|
-
let sectionStartIdx = -1;
|
|
731
|
-
// Normalize heading for comparison (lowercase, trim)
|
|
732
|
-
const normalizedHeading = sectionHeading.toLowerCase().trim();
|
|
733
|
-
// Find section boundaries
|
|
734
|
-
for (let i = 0; i < lines.length; i++) {
|
|
735
|
-
const currentLine = lines[i] ?? '';
|
|
736
|
-
const normalizedLine = currentLine.toLowerCase().trim();
|
|
737
|
-
if (normalizedLine === normalizedHeading || normalizedLine.startsWith(normalizedHeading)) {
|
|
738
|
-
inTargetSection = true;
|
|
739
|
-
sectionStartIdx = i;
|
|
740
|
-
continue;
|
|
741
|
-
}
|
|
742
|
-
if (inTargetSection && currentLine.trim().startsWith('## ')) {
|
|
743
|
-
nextSectionIdx = i;
|
|
744
|
-
break;
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
if (sectionStartIdx === -1)
|
|
748
|
-
return [];
|
|
749
|
-
const endIdx = nextSectionIdx === -1 ? lines.length : nextSectionIdx;
|
|
750
|
-
// Filter out lines containing the WU ID in the target section
|
|
751
|
-
const newLines = [];
|
|
752
|
-
let modified = false;
|
|
753
|
-
for (let i = 0; i < lines.length; i++) {
|
|
754
|
-
const currentLine = lines[i] ?? '';
|
|
755
|
-
if (i > sectionStartIdx && i < endIdx && currentLine.includes(id)) {
|
|
756
|
-
modified = true;
|
|
757
|
-
continue; // Skip this line
|
|
758
|
-
}
|
|
759
|
-
newLines.push(currentLine);
|
|
760
|
-
}
|
|
761
|
-
if (!modified)
|
|
762
|
-
return [];
|
|
763
|
-
// Ensure directory exists in worktree
|
|
764
|
-
const destDir = path.dirname(destPath);
|
|
765
|
-
if (!existsSync(destDir)) {
|
|
766
|
-
mkdirSync(destDir, { recursive: true });
|
|
767
|
-
}
|
|
768
|
-
writeFileSync(destPath, newLines.join(STRING_LITERALS.NEWLINE), { encoding: 'utf-8' });
|
|
769
|
-
return [relFilePath];
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* Remove WU entry from a specific section in a markdown file (DEPRECATED)
|
|
773
|
-
*
|
|
774
|
-
* Kept for backwards compatibility.
|
|
775
|
-
*
|
|
776
|
-
* @param {string} filePath - Path to the markdown file
|
|
777
|
-
* @param {string} id - WU ID to remove
|
|
778
|
-
* @param {string} sectionHeading - Section heading to target
|
|
779
|
-
* @returns {Promise<void>}
|
|
780
|
-
*/
|
|
781
|
-
async function _removeWUFromSection(filePath, id, sectionHeading) {
|
|
782
|
-
try {
|
|
783
|
-
await access(filePath, constants.R_OK);
|
|
784
|
-
}
|
|
785
|
-
catch {
|
|
786
|
-
return; // File doesn't exist
|
|
787
|
-
}
|
|
788
|
-
const content = await readFile(filePath, { encoding: 'utf-8' });
|
|
789
|
-
const lines = content.split(/\r?\n/);
|
|
790
|
-
let inTargetSection = false;
|
|
791
|
-
let nextSectionIdx = -1;
|
|
792
|
-
let sectionStartIdx = -1;
|
|
793
|
-
// Normalize heading for comparison (lowercase, trim)
|
|
794
|
-
const normalizedHeading = sectionHeading.toLowerCase().trim();
|
|
795
|
-
// Find section boundaries
|
|
796
|
-
for (let i = 0; i < lines.length; i++) {
|
|
797
|
-
const currentLine = lines[i] ?? '';
|
|
798
|
-
const normalizedLine = currentLine.toLowerCase().trim();
|
|
799
|
-
if (normalizedLine === normalizedHeading || normalizedLine.startsWith(normalizedHeading)) {
|
|
800
|
-
inTargetSection = true;
|
|
801
|
-
sectionStartIdx = i;
|
|
802
|
-
continue;
|
|
803
|
-
}
|
|
804
|
-
if (inTargetSection && currentLine.trim().startsWith('## ')) {
|
|
805
|
-
nextSectionIdx = i;
|
|
806
|
-
break;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
if (sectionStartIdx === -1)
|
|
810
|
-
return;
|
|
811
|
-
const endIdx = nextSectionIdx === -1 ? lines.length : nextSectionIdx;
|
|
812
|
-
// Filter out lines containing the WU ID in the target section
|
|
813
|
-
const newLines = [];
|
|
814
|
-
for (let i = 0; i < lines.length; i++) {
|
|
815
|
-
const currentLine = lines[i] ?? '';
|
|
816
|
-
if (i > sectionStartIdx && i < endIdx && currentLine.includes(id)) {
|
|
817
|
-
continue; // Skip this line
|
|
818
|
-
}
|
|
819
|
-
newLines.push(currentLine);
|
|
820
|
-
}
|
|
821
|
-
await writeFile(filePath, newLines.join(STRING_LITERALS.NEWLINE));
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Remove orphan worktree for a done WU
|
|
825
|
-
*
|
|
826
|
-
* CRITICAL: This function includes safety guards to prevent data loss.
|
|
827
|
-
* See WU-1276 incident report for why these guards are essential.
|
|
828
|
-
*
|
|
829
|
-
* @param {string} id - WU ID
|
|
830
|
-
* @param {string} lane - Lane name
|
|
831
|
-
* @param {string} projectRoot - Project root directory
|
|
832
|
-
* @returns {Promise<object>} Result with success, skipped, and reason
|
|
833
|
-
*/
|
|
834
|
-
async function removeOrphanWorktree(id, lane, projectRoot) {
|
|
835
|
-
// Find worktree path
|
|
836
|
-
const laneKebab = toKebab(lane);
|
|
837
|
-
const worktreeName = `${laneKebab}-${id.toLowerCase()}`;
|
|
838
|
-
const worktreePath = path.join(projectRoot, 'worktrees', worktreeName);
|
|
839
|
-
// 🚨 SAFETY GUARD 1: Check if cwd is inside worktree
|
|
840
|
-
const cwd = process.cwd();
|
|
841
|
-
if (cwd.startsWith(worktreePath)) {
|
|
842
|
-
return { skipped: true, reason: 'Cannot delete worktree while inside it' };
|
|
843
|
-
}
|
|
844
|
-
// 🚨 SAFETY GUARD 2: Check for uncommitted changes (if worktree exists)
|
|
845
|
-
try {
|
|
846
|
-
await access(worktreePath, constants.R_OK);
|
|
847
|
-
// Worktree exists, check for uncommitted changes
|
|
848
|
-
try {
|
|
849
|
-
const gitWorktree = createGitForPath(worktreePath);
|
|
850
|
-
const status = await gitWorktree.getStatus();
|
|
851
|
-
if (status.trim().length > 0) {
|
|
852
|
-
return { skipped: true, reason: 'Worktree has uncommitted changes' };
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
catch {
|
|
856
|
-
// Ignore errors checking status - proceed with other guards
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
catch {
|
|
860
|
-
// Worktree doesn't exist, that's fine
|
|
861
|
-
}
|
|
862
|
-
// 🚨 SAFETY GUARD 3: Check stamp exists (not rollback state)
|
|
863
|
-
const paths = createWuPaths({ projectRoot });
|
|
864
|
-
const stampPath = path.join(projectRoot, paths.STAMP(id));
|
|
865
|
-
try {
|
|
866
|
-
await access(stampPath, constants.R_OK);
|
|
867
|
-
}
|
|
868
|
-
catch {
|
|
869
|
-
return { skipped: true, reason: 'WU marked done but no stamp - possible rollback state' };
|
|
870
|
-
}
|
|
871
|
-
// Safe to proceed with cleanup
|
|
872
|
-
const git = createGitForPath(projectRoot);
|
|
873
|
-
try {
|
|
874
|
-
await access(worktreePath, constants.R_OK);
|
|
875
|
-
await git.worktreeRemove(worktreePath, { force: true });
|
|
876
|
-
}
|
|
877
|
-
catch {
|
|
878
|
-
// Worktree may not exist
|
|
879
|
-
}
|
|
880
|
-
// Delete lane branch
|
|
881
|
-
const branchName = `lane/${laneKebab}/${id.toLowerCase()}`;
|
|
882
|
-
try {
|
|
883
|
-
await git.deleteBranch(branchName, { force: true });
|
|
884
|
-
}
|
|
885
|
-
catch {
|
|
886
|
-
// Branch may not exist locally
|
|
887
|
-
}
|
|
888
|
-
try {
|
|
889
|
-
await git.raw(['push', REMOTES.ORIGIN, '--delete', branchName]);
|
|
890
|
-
}
|
|
891
|
-
catch {
|
|
892
|
-
// Remote branch may not exist
|
|
893
|
-
}
|
|
894
|
-
return { success: true };
|
|
895
|
-
}
|
|
896
|
-
/**
|
|
897
|
-
* Parse backlog.md to find which sections contain a WU ID
|
|
898
|
-
*
|
|
899
|
-
* @param {string} content - Backlog file content
|
|
900
|
-
* @param {string} id - WU ID to search for
|
|
901
|
-
* @returns {object} Object with inDone and inProgress booleans
|
|
902
|
-
*/
|
|
903
|
-
function parseBacklogSections(content, id) {
|
|
904
|
-
const lines = content.split(/\r?\n/);
|
|
905
|
-
let inDone = false;
|
|
906
|
-
let inProgress = false;
|
|
907
|
-
let currentSection = null;
|
|
908
|
-
// Match exact WU YAML filename to prevent substring false positives
|
|
909
|
-
// e.g., WU-208 should not match lines containing WU-2087
|
|
910
|
-
const exactPattern = `(wu/${id}.yaml)`;
|
|
911
|
-
for (const line of lines) {
|
|
912
|
-
if (line.trim() === '## ✅ Done') {
|
|
913
|
-
currentSection = WU_STATUS.DONE;
|
|
914
|
-
continue;
|
|
915
|
-
}
|
|
916
|
-
if (line.trim() === '## 🔧 In progress') {
|
|
917
|
-
currentSection = WU_STATUS.IN_PROGRESS;
|
|
918
|
-
continue;
|
|
919
|
-
}
|
|
920
|
-
if (line.trim().startsWith('## ')) {
|
|
921
|
-
currentSection = null;
|
|
922
|
-
continue;
|
|
923
|
-
}
|
|
924
|
-
if (line.includes(exactPattern)) {
|
|
925
|
-
if (currentSection === WU_STATUS.DONE)
|
|
926
|
-
inDone = true;
|
|
927
|
-
if (currentSection === WU_STATUS.IN_PROGRESS)
|
|
928
|
-
inProgress = true;
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
return { inDone, inProgress };
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* Parse status.md to find if WU is in In Progress section
|
|
935
|
-
*
|
|
936
|
-
* @param {string} content - Status file content
|
|
937
|
-
* @param {string} id - WU ID to search for
|
|
938
|
-
* @returns {object} Object with inProgress boolean
|
|
939
|
-
*/
|
|
940
|
-
function parseStatusSections(content, id) {
|
|
941
|
-
const lines = content.split(/\r?\n/);
|
|
942
|
-
let inProgress = false;
|
|
943
|
-
let currentSection = null;
|
|
944
|
-
// Match exact WU YAML filename to prevent substring false positives
|
|
945
|
-
// e.g., WU-208 should not match lines containing WU-2087
|
|
946
|
-
const exactPattern = `(wu/${id}.yaml)`;
|
|
947
|
-
for (const line of lines) {
|
|
948
|
-
if (line.trim() === '## In Progress') {
|
|
949
|
-
currentSection = WU_STATUS.IN_PROGRESS;
|
|
950
|
-
continue;
|
|
951
|
-
}
|
|
952
|
-
if (line.trim().startsWith('## ')) {
|
|
953
|
-
currentSection = null;
|
|
954
|
-
continue;
|
|
955
|
-
}
|
|
956
|
-
if (currentSection === WU_STATUS.IN_PROGRESS && line.includes(exactPattern)) {
|
|
957
|
-
inProgress = true;
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
return { inProgress };
|
|
961
|
-
}
|
|
962
|
-
/**
|
|
963
|
-
* Check if a worktree exists for a given WU ID
|
|
964
|
-
*
|
|
965
|
-
* Uses word-boundary matching to avoid false positives where one WU ID
|
|
966
|
-
* is a prefix of another (e.g., WU-204 should not match wu-2049).
|
|
967
|
-
*
|
|
968
|
-
* @param {string} id - WU ID
|
|
969
|
-
* @param {string} projectRoot - Project root directory
|
|
970
|
-
* @returns {Promise<boolean>} True if worktree exists
|
|
971
|
-
*/
|
|
972
|
-
async function checkWorktreeExists(id, projectRoot) {
|
|
973
|
-
try {
|
|
974
|
-
const git = createGitForPath(projectRoot);
|
|
975
|
-
const output = await git.worktreeList();
|
|
976
|
-
// Match WU ID followed by non-digit or end of string to prevent
|
|
977
|
-
// false positives (e.g., wu-204 matching wu-2049)
|
|
978
|
-
// eslint-disable-next-line security/detect-non-literal-regexp -- WU ID from internal state, not user input
|
|
979
|
-
const pattern = new RegExp(`${id.toLowerCase()}(?![0-9])`, 'i');
|
|
980
|
-
return pattern.test(output);
|
|
981
|
-
}
|
|
982
|
-
catch {
|
|
983
|
-
return false;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
/**
|
|
987
|
-
* Precompute active WU IDs from git worktree list.
|
|
988
|
-
*
|
|
989
|
-
* Returns:
|
|
990
|
-
* - Set of normalized WU IDs (e.g. WU-1234) when query succeeds
|
|
991
|
-
* - null when git worktree listing is unavailable (caller should fall back)
|
|
992
|
-
*/
|
|
993
|
-
async function listActiveWorktreeIds(projectRoot) {
|
|
994
|
-
try {
|
|
995
|
-
const git = createGitForPath(projectRoot);
|
|
996
|
-
const output = await git.worktreeList();
|
|
997
|
-
const matches = output.match(/\bwu-\d+\b/gi) ?? [];
|
|
998
|
-
const ids = new Set();
|
|
999
|
-
for (const match of matches) {
|
|
1000
|
-
ids.add(match.toUpperCase());
|
|
1001
|
-
}
|
|
1002
|
-
return ids;
|
|
1003
|
-
}
|
|
1004
|
-
catch {
|
|
1005
|
-
return null;
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
/**
|
|
1009
|
-
* Check whether a worktree path exists on disk
|
|
1010
|
-
*
|
|
1011
|
-
* @param {string} worktreePath - Worktree path from WU YAML
|
|
1012
|
-
* @returns {Promise<boolean>} True if path exists
|
|
1013
|
-
*/
|
|
1014
|
-
async function checkWorktreePathExists(worktreePath) {
|
|
1015
|
-
if (!worktreePath) {
|
|
1016
|
-
return false;
|
|
1017
|
-
}
|
|
1018
|
-
try {
|
|
1019
|
-
await access(worktreePath, constants.R_OK);
|
|
1020
|
-
return true;
|
|
1021
|
-
}
|
|
1022
|
-
catch {
|
|
1023
|
-
return false;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
//# sourceMappingURL=wu-consistency-checker.js.map
|