Skip to content

fix(display): polish extracted source snippets — strip PSPF banners, repair truncation, normalize bullets - #193

Merged
BigSimmo merged 3 commits into
mainfrom
claude/snippet-polish
Jul 2, 2026
Merged

fix(display): polish extracted source snippets — strip PSPF banners, repair truncation, normalize bullets#193
BigSimmo merged 3 commits into
mainfrom
claude/snippet-polish

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 2, 2026

Copy link
Copy Markdown
Owner

@-

BigSimmo and others added 3 commits July 2, 2026 22:42
…repair truncation, normalize bullets

Source cards showed raw PDF-extraction artifacts: duplicated OFFICIAL
classification banners glued to titles and body text, inline bullet and
sub-bullet glyphs, snippets starting mid-clause or mid-numbered-list, and
stored synopses cut mid-word before an ellipsis.

- stripClassificationBanner: ALL-CAPS, line-anchored PSPF marking removal,
  wired into the low-yield noise strippers so every compact/snippet/synopsis
  surface inherits it; verbatim quotes keep banners by design (pinned by test)
- sourceTextForCompactDisplay: inline bullets become '; ' separators; the
  PDF sub-bullet 'o' glyph is normalized conservatively (digit and
  single-capital guards); repairTruncatedCompactTail repairs stored mid-word
  cuts and never leaves meaning-inverting stubs (do not… -> …)
- compactSourceSnippet: ellipsis-aware fragment pipeline, drops the card's
  own glued title (dropTitle), sheds orphaned closers and mid-list ordinals,
  starts at a real sentence when a partial first fragment has substance
- cleanDisplayTitle/cleanCitationTitle: banner strip + missing space before
  acronym parentheticals (Guideline(EMHS) -> Guideline (EMHS))
- chunking: truncateAtWordBoundary replaces raw slices in synopsis/caption
  builders; banner-only lines dropped and per-sentence banner strip so new
  chunks store clean synopses (vectors untouched, no re-embed)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… repair)

Extends the in-place text-normalization backfill so retrieval_synopsis rows
stored before the snippet-polish fix get the same repairs at rest:
polishStoredSynopsis applies glyph repair, per-segment protective-marking
banner removal (the synopsis prefix format puts the banner mid-string), and
truncated-tail repair. content/section_heading keep glyph-only normalization —
they feed verbatim quotes and span matching and must not be rewritten.
Dry-run default, mandatory backup, and no-re-embed guarantees unchanged;
synopsis-only changes now surface in the dry-run samples.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BigSimmo
BigSimmo merged commit 260de10 into main Jul 2, 2026
4 checks passed
@BigSimmo
BigSimmo deleted the claude/snippet-polish branch July 5, 2026 11:43
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