Skip to content

chore(inference): remove what the fast auto-labeling slices left behind - #465

Merged
JArmandoAnaya merged 1 commit into
mainfrom
chore/autolabel-cleanup
Aug 9, 2026
Merged

chore(inference): remove what the fast auto-labeling slices left behind#465
JArmandoAnaya merged 1 commit into
mainfrom
chore/autolabel-cleanup

Conversation

@JArmandoAnaya

@JArmandoAnaya JArmandoAnaya commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

The auto-labeling feature is stable, so this removes what the slices that built it left behind. cf. #464, which carries the full inventory and the items deliberately not acted on.

No behaviour changes. Every item is a removal with zero references, a test deletion with a named surviving test proving the same failure mode, or a comment correction where the code is the authority.

Redundant tests

Three tests in tests/inference/test_provider.py (#434) were re-created in tests/inference/test_providers.py (#458) when the family resolver got its own file, and the originals were never removed — the first pair share a name character for character.

Deleted Surviving test Mutation that reddens the survivor
test_provider.py::test_an_http_connection_is_refused_because_this_build_has_no_adapter test_providers.py::test_an_http_connection_is_refused_because_this_build_has_no_adapter A
test_provider.py::test_a_local_connection_without_weights_is_refused_by_state test_providers.py::test_a_connection_without_weights_is_told_which_action_fixes_it B
test_provider.py::test_the_connections_own_state_is_reported_before_the_machines test_providers.py::test_a_missing_runtime_is_reported_after_the_connections_own_state B

In each pair the survivor is the stronger test: it drives provider_for through a real InferenceConnectionService rather than a hand-built model, and matches a longer substring of the message.

The third is worth naming separately, because it did not test what its name claimed. It asserted that a not-set-up connection raises InferenceConnectionNotSetUp — which is the second row's assertion — while stubbing nothing, so there was no second refusal for the order to be against. Its survivor stubs require to raise and then asserts both directions.

test_provider.py keeps everything unique to it: the unstubbed missing-extra refusal, the isinstance-against-Protocol check, both model_ref cases, and the whole regions_from half — including #434's named mutation test, test_duplicate_detections_are_suppressed_before_they_leave_the_adapter, which is untouched. Its module docstring now says which half of provider_for lives where.

Deleting the three left remote() and two error imports with no users; those went with them.

Mutation verification

Committed before the first mutation. Each anchor asserted present exactly once before applying and its replacement asserted after; each reverted by git apply -R on its recorded patch, with git status --porcelain empty afterwards.

Mutation Aprovider_for's HTTP arm returns _local(...) instead of raising InferenceConnectionNotRunnable.

FAILED tests/inference/test_providers.py::test_an_http_connection_is_refused_because_this_build_has_no_adapter

Mutation B — the setup_state is not READY guard deleted from _local.

FAILED tests/inference/test_providers.py::test_a_connection_without_weights_is_told_which_action_fixes_it
FAILED tests/inference/test_providers.py::test_a_missing_runtime_is_reported_after_the_connections_own_state
FAILED tests/inference/test_providers.py::test_a_refused_connection_leaves_nothing_behind_for_the_next_request

Both named survivors turn red, and B catches a third test the deletions never covered.

Dead code

  • inference/sam_provider.pybest_of(iou_scores, masks) never read masks; the choice comes entirely from the IoU head's scores. Flagged by ruff --select ARG. Three call sites, all in this repository. Not part of the ModelProvider port and not in visionset.inference.__all__.
  • frontend/ui-core/src/data/inferenceQueries.tsConnectionAction had no importers. Its three neighbours on the adjacent lines are each re-exported from ui-core/src/index.ts; this one was not, so it was not package API either. Anything needing it has it through Connection["allowed_actions"].

Comments that no longer described the code

  • pyproject.toml"uv.lock does not carry extras". It carries them twice: local-inference under [package.optional-dependencies], and one requires-dist row per member with an extra == marker, plus provides-extras. The half of the sentence that was true is kept and sharpened: a plain uv sync does not install the extra — that takes --extra local-inference — but editing those lines without re-locking leaves the lockfile stale and uv lock --check fails on it.
  • AnnotationPage.tsxonConfigureInference was documented as "expected to be absent for now: the Inference surface waits on Inference section — user-configured model connections #421's open rail question". That surface shipped in feat(app): Inference section, rail entry, download-size surface (#421 slice 2) #454, and frontend/app/src/routes.tsx:331 passes the prop. The prop stays optional for the real reason — ui-core imports no router and cannot know whether its host has such a screen.
  • inference/__init__.py and tests/architecture/test_optional_runtime.py — two ragged docstring wraps left by the edit that added torchvision to the enumerations. ruff does not reflow docstrings, which is why they passed every gate.

Found, not fixed

What the sweep did not find

No TODO/FIXME/HACK markers on any feature surface, no commented-out code, no .tmp/.bak/spike-residue files tracked or untracked, no unreachable branches. ruff --select ERA,ARG,PIE,RUF,F401,F841,B007 over every backend feature module reported exactly the two unused parameters — one of which is #463 — and nothing else. src/visionset/mcp/ has no inference surface at all.

Gate

Every stage run in this worktree, exit code recorded. Split by directory because of the ~10-minute command ceiling on this machine; the split is ls tests/ at run time, and tests/scripts is node --test, covered by the frontend stage.

Stage Command Exit
pytest A pytest tests/{architecture,cli,examples,fixtures,formats,inference,jobs,mcp,packaging,test_versioning.py} 0 — 988 collected
pytest B pytest tests/kernel 0 — 1381 collected
pytest C pytest tests/server 0 — 628 collected
lint ruff check . 0 — all checks passed
format ruff format --check . 0 — 341 files already formatted
types mypy src/visionset 0 — no issues in 150 source files
imports lint-imports 0 — 4 contracts kept, 0 broken
lock uv lock --check 0 — the comment corrected above, verified
frontend scripts/check.sh frontend 0 — annotator 904 passed, ui-core 806 passed, app build, node --test script gates
generated scripts/check.sh generated 0 — openapi, generated client and MCP tool reference: no drift
browser scripts/check.sh browser 0 — e2e 233 passed, cycle 1 passed (ports 18411/20459/22507)

Counts rather than pass lines for the pytest stages: addopts = "-q" in pyproject.toml plus the explicit -q makes -qq, which suppresses the summary line. The exit codes are the record.

Closes #459

Closes #464

Three tests in tests/inference/test_provider.py were re-created in
test_providers.py when the family resolver got its own file, and the
originals were never removed — one of them character-for-character the
same name. Each survivor is the stronger test: it drives provider_for
through a real InferenceConnectionService rather than a hand-built model.

best_of never read its `masks` argument; the choice comes entirely from
the IoU head's scores. ConnectionAction had no importers and, unlike its
three neighbours, was not package API either.

Four comments no longer described the code beneath them: pyproject's
claim that uv.lock does not carry extras (it carries them twice),
AnnotationPage's note that the Inference surface had not shipped yet, and
two ragged docstring wraps.

No behaviour changes.

Closes #459
@JArmandoAnaya JArmandoAnaya added this to the 0.1.0 milestone Aug 9, 2026
@JArmandoAnaya JArmandoAnaya added documentation Improvements or additions to documentation frontend annotator / ui-core / app packages backend visionset Python distribution — kernel, server, cli, mcp, formats labels Aug 9, 2026
@JArmandoAnaya
JArmandoAnaya merged commit ac0c645 into main Aug 9, 2026
13 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the chore/autolabel-cleanup branch August 9, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend visionset Python distribution — kernel, server, cli, mcp, formats documentation Improvements or additions to documentation frontend annotator / ui-core / app packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-labeling cleanup: remove what the fast slices left behind pyproject.toml says uv.lock does not carry extras; it does

1 participant