Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

parser: dateless anchor-line flush-right location glue not peeled (follow-up to #891)

Chiusa
#896 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Start in src/lib/heuristics/entry-blocks.ts, tracing the dateless anchor path and the existing splitOnFlushRightGap and peelFlushRightLocation logic from line-assembly.ts. Read belowHeaderCandidates and disambiguateCompanyTitle to determine where a peeled location can land for first_line projects and achievements. Add a dateless-anchor fixture and verify the flush-right location is preserved without breaking title/company disambiguation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug ux:parsing

Decisions (2026-09-29)

  • Peel only for anchors whose entry type has a location field — experience and education. Projects and achievements (first_line sections whose entries carry no location) are left untouched; their anchor text stays verbatim.
  • Reproduce with a synthetic generated fixture. No real corpus case is confirmed, so the implementer builds a synthetic repro via a scripts/fixtures/gen-*.mjs generator + bake, under the repo's synthetic-PII rules. The fixture must fail before the fix and pass after.

Problem

#891 / PR #895 fixed a tab-justified flush-right work-mode/location keyword ("Remote"/"Hybrid"/"On-site") glued onto a role's title when title and location render on the same PDF row — but only for below-anchor header lines (peelFlushRightLocation, src/lib/heuristics/entry-blocks.ts, defined ~:1320 and wired into the belowHeaderLines loop ~:1685).

A dateless anchor line — an anchor where shouldParseAnchorDate returns false (e.g. cfg.anchor === "first_line" sections, or a date_range-anchor entry with no parseable date) — takes anchorLine.text verbatim with no peel (~:1650):

const anchorTextWithoutDates = parseAnchorDate
  ? stripDateRange(anchorHeadText)
  : anchorLine.text;   // <- no peel applied here

So the same flush-right glue on the anchor line itself still merges the keyword into the title/anchor text and the location is lost the same way #891 described.

Scope note

Flagged during review of PR #895 (comment) as narrow and untested; not confirmed against a real corpus entry, hence the synthetic repro below. Deliberately left out of #895's dated/below-anchor scope.

Approach

Apply the same splitOnFlushRightGap (line-assembly.ts) geometry check to anchorLine when !parseAnchorDate, gated by the same closed isBareLocationString vocabulary as peelFlushRightLocation, and only when the section's entry type has a location field (experience, education). For projects/achievements, keep anchorLine.text verbatim.

Care needed: the anchor line feeds title/company disambiguation directly (not just a below-anchor header candidate), so the peeled trailer needs a landing spot equivalent to what belowHeaderCandidates gives disambiguateCompanyTitle today, and it must fill location only when the header itself yielded none (mirroring the existing below-anchor rule). Determine how the location-bearing gate is expressed (e.g. an explicit flag on EntryBlockConfig or derived from the section's entry type) by mirroring how the existing location fill is wired — do not special-case by section name inline.

Repro fixture (required)

  • Build a synthetic PDF: a dateless anchor line in a location-bearing section (e.g. an experience/education entry) whose title and a bare work-mode/location keyword sit on one row with a flush-right gap. Model the generator on an existing sibling such as scripts/fixtures/gen-two-line-role-header-right-location.mjs and bake it (npm run bake-fixtures).
  • Synthetic persona per the repo hard rule: fake name, @example.com email, real area code + 555 exchange + 0100–0199 subscriber. Run npm run check:fixtures and read pdftotext <file>.pdf - | head -40.
  • Fail-before proof: show the fixture's assertion failing on current main (keyword glued into the title, location empty) before applying the fix.
  • Add a negative/untouched case (or test) showing a projects/achievements dateless anchor with the same shape is not peeled.

Out of scope / deferred

  • Peeling for projects/achievements anchors (no location field) — not done.
  • Below-anchor peel (already shipped in #895) and the dated-anchor path.
  • Any widening of the isBareLocationString vocabulary.

Acceptance criteria

  • A synthetic dateless-anchor fixture with flush-right work-mode/location glue exists (generator under scripts/fixtures/ + bake) and fails before the fix
  • After the fix, the title/anchor text is clean and the location lands in location for experience/education entries
  • Projects/achievements anchors are unchanged (test covers it)
  • The peel uses the same geometry check + closed vocabulary as peelFlushRightLocation; no new vocabulary
  • Corpus baselines/gates (npm run verify) pass; any baseline change is limited to the new fixture
Lingua principale
TypeScript
Stelle
11
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di offlinecv/OfflineCV

Tutte le issue di offlinecv/OfflineCV

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.