Skip to content

Embedding privacy: measure the orphan-run width on the base64 tail only (#394) - #741

Closed
100yenadmin wants to merge 1 commit into
mainfrom
shadow/redaction-precision
Closed

100yenadmin wants to merge 1 commit into
mainfrom
shadow/redaction-precision

Conversation

@100yenadmin

Copy link
Copy Markdown
Member

Refs #394. Also carries the #389 mutation pins. The wider api_key names of #491 are not in this PR (see the note on #491).

What was wrong. On the cloud-embedding privacy path, the marker-independent orphan-run check in ingest_protection.py (_has_orphan_full_width_base64_run) applied its 40-character "full PEM width" test to a prefixed line's whole width (prefix words plus the final token). Two adjacent prose lines ending in a 16–17 character code, or a short numbered list, were refused as a private-key body. A refused document makes the embed backfill stop with privacy_refused on every run (#394).

What changed. For lines classified as prefixed base64, the width test now measures the final base64 token only. Unprefixed lines and every other backstop are unchanged. A numbered list of 40+ character base64-charset tokens still blocks: this fail-closed boundary is documented in the docstring and pinned by a test. Also adds two mutation-pin tests for the pure-hex exclusion in the placeholder-proximity check (carried over from #389).

Consumers. _embedding_privacy_residual_patterns is the only caller. Through it, protect_embedding_text and validate_embedding_privacy_dispatch are affected (warmup, summary/chunk backfill, lcm_grep / lcm_recall query embedding). The only effect is fewer false refusals. The durable store is not touched.

Tests. tests/test_issue_394_orphan_run_tail_width.py: the prose and short-list shapes fail before and pass after. Prefixed and unprefixed key-body controls still block, the long-token list boundary still blocks, and there are hex-exclusion mutation pins. The existing #383/#391 regression tests in tests/test_embedding_privacy.py are unchanged and green.

Risk. Low. The only coverage removed is a prefixed body line whose base64 token is 16–39 characters wide.

Changelog line (add at release): Fix: cloud-embedding privacy no longer refuses ordinary prose or short numbered lists whose last word is a long code; the orphan base64-run check now measures the token, not the line prefix (#394).

Review. Claude cross-model review of this codex-authored change: PASS 94, no merge-blocking findings. Follow-up: the width column of bench/tools/v1m-rebank/refused_line_model.py predates this fix (bench edits were out of scope).

Prepared by the triage lane for the release lane; draft, not for merge until the release lane reviews it.

…ly (#394)

The orphan-run check measured the whole line, including whitespace-separated prefix words, so prose ending in a short code was flagged. It now measures the base64 token alone. Refs #394.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@100yenadmin

Copy link
Copy Markdown
Member Author

Out of scope: owner ban; logged #394/#1034. Closing the draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant