@telora/daemon 0.15.3 → 0.15.5
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/build-info.json +2 -2
- package/dist/directive-executor.d.ts +18 -3
- package/dist/directive-executor.d.ts.map +1 -1
- package/dist/directive-executor.js +45 -4
- package/dist/directive-executor.js.map +1 -1
- package/dist/focus-completion.js +12 -12
- package/dist/focus-completion.js.map +1 -1
- package/dist/focus-executor.d.ts.map +1 -1
- package/dist/focus-executor.js +30 -13
- package/dist/focus-executor.js.map +1 -1
- package/dist/focus-phase.d.ts +22 -0
- package/dist/focus-phase.d.ts.map +1 -0
- package/dist/focus-phase.js +54 -0
- package/dist/focus-phase.js.map +1 -0
- package/dist/focus-team-state.d.ts +6 -0
- package/dist/focus-team-state.d.ts.map +1 -1
- package/dist/focus-team-state.js +13 -0
- package/dist/focus-team-state.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/listener.d.ts.map +1 -1
- package/dist/listener.js +0 -5
- package/dist/listener.js.map +1 -1
- package/dist/queries/focuses.d.ts +5 -0
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +15 -0
- package/dist/queries/focuses.js.map +1 -1
- package/dist/review-defect-detector.d.ts +16 -95
- package/dist/review-defect-detector.d.ts.map +1 -1
- package/dist/review-defect-detector.js +19 -211
- package/dist/review-defect-detector.js.map +1 -1
- package/dist/state-cascade.d.ts +45 -41
- package/dist/state-cascade.d.ts.map +1 -1
- package/dist/state-cascade.js +123 -215
- package/dist/state-cascade.js.map +1 -1
- package/package.json +2 -2
- package/dist/listener-review.d.ts +0 -37
- package/dist/listener-review.d.ts.map +0 -1
- package/dist/listener-review.js +0 -217
- package/dist/listener-review.js.map +0 -1
- package/dist/queries/strategies.d.ts +0 -97
- package/dist/queries/strategies.d.ts.map +0 -1
- package/dist/queries/strategies.js +0 -136
- package/dist/queries/strategies.js.map +0 -1
- package/dist/review-spawner.d.ts +0 -32
- package/dist/review-spawner.d.ts.map +0 -1
- package/dist/review-spawner.js +0 -170
- package/dist/review-spawner.js.map +0 -1
- package/dist/strategy-completion-event.d.ts +0 -63
- package/dist/strategy-completion-event.d.ts.map +0 -1
- package/dist/strategy-completion-event.js +0 -138
- package/dist/strategy-completion-event.js.map +0 -1
- package/dist/strategy-completion.d.ts +0 -85
- package/dist/strategy-completion.d.ts.map +0 -1
- package/dist/strategy-completion.js +0 -459
- package/dist/strategy-completion.js.map +0 -1
- package/dist/strategy-engine.d.ts +0 -47
- package/dist/strategy-engine.d.ts.map +0 -1
- package/dist/strategy-engine.js +0 -421
- package/dist/strategy-engine.js.map +0 -1
- package/dist/strategy-executor.d.ts +0 -55
- package/dist/strategy-executor.d.ts.map +0 -1
- package/dist/strategy-executor.js +0 -519
- package/dist/strategy-executor.js.map +0 -1
- package/dist/strategy-lifecycle.d.ts +0 -61
- package/dist/strategy-lifecycle.d.ts.map +0 -1
- package/dist/strategy-lifecycle.js +0 -544
- package/dist/strategy-lifecycle.js.map +0 -1
- package/dist/strategy-merge.d.ts +0 -77
- package/dist/strategy-merge.d.ts.map +0 -1
- package/dist/strategy-merge.js +0 -378
- package/dist/strategy-merge.js.map +0 -1
- package/dist/strategy-prompt-builder.d.ts +0 -24
- package/dist/strategy-prompt-builder.d.ts.map +0 -1
- package/dist/strategy-prompt-builder.js +0 -87
- package/dist/strategy-prompt-builder.js.map +0 -1
- package/dist/strategy-provisioning.d.ts +0 -16
- package/dist/strategy-provisioning.d.ts.map +0 -1
- package/dist/strategy-provisioning.js +0 -119
- package/dist/strategy-provisioning.js.map +0 -1
- package/dist/strategy-spawn-helpers.d.ts +0 -67
- package/dist/strategy-spawn-helpers.d.ts.map +0 -1
- package/dist/strategy-spawn-helpers.js +0 -160
- package/dist/strategy-spawn-helpers.js.map +0 -1
- package/dist/strategy-team-lifecycle.d.ts +0 -50
- package/dist/strategy-team-lifecycle.d.ts.map +0 -1
- package/dist/strategy-team-lifecycle.js +0 -256
- package/dist/strategy-team-lifecycle.js.map +0 -1
- package/dist/strategy-team-state.d.ts +0 -24
- package/dist/strategy-team-state.d.ts.map +0 -1
- package/dist/strategy-team-state.js +0 -43
- package/dist/strategy-team-state.js.map +0 -1
- package/dist/strategy-teardown.d.ts +0 -24
- package/dist/strategy-teardown.d.ts.map +0 -1
- package/dist/strategy-teardown.js +0 -158
- package/dist/strategy-teardown.js.map +0 -1
- package/dist/strategy-worktree-state.d.ts +0 -47
- package/dist/strategy-worktree-state.d.ts.map +0 -1
- package/dist/strategy-worktree-state.js +0 -104
- package/dist/strategy-worktree-state.js.map +0 -1
- package/dist/team-prompt-variants.d.ts +0 -17
- package/dist/team-prompt-variants.d.ts.map +0 -1
- package/dist/team-prompt-variants.js +0 -79
- package/dist/team-prompt-variants.js.map +0 -1
- package/dist/types/strategy.d.ts +0 -180
- package/dist/types/strategy.d.ts.map +0 -1
- package/dist/types/strategy.js +0 -5
- package/dist/types/strategy.js.map +0 -1
- package/dist/worktree-merge.d.ts +0 -23
- package/dist/worktree-merge.d.ts.map +0 -1
- package/dist/worktree-merge.js +0 -57
- package/dist/worktree-merge.js.map +0 -1
- package/dist/worktree-strategy.d.ts +0 -69
- package/dist/worktree-strategy.d.ts.map +0 -1
- package/dist/worktree-strategy.js +0 -214
- package/dist/worktree-strategy.js.map +0 -1
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strategy worktree lifecycle: canonical removal and orphan cleanup.
|
|
3
|
-
*
|
|
4
|
-
* safeRemoveStrategyWorktree is the single code path for all strategy
|
|
5
|
-
* worktree removals -- it merges before removing and conditionally
|
|
6
|
-
* clears in-memory state.
|
|
7
|
-
*
|
|
8
|
-
* cleanupOrphanStrategyWorktrees scans the worktree directory on startup
|
|
9
|
-
* and removes worktrees that no longer match any active strategy.
|
|
10
|
-
*/
|
|
11
|
-
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
12
|
-
import { join, resolve } from 'node:path';
|
|
13
|
-
import { runGitSync } from './git-types.js';
|
|
14
|
-
import { mergeToIntegration } from './git-merge.js';
|
|
15
|
-
import { getActiveStrategies } from './queries/deliveries.js';
|
|
16
|
-
import { removeStrategyWorktree as removeStrategyWorktreeState } from './strategy-worktree-state.js';
|
|
17
|
-
import { sanitizeGitSegment } from './git-utils.js';
|
|
18
|
-
import { branchHasUnmergedCommits, removeWorktree } from './worktree-safety.js';
|
|
19
|
-
// ── Canonical worktree removal ────────────────────────────────────
|
|
20
|
-
/**
|
|
21
|
-
* Canonical strategy worktree removal: merge-before-remove + conditional cleanup.
|
|
22
|
-
*
|
|
23
|
-
* Every code path that removes a strategy worktree should route through this
|
|
24
|
-
* function. It encapsulates the full lifecycle:
|
|
25
|
-
* 1. Check for unmerged commits on the branch
|
|
26
|
-
* 2. Attempt merge to integration if needed
|
|
27
|
-
* 3. Call removeWorktree with safety guards (handles uncommitted changes)
|
|
28
|
-
* 4. Conditionally clear in-memory state based on whether removal succeeded
|
|
29
|
-
*
|
|
30
|
-
* Returns structured result so callers can count cleaned/preserved and log.
|
|
31
|
-
*/
|
|
32
|
-
export async function safeRemoveStrategyWorktree(params) {
|
|
33
|
-
const { config, worktreePath, branchName, deliveryName, deliveryId, strategyId } = params;
|
|
34
|
-
const { repoPath, integrationBranch } = config;
|
|
35
|
-
// 1. Attempt merge if there are unmerged commits
|
|
36
|
-
let mergeSucceeded = false;
|
|
37
|
-
let merged = false;
|
|
38
|
-
let mergeError;
|
|
39
|
-
try {
|
|
40
|
-
if (branchHasUnmergedCommits(branchName, integrationBranch, repoPath)) {
|
|
41
|
-
console.log(`[worktree] Attempting merge for ${branchName} before removal`);
|
|
42
|
-
const mergeResult = await mergeToIntegration({
|
|
43
|
-
config,
|
|
44
|
-
branchName,
|
|
45
|
-
deliveryName,
|
|
46
|
-
deliveryId: deliveryId ?? deliveryName,
|
|
47
|
-
});
|
|
48
|
-
mergeSucceeded = mergeResult.success;
|
|
49
|
-
merged = true;
|
|
50
|
-
if (mergeResult.success) {
|
|
51
|
-
console.log(`[worktree] Merge succeeded for ${branchName}`);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
mergeError = mergeResult.error ?? 'unknown';
|
|
55
|
-
console.warn(`[worktree] Merge failed for ${branchName}: ${mergeError}. ` +
|
|
56
|
-
`Safety guards will preserve the branch.`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
mergeSucceeded = true; // Nothing to merge
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
mergeError = err.message;
|
|
65
|
-
console.warn(`[worktree] Merge attempt failed for ${branchName}: ${mergeError}`);
|
|
66
|
-
}
|
|
67
|
-
// 2. Remove worktree (safety guards handle uncommitted changes and unmerged commits)
|
|
68
|
-
let removed = false;
|
|
69
|
-
try {
|
|
70
|
-
removed = removeWorktree(repoPath, worktreePath, {
|
|
71
|
-
branchName,
|
|
72
|
-
integrationBranch,
|
|
73
|
-
deliveryName,
|
|
74
|
-
mergeSucceeded,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
console.warn(`[worktree] Failed to remove worktree ${worktreePath}: ${err.message}`);
|
|
79
|
-
}
|
|
80
|
-
// 3. Conditionally clear in-memory state
|
|
81
|
-
if (strategyId) {
|
|
82
|
-
if (removed) {
|
|
83
|
-
removeStrategyWorktreeState(strategyId);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
console.log(`[worktree] Worktree preserved for strategy ${strategyId} -- keeping in-memory state`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return { removed, merged, mergeError };
|
|
90
|
-
}
|
|
91
|
-
// ── Orphan strategy worktree cleanup ──────────────────────────────
|
|
92
|
-
/**
|
|
93
|
-
* Clean up orphan strategy worktrees on daemon startup.
|
|
94
|
-
*
|
|
95
|
-
* Scans the worktree directory and cross-references against active
|
|
96
|
-
* strategies (those with assigned agent roles and queued deliveries).
|
|
97
|
-
* Worktrees that don't match any active strategy are orphans from a
|
|
98
|
-
* previous daemon run and are cleaned up.
|
|
99
|
-
*
|
|
100
|
-
* Conservative approach:
|
|
101
|
-
* - Safety-commits any uncommitted changes before removal
|
|
102
|
-
* - Checks for unmerged commits before deleting
|
|
103
|
-
* - Logs all actions for auditability
|
|
104
|
-
*
|
|
105
|
-
* @returns Count of orphans cleaned up and preserved
|
|
106
|
-
*/
|
|
107
|
-
export async function cleanupOrphanStrategyWorktrees(config) {
|
|
108
|
-
const { worktreeDir, repoPath, organizationId, productId } = config;
|
|
109
|
-
let cleaned = 0;
|
|
110
|
-
let preserved = 0;
|
|
111
|
-
if (!existsSync(worktreeDir)) {
|
|
112
|
-
return { cleaned, preserved };
|
|
113
|
-
}
|
|
114
|
-
// 1. List all subdirectories in the worktree directory
|
|
115
|
-
let entries;
|
|
116
|
-
try {
|
|
117
|
-
entries = readdirSync(worktreeDir).filter((entry) => {
|
|
118
|
-
try {
|
|
119
|
-
return statSync(join(worktreeDir, entry)).isDirectory();
|
|
120
|
-
}
|
|
121
|
-
catch (e) {
|
|
122
|
-
console.debug(`[worktree] Failed to stat ${entry} (may have been deleted):`, e.message);
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
catch (err) {
|
|
128
|
-
console.warn(`[worktree] Failed to scan worktree directory: ${err instanceof Error ? err.message : String(err)}`);
|
|
129
|
-
return { cleaned, preserved };
|
|
130
|
-
}
|
|
131
|
-
if (entries.length === 0) {
|
|
132
|
-
return { cleaned, preserved };
|
|
133
|
-
}
|
|
134
|
-
// 2. Query active strategies
|
|
135
|
-
let activeStrategyBranchDirs;
|
|
136
|
-
try {
|
|
137
|
-
const activeStrategiesList = await getActiveStrategies(organizationId, productId);
|
|
138
|
-
activeStrategyBranchDirs = new Set();
|
|
139
|
-
for (const s of activeStrategiesList) {
|
|
140
|
-
const shortId = s.strategy_id.slice(0, 8);
|
|
141
|
-
const sanitizedRole = sanitizeGitSegment(s.agent_role_name ?? 'reviewer');
|
|
142
|
-
const sanitizedName = sanitizeGitSegment(s.strategy_name);
|
|
143
|
-
const expectedDir = `agent-${sanitizedRole}-${sanitizedName}-${shortId}`;
|
|
144
|
-
if (entries.includes(expectedDir)) {
|
|
145
|
-
activeStrategyBranchDirs.add(expectedDir);
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
// Fallback: match by strategy ID prefix in case sanitization differs
|
|
149
|
-
for (const entry of entries) {
|
|
150
|
-
if (entry.endsWith(shortId)) {
|
|
151
|
-
activeStrategyBranchDirs.add(entry);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
catch (err) {
|
|
158
|
-
console.warn(`[worktree] Failed to query active strategies for orphan detection: ` +
|
|
159
|
-
`${err instanceof Error ? err.message : String(err)}. Skipping orphan cleanup.`);
|
|
160
|
-
return { cleaned, preserved };
|
|
161
|
-
}
|
|
162
|
-
// 3. Identify orphans: agent worktree dirs not matching any active strategy
|
|
163
|
-
const orphanDirs = entries.filter((entry) => {
|
|
164
|
-
if (!entry.startsWith('agent-'))
|
|
165
|
-
return false;
|
|
166
|
-
return !activeStrategyBranchDirs.has(entry);
|
|
167
|
-
});
|
|
168
|
-
if (orphanDirs.length === 0) {
|
|
169
|
-
console.log('[worktree] No orphan strategy worktrees found');
|
|
170
|
-
return { cleaned, preserved };
|
|
171
|
-
}
|
|
172
|
-
console.log(`[worktree] Found ${orphanDirs.length} orphan strategy worktree(s)`);
|
|
173
|
-
// 4. Parse git worktree list to get branch names for each path
|
|
174
|
-
const worktreeListResult = runGitSync(['worktree', 'list', '--porcelain'], repoPath);
|
|
175
|
-
const pathToBranch = new Map();
|
|
176
|
-
if (worktreeListResult.success) {
|
|
177
|
-
let currentPath = null;
|
|
178
|
-
for (const line of worktreeListResult.output.split('\n')) {
|
|
179
|
-
if (line.startsWith('worktree ')) {
|
|
180
|
-
currentPath = line.slice('worktree '.length);
|
|
181
|
-
}
|
|
182
|
-
else if (line.startsWith('branch refs/heads/') && currentPath) {
|
|
183
|
-
pathToBranch.set(resolve(currentPath), line.slice('branch refs/heads/'.length));
|
|
184
|
-
currentPath = null;
|
|
185
|
-
}
|
|
186
|
-
else if (line === '') {
|
|
187
|
-
currentPath = null;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
// 5. Clean up each orphan via canonical removal path
|
|
192
|
-
for (const dir of orphanDirs) {
|
|
193
|
-
const worktreePath = resolve(join(worktreeDir, dir));
|
|
194
|
-
const branchName = pathToBranch.get(worktreePath) ?? dir.replace(/-/g, '/');
|
|
195
|
-
const deliveryName = branchName.split('/').slice(2).join('/') || dir;
|
|
196
|
-
console.log(`[worktree] Cleaning up orphan strategy worktree: ${worktreePath} [${branchName}]`);
|
|
197
|
-
const result = await safeRemoveStrategyWorktree({
|
|
198
|
-
config,
|
|
199
|
-
worktreePath,
|
|
200
|
-
branchName,
|
|
201
|
-
deliveryName,
|
|
202
|
-
deliveryId: dir, // No real delivery ID -- use dir name for traceability
|
|
203
|
-
});
|
|
204
|
-
if (result.removed) {
|
|
205
|
-
cleaned++;
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
preserved++;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
console.log(`[worktree] Orphan strategy worktree cleanup: ${cleaned} cleaned, ${preserved} preserved`);
|
|
212
|
-
return { cleaned, preserved };
|
|
213
|
-
}
|
|
214
|
-
//# sourceMappingURL=worktree-strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-strategy.js","sourceRoot":"","sources":["../src/worktree-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,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