fix(test): scope rendered-output tripwires to repo sources; stop cdp-e2e's env leak

Two hermeticity holes surfaced by the wave's final gate. (1) The three T6
tripwires (branch-slug, codex-flag, empty-find) enumerated the whole tree
including the workspace-local .claude/ install, which is not generated
output and can carry dangling symlinks from unrelated sessions — one ENOENT
there failed all three. They now scan repo sources only. (2)
browse/test/cdp-e2e.test.ts mutated process.env.GSTACK_HOME at module scope
without restore; in one-process shard runs that leaks into every later test
file — observed baking cdp-e2e's temp render path into artifacts that
outlived it (53 dangling SKILL.md symlinks in a workspace install). The
original value is now restored in afterAll. The exact test that performed
the polluted relink remains unattributed; both known leak vectors are
closed and the workspace was repaired via an explicit gstack-relink.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-16 11:19:22 -07:00
co-authored by Claude Fable 5
parent a19cdd69ba
commit 4da5be24a6
4 changed files with 16 additions and 2 deletions
+4 -1
View File
@@ -86,7 +86,10 @@ describe('empty find must not fall through to cwd (#2483)', () => {
const hits = out
.split('\n')
.filter(Boolean)
.filter((f) => !f.includes('node_modules'));
.filter((f) => !f.includes('node_modules'))
// The workspace-local .claude/ install is not generated output and can
// carry dangling symlinks from unrelated sessions.
.filter((f) => !f.includes('/.claude/'));
expect(hits).toEqual([]);
});
});