refactor(heuristics): split extract-fields.ts + segmentation spike (#126, #127) - #136
Merged
Merged
Conversation
- #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
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
3 tasks
Contributor
Author
|
Merging with admin bypass (no second review):
fallow green; the two pre-existing cognitive-complexity notes (contact |
5 tasks
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two-issue epic on one branch, one commit.
extract-fields.ts(1060-LOC god-module) into nine per-field modules undersrc/lib/heuristics/extract/(name,contact,summary,skills,experience,projects,achievements,education,shared).extract-fields.tsis now a 22-LOC barrel re-export, so all call-sites (openresume.ts, tests) are unchanged. Behavior-preserving: zero*.expected.jsonsnapshot churn.docs/segmentation-spike.md(catalog of segmentation-rooted downstream patches, proposedSectionedResumeinterface,skillsSectionTextside-channel removal plan, segmentation/heuristic/WebLLM boundary, GO recommendation). Spawned sequenced follow-ups Emit typed SectionedResume from cascade + retire skillsSectionText side-channel (proof PR) #132–Replace extractContact y-band header proxy with a real contact/links section boundary #135.No production code change for #127 (design-only, per its acceptance criteria).
Resolves #126
Resolves #127
Test plan
npm run typecheckcleannpm run testgreen — 616/616, snapshots unchanged (proves Refactor: split extract-fields.ts god-module (1060 LOC) into per-field modules #126 behavior-preserving)npm run lintclean