fix(selectors): make only value rewrites live recorded placeholders

Merged
TH
40m ago
+34-6

Summary

This is a follow-up to #4394, from the maintainer's non-blocking review note. #4394 merged before this commit was pushed.

#4394 had parameterizeRecordedResultEcho record every placeholder it wrote, including in object keys. A literal echoed only as a key could therefore mark its placeholder live, and the script writer would then leave a user-typed ${NAME} elsewhere in the same action unescaped.

The fix: the payload walk now tells its leaf transform whether it is rewriting a key or a value. The echo pass records only value rewrites, so a key match still redacts but is never live.

2 files, test included. Refs #4368.

Validation

  • Tested SHA 3506315 on current main.
  • A new recorder test echoes a literal only as an object key. The key becomes ${FOO} and livePlaceholders stays empty. The test fails on main.
  • Recorder and selectors tests pass (274), as do the script-writer tests.
  • check:quick and check:fallow --base origin/main pass on the same change, which was committed first as 0b4e235.
  • There is no device-facing change.

Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.