Skip to content

Epic: Unify section extraction into a shared entry-block parser #94

Description

@s-annam

Summary

The Tier 1 heuristic parser has one real "dated entry block" parserextractExperience — and every other section is bespoke or missing. Experience, projects, and achievements are structurally identical (a header line + optional date/date-range + a bullet body), yet:

  • extractExperience (src/lib/heuristics/extract-fields.ts:523) is the only one that anchors on DATE_RANGE_RE, splits entries, and parses a real date range.
  • Projects has no extractor at all (see child issue: Projects as a first-class section).
  • Achievements is demoted to the other sink bucket and never extracted (see child issue: Achievements).
  • Education re-implements date handling badly (first-year only) instead of reusing parseDateRange (see child issue: Education date-range).

This is the architectural root behind the three reported parser bugs: section logic is "implemented in multiple different ways," so fixing one section doesn't help the next.

Goal

Extract the common machinery out of extractExperience into a single shared primitive — tentatively parseEntryBlocks() — that all entry-style sections consume with a small per-section config. This is the enabler epic; the projects/achievements/education child issues build on it.

Proposed shape

// src/lib/heuristics/entry-blocks.ts (new)
interface EntryBlockConfig {
  anchor: "date_range" | "institution" | "first_line";
  // which header line becomes title vs subtitle (company / institution / project name)
  // whether bullets are collected into a description body
}
function parseEntryBlocks(section: PdfSection, cfg: EntryBlockConfig): EntryBlock[];

extractExperience becomes a thin caller of parseEntryBlocks({ anchor: "date_range", ... }). Reuse the existing parseDateRange / stripDateRange / isBulletLine / stripBullet helpers — don't duplicate them.

Acceptance criteria

  • New shared parseEntryBlocks() primitive with unit tests.
  • extractExperience refactored to consume it — behavior-preserving: existing corpus.test snapshots and extract-fields.test unchanged (or only mechanically re-baked with justification).
  • Date-range parsing, bullet-body collection, and entry scoring live in one place.
  • Child issues (projects, achievements, education) can implement their extractor as a config + field-mapping, not a fresh parser.

Scope notes

Milestone: M1 · Parser Hardening. Parent of the projects / achievements / education child issues.

Activity

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

Metadata

Metadata

Assignees

Labels

improvementEnhancing existing functionalityrefactorCode restructuring without behavior change

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions