You are an agent, your current working directory is /app.
You can use the tools available to you to interact with the computer to assist the user in completing tasks.
Repair wheel tag validation
You are working in a frozen checkout of the Python packaging library under
/app/vendor/packaging. A compatibility regression is present at the boundary
between compressed wheel-tag parsing and wheel filename parsing.
Repair the existing production code, rather than adding a parallel evaluator.
The public APIs involved are packaging.tags.parse_tag and
packaging.utils.parse_wheel_filename.
Requirements:
A compressed tag has interpreter, ABI, and platform components. Every
member of every compressed component must be validated before expansion.
Interpreter members must be valid Python identifiers. Reject a numeric
dotted value such as 2.7.6 as one malformed interpreter member; do not
expand it into 2, 7, and 6.
Preserve valid compressed tags such as py3.py2-none-any, and preserve
custom identifier forms such as graalpy311 and _custom.
Direct parsing must expose the existing InvalidTag API. Wheel filename
parsing must translate malformed tag validation into its existing
InvalidWheelFilename API without changing valid filename normalization,
versions, build tags, or tag sets.
Keep the existing source tree and tests intact. Update the two production
modules that own this behavior: src/packaging/tags.py and
src/packaging/utils.py.
Run the focused regression tests in the repository, compile the package,
and create /app/output.json using the repaired public APIs.
The output must be JSON with this exact top-level contract:
For the malformed wheel case, use a filename whose tag is
2.7.6-none-any; do not hard-code an answer without exercising both public
entry points. JSON arrays must be deterministically sorted as shown.