feat(kernel): export targets on the exporter port - #788
Merged
Conversation
This was referenced Aug 26, 2026
An export target is the model a person will train; each exporter now declares its targets beside the five existing port attributes. The kernel gains the frozen ExportTarget model with its Task, TargetFamily and ResizeStrategy vocabularies and the PreprocessingHints a target carries, pure resolution from a target name to the declaring exporter, and a validate_targets check holding every target's geometries within its exporter's own. ExportTargetNotFound, ExportTargetConflict and InvalidExportTarget are typed in kernel/errors.py and mapped in server/errors.py — no route raises them yet; the exact-correspondence test keeps the table total. Every shipped exporter declares one self-named target, family other, with no trainer tasks, so discovery keeps returning them under the widened port. TuSimple's target names the polyline it writes, because its supported set is empty — everything it carries arrives degraded.
JArmandoAnaya
force-pushed
the
feat/targets-t1-domain
branch
from
August 26, 2026 11:14
d9b2b5d to
307e7ef
Compare
This was referenced Aug 26, 2026
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.
First phase of the export-targets epic (#784): the kernel now knows what an export target is, and the
Exporterport declares them. A target is the model a person will train; it resolves to exactly one exporter, and the catalog every surface will render is derived from what is installed rather than kept anywhere by hand. This phase is kernel and formats only — no route, CLI command, or MCP tool consumes targets yet, and no wire shape changes.The contract added
kernel/domain/export_target.py(new): frozen pydantic models —Task,ResizeStrategy,TargetFamily,PreprocessingHints, andExportTargetwith three validators: the name is a lowercase slug,supported_geometriesis non-empty, and a recommended strategy requires a recommended size.ResizeStrategylives here because the hints reference it.kernel/ports/exporter.py: the port gainstargets: frozenset[ExportTarget]beside its five existing attributes, plus two module-level helpers —validate_targets(exporter), holding every target'ssupported_geometrieswithin the exporter's own, andresolve_target(installed, name), the pure resolution from a target name to(Exporter, ExportTarget).kernel/errors.py:ExportTargetNotFound(carrying the installed target names),ExportTargetConflict, andInvalidExportTargetfor thevalidate_targetsrefusal.other, no trainer tasks, geometries equal to itssupported_geometries, hints(None, None, trainer_resizes=True, augmentation_common=False)— spelled once informats/_targets.py. The dummy exporter declaresdummythe same way.Decisions a reviewer should see
tests/server/test_errors.pyholdsERROR_RULESin exact correspondence withkernel/errors.py, so the three new errors are mapped now (404 for the missing target; 500 for the conflict and the defective declaration, opaque) and added to the inventory indocs/content/api.md, on the table's own precedent for errors no route reaches yet. The phase that builds the target routes owns the final status and exposure argument.polylinerather than itssupported_geometries. That set is empty — everything TuSimple writes arrives degraded — and an empty target geometry set is invalid by design. The subset rulevalidate_targetsenforces therefore cannot hold for an exporter whose entire output is degraded; nothing runs that check against installed plugins yet, and the rule needs a ruling before the registry enforces it at discovery.yoloexporter's self-named target is a placeholder; the dialect work replaces it with the real trainer targets.Stack
Position 1 of the export-targets stack (#784); based on
main.Checks
Targeted:
tests/kernel,tests/formats,tests/architecture,tests/server,tests/cli,tests/mcp,tests/jobs,tests/packaging(all passing),uv run lint-imports(4 contracts kept),uv run mypy src/visionset(clean),uv run ruff check .andruff format --check .(clean).Full gate:
bash scripts/check.sh—check.sh: PASSED ran=python,frontend,generated,browser skipped=docs("All checks passed."; the docs group is CI's, and the only docs change here is the api.md code inventory, whichtests/server/test_errors.pygates).