← Back to PRs

#8716: fix(soul-evil): minimal simplification of env config merging

by myberry2026 open 2026-02-04 09:33 View on GitHub →
stale
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