From 34049b4a7e8694c5f49c7f06f570689f7411cbed Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Mon, 6 Apr 2026 19:27:06 -0700 Subject: [PATCH 1/2] fix(gsd): add .bg-shell/ to baseline gitignore patterns The bg-shell process manifest directory is ephemeral runtime state that should never be committed, but ensureGitignore() was not including it. Closes #3389 Closes #3388 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/resources/extensions/gsd/gitignore.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resources/extensions/gsd/gitignore.ts b/src/resources/extensions/gsd/gitignore.ts index c3c2f66b8..8a80c3da5 100644 --- a/src/resources/extensions/gsd/gitignore.ts +++ b/src/resources/extensions/gsd/gitignore.ts @@ -42,6 +42,7 @@ const BASELINE_PATTERNS = [ // ── GSD state directory (symlink to external storage) ── ".gsd", ".gsd-id", + ".bg-shell/", // ── OS junk ── ".DS_Store", From fc210a4edf84cc00846711bb9029cac44831805b Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Mon, 6 Apr 2026 22:25:38 -0700 Subject: [PATCH 2/2] test: add regression test for .bg-shell/ in gitignore BASELINE_PATTERNS Structural verification that .bg-shell/ is included in the BASELINE_PATTERNS array in gitignore.ts. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../gsd/tests/gitignore-bg-shell.test.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/resources/extensions/gsd/tests/gitignore-bg-shell.test.ts diff --git a/src/resources/extensions/gsd/tests/gitignore-bg-shell.test.ts b/src/resources/extensions/gsd/tests/gitignore-bg-shell.test.ts new file mode 100644 index 000000000..5060b08a9 --- /dev/null +++ b/src/resources/extensions/gsd/tests/gitignore-bg-shell.test.ts @@ -0,0 +1,38 @@ +/** + * Regression test — .bg-shell/ added to BASELINE_PATTERNS in gitignore.ts + * + * The bg-shell background process directory was not included in the + * baseline gitignore patterns, causing it to appear as untracked in + * git status and potentially be committed. + * + * Structural verification test — reads source to confirm .bg-shell/ + * is in BASELINE_PATTERNS. + */ + +import { describe, test } from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const source = readFileSync(join(__dirname, '..', 'gitignore.ts'), 'utf-8'); + +describe('.bg-shell/ in BASELINE_PATTERNS', () => { + test('BASELINE_PATTERNS array is defined', () => { + assert.match(source, /const BASELINE_PATTERNS\s*=/, + 'BASELINE_PATTERNS should be defined'); + }); + + test('.bg-shell/ is included in BASELINE_PATTERNS', () => { + // Extract the BASELINE_PATTERNS array content + const patternsStart = source.indexOf('BASELINE_PATTERNS'); + const arrayStart = source.indexOf('[', patternsStart); + const arrayEnd = source.indexOf('] as const', arrayStart); + const patternsContent = source.slice(arrayStart, arrayEnd); + assert.match(patternsContent, /\.bg-shell\//, + '.bg-shell/ should be in BASELINE_PATTERNS'); + }); +});