Drop implausibly small per-occupation salary estimates (#275) - #276
Merged
Merged
Conversation
…ad of 80000)
Found via real browser testing: the Market Potential page occasionally
showed nonsensical ranges like "$80 - $120" for a Software Engineer
match. The LLM sometimes returns typicalMinUsd/typicalMaxUsd as an
abbreviated figure (e.g. 80, presumably meaning "$80k") rather than a
full annual-salary number - a valid, correctly-ordered positive range,
so the existing negative/min>max validation didn't catch it.
- Strengthened the prompt with an explicit example ("85000, never 85 or
'85k'") to reduce how often this happens.
- Added a plausibility floor (any value under $1,000/year is obviously
not a real full-time salary) that nulls out both values rather than
keeping them, consistent with the prompt's own "omit both if you
cannot give a reasonable estimate" contract and the codebase's
existing explicit-no-estimate-over-fabricated-data philosophy.
Sumedh-Joshi
force-pushed
the
fix/occupation-salary-scale-validation
branch
from
September 20, 2026 11:01
3800b6d to
5c2449e
Compare
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
Found via real browser testing (Puppeteer):
/market-potentialoccasionally showed nonsensical per-occupation salary ranges like "C#/.NET Developer - $80 – $120" and a Growth Path step of "(~$100)", while the page's separate, top-level "Estimated Compensation Range" (a different LLM call) correctly showed "$90,000 – $150,000" on the same load.Root cause
AiSuggestedOccupationMatchingService's prompt asks fortypicalMinUsd/typicalMaxUsdas "a rough typical US annual salary range" with no example number format. The model sometimes returns an abbreviated figure (e.g.80, presumably meaning "$80k") instead of80000. It's a valid, correctly-ordered positive integer, so none of the existing validation (< 0,min > max) catches it.I confirmed this isn't a deterministic code bug (the downstream arithmetic in
OpportunityFinder.BuildProgressionis plain, correct averaging) by comparing two live runs of the exact same code path: one produced the "$80 – $120" nonsense, a later one (fresh LLM completion) produced correctly-scaled "(~$100,000)" etc. Same code, different LLM output.Changes
HumanCapital/AiSuggestedOccupationMatchingService.cs:85000, never 85 or "85k") to reduce how often this happens.$1,000/year) as a safety net: any occupation match with implausibly small compensation values has both nulled out rather than displayed, consistent with the prompt's own "omit both if you cannot give a reasonable estimate" instruction and the codebase's existing explicit-no-estimate-over-fabricated-data philosophy.Verification
dotnet test— all 222 tests pass, including a new test asserting a{80, 120}range gets nulled while a normal{85000, 130000}range is untouched.dotnet csharpier check— clean.Closes #275.