From 068a3099baf660e995c693b5625b4b3e4546b7a8 Mon Sep 17 00:00:00 2001 From: garrytan Date: Wed, 7 Oct 2026 21:45:33 +0000 Subject: [PATCH] test: assemble GitHub-token fixtures at runtime in the new brain-sync and skill-start tests (CI credential scan) --- test/brain-sync.test.ts | 2 +- test/gstack-skill-start.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/brain-sync.test.ts b/test/brain-sync.test.ts index 746619d85..711fb6468 100644 --- a/test/brain-sync.test.ts +++ b/test/brain-sync.test.ts @@ -434,7 +434,7 @@ describe('gstack-brain-sync per-file hold', () => { const CLEAN = 'projects/p/ceo-plans/clean.md'; const LOG = 'projects/p/decisions.jsonl'; const SNAP = 'projects/p/decisions.active.json'; - const TOKEN = 'ghp_abcdefghij1234567890abcdef1234567890'; + const TOKEN = ['ghp', 'abcdefghij1234567890abcdef1234567890'].join('_'); const SELF = path.join(BIN, 'gstack-brain-sync'); const statusRaw = () => fs.readFileSync(path.join(tmpHome, '.brain-sync-status.json'), 'utf-8'); const statusJson = () => JSON.parse(statusRaw()); diff --git a/test/gstack-skill-start.test.ts b/test/gstack-skill-start.test.ts index 0cadd4bd8..e0eb737de 100644 --- a/test/gstack-skill-start.test.ts +++ b/test/gstack-skill-start.test.ts @@ -531,7 +531,7 @@ describe('ARTIFACTS_SYNC attention lines (sync status table)', () => { }); test('attention lines carry no status text, artifact path or bare helper name', () => { - const leak = 'ghp_abcdefghij1234567890abcdef1234567890'; + const leak = ['ghp', 'abcdefghij1234567890abcdef1234567890'].join('_'); const gh = syncHome(status('held', { held_count: 7, message: `secret pattern detected (github-token:${leak.slice(0, 30)}...) in projects/p/learnings.jsonl`, @@ -571,7 +571,7 @@ describe('ARTIFACTS_SYNC attention lines (sync status table)', () => { bin('gstack-config', ['set', 'artifacts_sync_mode_prompted', 'true']); bin('gstack-config', ['set', 'update_check', 'false']); fs.mkdirSync(path.join(gh, 'projects/p/ceo-plans'), { recursive: true }); - fs.writeFileSync(path.join(gh, 'projects/p/learnings.jsonl'), '{"gh":"ghp_abcdefghij1234567890abcdef1234567890"}\n'); + fs.writeFileSync(path.join(gh, 'projects/p/learnings.jsonl'), `{"gh":"${['ghp', 'abcdefghij1234567890abcdef1234567890'].join('_')}"}\n`); fs.writeFileSync(path.join(gh, 'projects/p/ceo-plans/clean.md'), '# a plan\n'); bin('gstack-brain-enqueue', ['projects/p/learnings.jsonl']); bin('gstack-brain-enqueue', ['projects/p/ceo-plans/clean.md']);