Categories two and three of the mechanical-fix work, sharing the seam category
one established.
Undefined or misspelled names are located exactly by the runtime or compiler,
so the fix is one identifier or one import. Python names the file on a
traceback frame above the error, so the most recent frame is carried forward
and attached when the error arrives; a defect with no known file is dropped
because the patcher could not act on it.
Failing assertions now come from the structured test results junit publishes,
carrying the test, its class and the assertion. They deliberately carry no
path: the failing test is the symptom and the defect is usually in the code
under test, so naming the test file would invite weakening the assertion
instead of fixing the cause. The instruction says so explicitly.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Category one of the mechanical-fix work. A linter has already located the
defect precisely - file, line, rule, and what is wrong - so passing that
through converts an open-ended 'repair this build' request into a narrow
instruction whose result can be checked against the same evidence.
Recognises ruff/flake8, golangci-lint, and eslint diagnostics from console
evidence, deduplicates them, and bounds the list at twenty. A diagnostic for a
file outside the write allowlist is dropped at extraction rather than later,
so a defect is never reported for a file the patcher could not touch anyway.
Only categories whose fix is mechanical belong here; anything needing a
judgement about intended behaviour stays on the ordinary escalation path.
A build with no linter output is unaffected and falls back to the existing
open-ended request. The patch prompt moves to its own module, as the triage
prompt already had.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>