#8716: fix(soul-evil): minimal simplification of env config merging
stale
Cluster:
Soul Hooks Security Enhancements
Simplified the soul-evil configuration resolution logic by:
1. Merging `entry.env` into `entry` using a one-liner.
2. Removing redundant type casts and variable renames to minimize diff noise.
3. Using `any` type for the source object to improve readability without sacrificing type safety for the final output.
verified with unit tests.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR simplifies `resolveSoulEvilConfigFromHook` by flattening `entry.env` into the top-level `entry` object before parsing the `file`, `chance`, and `purge` fields. The rest of the Soul Evil decision logic (purge window + chance-based activation) remains unchanged, and this config resolver continues to act as the boundary that validates/normalizes untyped hook input into a `SoulEvilConfig` object.
<h3>Confidence Score: 4/5</h3>
- This PR is mostly safe to merge; it’s a small behavioral change with one edge case around spreading non-object `env` values.
- The change is localized to config normalization and is covered by unit tests per PR description. Main remaining risk is if `entry.env` can be non-plain-object at runtime, which can cause surprising merges or runtime errors due to the unconditional spread.
- src/hooks/soul-evil.ts
<!-- greptile_other_comments_section -->
<sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#7036: Fix evil soul hooks by enforcing env properties
by myberry2026 · 2026-02-02
90.9%
#11169: fix(security): remove bundled soul-evil hook that enables silent ag...
by liuxiaopai-ai · 2026-02-07
79.2%
#9914: fix(hooks): resolve bundled hook dist paths and packaging checks
by zimmra · 2026-02-05
71.0%
#3392: fix(hooks): remove debug console.log statements from session-memory...
by WinJayX · 2026-01-28
69.7%
#16461: feat: flexible soul injection and quiet TUI
by krry · 2026-02-14
68.2%
#7892: Claude/setup agent firewall ww xsv
by starwreckntx · 2026-02-03
68.2%
#13029: fix(docs): add redirect from /hooks to /automation/hooks
by asklee-klawd · 2026-02-10
68.1%
#10056: fix: allow extra fields in HookConfig schema
by 7Sageer · 2026-02-06
67.9%
#11339: fix: resolve bundled hooks path on npm global install
by matthewpoe · 2026-02-07
67.6%
#11817: fix(build): compile bundled hook handlers into dist
by AnonO6 · 2026-02-08
67.4%