Skip to content

[edit] A prose-description edit never re-grades the score — descriptionOverrides is missing from the score memo's dep list #933

Description

@s-annam

Problem

Editing a role's or project's prose description on / changes the exported résumé but
does not re-grade the score. The edit folds into editedCore, but the score memo in
src/hooks/useAnalyzedResume.ts does not list descriptionOverrides as a dependency, so
it never re-runs for that channel.

descriptionOverrides writes experience[].description, and src/lib/score/score.ts
(computeAnonymousAtsScore) uses exactly that field as the bullet-pool fallback for
glyph-less résumés:

if (extractExperienceSectionBullets(input.sections).length === 0) {
  bullets.push(...poolExperienceDescriptions(input.parsed.experience));
}

So on a Word / Google-Docs-Skia style résumé whose Experience section yields no marker
bullets, the description is the graded pool — and editing it silently grades the
pre-edit text.

Repro

  1. Load a glyph-less-prose résumé on / (an Experience section with no • markers).
  2. Edit a role description through the reconstructed résumé.
  3. Observe the score object is identical — overall stays at its pre-edit value.
  4. Touch any other scoring channel (a skill, the summary, a contact field) — the score
    jumps to the value the description edit should already have produced.

Two further symptoms of the same stale pool:

  • score.bullets keeps the pre-edit bullet text.
  • groupBulletsByExperience over that stale pool returns experienceIndex: null, so the
    role's editable rows detach into the "Other" bucket in the UI.

Export is unaffected — applyOverrides folds the edit correctly; only the grade is stale.

Where

src/hooks/useAnalyzedResume.ts — the score useMemo (line 258 on main). Its dep
array names contactOverrides, experienceOverrides, bulletOverrides,
educationOverrides, achievementOverrides, certificationOverrides, skillsOverride,
summaryOverride, addedEntries, addedBullets, removedBullets, removedEntries,
claimedBulletKeys and the four scoreAffectingProfileSlots primitives —
descriptionOverrides is absent.

profileOverrides is also absent, but that one is deliberate and documented (#428: it is
stood in for by scoreAffectingProfileSlots so a non-scoring link edit keeps the score
object reference identical). descriptionOverrides has no such justification.

Why it matters now

Pre-existing and long-standing, but less detectable since #652 (PR #922). The score
dep list and the fold memo's dep list used to sit adjacent and spell out the same fourteen
override maps, so an omission was visible by diffing the two arrays. The fold memo is now
[base, doneScoreBullets, snapshot], so a new override channel joins the fold
automatically and joins the score only by hand. #922 added a comment naming the knowingly
absent channels to restore some of that signal, but the defect itself is untouched.

Proposed fix

Add descriptionOverrides to the score memo's dep array, and add a regression test
alongside the existing useAnalyzedResume score-reference-stability tests asserting that a
description edit on a glyph-less-prose parse mints a new score object with a changed
overall.

Consider also whether the hand-maintained dep list is the right mechanism at all: a
derived "score-affecting slice of the snapshot" — the shape scoreAffectingProfileSlots
already uses for profileOverrides — would make the omission structural rather than
clerical. That is a larger change and can be a follow-up.

Acceptance criteria

  • A description edit on a glyph-less-prose résumé re-grades: new score object, changed
    overall, score.bullets carries the edited text.
  • groupBulletsByExperience attributes the edited role's bullets back to their role
    (no experienceIndex: null detachment into "Other").
  • The Download-export follow-up (#421 Secondary #11) #428 invariant still holds: a non-scoring profile edit keeps the score object
    reference identical.
  • A regression test pins the above and fails on main before the fix.
  • npm run verify green.

Found during the PR review of #922 (which documents it as out of scope, correctly).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggaalHand this issue to Gaal, the repo's coding agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions