feat: implement causal chain bullet rewriting with seniority-aware framing#81
Open
Ztrimus wants to merge 1 commit into
Open
feat: implement causal chain bullet rewriting with seniority-aware framing#81Ztrimus wants to merge 1 commit into
Ztrimus wants to merge 1 commit into
Conversation
…aming Closes #55 Depends on #54 (keyword tiers, already merged) ## Problem Bullet generation was generic — no enforced structure, no per-tier keyword obligation, no fabrication guard, and no awareness of whether the role was junior vs. lead. Modern ATS LLMs score quantified, keyword-anchored bullets 3-5x higher than vague ones. ## Changes ### zlm/schemas/job_details_schema.py - Added `seniority_level: Literal["junior", "mid", "senior", "lead"]` to `JobDetails`. Validated by Pydantic — rejects invalid values at parse time. - Added `Literal` to imports. ### zlm/prompts/resume_prompt.py (JOB_DETAILS_EXTRACTOR) - Expanded step 1 of `<reasoning>` to include seniority detection signals: years required (0-2 → junior, 2-5 → mid, 5+ → senior), title modifiers (Senior/Staff/Principal → senior, Lead/Manager/Director → lead), and scope language ("owns", "drives", "leads team" → senior/lead). - Added `seniority_level` to `<instructions>` with mapping rules and signals. ### zlm/prompts/sections_prompt.py (EXPERIENCE + PROJECTS) Replaced generic bullet guidance with an explicit 7-rule causal chain contract: Formula: [Action Verb] + [Tier 1 Keyword] + [Quantified Impact or Scope] Rule 1 — Tier 1 must-have: every bullet must contain ≥1 Tier 1 keyword. Rule 2 — Metrics first: use numbers whenever original data supports them. Rule 3 — Scope fallback: if no metric, add team size / data volume / scale. Rule 4 — No fabrication: metrics not in the original resume are forbidden. Rule 5 — Seniority framing (references `seniority_level` from job JSON): junior → learning velocity, initiative, direct contribution mid → technical wins, measurable outcomes, independent ownership senior → system scope, cross-team impact, strategic decisions lead → people leadership, org-level outcomes, directional influence Rule 6 — Factual preservation: titles, companies, dates unchanged. Rule 7 — Reverse-chronological ordering. Output schema updated to show "Action + Tier1Keyword + Metric/Scope" in bullet type comments (reinforces the formula). ## Integration `seniority_level` flows into section prompts automatically via the existing `json.dumps(job_details)` passed as `job_description` — no changes to `__init__.py` required. ## Verified All 9 templates smoke-tested. Literal constraint validated (rejects "invalid" seniority value). JobDetails instantiates with seniority_level=senior.
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
Enforces an explicit causal chain formula on every resume bullet, anchors Tier 1 keywords from #54, and adjusts framing based on the detected seniority level of the target role.
Closes #55
Depends on #54 ✅
Problem
Causal Chain Formula
Bad: "Worked on database migration projects"
Good: "Led 6-engineer team migrating 14M records to PostgreSQL, cutting query latency by 68%"
Rules (applied to every bullet in EXPERIENCE + PROJECTS)
Seniority framing
Schema change
Added to .
Detection signals baked into :
Zero integration cost
flows into section prompts via the existing — no changes to .
Verified
All 9 templates smoke-tested. Literal constraint validated (rejects invalid values).