@lumenflow/core 1.0.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/LICENSE +190 -0
- package/README.md +119 -0
- package/dist/active-wu-detector.d.ts +33 -0
- package/dist/active-wu-detector.js +106 -0
- package/dist/adapters/filesystem-metrics.adapter.d.ts +108 -0
- package/dist/adapters/filesystem-metrics.adapter.js +519 -0
- package/dist/adapters/terminal-renderer.adapter.d.ts +106 -0
- package/dist/adapters/terminal-renderer.adapter.js +337 -0
- package/dist/arg-parser.d.ts +63 -0
- package/dist/arg-parser.js +560 -0
- package/dist/backlog-editor.d.ts +98 -0
- package/dist/backlog-editor.js +179 -0
- package/dist/backlog-generator.d.ts +111 -0
- package/dist/backlog-generator.js +381 -0
- package/dist/backlog-parser.d.ts +45 -0
- package/dist/backlog-parser.js +102 -0
- package/dist/backlog-sync-validator.d.ts +78 -0
- package/dist/backlog-sync-validator.js +294 -0
- package/dist/branch-drift.d.ts +34 -0
- package/dist/branch-drift.js +51 -0
- package/dist/cleanup-install-config.d.ts +33 -0
- package/dist/cleanup-install-config.js +37 -0
- package/dist/cleanup-lock.d.ts +139 -0
- package/dist/cleanup-lock.js +313 -0
- package/dist/code-path-validator.d.ts +146 -0
- package/dist/code-path-validator.js +537 -0
- package/dist/code-paths-overlap.d.ts +55 -0
- package/dist/code-paths-overlap.js +245 -0
- package/dist/commands-logger.d.ts +77 -0
- package/dist/commands-logger.js +254 -0
- package/dist/commit-message-utils.d.ts +25 -0
- package/dist/commit-message-utils.js +41 -0
- package/dist/compliance-parser.d.ts +150 -0
- package/dist/compliance-parser.js +507 -0
- package/dist/constants/backlog-patterns.d.ts +20 -0
- package/dist/constants/backlog-patterns.js +23 -0
- package/dist/constants/dora-constants.d.ts +49 -0
- package/dist/constants/dora-constants.js +53 -0
- package/dist/constants/gate-constants.d.ts +15 -0
- package/dist/constants/gate-constants.js +15 -0
- package/dist/constants/linter-constants.d.ts +16 -0
- package/dist/constants/linter-constants.js +16 -0
- package/dist/constants/tokenizer-constants.d.ts +15 -0
- package/dist/constants/tokenizer-constants.js +15 -0
- package/dist/core/scope-checker.d.ts +97 -0
- package/dist/core/scope-checker.js +163 -0
- package/dist/core/tool-runner.d.ts +161 -0
- package/dist/core/tool-runner.js +393 -0
- package/dist/core/tool.constants.d.ts +105 -0
- package/dist/core/tool.constants.js +101 -0
- package/dist/core/tool.schemas.d.ts +226 -0
- package/dist/core/tool.schemas.js +226 -0
- package/dist/core/worktree-guard.d.ts +130 -0
- package/dist/core/worktree-guard.js +242 -0
- package/dist/coverage-gate.d.ts +108 -0
- package/dist/coverage-gate.js +196 -0
- package/dist/date-utils.d.ts +75 -0
- package/dist/date-utils.js +140 -0
- package/dist/dependency-graph.d.ts +142 -0
- package/dist/dependency-graph.js +550 -0
- package/dist/dependency-guard.d.ts +54 -0
- package/dist/dependency-guard.js +142 -0
- package/dist/dependency-validator.d.ts +105 -0
- package/dist/dependency-validator.js +154 -0
- package/dist/docs-path-validator.d.ts +36 -0
- package/dist/docs-path-validator.js +95 -0
- package/dist/domain/orchestration.constants.d.ts +99 -0
- package/dist/domain/orchestration.constants.js +97 -0
- package/dist/domain/orchestration.schemas.d.ts +280 -0
- package/dist/domain/orchestration.schemas.js +211 -0
- package/dist/domain/orchestration.types.d.ts +133 -0
- package/dist/domain/orchestration.types.js +12 -0
- package/dist/error-handler.d.ts +116 -0
- package/dist/error-handler.js +136 -0
- package/dist/file-classifiers.d.ts +62 -0
- package/dist/file-classifiers.js +108 -0
- package/dist/gates-agent-mode.d.ts +81 -0
- package/dist/gates-agent-mode.js +94 -0
- package/dist/generate-traceability.d.ts +107 -0
- package/dist/generate-traceability.js +411 -0
- package/dist/git-adapter.d.ts +395 -0
- package/dist/git-adapter.js +649 -0
- package/dist/git-staged-validator.d.ts +32 -0
- package/dist/git-staged-validator.js +48 -0
- package/dist/hardcoded-strings.d.ts +61 -0
- package/dist/hardcoded-strings.js +270 -0
- package/dist/incremental-lint.d.ts +78 -0
- package/dist/incremental-lint.js +129 -0
- package/dist/incremental-test.d.ts +39 -0
- package/dist/incremental-test.js +61 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +61 -0
- package/dist/invariants/check-automated-tests.d.ts +50 -0
- package/dist/invariants/check-automated-tests.js +166 -0
- package/dist/invariants-runner.d.ts +103 -0
- package/dist/invariants-runner.js +527 -0
- package/dist/lane-checker.d.ts +50 -0
- package/dist/lane-checker.js +319 -0
- package/dist/lane-inference.d.ts +39 -0
- package/dist/lane-inference.js +195 -0
- package/dist/lane-lock.d.ts +211 -0
- package/dist/lane-lock.js +474 -0
- package/dist/lane-validator.d.ts +48 -0
- package/dist/lane-validator.js +114 -0
- package/dist/logs-lib.d.ts +104 -0
- package/dist/logs-lib.js +207 -0
- package/dist/lumenflow-config-schema.d.ts +272 -0
- package/dist/lumenflow-config-schema.js +207 -0
- package/dist/lumenflow-config.d.ts +95 -0
- package/dist/lumenflow-config.js +236 -0
- package/dist/manual-test-validator.d.ts +80 -0
- package/dist/manual-test-validator.js +200 -0
- package/dist/merge-lock.d.ts +115 -0
- package/dist/merge-lock.js +251 -0
- package/dist/micro-worktree.d.ts +159 -0
- package/dist/micro-worktree.js +427 -0
- package/dist/migration-deployer.d.ts +69 -0
- package/dist/migration-deployer.js +151 -0
- package/dist/orchestration-advisory-loader.d.ts +28 -0
- package/dist/orchestration-advisory-loader.js +87 -0
- package/dist/orchestration-advisory.d.ts +58 -0
- package/dist/orchestration-advisory.js +94 -0
- package/dist/orchestration-di.d.ts +48 -0
- package/dist/orchestration-di.js +57 -0
- package/dist/orchestration-rules.d.ts +57 -0
- package/dist/orchestration-rules.js +201 -0
- package/dist/orphan-detector.d.ts +131 -0
- package/dist/orphan-detector.js +226 -0
- package/dist/path-classifiers.d.ts +57 -0
- package/dist/path-classifiers.js +93 -0
- package/dist/piped-command-detector.d.ts +34 -0
- package/dist/piped-command-detector.js +64 -0
- package/dist/ports/dashboard-renderer.port.d.ts +112 -0
- package/dist/ports/dashboard-renderer.port.js +25 -0
- package/dist/ports/metrics-collector.port.d.ts +132 -0
- package/dist/ports/metrics-collector.port.js +26 -0
- package/dist/process-detector.d.ts +84 -0
- package/dist/process-detector.js +172 -0
- package/dist/prompt-linter.d.ts +72 -0
- package/dist/prompt-linter.js +312 -0
- package/dist/prompt-monitor.d.ts +15 -0
- package/dist/prompt-monitor.js +205 -0
- package/dist/rebase-artifact-cleanup.d.ts +145 -0
- package/dist/rebase-artifact-cleanup.js +433 -0
- package/dist/retry-strategy.d.ts +189 -0
- package/dist/retry-strategy.js +283 -0
- package/dist/risk-detector.d.ts +108 -0
- package/dist/risk-detector.js +252 -0
- package/dist/rollback-utils.d.ts +76 -0
- package/dist/rollback-utils.js +104 -0
- package/dist/section-headings.d.ts +43 -0
- package/dist/section-headings.js +49 -0
- package/dist/spawn-escalation.d.ts +90 -0
- package/dist/spawn-escalation.js +253 -0
- package/dist/spawn-monitor.d.ts +229 -0
- package/dist/spawn-monitor.js +672 -0
- package/dist/spawn-recovery.d.ts +82 -0
- package/dist/spawn-recovery.js +298 -0
- package/dist/spawn-registry-schema.d.ts +98 -0
- package/dist/spawn-registry-schema.js +108 -0
- package/dist/spawn-registry-store.d.ts +146 -0
- package/dist/spawn-registry-store.js +273 -0
- package/dist/spawn-tree.d.ts +121 -0
- package/dist/spawn-tree.js +285 -0
- package/dist/stamp-status-validator.d.ts +84 -0
- package/dist/stamp-status-validator.js +134 -0
- package/dist/stamp-utils.d.ts +100 -0
- package/dist/stamp-utils.js +229 -0
- package/dist/state-machine.d.ts +26 -0
- package/dist/state-machine.js +83 -0
- package/dist/system-map-validator.d.ts +80 -0
- package/dist/system-map-validator.js +272 -0
- package/dist/telemetry.d.ts +80 -0
- package/dist/telemetry.js +213 -0
- package/dist/token-counter.d.ts +51 -0
- package/dist/token-counter.js +145 -0
- package/dist/usecases/get-dashboard-data.usecase.d.ts +52 -0
- package/dist/usecases/get-dashboard-data.usecase.js +61 -0
- package/dist/usecases/get-suggestions.usecase.d.ts +100 -0
- package/dist/usecases/get-suggestions.usecase.js +153 -0
- package/dist/user-normalizer.d.ts +41 -0
- package/dist/user-normalizer.js +141 -0
- package/dist/validators/phi-constants.d.ts +97 -0
- package/dist/validators/phi-constants.js +152 -0
- package/dist/validators/phi-scanner.d.ts +58 -0
- package/dist/validators/phi-scanner.js +215 -0
- package/dist/worktree-ownership.d.ts +50 -0
- package/dist/worktree-ownership.js +74 -0
- package/dist/worktree-scanner.d.ts +103 -0
- package/dist/worktree-scanner.js +168 -0
- package/dist/worktree-symlink.d.ts +99 -0
- package/dist/worktree-symlink.js +359 -0
- package/dist/wu-backlog-updater.d.ts +17 -0
- package/dist/wu-backlog-updater.js +37 -0
- package/dist/wu-checkpoint.d.ts +124 -0
- package/dist/wu-checkpoint.js +233 -0
- package/dist/wu-claim-helpers.d.ts +26 -0
- package/dist/wu-claim-helpers.js +63 -0
- package/dist/wu-claim-resume.d.ts +106 -0
- package/dist/wu-claim-resume.js +276 -0
- package/dist/wu-consistency-checker.d.ts +95 -0
- package/dist/wu-consistency-checker.js +567 -0
- package/dist/wu-constants.d.ts +1275 -0
- package/dist/wu-constants.js +1382 -0
- package/dist/wu-create-validators.d.ts +42 -0
- package/dist/wu-create-validators.js +93 -0
- package/dist/wu-done-branch-only.d.ts +63 -0
- package/dist/wu-done-branch-only.js +191 -0
- package/dist/wu-done-messages.d.ts +119 -0
- package/dist/wu-done-messages.js +185 -0
- package/dist/wu-done-pr.d.ts +72 -0
- package/dist/wu-done-pr.js +174 -0
- package/dist/wu-done-retry-helpers.d.ts +85 -0
- package/dist/wu-done-retry-helpers.js +172 -0
- package/dist/wu-done-ui.d.ts +37 -0
- package/dist/wu-done-ui.js +69 -0
- package/dist/wu-done-validators.d.ts +411 -0
- package/dist/wu-done-validators.js +1229 -0
- package/dist/wu-done-worktree.d.ts +182 -0
- package/dist/wu-done-worktree.js +1097 -0
- package/dist/wu-helpers.d.ts +128 -0
- package/dist/wu-helpers.js +248 -0
- package/dist/wu-lint.d.ts +70 -0
- package/dist/wu-lint.js +234 -0
- package/dist/wu-paths.d.ts +171 -0
- package/dist/wu-paths.js +178 -0
- package/dist/wu-preflight-validators.d.ts +86 -0
- package/dist/wu-preflight-validators.js +251 -0
- package/dist/wu-recovery.d.ts +138 -0
- package/dist/wu-recovery.js +341 -0
- package/dist/wu-repair-core.d.ts +131 -0
- package/dist/wu-repair-core.js +669 -0
- package/dist/wu-schema-normalization.d.ts +17 -0
- package/dist/wu-schema-normalization.js +82 -0
- package/dist/wu-schema.d.ts +793 -0
- package/dist/wu-schema.js +881 -0
- package/dist/wu-spawn-helpers.d.ts +121 -0
- package/dist/wu-spawn-helpers.js +271 -0
- package/dist/wu-spawn.d.ts +158 -0
- package/dist/wu-spawn.js +1306 -0
- package/dist/wu-state-schema.d.ts +213 -0
- package/dist/wu-state-schema.js +156 -0
- package/dist/wu-state-store.d.ts +264 -0
- package/dist/wu-state-store.js +691 -0
- package/dist/wu-status-transition.d.ts +63 -0
- package/dist/wu-status-transition.js +382 -0
- package/dist/wu-status-updater.d.ts +25 -0
- package/dist/wu-status-updater.js +116 -0
- package/dist/wu-transaction-collectors.d.ts +116 -0
- package/dist/wu-transaction-collectors.js +272 -0
- package/dist/wu-transaction.d.ts +170 -0
- package/dist/wu-transaction.js +273 -0
- package/dist/wu-validation-constants.d.ts +60 -0
- package/dist/wu-validation-constants.js +66 -0
- package/dist/wu-validation.d.ts +118 -0
- package/dist/wu-validation.js +243 -0
- package/dist/wu-validator.d.ts +62 -0
- package/dist/wu-validator.js +325 -0
- package/dist/wu-yaml-fixer.d.ts +97 -0
- package/dist/wu-yaml-fixer.js +264 -0
- package/dist/wu-yaml.d.ts +86 -0
- package/dist/wu-yaml.js +222 -0
- package/package.json +114 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Worktree mode completion workflow for wu:done
|
|
4
|
+
* Extracted from wu-done.mjs (WU-1215 refactoring)
|
|
5
|
+
* Updated in WU-1369 to use atomic transaction pattern.
|
|
6
|
+
*
|
|
7
|
+
* Flow (WU-1369 Atomic Pattern):
|
|
8
|
+
* 1. cd into worktree
|
|
9
|
+
* 2. Read and validate WU state
|
|
10
|
+
* 3. Run ALL validations FIRST (before any file writes)
|
|
11
|
+
* 4. Collect all metadata changes into transaction (in memory)
|
|
12
|
+
* 5. Commit transaction (atomic write)
|
|
13
|
+
* 6. Stage and format files
|
|
14
|
+
* 7. Git commit in worktree
|
|
15
|
+
* 8. Return to main checkout
|
|
16
|
+
* 9. Either merge (default) OR create PR (pr-mode)
|
|
17
|
+
* 10. Push to origin
|
|
18
|
+
*
|
|
19
|
+
* Key guarantee: If any validation fails, NO files are modified.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} WorktreeContext
|
|
23
|
+
* @property {string} id - WU ID (e.g., "WU-1215")
|
|
24
|
+
* @property {Object} args - Parsed CLI arguments
|
|
25
|
+
* @property {Object} docMain - WU YAML document from main checkout
|
|
26
|
+
* @property {string} title - WU title for commit message
|
|
27
|
+
* @property {boolean} isDocsOnly - Whether this is a docs-only WU
|
|
28
|
+
* @property {string} worktreePath - Path to worktree
|
|
29
|
+
* @property {number} maxCommitLength - Max commit header length from commitlint
|
|
30
|
+
* @property {function} validateStagedFiles - Staged files validator
|
|
31
|
+
* NOTE: recordTransactionState/rollbackTransaction removed in WU-1369 (atomic pattern)
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* @typedef {Object} WorktreeResult
|
|
35
|
+
* @property {boolean} success - Whether completion succeeded
|
|
36
|
+
* @property {boolean} committed - Whether changes were committed
|
|
37
|
+
* @property {boolean} pushed - Whether changes were pushed
|
|
38
|
+
* @property {boolean} merged - Whether lane branch was merged (vs PR created)
|
|
39
|
+
* @property {string|null} prUrl - PR URL if PR mode was used
|
|
40
|
+
* @property {boolean} [recovered] - Whether zombie state was recovered
|
|
41
|
+
* @property {boolean} [cleanupSafe] - WU-1811: Whether worktree cleanup is safe (all steps succeeded)
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Execute worktree mode completion
|
|
45
|
+
*
|
|
46
|
+
* @param {WorktreeContext} context - Worktree mode context
|
|
47
|
+
* @returns {Promise<WorktreeResult>} Completion result
|
|
48
|
+
* @throws {Error} On validation or git operation failure
|
|
49
|
+
*/
|
|
50
|
+
export declare function executeWorktreeCompletion(context: any): Promise<{
|
|
51
|
+
success: boolean;
|
|
52
|
+
committed: boolean;
|
|
53
|
+
pushed: boolean;
|
|
54
|
+
merged: boolean;
|
|
55
|
+
prUrl: any;
|
|
56
|
+
cleanupSafe: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Check for branch drift (commits behind main)
|
|
60
|
+
* WU-755 pre-flight check
|
|
61
|
+
*
|
|
62
|
+
* @param {string} branch - Lane branch name
|
|
63
|
+
* @returns {Promise<number>} Number of commits behind main
|
|
64
|
+
*/
|
|
65
|
+
export declare function checkBranchDrift(branch: any): Promise<number>;
|
|
66
|
+
/**
|
|
67
|
+
* Auto-rebase branch onto main
|
|
68
|
+
* WU-1303: Auto-rebase on wu:done to handle diverged branches automatically
|
|
69
|
+
* WU-1371: Added wuId parameter for post-rebase artifact cleanup
|
|
70
|
+
* WU-1749 Bug 3: Auto-resolve append-only file conflicts during rebase
|
|
71
|
+
*
|
|
72
|
+
* @param {string} branch - Lane branch name
|
|
73
|
+
* @param {string} worktreePath - Path to worktree
|
|
74
|
+
* @param {string} [wuId] - WU ID for artifact cleanup (e.g., 'WU-1371')
|
|
75
|
+
* @returns {Promise<{success: boolean, error?: string}>} Rebase result
|
|
76
|
+
*/
|
|
77
|
+
export declare function autoRebaseBranch(branch: any, worktreePath: any, wuId: any): Promise<{
|
|
78
|
+
success: boolean;
|
|
79
|
+
error?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
success: boolean;
|
|
82
|
+
error: string;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Check for branch divergence (main has advanced since branch creation)
|
|
86
|
+
* WU-1303: Added autoRebase option (default ON) to automatically rebase diverged branches
|
|
87
|
+
* WU-1371: Added wuId option for post-rebase artifact cleanup
|
|
88
|
+
*
|
|
89
|
+
* @param {string} branch - Lane branch name
|
|
90
|
+
* @param {CheckBranchOptions} [options] - Check options
|
|
91
|
+
* @throws {Error} If divergence detected and auto-rebase fails or is disabled
|
|
92
|
+
*/
|
|
93
|
+
interface CheckBranchOptions {
|
|
94
|
+
/** Automatically rebase if diverged */
|
|
95
|
+
autoRebase?: boolean;
|
|
96
|
+
/** Path to worktree (required if autoRebase=true) */
|
|
97
|
+
worktreePath?: string | null;
|
|
98
|
+
/** WU ID for artifact cleanup (e.g., 'WU-1371') */
|
|
99
|
+
wuId?: string | null;
|
|
100
|
+
}
|
|
101
|
+
export declare function checkBranchDivergence(branch: any, options?: CheckBranchOptions): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Check for merge commits in lane branch that would violate linear history
|
|
104
|
+
* WU-1384: GitHub requires linear history; merge commits in lane branches must be eliminated
|
|
105
|
+
* WU-1371: Added wuId option for post-rebase artifact cleanup
|
|
106
|
+
*
|
|
107
|
+
* If merge commits are found, triggers auto-rebase to linearize history.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} branch - Lane branch name
|
|
110
|
+
* @param {CheckBranchOptions} [options] - Check options
|
|
111
|
+
* @throws {Error} If merge commits found and auto-rebase fails or is disabled
|
|
112
|
+
*/
|
|
113
|
+
export declare function checkMergeCommits(branch: any, options?: CheckBranchOptions): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Check for merge conflicts using git merge-tree
|
|
116
|
+
* WU-755 pre-flight check
|
|
117
|
+
*
|
|
118
|
+
* @param {string} branch - Lane branch name
|
|
119
|
+
*/
|
|
120
|
+
export declare function checkMergeConflicts(branch: any): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* WU-1456: Check for empty merge (no work commits beyond claim)
|
|
123
|
+
* WU-1460: Upgraded to BLOCK when code_paths defined but files not modified
|
|
124
|
+
*
|
|
125
|
+
* Detects when an agent runs wu:done without committing actual work.
|
|
126
|
+
* - If code_paths defined: BLOCK if those files weren't modified
|
|
127
|
+
* - If no code_paths: WARNING only (docs-only or metadata updates are valid)
|
|
128
|
+
*
|
|
129
|
+
* @param {string} branch - Lane branch name
|
|
130
|
+
* @param {object} [doc] - WU document with code_paths array (optional for backwards compatibility)
|
|
131
|
+
* @returns {Promise<void>}
|
|
132
|
+
* @throws {Error} When code_paths defined but files not modified in commits
|
|
133
|
+
*/
|
|
134
|
+
export declare function checkEmptyMerge(branch: any, doc?: any): Promise<void>;
|
|
135
|
+
export declare function isBranchAlreadyMerged(branch: any): Promise<boolean>;
|
|
136
|
+
/**
|
|
137
|
+
* Merge lane branch to main with exponential backoff retry (WU-1747)
|
|
138
|
+
*
|
|
139
|
+
* Uses retry strategy to handle concurrent completions gracefully.
|
|
140
|
+
* WU-1749 Bug 2: Will auto-rebase lane branch onto new main on retry.
|
|
141
|
+
*
|
|
142
|
+
* @param {string} branch - Lane branch name
|
|
143
|
+
* @param {Object} [options] - Merge options
|
|
144
|
+
* @param {MergeLaneBranchOptions} [options] - Merge options
|
|
145
|
+
* @throws {Error} On merge failure after all retries
|
|
146
|
+
*/
|
|
147
|
+
interface MergeLaneBranchOptions extends CheckBranchOptions {
|
|
148
|
+
/** Override max retry attempts */
|
|
149
|
+
maxAttempts?: number;
|
|
150
|
+
}
|
|
151
|
+
export declare function mergeLaneBranch(branch: any, options?: MergeLaneBranchOptions): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* WU-1943: Check if the session has checkpoints for the given WU
|
|
154
|
+
*
|
|
155
|
+
* Used to warn agents when they're completing a WU without any checkpoints,
|
|
156
|
+
* which means no recovery data if the session crashes.
|
|
157
|
+
*
|
|
158
|
+
* @param {string} wuId - WU ID to check
|
|
159
|
+
* @param {Array|null} nodes - Memory nodes for the WU (from queryByWu)
|
|
160
|
+
* @returns {boolean} True if checkpoints exist, false otherwise
|
|
161
|
+
*/
|
|
162
|
+
export declare function hasSessionCheckpoints(wuId: any, nodes: any): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* WU-1943: Rollback branch to pre-commit SHA when merge fails
|
|
165
|
+
*
|
|
166
|
+
* When wu:done commits metadata to the lane branch but the subsequent merge
|
|
167
|
+
* to main fails, this function rolls back the branch to its pre-commit state.
|
|
168
|
+
* This prevents "zombie" states where the branch shows done but wasn't merged.
|
|
169
|
+
*
|
|
170
|
+
* @param {object} gitAdapter - Git adapter instance (must be in worktree context)
|
|
171
|
+
* @param {string} preCommitSha - SHA to reset to (captured before metadata commit)
|
|
172
|
+
* @param {string} wuId - WU ID for logging
|
|
173
|
+
* @returns {Promise<{success: boolean, error?: string}>} Rollback result
|
|
174
|
+
*/
|
|
175
|
+
export declare function rollbackBranchOnMergeFailure(gitAdapter: any, preCommitSha: any, wuId: any): Promise<{
|
|
176
|
+
success: boolean;
|
|
177
|
+
error?: undefined;
|
|
178
|
+
} | {
|
|
179
|
+
success: boolean;
|
|
180
|
+
error: any;
|
|
181
|
+
}>;
|
|
182
|
+
export {};
|