Client or integration
Other
Area
Other
Summary
tests/ci-workflows/test-home-guard.test.ts exists because a test once deleted the real OpenCodex home. The source scan it performs recognises only same-line forms — rmSync(getConfigDir()) and const x = getConfigDir().
Multiline calls, let aliases, helper wrappers, fs.rmSync(...), and the sibling resolvers getConfigPath() and usageLogPath() all pass it. A future test could reintroduce the exact incident while CI stays green.
The specific quota test that caused the original incident is correctly fixed (tests/usage/quota-reset-seen-store.test.ts:39-46,111-119 creates and pins a temporary home and deletes only that), and no other committed test currently deletes the real home. This is about the guard, not a live defect.
Reproduction
- Read the source scan in
tests/ci-workflows/test-home-guard.test.ts:552.
- Write a test that resolves the home through a
let alias or a helper wrapper and deletes it, or that splits the call across lines.
- The guard does not flag it.
Suggested fix: use an AST scan instead of line matching, or require destructive tests to delete only paths handed out by an ownership-tracking fixture, with adversarial false-negative cases in the guard's own tests.
Version
2.56.0 (e4a8539)
Operating system
macOS 15.5
Logs or error output
(static analysis; no runtime output)
Checks
Client or integration
Other
Area
Other
Summary
tests/ci-workflows/test-home-guard.test.tsexists because a test once deleted the real OpenCodex home. The source scan it performs recognises only same-line forms —rmSync(getConfigDir())andconst x = getConfigDir().Multiline calls,
letaliases, helper wrappers,fs.rmSync(...), and the sibling resolversgetConfigPath()andusageLogPath()all pass it. A future test could reintroduce the exact incident while CI stays green.The specific quota test that caused the original incident is correctly fixed (
tests/usage/quota-reset-seen-store.test.ts:39-46,111-119creates and pins a temporary home and deletes only that), and no other committed test currently deletes the real home. This is about the guard, not a live defect.Reproduction
tests/ci-workflows/test-home-guard.test.ts:552.letalias or a helper wrapper and deletes it, or that splits the call across lines.Suggested fix: use an AST scan instead of line matching, or require destructive tests to delete only paths handed out by an ownership-tracking fixture, with adversarial false-negative cases in the guard's own tests.
Version
2.56.0 (e4a8539)
Operating system
macOS 15.5
Logs or error output
(static analysis; no runtime output)Checks