From e2eb5cecf210a0dbfdf317cb99b37c69b643985f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=82CHES?= Date: Wed, 25 Mar 2026 00:17:22 -0600 Subject: [PATCH] fix(gsd): handle retentionDays=0 on Windows + run windows-portability on PRs (#2460) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two changes: 1. pruneActivityLogs: when retentionDays is 0, skip mtime comparison and unconditionally remove all files except highest-seq. On Windows, NTFS timestamp resolution meant freshly-created files could have mtime >= Date.now() at cutoff calculation, so none were pruned. 2. CI: remove the push-to-main gate on windows-portability so it runs on PRs too — catches Windows failures before merge instead of after. Co-authored-by: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 3 +-- src/resources/extensions/gsd/activity-log.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02095016b..d5a88312d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,8 +145,7 @@ jobs: timeout-minutes: 15 needs: detect-changes if: >- - needs.detect-changes.outputs.docs-only != 'true' && - github.event_name == 'push' && github.ref == 'refs/heads/main' + needs.detect-changes.outputs.docs-only != 'true' runs-on: blacksmith-4vcpu-windows-2025 steps: diff --git a/src/resources/extensions/gsd/activity-log.ts b/src/resources/extensions/gsd/activity-log.ts index 932f28e2e..82896ea5b 100644 --- a/src/resources/extensions/gsd/activity-log.ts +++ b/src/resources/extensions/gsd/activity-log.ts @@ -153,6 +153,7 @@ export function pruneActivityLogs(activityDir: string, retentionDays: number): v const cutoff = Date.now() - retentionDays * 86_400_000; for (const entry of entries) { if (entry.seq === maxSeq) continue; // always preserve highest-seq + if (retentionDays === 0) { try { unlinkSync(entry.filePath); } catch { /* skip */ } continue; } try { const mtime = statSync(entry.filePath).mtimeMs; if (Math.floor(mtime) <= cutoff) unlinkSync(entry.filePath);