STEP 01 / 05Reproduce the issue
parse_ports(",80,,443,")
→ ValueError: invalid literal for int()
Reproduce before patching.
STEP 02 / 05Locate the parser
src/ports.py
raw.split(",") → ["", "80", "", "443", ""]
Empty fields are the defect, not every conversion error.
STEP 03 / 05Make a minimal patch
- return [int(t) for t in raw.split(",")]
+ return [int(t) for t in raw.split(",")
+ if t.strip()]
Filter blanks only; invalid numbers still raise.
STEP 04 / 05Run visible self-checks
parse_ports(",80,,443,") → [80, 443]
parse_ports("80,443") → [80, 443]
parse_ports("80,nope") → ValueError
The Agent may write tests but cannot see the judge’s test_patch.
STEP 05 / 05Verify in a fresh repository
apply candidate patch to clean base
apply hidden test_patch (judge only)
FAIL_TO_PASS: all pass
PASS_TO_PASS: all pass
resolved = true
Judge on a clean base; Agent-edited tests are not trusted.