@promptwheel/core 0.7.21 → 0.7.34
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/dist/codebase-index/ast-analysis.d.ts +33 -2
- package/dist/codebase-index/ast-analysis.d.ts.map +1 -1
- package/dist/codebase-index/ast-analysis.js +457 -2
- package/dist/codebase-index/ast-analysis.js.map +1 -1
- package/dist/codebase-index/ast-cache.d.ts +9 -1
- package/dist/codebase-index/ast-cache.d.ts.map +1 -1
- package/dist/codebase-index/ast-cache.js.map +1 -1
- package/dist/codebase-index/ast-patterns.d.ts +24 -4
- package/dist/codebase-index/ast-patterns.d.ts.map +1 -1
- package/dist/codebase-index/ast-patterns.js +274 -10
- package/dist/codebase-index/ast-patterns.js.map +1 -1
- package/dist/codebase-index/dead-code.d.ts +37 -4
- package/dist/codebase-index/dead-code.d.ts.map +1 -1
- package/dist/codebase-index/dead-code.js +152 -17
- package/dist/codebase-index/dead-code.js.map +1 -1
- package/dist/codebase-index/index.d.ts +4 -2
- package/dist/codebase-index/index.d.ts.map +1 -1
- package/dist/codebase-index/index.js +129 -14
- package/dist/codebase-index/index.js.map +1 -1
- package/dist/codebase-index/shared.d.ts +31 -0
- package/dist/codebase-index/shared.d.ts.map +1 -1
- package/dist/codebase-index/shared.js +50 -0
- package/dist/codebase-index/shared.js.map +1 -1
- package/dist/dedup/shared.d.ts +14 -0
- package/dist/dedup/shared.d.ts.map +1 -1
- package/dist/dedup/shared.js +40 -0
- package/dist/dedup/shared.js.map +1 -1
- package/dist/learnings/shared.d.ts +1 -1
- package/dist/learnings/shared.d.ts.map +1 -1
- package/dist/learnings/shared.js.map +1 -1
- package/dist/proposals/blueprint.d.ts +68 -0
- package/dist/proposals/blueprint.d.ts.map +1 -0
- package/dist/proposals/blueprint.js +292 -0
- package/dist/proposals/blueprint.js.map +1 -0
- package/dist/proposals/shared.d.ts +30 -2
- package/dist/proposals/shared.d.ts.map +1 -1
- package/dist/proposals/shared.js +58 -11
- package/dist/proposals/shared.js.map +1 -1
- package/dist/proposals/step-classifier.d.ts +32 -0
- package/dist/proposals/step-classifier.d.ts.map +1 -0
- package/dist/proposals/step-classifier.js +49 -0
- package/dist/proposals/step-classifier.js.map +1 -0
- package/dist/proposals/trajectory-critic.d.ts +35 -0
- package/dist/proposals/trajectory-critic.d.ts.map +1 -0
- package/dist/proposals/trajectory-critic.js +211 -0
- package/dist/proposals/trajectory-critic.js.map +1 -0
- package/dist/repos/tickets.d.ts +2 -0
- package/dist/repos/tickets.d.ts.map +1 -1
- package/dist/repos/tickets.js.map +1 -1
- package/dist/scout/index.d.ts.map +1 -1
- package/dist/scout/index.js +10 -1
- package/dist/scout/index.js.map +1 -1
- package/dist/scout/prompt.d.ts.map +1 -1
- package/dist/scout/prompt.js +7 -1
- package/dist/scout/prompt.js.map +1 -1
- package/dist/scout/runner.d.ts.map +1 -1
- package/dist/scout/runner.js +1 -0
- package/dist/scout/runner.js.map +1 -1
- package/dist/scout/types.d.ts +20 -1
- package/dist/scout/types.d.ts.map +1 -1
- package/dist/scout/types.js +4 -2
- package/dist/scout/types.js.map +1 -1
- package/dist/sectors/shared.d.ts +17 -0
- package/dist/sectors/shared.d.ts.map +1 -1
- package/dist/sectors/shared.js +65 -0
- package/dist/sectors/shared.js.map +1 -1
- package/dist/services/scout.d.ts +2 -0
- package/dist/services/scout.d.ts.map +1 -1
- package/dist/services/scout.js +1 -0
- package/dist/services/scout.js.map +1 -1
- package/dist/trajectory/io.d.ts +32 -0
- package/dist/trajectory/io.d.ts.map +1 -0
- package/dist/trajectory/io.js +201 -0
- package/dist/trajectory/io.js.map +1 -0
- package/dist/trajectory/shared.d.ts +50 -0
- package/dist/trajectory/shared.d.ts.map +1 -1
- package/dist/trajectory/shared.js +178 -0
- package/dist/trajectory/shared.js.map +1 -1
- package/dist/waves/conflict.d.ts +130 -0
- package/dist/waves/conflict.d.ts.map +1 -0
- package/dist/waves/conflict.js +400 -0
- package/dist/waves/conflict.js.map +1 -0
- package/dist/waves/merge.d.ts +75 -0
- package/dist/waves/merge.d.ts.map +1 -0
- package/dist/waves/merge.js +305 -0
- package/dist/waves/merge.js.map +1 -0
- package/dist/waves/shared.d.ts +6 -102
- package/dist/waves/shared.d.ts.map +1 -1
- package/dist/waves/shared.js +16 -346
- package/dist/waves/shared.js.map +1 -1
- package/package.json +17 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge resolution and symbol enrichment — pure functions for AST-aware
|
|
3
|
+
* merge conflict prediction, structural merge, and scout escalation.
|
|
4
|
+
*
|
|
5
|
+
* No filesystem, git, or child_process I/O.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Enrich proposals with target_symbols from a pre-loaded AST symbol map.
|
|
9
|
+
*
|
|
10
|
+
* For each proposal that lacks target_symbols, looks up its files in the
|
|
11
|
+
* symbol map and collects all symbol names. This makes symbol-aware conflict
|
|
12
|
+
* detection work automatically without relying on scout LLM compliance.
|
|
13
|
+
*
|
|
14
|
+
* Only sets target_symbols when ALL of a proposal's files have symbol data.
|
|
15
|
+
* If any file is missing from the map, we leave target_symbols unset so
|
|
16
|
+
* conflict detection falls back to the conservative path-based check.
|
|
17
|
+
*
|
|
18
|
+
* Mutates proposals in place for efficiency.
|
|
19
|
+
*/
|
|
20
|
+
export function enrichWithSymbols(proposals, symbolMap) {
|
|
21
|
+
for (const p of proposals) {
|
|
22
|
+
// Don't overwrite scout-provided symbols
|
|
23
|
+
if (p.target_symbols?.length)
|
|
24
|
+
continue;
|
|
25
|
+
if (p.files.length === 0)
|
|
26
|
+
continue;
|
|
27
|
+
// Only concrete file paths (no globs)
|
|
28
|
+
const concreteFiles = p.files.filter(f => !f.includes('*'));
|
|
29
|
+
if (concreteFiles.length === 0)
|
|
30
|
+
continue;
|
|
31
|
+
// All files must have symbol data for the enrichment to be reliable
|
|
32
|
+
const allSymbols = [];
|
|
33
|
+
let allResolved = true;
|
|
34
|
+
for (const file of concreteFiles) {
|
|
35
|
+
const symbols = symbolMap[file];
|
|
36
|
+
if (!symbols) {
|
|
37
|
+
allResolved = false;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
for (const s of symbols) {
|
|
41
|
+
allSymbols.push(s.name);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (allResolved && allSymbols.length > 0) {
|
|
45
|
+
// Deduplicate
|
|
46
|
+
p.target_symbols = [...new Set(allSymbols)];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// Pre-merge conflict prediction
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
/**
|
|
54
|
+
* Predict whether merging two sets of file changes will conflict,
|
|
55
|
+
* based on symbol-level line ranges.
|
|
56
|
+
*
|
|
57
|
+
* For each file both branches modified, checks if the modified symbol ranges
|
|
58
|
+
* overlap. Returns:
|
|
59
|
+
* - 'safe' — all shared files have disjoint symbol ranges (merge likely succeeds)
|
|
60
|
+
* - 'risky' — at least one shared file has overlapping symbol ranges (merge may conflict)
|
|
61
|
+
* - 'unknown' — symbol data missing for one or more shared files (can't predict)
|
|
62
|
+
*/
|
|
63
|
+
export function predictMergeConflict(filesA, filesB, symbolsA, symbolsB, symbolMap) {
|
|
64
|
+
const setB = new Set(filesB);
|
|
65
|
+
const sharedFiles = filesA.filter(f => setB.has(f));
|
|
66
|
+
if (sharedFiles.length === 0)
|
|
67
|
+
return 'safe';
|
|
68
|
+
for (const file of sharedFiles) {
|
|
69
|
+
const fileSymbols = symbolMap[file];
|
|
70
|
+
const symsA = symbolsA[file];
|
|
71
|
+
const symsB = symbolsB[file];
|
|
72
|
+
// If we don't have symbol data for a shared file, can't predict
|
|
73
|
+
if (!fileSymbols?.length || !symsA?.length || !symsB?.length)
|
|
74
|
+
return 'unknown';
|
|
75
|
+
// Build a map of symbol name → line range for quick lookup
|
|
76
|
+
const rangeByName = new Map(fileSymbols.map(s => [s.name, s]));
|
|
77
|
+
// Check if any symbol is modified by both branches
|
|
78
|
+
for (const symName of symsA) {
|
|
79
|
+
if (!symsB.includes(symName))
|
|
80
|
+
continue;
|
|
81
|
+
// Same symbol modified by both branches — check line range overlap
|
|
82
|
+
const range = rangeByName.get(symName);
|
|
83
|
+
if (range) {
|
|
84
|
+
// Both branches touch the same symbol → likely conflict
|
|
85
|
+
return 'risky';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Even if no named symbol overlaps, check if any line ranges overlap
|
|
89
|
+
// by matching unnamed modifications
|
|
90
|
+
const rangesA = symsA.map(s => rangeByName.get(s)).filter(Boolean);
|
|
91
|
+
const rangesB = symsB.map(s => rangeByName.get(s)).filter(Boolean);
|
|
92
|
+
for (const ra of rangesA) {
|
|
93
|
+
for (const rb of rangesB) {
|
|
94
|
+
// Line range overlap check
|
|
95
|
+
if (ra.startLine <= rb.endLine && rb.startLine <= ra.endLine) {
|
|
96
|
+
return 'risky';
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return 'safe';
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Reorder a list of ticket branches for merge, placing "safe" merges first
|
|
105
|
+
* and "risky" ones last. This minimizes the chance of early merge failures
|
|
106
|
+
* blocking later safe merges.
|
|
107
|
+
*
|
|
108
|
+
* Takes already-merged files (from the milestone) and each candidate's files+symbols.
|
|
109
|
+
* Returns indices sorted from safest to riskiest.
|
|
110
|
+
*/
|
|
111
|
+
export function orderMergeSequence(candidates, symbolMap) {
|
|
112
|
+
// Score each candidate: count how many other candidates it conflicts with
|
|
113
|
+
const scores = candidates.map((c, i) => {
|
|
114
|
+
let riskyCount = 0;
|
|
115
|
+
for (let j = 0; j < candidates.length; j++) {
|
|
116
|
+
if (i === j)
|
|
117
|
+
continue;
|
|
118
|
+
const prediction = predictMergeConflict(c.files, candidates[j].files, c.targetSymbols, candidates[j].targetSymbols, symbolMap);
|
|
119
|
+
if (prediction === 'risky')
|
|
120
|
+
riskyCount++;
|
|
121
|
+
}
|
|
122
|
+
return { index: i, riskyCount };
|
|
123
|
+
});
|
|
124
|
+
// Sort: fewest conflicts first (safest merges go first)
|
|
125
|
+
scores.sort((a, b) => a.riskyCount - b.riskyCount);
|
|
126
|
+
return scores.map(s => s.index);
|
|
127
|
+
}
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
// Scout escalation
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
/**
|
|
132
|
+
* Build escalation prompt text for scout retries.
|
|
133
|
+
* Suggests unexplored modules and fresh angles when previous attempts found nothing.
|
|
134
|
+
*/
|
|
135
|
+
export function buildScoutEscalation(retryCount, scoutedDirs, codebaseIndex, sectorState) {
|
|
136
|
+
const parts = [
|
|
137
|
+
'## Previous Attempts Found Nothing — Fresh Approach Required',
|
|
138
|
+
'',
|
|
139
|
+
];
|
|
140
|
+
if (scoutedDirs.length > 0) {
|
|
141
|
+
parts.push('### What Was Already Tried');
|
|
142
|
+
for (const dir of scoutedDirs) {
|
|
143
|
+
parts.push(`- Scouted \`${dir}\``);
|
|
144
|
+
}
|
|
145
|
+
parts.push('');
|
|
146
|
+
}
|
|
147
|
+
// Suggest unexplored modules from codebase index
|
|
148
|
+
const exploredSet = new Set(scoutedDirs.map(d => d.replace(/\/$/, '')));
|
|
149
|
+
const unexplored = [];
|
|
150
|
+
if (codebaseIndex) {
|
|
151
|
+
for (const mod of codebaseIndex.modules) {
|
|
152
|
+
if (!exploredSet.has(mod.path) && !exploredSet.has(mod.path + '/')) {
|
|
153
|
+
unexplored.push(mod.path);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Sort unexplored by sector history when available
|
|
158
|
+
if (sectorState && unexplored.length > 0) {
|
|
159
|
+
const sectorByPath = new Map(sectorState.sectors.map(s => [s.path, s]));
|
|
160
|
+
unexplored.sort((a, b) => {
|
|
161
|
+
const sa = sectorByPath.get(a);
|
|
162
|
+
const sb = sectorByPath.get(b);
|
|
163
|
+
// Fewer scans first
|
|
164
|
+
const scanA = sa?.scanCount ?? 0;
|
|
165
|
+
const scanB = sb?.scanCount ?? 0;
|
|
166
|
+
if (scanA !== scanB)
|
|
167
|
+
return scanA - scanB;
|
|
168
|
+
// Higher yield first
|
|
169
|
+
const yieldA = sa?.proposalYield ?? 0;
|
|
170
|
+
const yieldB = sb?.proposalYield ?? 0;
|
|
171
|
+
return yieldB - yieldA;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
parts.push('### What to Do Differently');
|
|
175
|
+
parts.push('');
|
|
176
|
+
parts.push('Knowing everything from the attempts above, take a completely different angle:');
|
|
177
|
+
parts.push('- Do NOT re-read the directories listed above.');
|
|
178
|
+
if (unexplored.length > 0) {
|
|
179
|
+
parts.push(`- Try unexplored areas: ${unexplored.slice(0, 8).map(d => `\`${d}\``).join(', ')}`);
|
|
180
|
+
}
|
|
181
|
+
parts.push('- Switch categories: if you looked for bugs, look for tests. If tests, try security.');
|
|
182
|
+
parts.push('- Read at least 15 NEW source files.');
|
|
183
|
+
parts.push('- If genuinely nothing to improve, explain your analysis across all attempts.');
|
|
184
|
+
return parts.join('\n');
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Split file content into symbol-aligned blocks using SymbolRange data.
|
|
188
|
+
* Produces a sequence of blocks covering the entire file: inter-symbol gaps
|
|
189
|
+
* are their own blocks (symbol=null), and each symbol gets its own block.
|
|
190
|
+
*
|
|
191
|
+
* SymbolRanges use 1-based line numbers; this function converts to 0-based
|
|
192
|
+
* for array indexing.
|
|
193
|
+
*/
|
|
194
|
+
function splitIntoBlocks(lines, symbols) {
|
|
195
|
+
const blocks = [];
|
|
196
|
+
// Sort symbols by start line
|
|
197
|
+
const sorted = [...symbols].sort((a, b) => a.startLine - b.startLine);
|
|
198
|
+
let cursor = 0; // 0-based current line
|
|
199
|
+
for (const sym of sorted) {
|
|
200
|
+
const symStart = sym.startLine - 1; // convert 1-based to 0-based
|
|
201
|
+
const symEnd = sym.endLine; // 1-based endLine → 0-based exclusive
|
|
202
|
+
// Gap before this symbol
|
|
203
|
+
if (cursor < symStart) {
|
|
204
|
+
blocks.push({
|
|
205
|
+
symbol: null,
|
|
206
|
+
startLine: cursor,
|
|
207
|
+
endLine: symStart,
|
|
208
|
+
lines: lines.slice(cursor, symStart),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
// The symbol block
|
|
212
|
+
const effectiveStart = Math.max(cursor, symStart);
|
|
213
|
+
const effectiveEnd = Math.min(symEnd, lines.length);
|
|
214
|
+
blocks.push({
|
|
215
|
+
symbol: sym.name,
|
|
216
|
+
startLine: effectiveStart,
|
|
217
|
+
endLine: effectiveEnd,
|
|
218
|
+
lines: lines.slice(effectiveStart, effectiveEnd),
|
|
219
|
+
});
|
|
220
|
+
cursor = effectiveEnd;
|
|
221
|
+
}
|
|
222
|
+
// Trailing gap after last symbol
|
|
223
|
+
if (cursor < lines.length) {
|
|
224
|
+
blocks.push({
|
|
225
|
+
symbol: null,
|
|
226
|
+
startLine: cursor,
|
|
227
|
+
endLine: lines.length,
|
|
228
|
+
lines: lines.slice(cursor),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return blocks;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Check if two arrays of strings are identical.
|
|
235
|
+
*/
|
|
236
|
+
function linesEqual(a, b) {
|
|
237
|
+
if (a.length !== b.length)
|
|
238
|
+
return false;
|
|
239
|
+
for (let i = 0; i < a.length; i++) {
|
|
240
|
+
if (a[i] !== b[i])
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Attempt to structurally resolve a merge conflict for a single file.
|
|
247
|
+
*
|
|
248
|
+
* Given three versions (base, ours, theirs) and symbol ranges for each,
|
|
249
|
+
* splits each version into symbol-aligned blocks. If modifications from
|
|
250
|
+
* "ours" and "theirs" affect disjoint symbols, produces a resolved version
|
|
251
|
+
* that includes both sets of changes.
|
|
252
|
+
*
|
|
253
|
+
* Returns the resolved content as a string, or null if:
|
|
254
|
+
* - Symbol data is unavailable for any version
|
|
255
|
+
* - Both sides modified the same symbol (true conflict)
|
|
256
|
+
* - Block structure doesn't align across versions (structural shift)
|
|
257
|
+
*
|
|
258
|
+
* Conservative by design: returns null on any ambiguity.
|
|
259
|
+
*/
|
|
260
|
+
export function tryStructuralMerge(baseContent, oursContent, theirsContent, baseSymbols, oursSymbols, theirsSymbols) {
|
|
261
|
+
if (!baseSymbols.length || !oursSymbols.length || !theirsSymbols.length) {
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
const baseLines = baseContent.split('\n');
|
|
265
|
+
const oursLines = oursContent.split('\n');
|
|
266
|
+
const theirsLines = theirsContent.split('\n');
|
|
267
|
+
const baseBlocks = splitIntoBlocks(baseLines, baseSymbols);
|
|
268
|
+
const oursBlocks = splitIntoBlocks(oursLines, oursSymbols);
|
|
269
|
+
const theirsBlocks = splitIntoBlocks(theirsLines, theirsSymbols);
|
|
270
|
+
// Block counts must match — structural shifts (added/removed symbols) are too risky
|
|
271
|
+
if (baseBlocks.length !== oursBlocks.length || baseBlocks.length !== theirsBlocks.length) {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
// Symbol names must match in order — reordered symbols are too risky
|
|
275
|
+
for (let i = 0; i < baseBlocks.length; i++) {
|
|
276
|
+
if (baseBlocks[i].symbol !== oursBlocks[i].symbol || baseBlocks[i].symbol !== theirsBlocks[i].symbol) {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// For each block, determine which side(s) modified it
|
|
281
|
+
const resolvedLines = [];
|
|
282
|
+
for (let i = 0; i < baseBlocks.length; i++) {
|
|
283
|
+
const base = baseBlocks[i].lines;
|
|
284
|
+
const ours = oursBlocks[i].lines;
|
|
285
|
+
const theirs = theirsBlocks[i].lines;
|
|
286
|
+
const oursChanged = !linesEqual(base, ours);
|
|
287
|
+
const theirsChanged = !linesEqual(base, theirs);
|
|
288
|
+
if (oursChanged && theirsChanged) {
|
|
289
|
+
// Both sides modified the same block — true conflict, bail out
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
else if (oursChanged) {
|
|
293
|
+
resolvedLines.push(...ours);
|
|
294
|
+
}
|
|
295
|
+
else if (theirsChanged) {
|
|
296
|
+
resolvedLines.push(...theirs);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
// Neither side changed — use base
|
|
300
|
+
resolvedLines.push(...base);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return resolvedLines.join('\n');
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/waves/merge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAc,EACd,SAAoB;IAEpB,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;QAC1B,yCAAyC;QACzC,IAAI,CAAC,CAAC,cAAc,EAAE,MAAM;YAAE,SAAS;QACvC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEnC,sCAAsC;QACtC,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5D,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEzC,oEAAoE;QACpE,MAAM,UAAU,GAAa,EAAE,CAAC;QAChC,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,MAAM,OA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I,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/waves/shared.d.ts
CHANGED
|
@@ -1,106 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Wave scheduling shared algorithms —
|
|
3
|
-
* parallel execution partitioning.
|
|
2
|
+
* Wave scheduling shared algorithms — barrel re-export.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* No filesystem, git, or child_process I/O.
|
|
10
|
-
*/
|
|
11
|
-
import type { CodebaseIndex } from '../codebase-index/shared.js';
|
|
12
|
-
import type { SectorState } from '../sectors/shared.js';
|
|
13
|
-
export type ConflictSensitivity = 'strict' | 'normal' | 'relaxed';
|
|
14
|
-
export interface ConflictDetectionOptions {
|
|
15
|
-
/**
|
|
16
|
-
* Sensitivity level:
|
|
17
|
-
* - 'strict': Any shared directory or package = conflict (safest, most sequential)
|
|
18
|
-
* - 'normal': Sibling files + conflict-prone files + shared dirs (balanced)
|
|
19
|
-
* - 'relaxed': Only direct file overlap + glob overlap (most parallel, riskier)
|
|
20
|
-
*/
|
|
21
|
-
sensitivity?: ConflictSensitivity;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Files that frequently cause merge conflicts when multiple tickets
|
|
25
|
-
* touch the same directory. These are "hub" files that re-export or
|
|
26
|
-
* aggregate content from sibling files.
|
|
27
|
-
*/
|
|
28
|
-
export declare const CONFLICT_PRONE_FILENAMES: Set<string>;
|
|
29
|
-
/**
|
|
30
|
-
* Directory patterns that indicate shared/common code.
|
|
31
|
-
* Files in these directories are more likely to be touched by multiple tickets.
|
|
32
|
-
*/
|
|
33
|
-
export declare const SHARED_DIRECTORY_PATTERNS: RegExp[];
|
|
34
|
-
/** Monorepo top-level directory patterns. */
|
|
35
|
-
export declare const PACKAGE_PATTERN: RegExp;
|
|
36
|
-
/** Default directory overlap threshold for normal mode. */
|
|
37
|
-
export declare const DIRECTORY_OVERLAP_NORMAL = 0.3;
|
|
38
|
-
/** Default directory overlap threshold for strict mode. */
|
|
39
|
-
export declare const DIRECTORY_OVERLAP_STRICT = 0.2;
|
|
40
|
-
/** Extract the directory and filename from a path. */
|
|
41
|
-
export declare function parsePath(filePath: string): {
|
|
42
|
-
dir: string;
|
|
43
|
-
filename: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Check if two file paths overlap: exact match, directory containment,
|
|
47
|
-
* or glob pattern overlap.
|
|
48
|
-
*/
|
|
49
|
-
export declare function pathsOverlap(pathA: string, pathB: string): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Check if two sets of file paths share directories above a threshold.
|
|
52
|
-
* Used for semantic conflict detection in wave scheduling.
|
|
53
|
-
*/
|
|
54
|
-
export declare function directoriesOverlap(pathsA: string[], pathsB: string[], threshold?: number): boolean;
|
|
55
|
-
/** Check if a file is conflict-prone (index files, configs, etc.) */
|
|
56
|
-
export declare function isConflictProneFile(filePath: string): boolean;
|
|
57
|
-
/** Check if a path is in a shared/common directory. */
|
|
58
|
-
export declare function isInSharedDirectory(filePath: string): boolean;
|
|
59
|
-
/** Get all unique directories from a list of file paths, including parent hierarchy. */
|
|
60
|
-
export declare function getDirectories(files: string[]): Set<string>;
|
|
61
|
-
/**
|
|
62
|
-
* Check if two proposals have sibling files (different files in the same directory).
|
|
63
|
-
*/
|
|
64
|
-
export declare function hasSiblingFiles(filesA: string[], filesB: string[]): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Check if either proposal touches conflict-prone files in overlapping directories.
|
|
67
|
-
*/
|
|
68
|
-
export declare function hasConflictProneOverlap(filesA: string[], filesB: string[]): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Check if proposals share a common parent directory that might have
|
|
71
|
-
* configuration or index files affected by both changes.
|
|
72
|
-
*/
|
|
73
|
-
export declare function hasSharedParentConflict(filesA: string[], filesB: string[]): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Monorepo-aware: check if both proposals touch the same package.
|
|
76
|
-
* Common patterns: packages/*, apps/*, libs/*, modules/*
|
|
77
|
-
*/
|
|
78
|
-
export declare function touchesSamePackage(filesA: string[], filesB: string[]): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Check if two proposals have a potential conflict based on their file lists.
|
|
81
|
-
*/
|
|
82
|
-
export declare function proposalsConflict<T extends {
|
|
83
|
-
files: string[];
|
|
84
|
-
category?: string;
|
|
85
|
-
}>(a: T, b: T, options?: ConflictDetectionOptions): boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Partition proposals into conflict-free waves.
|
|
88
|
-
* Proposals with overlapping file paths go into separate waves
|
|
89
|
-
* so they run sequentially, avoiding merge conflicts.
|
|
90
|
-
*
|
|
91
|
-
* Uses a greedy first-fit bin-packing algorithm.
|
|
92
|
-
*
|
|
93
|
-
* @param proposals - List of proposals with file paths
|
|
94
|
-
* @param options - Conflict detection options
|
|
95
|
-
* @returns Array of waves, each containing non-conflicting proposals
|
|
96
|
-
*/
|
|
97
|
-
export declare function partitionIntoWaves<T extends {
|
|
98
|
-
files: string[];
|
|
99
|
-
category?: string;
|
|
100
|
-
}>(proposals: T[], options?: ConflictDetectionOptions): T[][];
|
|
101
|
-
/**
|
|
102
|
-
* Build escalation prompt text for scout retries.
|
|
103
|
-
* Suggests unexplored modules and fresh angles when previous attempts found nothing.
|
|
4
|
+
* All implementations live in focused submodules:
|
|
5
|
+
* - conflict.ts — conflict detection, path helpers, wave partitioning
|
|
6
|
+
* - merge.ts — symbol enrichment, merge prediction, structural merge, scout escalation
|
|
104
7
|
*/
|
|
105
|
-
export
|
|
8
|
+
export { type ConflictSensitivity, type ConflictDetectionOptions, CONFLICT_PRONE_FILENAMES, SHARED_DIRECTORY_PATTERNS, PACKAGE_PATTERN, DIRECTORY_OVERLAP_NORMAL, DIRECTORY_OVERLAP_STRICT, parsePath, pathsOverlap, directoriesOverlap, isConflictProneFile, isInSharedDirectory, getDirectories, hasSiblingFiles, hasConflictProneOverlap, hasSharedParentConflict, touchesSamePackage, hasImportChainConflict, hasCallGraphConflict, proposalsConflict, partitionIntoWaves, } from './conflict.js';
|
|
9
|
+
export { type SymbolMap, enrichWithSymbols, predictMergeConflict, orderMergeSequence, buildScoutEscalation, tryStructuralMerge, } from './merge.js';
|
|
106
10
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/waves/shared.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/waves/shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAG7B,wBAAwB,EACxB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EAGxB,SAAS,EACT,YAAY,EACZ,kBAAkB,EAGlB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAGlB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EAGjB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAEL,KAAK,SAAS,EACd,iBAAiB,EAGjB,oBAAoB,EACpB,kBAAkB,EAGlB,oBAAoB,EAGpB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|