Skip to content

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

Description

@rajarshidattapy

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions