The Swift test suite creates ~/.config/tacet/key in the real home directory of whoever runs it. swift/Tests/TacetCoreTests/KeyFileTests.swift:6 asserts the opposite in a comment:
the real ~/.config/tacet/key is never touched.
Reproduction
rm -rf ~/.config/tacet
cd swift && swift test
ls -la ~/.config/tacet/ # key, 44 bytes, mode 600
Reproduced twice; the file timestamp matches the test-run second exactly.
Severity
Lower than it first looks, and worth recording why. Behaviour is create-if-absent, verified directly:
key before tests: cc32ca79d0f2b7c0
key after tests: cc32ca79d0f2b7c0
An existing key is not overwritten, so this has never rotated a live secret out from under a running client. If it did overwrite, every client would start failing with a silent 401 after any test run — the same failure the dictate→hark rename produced.
Why it matters anyway
- A test run generates real key material outside the repo, on any machine including CI runners.
- It made the rename genuinely confusing:
~/.config/tacet/ appeared populated with a key that did not match the live ~/.config/hark/key, which looks exactly like a botched migration. Anyone moving config with mv would have hit "directory not empty" and, resolving it the obvious way, could have installed the test key as the live one and broken every client.
Fix
Point the tests at a temp directory. Config.swift:41 already honours TACET_CONFIG; KeyFile.swift:21 resolves homeDirectoryForCurrentUser unconditionally and does not. Giving KeyFile the same override — and setting it in the test harness — closes it.
The Swift test suite creates
~/.config/tacet/keyin the real home directory of whoever runs it.swift/Tests/TacetCoreTests/KeyFileTests.swift:6asserts the opposite in a comment:Reproduction
Reproduced twice; the file timestamp matches the test-run second exactly.
Severity
Lower than it first looks, and worth recording why. Behaviour is create-if-absent, verified directly:
An existing key is not overwritten, so this has never rotated a live secret out from under a running client. If it did overwrite, every client would start failing with a silent 401 after any test run — the same failure the dictate→hark rename produced.
Why it matters anyway
~/.config/tacet/appeared populated with a key that did not match the live~/.config/hark/key, which looks exactly like a botched migration. Anyone moving config withmvwould have hit "directory not empty" and, resolving it the obvious way, could have installed the test key as the live one and broken every client.Fix
Point the tests at a temp directory.
Config.swift:41already honoursTACET_CONFIG;KeyFile.swift:21resolveshomeDirectoryForCurrentUserunconditionally and does not. GivingKeyFilethe same override — and setting it in the test harness — closes it.