@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.69.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 52dfa8e: Preserve pull request `.gitkeep` edits during final cleanup so intentional `.gitkeep` deletions are not re-added.
8
+
3
9
  ## 1.69.12
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.69.12",
3
+ "version": "1.69.13",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -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 });