Repository navigation
feat(candidate-db): add Roles and Role profiles that cite Facts by id - #15
Merged
Merged
Conversation
A Candidate can pursue several Roles. Each Role keeps its definition in roles/<role-slug>/role.yml (title from the Glossary, level, industries, priority, state, and must/nice requirements with their origin) and its Role profile in profile.md: positioning, evidence per requirement as Fact ids with reasons, and gaps whose kind the script works out. hh.py gains role new, update, list, match, build and stale. Profiles record what they were built from, so a changed or removed Fact, a newer matching Fact, or a changed role.yml marks them stale. strategy.md gets a Roles section kept by the script, the Index gains Role tables, and search candidates takes --role, --requirement-tag and --no-must-gaps. Closes #9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Implements Role profiles from #9: a Candidate can pursue several Roles, and each Role profile links the Candidate's Facts to the Role's requirements, with reasons and gaps.
skills/headhunter/scripts/hh.py:role new,role update,role list,role match,role build,role stale; Role checks invalidate; Roles incandidate show; Role tables in the Index;search candidates --role / --requirement-tag / --no-must-gapsskills/headhunter/SKILL.md: layout,role.ymlandprofile.mdformats, gap kinds, staleness, the Roles workflow, search options, and a rule that Role profiles cite Facts and never change themCONTEXT.md: defines Role and Role profile; Strategy now names RolesREADME.md/README.zh-TW.md: the Role profiles featureRelated Issues
Closes #9
Type of Change
Decisions
<role-slug>is formedrole-1: unreadable folders. Letting titles change in place: the folder name would drift from the titleprofile.mdrecords a hash of the Role definition, a hash of every Fact it cites, and the newest Fact id at build time. Stale whenrole.ymlchanged, a cited Fact changed or was removed, or a newer active Fact shares a Tag with the requirementsprofile.md: a YAML block (the same subset as other files) the script validates and indexes, then a readable body the script renders from itmissing(no Fact),to-confirm(only inferred Facts),weak-evidence(only self-reported Facts); every requirement needs documented or third-party evidence or a gap entrymissingandto-confirmon must-haves;weak-evidenceis reported but does not count, since most resumes are self-reportedweak-evidence: almost every Candidate would match nothingsearch candidates --rolematches either languagerole.yml; the script rewrites a Roles section instrategy.md, leaving the rest of the file to the agentstrategy.mdMigration
Data folders created by #1 have no
roles/; the script creates it with the first Role and adds the Roles section tostrategy.mdthen. No other files change, so no migration is needed.Validation
All runs used a copy of the fictional Candidates from #1 (王小明
c-001, 林小華c-002) in a scratchHEADHUNTER_DATA_DIRoutside any repository, with one Job snapshot from #12, on Python 3.9 unless noted. I acted as the agent followingSKILL.md.Roles
role new c-1with title "Tech Lead" before it was in the Glossary →add the title 'Tech Lead' to glossary.yml as a title with both languages, nothing writtenrole new c-1→senior-backend-engineer(4 must / 2 nice) andtech-lead(3 must / 1 nice); requirement idsr-001… assigned;strategy.mdRoles table writtenrole new c-2with a Job requirement citingj-yourator-99999→Job j-yourator-99999 has no snapshot in jobs/; withj-yourator-25039→data-engineercreatedrole matchlists Facts per requirement by shared Tag, strongest evidence first, and flags requirements with noneRole profiles
f-004as evidence, a gap on a requirement with documented evidence, five gaps missing) → all seven problems listed, nothing writtenf-012as evidence →f-012 is inferred; list it under the requirement's gap to confirmc-001Roles sharef-005andf-013.data-engineershows all three gap kinds:weak-evidence(r-001–r-004),to-confirm(r-005,f-012),missing(r-006)Staleness and rebuild
s-007, new Factf-015(tool/kubernetes), and an extra citation onf-005→role stale:senior-backend-engineer: f-005 changed; new f-015 matches its requirements,tech-lead: f-005 changed;search candidatesshowsstaleEvery Role profile is current.role updateadding requirementr-007→profile: role.yml changed; rebuilt → currentrole update→ refusedFacts, Sources and Taxonomy are never changed by Roles
shasumof everyfacts.yml,sources.ymlandtaxonomy.ymlbefore and after the rebuilds, and before and afterrole updateand the drop → identicalDrop
role update c-1 tech-leadwith{"state": "dropped"}→ folder and profile kept,strategy.mdshowsdropped,search candidates --role "tech lead"→ no match,role staleskips itIndex and search
search candidates --role "data engineer" --no-must-gaps→c-002(0 must-have gaps);--role 資料工程師(Chinese title through the Glossary) →c-002;--role engineer→ both;--no-must-gaps→c-002only;--requirement-tag kubernetes→c-001;--role "tech lead" --tag leadership→c-001with matched Factsquerycalls onrole_gapsandrole_evidenceindex.sqlite, ranindex(2 Candidates, 26 Facts, 3 Roles), repeated all 8 commands →diffis emptyChecks
validate→ OK on Python 3.9 and 3.13; the data folders from [Feature] Candidate database: import, quality check, tags, CRUD and search #1 and [Feature] Job reading: Listings and Job snapshots #12 still validaterole.ymlandprofile.mdYAML block parses identically with PyYAML andhhyamlclaude plugin validate .→ passed;claude plugin validate .claude-plugin/plugin.json→ passed with the expectedCLAUDE.mdwarningruff check --select E,F,W,B skills/headhunter/scripts→ all checks passed; scripts parse on Python 3.9Not run
claude --plugin-dir .Checklist
skills/headhunter/SKILL.md,README.mdandREADME.zh-TW.mdupdated when behavior or data layout changed🤖 Generated with Claude Code