fix(formats): yolov5 declares its three tasks, and an exporter must declare a target - #809
Merged
Merged
Conversation
JArmandoAnaya
force-pushed
the
feat/targets-closeout-backend
branch
from
August 26, 2026 14:11
b89ccd2 to
2c4f01e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The backend and documentation half of the export-targets closeout.
yolov5was declared as a detect-only target, so a polygon or a tag in a release addressed to it was stripped without a word; it now declares the three tasks its trainer accepts. TheExporterport promised at least one target per exporter and never checked it; the scan now refuses an exporter that declares none. The rest pins behaviour that already held and had no test or no prose: task derivation follows the target, theyoloalias is silent on REST and MCP, and three documents said something the code does not do.Part of the closeout of #784; the epic is closed by the companion frontend pull request.
What changed
fix(formats): yolov5 trains segment and classify as well as detect—yolov5declaresdetect,segmentandclassifywith the geometries behind them, mirroringyolov8andyolo11. The generated catalog table indocs/content/releases.mdis regenerated. Two new tests intests/formats/test_registry.pypin the exact set of ten YOLO target names with each one's task set, and assert that every task the dialect lays out has its geometry behind it on the target that declares it — so a dropped or narrowed target fails a test rather than only the doc-table diff.feat(kernel): an exporter without a target is refused at scan—validate_targetsraisesInvalidExportTargeton an emptytargets;validate_installedand thereforeregistry.exporters()inherit the refusal. The error's docstring now covers both defects it names. Tests: the empty declaration refused directly and through the installed set (tests/kernel/test_export_target.py), and a fake entry point whose plugin passes the port'sisinstancefilter with no target refused atregistry.exporters()(tests/formats/test_registry.py). The seam test'sImageWriterdouble, which carriedtargets = frozenset(), now declares a real one. The three scan-time rules are written out indocs/content/architecture/backend/formats.md.test(formats): task derivation follows the target, not the dialect—tests/formats/test_yolo_writer.pycoversderive_task's three branches directly.tests/formats/test_ultralytics.pygains three service-level exports through the realultralyticsplugin: a tags-only release addressed toyolov10writes the detect layout and no class tree; a polygon release addressed toyolov10writes five-column detect rows; the same polygon addressed toyolov5keeps its vertices. No port change.test(server,mcp): the yolo alias is accepted on REST and MCP without a warning— one REST test and one MCP test thatformat=yoloresolves toultralytics, reportsformat_nameas the real name on the job result and the compatibility report, and carries no deprecation text.docs/content/releases.md(§The YOLO dialects) anddocs/content/api.mdsay that the alias is accepted silently on REST and MCP and warns only on the CLI, until its removal in the release after next.docs(releases): the 422 for target and format, and the polygon claim—docs/content/api.md§The two shapes of 422 states the export address refusal: both or neither oftargetandformaton export and compatibility is a 422VALIDATION_ERRORwithloc: ["query"]andmsg: "give exactly one of target and format".docs/content/releases.mdno longer claims that YOLO reduces a polygon to its box —ultralyticswrites polygons as segment rows with an emptydegraded_geometries, and onlyyolov5-yamlandvocreduce — and cites the test by its real name,test_the_general_formats_declare_polyline_truthfully. The Export row ofdocs/content/examples.mdnow describes whatexamples/mcp_end_to_end.pycalls (list_formatsthenexport_release(format="dummy")) and points at the Recipe row as the target-addressed export of the same release, rather than being read as a second way to address a trainer.Found, not fixed
yolo26declaressemanticanddepthbeyond the five tasks its siblings share. Neither task has a geometry VisionSet produces, so the declaration is an absence rather than a drop, but whether the catalog should advertise tasks nothing can reach needs a ruling; the task set is left as it was and pinned as-is by the new test.examples/mcp_end_to_end.pyaddresses its plain export byformat="dummy"; the task asked for the docs row to address bytarget, but the row describes the script and the script is out of scope here, so the row was made accurate and the target-addressed call stays in the Recipe row.docs/content/api.mdstill carries#328in prose ("the generic surface Embedded job system: a JobQueue port, a SQLite adapter, and an in-process spawn dispatcher #328 added"); untouched, since the line is outside this change.Test plan
uv run pytest tests/formats tests/kernel/test_export_target.py tests/kernel/test_export_seam.py tests/architecture tests/server/test_releases.py tests/mcp/test_release_tools.py tests/cli/test_export_commands.py— green per commit.uv run pytest tests/formats/test_ultralytics_roundtrip.pyunderuv sync --group yolo:3 passed; synced back after.if False and not exporter.targets) and the three new tests failed, then restored.uv run mypy src/visionset/kernel,uv run ruff check .,uv run lint-imports— green.bash scripts/check.sh: