redact: route OPF progress to stderr instead of /dev/tty

main

Commit

Soph3mo ago

OPF progress UX (→ scanning / ✓ done / × unavailable) defaulted to /dev/tty so the messages survived the post-commit hook's 2>/dev/null redirect. OPF no longer runs at post-commit — it lives solely in the pre-push rewrite path, whose hook is installed without a stderr redirect (post-commit condensation calls the 7-layer functions directly via RedactBlobBytes(..., usePrivacyFilter=false)). So the /dev/tty routing is obsolete: plain os.Stderr is visible during git push and, in tests, is captured by go test instead of bleeding straight to the terminal.

  • redact/opf.go: default opfStderr to os.Stderr; drop openTTYOrDiscard.
  • redact/global_test.go: silence opfStderr once in TestMain, matching how the strategy package handles its pre-push progress writer.
  • redact/{opf,batch}_test.go: remove the 11 per-test io.Discard overrides (now redundant, and race-free as a single set-once).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 8cc824aa79c0

Checkpoints

Route OPF Progress to stderr

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1