@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 +12 -0
- package/package.json +1 -1
- package/src/solve.results.lib.mjs +37 -4
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
|
@@ -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
|
|
255
|
-
//
|
|
256
|
-
|
|
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
|
-
|
|
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',
|