fix: plugin hooks no-op on Node 21+ (require.main undefined under -e) + green the suite#2184
Conversation
…rn Node ROOT CAUSE: hooks load plugin-hook-bootstrap.js via `node -e "...; process.argv.splice(1,0,s); require(s)"`. On Node 21+, require.main is `undefined` under --eval, so the `if (require.main === module)` guard was false and main() never ran — every plugin hook silently no-op'd (e.g. the MCP-health PreToolUse hook stopped blocking). CI (Node 18/20) hid this; it only surfaces on Node 21+. Fix: also run main() when require.main is undefined (the eval-bootstrap case), while staying dormant on real imports. Also clears pre-existing main debt the full local suite enforces: - catalog:sync — README/docs agent+skill counts drifted after recent merges - tests/ci/supply-chain-watch-workflow: update checkout SHA to the merged v6.0.3 (#2183) - markdownlint + check-unicode-safety --write across docs/skills Suite: 2683/2683 green under Node v25; lint + unicode clean.
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (36)
📝 WalkthroughWalkthroughThis PR updates the ECC plugin catalog inventory from 63/251 to 64/255 agents/skills across manifests and documentation, fixes plugin hook bootstrap execution for eval/Node 21+ loading paths, and applies extensive whitespace and formatting normalization across skill and documentation files. ChangesCatalog inventory count updates
Plugin hook bootstrap execution fix
Documentation and skill file formatting normalization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…rn Node (affaan-m#2184) ROOT CAUSE: hooks load plugin-hook-bootstrap.js via `node -e "...; process.argv.splice(1,0,s); require(s)"`. On Node 21+, require.main is `undefined` under --eval, so the `if (require.main === module)` guard was false and main() never ran — every plugin hook silently no-op'd (e.g. the MCP-health PreToolUse hook stopped blocking). CI (Node 18/20) hid this; it only surfaces on Node 21+. Fix: also run main() when require.main is undefined (the eval-bootstrap case), while staying dormant on real imports. Also clears pre-existing main debt the full local suite enforces: - catalog:sync — README/docs agent+skill counts drifted after recent merges - tests/ci/supply-chain-watch-workflow: update checkout SHA to the merged v6.0.3 (affaan-m#2183) - markdownlint + check-unicode-safety --write across docs/skills Suite: 2683/2683 green under Node v25; lint + unicode clean. Co-authored-by: ECC Test <ecc@example.test>
Root cause
Plugin hooks load
plugin-hook-bootstrap.jsvianode -e "...; process.argv.splice(1,0,s); require(s)". On Node 21+,require.mainisundefinedunder--eval, so theif (require.main === module)guard was false andmain()never ran — every plugin hook silently no-op'd (e.g. the MCP-health PreToolUse hook stopped blocking unhealthy MCP calls). CI runs Node 18/20 where the trick still works, which is why this stayed hidden; it only surfaces on Node 21+.Fix: also run
main()whenrequire.mainisundefined(the eval-bootstrap case), while staying dormant on realrequire()imports (tests) whererequire.mainis a defined, different module.Also clears pre-existing main debt the full local suite enforces
catalog:sync— README/docs agent+skill counts had drifted after recent mergestests/ci/supply-chain-watch-workflow: update checkout SHA to the merged v6.0.3 (chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 #2183)markdownlint --fix+check-unicode-safety --writeacross docs/skillsVerification
Full suite 2683/2683 green under Node v25; lint + unicode clean. (Was 4 failures on Node 25 before.)
Summary by cubic
Fixes plugin hooks no-op on Node 21+ by running
main()whenrequire.mainis undefined undernode --eval; hooks now execute correctly while staying dormant on imports. Also greens the suite on Node 25, syncs agent/skill counts in docs, pinsactions/checkoutto v6.0.3, and applies markdown/unicode cleanup.Written for commit 44da898. Summary will update on new commits.
Summary by CodeRabbit
Chores
Bug Fixes
Documentation