Extend CV classifier contract and provenance UI
This commit is contained in:
+12
-4
@@ -376,18 +376,24 @@ Return ONLY valid JSON with this exact shape:
|
||||
"location": string|null,
|
||||
"start": string|null,
|
||||
"end": string|null,
|
||||
"bullets": string[]
|
||||
"bullets": string[],
|
||||
"summary": string[],
|
||||
"skills": string[]
|
||||
}}
|
||||
|
||||
Rules:
|
||||
- Preserve facts only.
|
||||
- section must be one of the listed values.
|
||||
- Use Work Experience only for job/employment blocks.
|
||||
- For Contact blocks, keep title/company/start/end null and bullets empty.
|
||||
- For non-work blocks, title/company/start/end should usually be null.
|
||||
- Use Education only for degree/course/certification blocks.
|
||||
- For Contact blocks, keep title/company/start/end null and bullets/summary/skills empty.
|
||||
- For Professional Summary blocks, prefer summary for concise summary lines and keep bullets empty unless the source is already bullet-like.
|
||||
- For Skills blocks, prefer skills for normalized skill items and keep title/company/start/end null.
|
||||
- For non-work and non-education blocks, title/company/start/end should usually be null.
|
||||
- location must look like a place, not a sentence.
|
||||
- dates must be one of: year, month+year, dd/mm/yyyy, Present, Current.
|
||||
- bullets should only be job tasks/achievements, not titles, companies, dates, or headings.
|
||||
- bullets should only be concrete tasks/achievements/details, not titles, companies, dates, or headings.
|
||||
- skills should be short normalized skill/tool terms, not sentences.
|
||||
- If unsure, choose Other and keep fields null/empty.
|
||||
|
||||
Block:
|
||||
@@ -405,6 +411,8 @@ Block:
|
||||
"start": parsed.get("start"),
|
||||
"end": parsed.get("end"),
|
||||
"bullets": parsed.get("bullets") or [],
|
||||
"summary": parsed.get("summary") or [],
|
||||
"skills": parsed.get("skills") or [],
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ def test_classify_block_returns_structured_json(monkeypatch):
|
||||
"start": "2019",
|
||||
"end": "Present",
|
||||
"bullets": ["Built event-driven APIs and migration tooling."],
|
||||
"summary": [],
|
||||
"skills": ["Python", "SQL"],
|
||||
}
|
||||
|
||||
monkeypatch.setattr(module, "_ollama_generate_json", fake_generate_json)
|
||||
@@ -62,6 +64,8 @@ def test_classify_block_returns_structured_json(monkeypatch):
|
||||
assert payload["title"] == "Senior Platform Engineer"
|
||||
assert payload["company"] == "Atlas Systems"
|
||||
assert payload["bullets"] == ["Built event-driven APIs and migration tooling."]
|
||||
assert payload["summary"] == []
|
||||
assert payload["skills"] == ["Python", "SQL"]
|
||||
|
||||
|
||||
def test_classify_block_defaults_missing_section_to_other(monkeypatch):
|
||||
@@ -75,3 +79,5 @@ def test_classify_block_defaults_missing_section_to_other(monkeypatch):
|
||||
payload = response.json()
|
||||
assert payload["section"] == "Other"
|
||||
assert payload["bullets"] == []
|
||||
assert payload["summary"] == []
|
||||
assert payload["skills"] == []
|
||||
|
||||
Reference in New Issue
Block a user