You are given a multi-file codebase and several CSV fixtures that implement a project assignment workflow. The system assigns people to projects based on course eligibility, project priority, and remaining capacity. Several automated tests are failing.
Your task is to inspect the existing implementation, reproduce the failures, and fix the bugs without changing the public API.
The expected behavior is:
-
A project can accept a new assignment only when its available headcount is strictly greater than 0.
-
Projects must be processed in descending order of priority.
-
Eligibility filtering must use
course_id
, not a generic row
id
field.
-
Any temporary state used inside a loop must be reset before the next iteration.
Describe how you would debug this codebase, identify the root causes, implement the fixes, and verify that the behavior is now correct.