試験が、端末の本物のhost設定を書き換えないようにする - #11
Merged
Merged
Conversation
hooksの試験は一時のHOMEをCLIへ渡すが、CODEX_HOME・CLAUDE_CONFIG_DIR・GROK_HOMEを消していなかった。 CLIはHOMEよりこれらを優先するので、CODEX_HOMEを持つ端末で試験を走らせると、利用者の本物の Codex hooks.jsonへhandlerを足し、外し、backupを残した(2026-10-03に実際に起きた)。 - 試験の入口(productTestEnvironment)が3つの変数を子processへ渡さない - hooks試験のisolatedEnvも同じ3つを消す(node --test で直に走らせた時のため) - 偽のフォルダを3つの変数に指して、1 byteも変わらないことを確かめる試験を足した Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
何が起きたか
test/hooks-cli.test.mjsは一時のHOMEをCLIへ渡すが、CODEX_HOME・CLAUDE_CONFIG_DIR・GROK_HOMEを消していなかった。CLI(src/setup-hosts.mjs)はHOMEよりこれらを優先する。CODEX_HOMEを持つ端末でこの試験を走らせると、CLIは試験のHOMEでなく、利用者の本物のhooks.jsonを相手に動く。2026-10-03に実際に起きた。hooks.jsonへLatticeのhandlerを足し、外した(他の項目は残った)。hooks.json.bak-lattice-hooks-*・hooks.json.pre-lattice-hooks-*を本物のフォルダへ残した。CIのrunnerではこれらの変数が無いので、今まで表に出なかった。
直したこと
productTestEnvironment)が、3つの変数を子processへ渡さない。isolatedEnvも同じ3つを消す。node --testで直に走らせた時に効く。hooks install/uninstallを走らせ、偽のフォルダが1 byteも変わらないことを見る。製品のcodeは変えていない。版も上げない。
確かめたこと
hooks-cli.test.mjsを走らせ、52件成功、偽のフォルダは不変。isolatedEnvの修正を外すと、足した試験は落ちる。npm run ci全体が成功(root 1944件中 0失敗)。本物のhooks.jsonとconfig.tomlのhashは前後で同じ。🤖 Generated with Claude Code