@link-assistant/hive-mind 1.34.5 → 1.34.6

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,17 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.34.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 3157192: Optimize CI/CD to skip checks for .gitkeep-only changes and harden .gitkeep cleanup logic (Issue #1436).
8
+
9
+ CI/CD jobs `version-check` and `helm-pr-check` now skip when only `.gitkeep` files changed, saving ~21 seconds of runner time per PR on the initial commit. The `detect-code-changes.mjs` script now excludes `.gitkeep` files from code change detection and outputs a `gitkeep-only` flag.
10
+
11
+ The `.gitkeep` cleanup logic in `solve.results.lib.mjs` is hardened with: (1) full commit message body detection (`%B` instead of `%s`) so `.gitkeep` references in commit body are found, (2) fallback file detection via `git diff-tree`, and (3) post-cleanup verification with direct removal fallback to prevent leftover `.gitkeep` files.
12
+
13
+ Also removes the leftover `.gitkeep` file from the repository that was left behind by PR #1420.
14
+
3
15
  ## 1.34.5
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.34.5",
3
+ "version": "1.34.6",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -251,11 +251,19 @@ export const cleanupClaudeFile = async (tempDir, branchName, claudeCommitHash =
251
251
  await log(` Detected initial commit: ${claudeCommitHash.substring(0, 7)}`, { verbose: true });
252
252
  }
253
253
 
254
- // Determine which file was used based on the commit message or flags
255
- // Check the commit message to determine which file was committed
256
- const commitMsgResult = await $({ cwd: tempDir })`git log -1 --format=%s ${claudeCommitHash} 2>&1`;
254
+ // Determine which file was used based on the commit message or actual files changed
255
+ // Use %B (full message including body) instead of %s (subject only) to catch ".gitkeep" in body
256
+ // Also check the actual files changed as a fallback (Issue #1436)
257
+ const commitMsgResult = await $({ cwd: tempDir })`git log -1 --format=%B ${claudeCommitHash} 2>&1`;
257
258
  const commitMsg = commitMsgResult.stdout?.trim() || '';
258
- const isGitkeepFile = commitMsg.includes('.gitkeep');
259
+ let isGitkeepFile = commitMsg.includes('.gitkeep');
260
+
261
+ // Fallback: check actual files changed in the commit if message doesn't mention .gitkeep
262
+ if (!isGitkeepFile) {
263
+ const filesResult = await $({ cwd: tempDir })`git diff-tree --no-commit-id --name-only -r ${claudeCommitHash} 2>&1`;
264
+ const files = filesResult.stdout?.trim().split('\n').filter(Boolean) || [];
265
+ isGitkeepFile = files.includes('.gitkeep');
266
+ }
259
267
  const fileName = isGitkeepFile ? '.gitkeep' : 'CLAUDE.md';
260
268
 
261
269
  await log(formatAligned('🔄', 'Cleanup:', `Reverting ${fileName} commit`));
@@ -381,6 +389,31 @@ export const cleanupClaudeFile = async (tempDir, branchName, claudeCommitHash =
381
389
  }
382
390
  }
383
391
  }
392
+ // Post-cleanup verification: check if the file was actually removed (Issue #1436)
393
+ // This catches cases where revert/push succeeded in logs but file still exists
394
+ const verifyResult = await $({ cwd: tempDir })`git ls-files ${fileName} 2>&1`;
395
+ const fileStillExists = verifyResult.code === 0 && verifyResult.stdout && verifyResult.stdout.trim();
396
+ if (fileStillExists) {
397
+ await log(` âš ī¸ WARNING: ${fileName} still exists after cleanup — attempting direct removal...`);
398
+ // Check if the file existed before the initial commit (parent)
399
+ const parentCommit = `${claudeCommitHash}~1`;
400
+ const parentFileExists = await $({ cwd: tempDir })`git cat-file -e ${parentCommit}:${fileName} 2>&1`;
401
+ if (parentFileExists.code !== 0) {
402
+ // File didn't exist before the session — force remove it
403
+ await $({ cwd: tempDir })`git rm -f ${fileName} 2>&1`;
404
+ const fallbackCommit = await $({ cwd: tempDir })`git commit -m "Remove leftover ${fileName} (post-cleanup fallback, Issue #1436)" 2>&1`;
405
+ if (fallbackCommit.code === 0) {
406
+ const fallbackPush = await $({ cwd: tempDir })`git push origin ${branchName} 2>&1`;
407
+ if (fallbackPush.code === 0) {
408
+ await log(` ✅ ${fileName} removed via post-cleanup fallback`);
409
+ } else {
410
+ await log(` âš ī¸ ${fileName} removed locally but push failed`, { verbose: true });
411
+ }
412
+ }
413
+ } else {
414
+ await log(` â„šī¸ ${fileName} existed before this session — keeping pre-existing file`, { verbose: true });
415
+ }
416
+ }
384
417
  } catch (e) {
385
418
  reportError(e, {
386
419
  context: 'cleanup_claude_file',