From 083292d528baeaf3746e3b9c4ea8ab92a512b684 Mon Sep 17 00:00:00 2001 From: Peyton Montei Date: Thu, 14 May 2026 18:23:53 -0400 Subject: [PATCH 01/11] feat(redact): add OpenAI Privacy Filter as opt-in 8th layer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds OPF as an opt-in 8th region producer in the redaction pipeline. Two public entry points (StringWithPrivacyFilter, JSONLContentWithPrivacyFilter) gate the OPF call; the four plain entry points (String, Bytes, JSONLBytes, JSONLContent) are unchanged so per-turn temp writes never invoke OPF. Single inference pass per scope via \x1e-joined batching — opf otherwise runs a fresh inference pass per newline-delimited input, defeating the batch. Process-scoped atomic circuit breaker disables OPF after the first runtime failure so a broken opf install costs one warning instead of N×30s timeouts. Settings layer (redaction.openai_privacy_filter) accepts enabled + categories + command + timeout_seconds. The on_failure field is intentionally absent: warn-only is the only mode the runtime supports today, and DisallowUnknownFields rejects users who try to opt into a fail-closed mode that doesn't exist. Category names are validated against the canonical map at parse time — silent zero-detection of a privacy category is effectively a correctness bug. Shell-out runtime, progress UX, and label mapping are all inlined in redact/opf.go (no separate subpackage, no separate progress writer). Co-Authored-By: Claude Opus 4.7 (1M context) --- cmd/entire/cli/settings/settings.go | 92 +++++ cmd/entire/cli/settings/settings_test.go | 112 ++++++ redact/opf.go | 436 ++++++++++++++++++++ redact/opf_test.go | 481 +++++++++++++++++++++++ redact/redact.go | 163 +++++++- redact/redact_test.go | 8 +- 6 files changed, 1280 insertions(+), 12 deletions(-) create mode 100644 redact/opf.go create mode 100644 redact/opf_test.go diff --git a/cmd/entire/cli/settings/settings.go b/cmd/entire/cli/settings/settings.go index cd1513df11..11ffd3de0c 100644 --- a/cmd/entire/cli/settings/settings.go +++ b/cmd/entire/cli/settings/settings.go @@ -20,6 +20,7 @@ import ( "github.com/entireio/cli/cmd/entire/cli/logging" "github.com/entireio/cli/cmd/entire/cli/paths" "github.com/entireio/cli/cmd/entire/cli/session" + "github.com/entireio/cli/redact" ) const ( @@ -190,6 +191,10 @@ type RedactionSettings struct { // "[REDACTED_