Skip to content

Collapse long redactions on the verify page; reveal each passage once (plain-text copy) - #31

Merged
Divide-By-0 merged 2 commits into
mainfrom
stack/13-collapse-redactions
Oct 4, 2026
Merged

Divide-By-0 merged 2 commits into
mainfrom
stack/13-collapse-redactions

Conversation

@Divide-By-0

@Divide-By-0 Divide-By-0 commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Human intent

  • On verify links that hide most of the email, replace huge walls of █ with something like "⋯ 111 lines ⋯" so readers can skip them, and do this everywhere many full lines are redacted.
  • The same proof revealed one passage twice: once as plain text and again inside the raw HTML part. Tell agents (the skill) not to do that, and when there are two similar versions of a passage, or one wrapped in HTML tags, to reveal only the most human-readable one.

Changes

  • Verify page (MaskedText, src/utils/maskedRuns.ts): a redacted stretch with at least 240 hidden characters collapses to one row, ⋯ N redacted characters (~L lines) ⋯ show, and clicking expands it.
    • A stretch is either one long hidden run (its newlines are hidden too, so lines are estimated at 80 characters each) or many fully hidden lines whose line breaks were revealed (exact line count).
    • Short redactions stay inline.
  • CLI output: 3 or more fully redacted lines merge into █ ⋯ N redacted characters (L lines) ⋯.
  • CLI --reveal / --reveal-regex: in multipart/alternative mail, a match in the plain-text part is no longer also revealed in the text/html part. A warning says so, and --reveal-all-parts restores the old behaviour. Text that exists only in the HTML part is still revealed.
  • SKILL.md: reveal each passage once, in its most readable copy: plain text over HTML, the original over a quoted copy. Check the preview for duplicates.

Evidence

  • Proof 5db31511-… in headless Chromium: the body renders as 2 collapsed rows (9,139 and 18,169 characters) instead of about 27,000 █ characters. Expanding one restores its blocks.
  • Tests: tests/masked-runs.test.ts covers the one-run, many-lines and short cases, CLI compaction, and reveal-once with --reveal-all-parts. Full suite 51/51; tsc -b clean; vite build OK.
  • Not changed: the web prover's own highlight UI still lets a user select text in both parts by hand.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Long redacted passages can now be collapsed into a compact preview and expanded when needed.
    • Revealing matching text in an email now avoids showing duplicate HTML copies by default. HTML-only matches remain visible; use --reveal-all-parts to show all matching copies.
    • Added guidance for reviewing multipart email content and checking previews for duplicate text.
  • Improvements
    • Compact output groups runs of three or more fully redacted lines and reports the redacted character and line counts.

… (plain-text copy)

Verify page: a redacted stretch of 240+ hidden characters (one long run, or many fully
hidden lines with revealed line breaks) shows as one row
'⋯ 9,139 redacted characters (~115 lines) ⋯ show' that expands on click.
CLI: the preview/verify output merges 3+ fully redacted lines the same way.
CLI --reveal: in multipart/alternative mail, a passage found in the plain-text part is no
longer also revealed inside the text/html part (--reveal-all-parts restores that).
SKILL.md: reveal each passage once, in its most human-readable copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0210b28f-d44b-484f-9553-14e462e7f663
📥 Commits

Reviewing files that changed from the base of the PR and between 1871e21 and a4f5eee.

📒 Files selected for processing (5)
  • skills/redacted-email-proof/SKILL.md
  • skills/redacted-email-proof/scripts/redacted.mjs
  • src/components/MaskedText.tsx
  • src/utils/maskedRuns.ts
  • tests/masked-runs.test.ts
 _________________________________________________________________________
< Performing code review exorcisms to the eerie strains of Tubular Bells. >
 -------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Review findings: (1) one plain-text regex match suppressed unrelated HTML-only matches of the
same regex; (2) anything outside text/html (MIME headers, attachments) counted as the
'plain-text copy', hiding the readable HTML occurrence. Now each HTML match is skipped only if
the same matched text occurs inside text/plain part content. Tests for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Divide-By-0

Copy link
Copy Markdown
Member Author

Review follow-up (6553cda): --reveal deduplication is now decided per match, and only real text/plain part content counts as the preferred copy.

  • Regex reveals: a regex that matches a duplicated passage plus an HTML-only passage still reveals the HTML-only one.
  • MIME headers and attachments don't count as a plain-text copy. An HTML-only message whose attachment name matches keeps its readable reveal.

Both cases now have tests: 53/53 pass, and tsc -b is clean.

🤖 Generated with Claude Code

@Divide-By-0
Divide-By-0 merged commit 5e2e32a into main Oct 4, 2026
3 checks passed
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