Files
hermes-agent/tools
kshitijk4poor 5d579c5144 refactor(tools): pass the Unicode edit plan explicitly; tighten JSON constant scan
Behaviour-neutral review cleanups for the stack:

- fuzzy_match: _preserve_unicode_in_replacement now requires the plan
  (it is always precomputed by the caller), so the unused old_string param
  and the plan-less fallback go away. _apply_replacements takes the
  precomputed unicode_plan instead of a preserve_unicode flag, keeping the
  strategy decision in fuzzy_find_and_replace where it is made.
- file_operations: _json_nonstandard_constant skips the full json.loads
  when the text cannot contain NaN/Infinity (every JSON write pays this
  scan), strips the BOM via the shared _strip_bom helper, and catches only
  the errors json.loads can raise on str input instead of a blanket
  Exception.
- backup: the --keep validator comment now states why it exists (a
  negative keep slices away the newest archives).
2026-10-02 01:15:39 +05:30
..