Skip to content

Commit ac2552e

Browse files
committed
Fix missing PII redaction in task checkpoints and doctor condense
1 parent 2d8cf5a commit ac2552e

5 files changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/entire/cli/strategy/auto_commit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ func (s *AutoCommitStrategy) GetSessionInfo() (*SessionInfo, error) {
503503
// 1. Commit code changes to active branch (no trailers - clean history)
504504
// 2. Commit task metadata to entire/checkpoints/v1 branch with checkpoint format
505505
func (s *AutoCommitStrategy) SaveTaskCheckpoint(ctx TaskCheckpointContext) error {
506+
EnsureRedactionConfigured()
506507
repo, err := OpenRepository()
507508
if err != nil {
508509
return fmt.Errorf("failed to open git repository: %w", err)

cmd/entire/cli/strategy/manual_commit_condensation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ func generateContextFromPrompts(prompts []string) []byte {
648648
// CondenseSessionByID force-condenses a session by its ID and cleans up.
649649
// This is used by "entire doctor" to salvage stuck sessions.
650650
func (s *ManualCommitStrategy) CondenseSessionByID(sessionID string) error {
651+
EnsureRedactionConfigured()
651652
ctx := logging.WithComponent(context.Background(), "condense-by-id")
652653

653654
// Load session state

cmd/entire/cli/strategy/manual_commit_git.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ func (s *ManualCommitStrategy) SaveChanges(ctx SaveContext) error {
167167
// SaveTaskCheckpoint saves a task checkpoint to the shadow branch.
168168
// Uses checkpoint.GitStore.WriteTemporaryTask for git operations.
169169
func (s *ManualCommitStrategy) SaveTaskCheckpoint(ctx TaskCheckpointContext) error {
170+
EnsureRedactionConfigured()
170171
repo, err := OpenRepository()
171172
if err != nil {
172173
return fmt.Errorf("failed to open git repository: %w", err)

redact/pii.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ type builtinPIIPattern struct {
7676
// builtinPIIPatterns returns the default PII detection patterns.
7777
func builtinPIIPatterns() []builtinPIIPattern {
7878
return []builtinPIIPattern{
79-
// Email: standard format
80-
{PIIEmail, "EMAIL", `[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}`},
79+
// Email: standard format with word boundaries to reduce false positives
80+
{PIIEmail, "EMAIL", `\b[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}\b`},
8181
// Phone: US formats (xxx-xxx-xxxx, (xxx) xxx-xxxx, +1xxxxxxxxxx, etc.)
8282
{PIIPhone, "PHONE", `(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}`},
8383
// Address: US street address patterns (123 Main St, 456 Elm Avenue, etc.)

redact/redact.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type region struct{ start, end int }
4545
// Empty label = secret (produces "REDACTED"). Non-empty = PII (produces "[REDACTED_<LABEL>]").
4646
type taggedRegion struct {
4747
region
48+
4849
label string
4950
}
5051

0 commit comments

Comments
 (0)