feat(ai): prompt-injection delimiters + synonym-aware match scoring
Wave 4 hardening. Wrap untrusted CV/job-description/instruction text in tools/summarizer prompts with explicit delimiters and an ignore-embedded-instructions rule, since JD text, recruiter emails, and free-text candidate background all flow into rewrite/normalize prompts unescaped today. Match score previously normalized synonyms (JS/Kubernetes/K8s/etc) only when scanning the job posting, not when checking the CV corpus, so a CV using an abbreviation the job spelled out never matched. SkillTagger.MatchesTag reuses the same synonym regex for both sides.
This commit is contained in:
@@ -90,6 +90,19 @@ public sealed class JobCvMatchServiceTests
|
||||
Assert.Equal(0, result.MatchedCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Curated_tag_matches_synonym_spelling_in_cv()
|
||||
{
|
||||
// Job posting says "Kubernetes"; CV only says "K8s" -- same skill, different spelling.
|
||||
var result = _service.Evaluate(
|
||||
jobTitle: "Platform Engineer",
|
||||
jobText: "Deep Kubernetes experience required for our platform team.",
|
||||
cvSections: Sections(("Skills", "K8s, Terraform, Helm")));
|
||||
|
||||
Assert.Contains("Kubernetes", result.MatchedKeywords);
|
||||
Assert.DoesNotContain("Kubernetes", result.MissingKeywords);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Title_keywords_are_weighted_and_missing_ones_rank_first()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user