hired.alignment#
JD-vs-candidate alignment: classify each requirement honestly into four buckets.
Public surface:
schemas in
hired.alignment.base(Requirement,RequirementRecord,AlignmentReport, and the enums),the deterministic rubric in
hired.alignment.rubric(classify(),assign_bucket(),apply_ai_leverage()),the elicitation helpers in
hired.alignment.elicitation(rank_clarifications(),is_decision_stable()),Markdown rendering in
hired.alignment.report(render_report_markdown()).
The intelligence (judging transfer distance, trainability, evidence) is supplied
by the hired-align skill (Claude as brain) or an injected LLM; this package
provides the schemas, deterministic scoring, and rendering. See
misc/docs/DESIGN.md §6-8.
Functions
|
Fill |
|
Assign the alignment bucket for a record, or |
|
Soften a codified gap's closeability by the candidate's AI leverage. |
|
Residual gap, floored at zero. |
|
Produce clarifying questions for askable records, highest info-gain first. |
|
True when no remaining open unknown could flip the verdict. |
|
Whether to route this record to a clarifying question. |
|
Expected information gain of resolving this requirement, wrt the verdict. |
|
Render the report as a Markdown string. |
|
Return a structured diff of two alignment-report dicts. |
|
A short human-readable summary of |
Classes
|
One atomic requirement extracted verbatim from a job description. |
|
The analysis of one requirement against the candidate's knowledge. |
|
A verbatim grounding span for a match judgment. |
|
A complete, verdict-first alignment analysis for one JD. |
|
|
|
|
|
|
|
A question to ask the candidate to resolve a decision-relevant unknown. |
|
|
|
The four alignment buckets. |
|
How the candidate's background relates to the requirement (Axis A). |
|
How decision-critical a requirement is. |
|
|
|
How hard a gap is to close (Axis B), after the AI-leverage modifier. |
|
|
|
|
|
|
|
How much the candidate's standing AI-agent capability lowers the ramp. |
|
Local closed-world flag: may a missing value be read as a real negative? |
|
|
|
- class hired.alignment.AILeverage(*values)[source]#
-
How much the candidate’s standing AI-agent capability lowers the ramp.
Applies to codified / knowledge-breadth gaps, not tacit-judgment or enduring-aptitude gaps (those it cannot rescue).
- class hired.alignment.AlignmentReport(**data)[source]#
Bases:
BaseModelA complete, verdict-first alignment analysis for one JD.
- class hired.alignment.Clarification(**data)[source]#
Bases:
BaseModelA question to ask the candidate to resolve a decision-relevant unknown.
- class hired.alignment.Closeability(*values)[source]#
-
How hard a gap is to close (Axis B), after the AI-leverage modifier.
- class hired.alignment.Evidence(**data)[source]#
Bases:
BaseModelA verbatim grounding span for a match judgment.
- class hired.alignment.FieldCompleteness(*values)[source]#
-
Local closed-world flag: may a missing value be read as a real negative?
- class hired.alignment.MatchType(*values)[source]#
-
How the candidate’s background relates to the requirement (Axis A).
- class hired.alignment.Requirement(**data)[source]#
Bases:
BaseModelOne atomic requirement extracted verbatim from a job description.
- class hired.alignment.RequirementRecord(**data)[source]#
Bases:
BaseModelThe analysis of one requirement against the candidate’s knowledge.
- hired.alignment.apply_ai_leverage(closeability, ai_leverage, *, skill_type, is_tacit=False)[source]#
Soften a codified gap’s closeability by the candidate’s AI leverage.
Tacit/soft gaps and structurally-hard gaps are never softened — AI agents extend breadth of codified knowledge, not judgment or enduring aptitude.
- Return type:
>>> apply_ai_leverage(Closeability.REQUIRES_EXPERIENCE, AILeverage.HIGH, ... skill_type=SkillType.TECHNICAL) <Closeability.LEARNABLE: 'learnable'> >>> apply_ai_leverage(Closeability.REQUIRES_EXPERIENCE, AILeverage.HIGH, ... skill_type=SkillType.SOFT_SKILL) <Closeability.REQUIRES_EXPERIENCE: 'requires_experience'>
- hired.alignment.assign_bucket(record)[source]#
Assign the alignment bucket for a record, or
Noneif it should be a clarifying question instead.Returns
Nonewhen the requirement isUNKNOWNon an OPEN field — that routes to elicitation rather than being scored as a gap (the “don’t assume absence” rule).UNKNOWNon a CLOSED field is treated as a real gap.
- hired.alignment.classify(record)[source]#
Fill
gap_sizeandbucket(andneeds_clarification) in place.Returns the same record for convenience.
- Return type:
- hired.alignment.compute_gap_size(required_level, candidate_level)[source]#
Residual gap, floored at zero.
- Return type:
- hired.alignment.diff_reports(old, new)[source]#
Return a structured diff of two alignment-report dicts.
Both inputs are
AlignmentReport.model_dump()dicts. The result has:verdict_changed/verdict_old/verdict_newfit_old/fit_newbucket_changes: list of{requirement, from, to}for requirements whose bucket moved (the heart of a refresh — typically UNKNOWN→known as Q&A resolves false negatives)added/removed: requirement texts present in only one versionclarifications_resolved: clarifying questions in old but not new
- hired.alignment.info_gain(record)[source]#
Expected information gain of resolving this requirement, wrt the verdict.
Heuristic:
uncertainty × criticality. Animpactoverride (1-5) scales criticality when the analyst has a sharper view than the requirement class.- Return type:
- hired.alignment.is_decision_stable(records)[source]#
True when no remaining open unknown could flip the verdict.
Concretely: there are no askable (decision-relevant, open, unknown) requirements left. This is the sharpest stop criterion from the research.
- Return type:
- hired.alignment.rank_clarifications(records, *, max_questions=None, min_info_gain=0.0)[source]#
Produce clarifying questions for askable records, highest info-gain first.
The question text is left to the analyst; this returns the prioritized skeleton (requirement, reason, info_gain) so the caller can fill
question.- Return type:
- hired.alignment.render_report_markdown(report)[source]#
Render the report as a Markdown string.
- Return type:
- hired.alignment.should_ask(record)[source]#
Whether to route this record to a clarifying question.
Ask only when it’s
UNKNOWNon an OPEN field and decision-relevant — the “don’t assume absence from silence” rule. CONTRADICTED facts and closed-field unknowns are real gaps, not questions.- Return type:
- hired.alignment.summarize_diff(diff)[source]#
A short human-readable summary of
diff_reports()output.- Return type:
Modules
Schemas for JD-vs-candidate alignment analysis. |
|
Deterministic diff between two alignment reports. |
|
The honesty loop: rank unknowns into the most informative questions first. |
|
Render an |
|
Deterministic bucket assignment — the two-axis rubric in code. |