Skip to content

refactor(heuristics): split extract-fields.ts + segmentation spike (#126, #127) - #136

Merged
s-annam merged 3 commits into
mainfrom
epic-126-127-extract-split-segmentation-spike
Jun 20, 2026
Merged

refactor(heuristics): split extract-fields.ts + segmentation spike (#126, #127)#136
s-annam merged 3 commits into
mainfrom
epic-126-127-extract-split-segmentation-spike

Conversation

@s-annam

@s-annam s-annam commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Two-issue epic on one branch, one commit.

No production code change for #127 (design-only, per its acceptance criteria).

Resolves #126
Resolves #127

Test plan

- #126: extract-fields.ts (1060 LOC god-module) split into nine
  per-field modules under extract/ (contact, name, education,
  experience, skills, projects, achievements, summary, shared);
  barrel re-export preserves all call-sites, zero snapshot churn.
- #127: docs/segmentation-spike.md — segmentation centralization
  catalog, SectionedResume interface proposal, go/no-go decision,
  and 4 follow-up issues (#132#135) filed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GstfZc8CpvugDY85bS541Y

Resolves #126
Resolves #127
Comment thread src/lib/heuristics/extract-fields.ts Fixed
Comment thread src/lib/heuristics/extract-fields.ts Fixed
Comment thread src/lib/heuristics/extract/experience.ts Fixed
Comment thread src/lib/heuristics/extract/name.ts Fixed
Comment thread src/lib/heuristics/extract/shared.ts Fixed
Comment thread src/lib/heuristics/extract/contact.ts Dismissed
Comment thread src/lib/heuristics/extract/skills.ts Dismissed
Post-split cleanup for the extract/ modules (#126):
- Drop 4 dead exports fallow flagged as never imported externally:
  disambiguateCompanyTitle (experience.ts + barrel), TITLE_KEYWORDS_RE
  (shared.ts), ContactExtractionResult (contact.ts + barrel). All are
  internal-only — the god-module exported them but nothing consumed them
  across module boundaries.
- Decompose extractName: extract pure buildNameCandidates + scoreNameCandidate
  helpers to drop cyclomatic complexity below the CRAP threshold. No weight or
  control-flow change — 616/616 tests green, zero *.expected.json churn.

Refs #126
Comment thread src/lib/heuristics/extract/name.ts Fixed
…ow gate

Extract the per-candidate structural eligibility filter into a pure
nameCandidateWords helper. Identical predicate order and semantics — the
loop just delegates rejection — so behavior is preserved (616/616 tests,
zero *.expected.json churn). Clears fallow warning #76.

Refs #126
@s-annam

s-annam commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Merging with admin bypass (no second review):

fallow green; the two pre-existing cognitive-complexity notes (contact scan, extractSkills) are dismissed and tracked in #137.

@s-annam
s-annam merged commit 970b89c into main Jun 20, 2026
2 checks passed
@s-annam
s-annam deleted the epic-126-127-extract-split-segmentation-spike branch June 20, 2026 17:47
s-annam added a commit that referenced this pull request Jun 25, 2026
, #127) (#136)

* refactor(heuristics): split extract-fields.ts into per-field modules

- #126: extract-fields.ts (1060 LOC god-module) split into nine
  per-field modules under extract/ (contact, name, education,
  experience, skills, projects, achievements, summary, shared);
  barrel re-export preserves all call-sites, zero snapshot churn.
- #127: docs/segmentation-spike.md — segmentation centralization
  catalog, SectionedResume interface proposal, go/no-go decision,
  and 4 follow-up issues (#132#135) filed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GstfZc8CpvugDY85bS541Y

Resolves #126
Resolves #127

* refactor(heuristics): clear fallow dead-export + complexity alerts

Post-split cleanup for the extract/ modules (#126):
- Drop 4 dead exports fallow flagged as never imported externally:
  disambiguateCompanyTitle (experience.ts + barrel), TITLE_KEYWORDS_RE
  (shared.ts), ContactExtractionResult (contact.ts + barrel). All are
  internal-only — the god-module exported them but nothing consumed them
  across module boundaries.
- Decompose extractName: extract pure buildNameCandidates + scoreNameCandidate
  helpers to drop cyclomatic complexity below the CRAP threshold. No weight or
  control-flow change — 616/616 tests green, zero *.expected.json churn.

Refs #126

* refactor(heuristics): cut extractName cognitive complexity below fallow gate

Extract the per-candidate structural eligibility filter into a pure
nameCandidateWords helper. Identical predicate order and semantics — the
loop just delegates rejection — so behavior is preserved (616/616 tests,
zero *.expected.json churn). Clears fallow warning #76.

Refs #126
s-annam added a commit that referenced this pull request Jun 28, 2026
, #127) (#136)

* refactor(heuristics): split extract-fields.ts into per-field modules

- #126: extract-fields.ts (1060 LOC god-module) split into nine
  per-field modules under extract/ (contact, name, education,
  experience, skills, projects, achievements, summary, shared);
  barrel re-export preserves all call-sites, zero snapshot churn.
- #127: docs/segmentation-spike.md — segmentation centralization
  catalog, SectionedResume interface proposal, go/no-go decision,
  and 4 follow-up issues (#132#135) filed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GstfZc8CpvugDY85bS541Y

Resolves #126
Resolves #127

* refactor(heuristics): clear fallow dead-export + complexity alerts

Post-split cleanup for the extract/ modules (#126):
- Drop 4 dead exports fallow flagged as never imported externally:
  disambiguateCompanyTitle (experience.ts + barrel), TITLE_KEYWORDS_RE
  (shared.ts), ContactExtractionResult (contact.ts + barrel). All are
  internal-only — the god-module exported them but nothing consumed them
  across module boundaries.
- Decompose extractName: extract pure buildNameCandidates + scoreNameCandidate
  helpers to drop cyclomatic complexity below the CRAP threshold. No weight or
  control-flow change — 616/616 tests green, zero *.expected.json churn.

Refs #126

* refactor(heuristics): cut extractName cognitive complexity below fallow gate

Extract the per-candidate structural eligibility filter into a pure
nameCandidateWords helper. Identical predicate order and semantics — the
loop just delegates rejection — so behavior is preserved (616/616 tests,
zero *.expected.json churn). Clears fallow warning #76.

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

Labels

None yet

Projects

None yet

2 participants