Bug: role.json min_final_score / max_final_score are loaded but never applied to the final score

Author: rajarshidattapyCreated Sep 12, 2026Updated Sep 12, 2026

Description

role.json defines min_final_score and max_final_score (intern role: -20 / 120), and load_role parses them into Role:

https://github.com/interviewstreet/hiring-agent/blob/70fd3ea/roles.py#L221-L232

But nothing reads them. print_evaluation_results instead caps at max_score + role.bonus_max and applies no lower bound at all:

https://github.com/interviewstreet/hiring-agent/blob/70fd3ea/score.py#L82-L90

python
if hasattr(evaluation, "deductions") and evaluation.deductions:
    total_score -= evaluation.deductions.total        # no floor
max_possible_score = max_score + role.bonus_max       # not role.max_final_score

Deductions.total has no upper bound, so a large deduction produces totals below the role's configured floor, and a role author who sets max_final_score to something other than sum(categories) + bonus_max sees no effect. --init-role also scaffolds these fields, suggesting they're meant to be honored.

(#273 notes that the old MAX_FINAL_SCORE constant in evaluator.py was unused; this is the same gap carried over into the new role system.)

Expected

Final score clamped to [role.min_final_score, role.max_final_score] in the printout (and CSV), or the fields removed from the role schema if they're not intended to be used.

Source: interviewstreet/hiring-agent