You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(redact): drop unused OPF helpers, table-drive cleanup tests
Two trim-and-simplify changes from a self-review of the PR's surface:
1. Drop redact.JoinedPromptsLegacy + its dedicated test file.
The function was added to keep the writer's safety net 7-layer-only
while signaling the distinction via the type system. With pre-push
rewrite owning all OPF execution, the writer is now unambiguously
7-layer-only — the typed-wrapper signal is no longer earning its
weight. checkpoint.redactedJoinedPrompts now inlines
redact.String(strings.Join(prompts, PromptSeparator)) for the same
behavior with less ceremony.
2. Drop redact.GetOPFConfigForTest. The "ForTest" helper was exported
for cross-package tests but never had any callers — production code
should never introspect the OPF config directly (use OPFEnabled()),
and our tests already use ConfigurePrivacyFilterWithRuntime +
ResetOPFConfigForTest to manage state.
3. Table-drive the four single-shadow-branch cleanup tests into one
TestCleanupPushedShadowBranches_Predicate. The four cases shared
~90% of setup; the table-driven form keeps each scenario as a named
sub-test while collapsing the boilerplate. The two non-single-shadow
cases (mixed branches, no branches at all) stay standalone because
their setups are structurally different.
Net diff: -7 tests (collapsed into 4 sub-tests in 1 function), -100
lines of helpers, no behavior change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments