fix: copy _memoryFiltering.js in setup-hooks (#547)#550
Conversation
…rt works (EvoMap#547) evolver-session-start.js requires ./_memoryFiltering, but copyHookScripts copied only _runtimePaths.js and the three entry scripts. A fresh `setup-hooks --platform=codex` left the destination without _memoryFiltering.js, so the generated hook crashed with MODULE_NOT_FOUND on first run. Add _memoryFiltering.js to both copyHookScripts and removeHookScripts so a clean install/uninstall stays in sync with the runtime require graph of the copied hooks. Extend the existing copyHookScripts / removeHookScripts tests to cover the new file, and add a regression test asserting _memoryFiltering.js lands in the destination directory alongside the entry scripts. Smoke-tested locally by running setup-hooks against a fresh tmpdir and invoking the copied evolver-session-start.js with `{}` on stdin — now exits 0 instead of MODULE_NOT_FOUND on `./_memoryFiltering`.
|
Thanks for the clean diagnosis and fix, @mvanhorn — root cause is exactly right, and the install/uninstall symmetry is the right pattern. We have an internal patch already in flight that lands the same change plus a broader regression guard: it scans every If you have an EvoMap account, could you drop the registered email here (or DM if you prefer)? We'd like to add your avatar to the public-repo contributors panel and send a small thank-you your way. |
|
Update: shipped in v1.87.1 — npm The release notes credit your independent diagnosis on this PR alongside @rendigua's reproduction. If you have an EvoMap account, drop the registered email here when you have a moment and we'll get the contributor entry + thank-you sorted. |
Summary
Generated
evolver-session-start.jsrequires./_memoryFilteringat the top of the file, butcopyHookScriptswas never updated to copy the helper alongside it. A freshsetup-hooks --platform=codexproduced a hook that crashed immediately withMODULE_NOT_FOUND. This adds_memoryFiltering.jsto both the copy list and the cleanup list. Closes #547.What changed
src/adapters/hookAdapter.js: add_memoryFiltering.jstocopyHookScriptsandremoveHookScriptsso the install/uninstall manifests cover every runtime dependency of the generated session hooks.test/adapters.test.js: bump thecopyHookScriptscount assertion from 4 to 5, add a_memoryFiltering.jspresence assertion mirroring the existing_runtimePaths.jsregression test, and update theremoveHookScriptsfixture to include the new file.How to test
Risk
Low. The change is two
stringentries added to twoconst scripts = [...]arrays. Both lists are explicit allowlists, so callers depending on the prior length (4 entries) would need to fail closed; the only such caller in-repo is the copyHookScripts test, which is updated in this PR.Self-check
src/.Object.assign({}, DEFAULTS, ...).process.env.Related
Closes #547
Note
Low Risk
Two allowlist entries in install/uninstall helpers; behavior matches the existing
_runtimePaths.jspattern with updated tests only.Overview
Fixes fresh
setup-hooksinstalls whereevolver-session-start.jsfails immediately withMODULE_NOT_FOUNDbecause itrequire('./_memoryFiltering')but that helper was never copied into the platform hooks directory.copyHookScriptsandremoveHookScriptsnow include_memoryFiltering.jsin the same allowlist as_runtimePaths.js, so install/uninstall ship and clean every runtime dependency of the generated session hooks.Tests expect 5 copied/removed scripts and add a presence check for
_memoryFiltering.js, parallel to the existing_runtimePaths.jsregression.Reviewed by Cursor Bugbot for commit 092334a. Bugbot is set up for automated code reviews on this repo. Configure here.