@link-assistant/hive-mind 1.69.12 → 1.69.13
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/solve.results.lib.mjs +24 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -361,6 +361,20 @@ const detectClaudeMdCommitFromBranch = async (tempDir, branchName) => {
|
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
363
|
|
|
364
|
+
const wasFileTouchedAfterCommit = async (tempDir, commitHash, fileName) => {
|
|
365
|
+
const changedCommitsResult = await $({ cwd: tempDir, silent: true })`git log --format=%H ${commitHash}..HEAD -- ${fileName}`;
|
|
366
|
+
if (changedCommitsResult.code === 0) {
|
|
367
|
+
return Boolean(changedCommitsResult.stdout?.trim());
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (changedCommitsResult.code !== 0) {
|
|
371
|
+
await log(` Could not inspect ${fileName} changes after initial commit`, { verbose: true });
|
|
372
|
+
await log(` git log output: ${changedCommitsResult.stderr || changedCommitsResult.stdout || 'no output'}`, { verbose: true });
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return true;
|
|
376
|
+
};
|
|
377
|
+
|
|
364
378
|
// Revert the CLAUDE.md or .gitkeep commit to restore original state
|
|
365
379
|
export const cleanupClaudeFile = async (tempDir, branchName, claudeCommitHash = null) => {
|
|
366
380
|
try {
|
|
@@ -406,6 +420,16 @@ export const cleanupClaudeFile = async (tempDir, branchName, claudeCommitHash =
|
|
|
406
420
|
|
|
407
421
|
const commitToRevert = claudeCommitHash;
|
|
408
422
|
|
|
423
|
+
// Issue #1791: .gitkeep is a normal repository file in some projects, and
|
|
424
|
+
// user work may intentionally edit or delete it. Once later PR commits touch
|
|
425
|
+
// .gitkeep, final cleanup must not restore the pre-session version.
|
|
426
|
+
if (fileName === '.gitkeep' && (await wasFileTouchedAfterCommit(tempDir, commitToRevert, fileName))) {
|
|
427
|
+
await log(` ${fileName} changed after the initial auto-commit; leaving PR changes untouched`, {
|
|
428
|
+
verbose: true,
|
|
429
|
+
});
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
|
|
409
433
|
// APPROACH 3: Check for modifications before reverting (proactive detection)
|
|
410
434
|
// This is the main strategy - detect if the file was modified after initial commit
|
|
411
435
|
await log(` Checking if ${fileName} was modified since initial commit...`, { verbose: true });
|