Skip to content

fix(secrets): preserve shell snapshot syntax during redaction - #471

Merged
andrei-hasna merged 2 commits into
mainfrom
fix/a9a258f6-shell-snapshot
Aug 1, 2026
Merged

fix(secrets): preserve shell snapshot syntax during redaction#471
andrei-hasna merged 2 commits into
mainfrom
fix/a9a258f6-shell-snapshot

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Why

Shell snapshot redaction could consume the trailing backslash from an escaped quote when a colon-delimited value contained a secret-like segment. The redacted file then became invalid Bash, so fresh codewith exec sessions discarded their shell snapshot after validation failed.

What changed

  • Capture the value spans handled by the generic and AWS assignment redactors.
  • Fully replace each matched value while preserving only its trailing backslash run, which keeps the following quote escape parity intact.
  • Add synthetic coverage for one- and two-backslash endings plus a full Bash snapshot export that is redacted and sourced.

Test plan

Tracks OPE127-00016.

@andrei-hasna
andrei-hasna merged commit 14ece82 into main Aug 1, 2026
29 checks passed
@andrei-hasna
andrei-hasna deleted the fix/a9a258f6-shell-snapshot branch August 1, 2026 17:20
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant