Skip to content

refactor(taxonomy): pin the CLI registry == schema both ways; drop dead instance_segmentation (#1005)#189

Open
LukasWodka wants to merge 1 commit into
developfrom
feat/1005-taxonomy-contract
Open

refactor(taxonomy): pin the CLI registry == schema both ways; drop dead instance_segmentation (#1005)#189
LukasWodka wants to merge 1 commit into
developfrom
feat/1005-taxonomy-contract

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The task taxonomy lives in 5 hand-synced copies across 3 repos (#1005). The only actual divergence is instance_segmentation — in the CLI registry (16th entry) but deliberately absent from the ingest.v1 schema and the ingestor registry.

The "decide first" question (planned vs dead) is settled by the ingestor: instance_segmentation is dead — it "briefly shipped with no validators and no file transfer, so configs half-ingested (DB rows + API records, zero files staged)" and was removed (data-ingestors constants.py, #240/#99). So this drops it from the CLI rather than keeping a misleading "not implemented" placeholder.

What changed (CLI third of #1005)

  • Remove instance_segmentation from categoryRegistry — registry is now == the schema enum (15 == 15) — and from the two tests + code comments that named it. It now hits the "unrecognized category" gate like any other non-category (still exit 2).
  • Add TestRegistryWithinSchema — the reverse of the existing TestRegistryCoversSchemaCategories (schema ⊆ registry). Together they pin registry == schema both ways, so the registry can neither fall behind the schema (a valid --category wrongly rejected as "unrecognized" — the token_classification RC drift) nor carry an extra the ingestor won't accept (the instance_segmentation half-ingest class).
  • A future known-but-unschema'd placeholder must be declared in the new registryAliases allow-list (empty today) — an intentional superset is explicit, never silent. Exactly the #1005 proposal. Factored the schema-enum parse into a shared helper.
  • Mutation-verified the new gate bites: re-adding instance_segmentation fails TestRegistryWithinSchema with an actionable message.

Scope

  • data-ingestors already pins registry == schema (test_category_congruence.py + test_schema_validation). ✔ Nothing needed.
  • backend copies (UserDataSet.CATEGORY_CHOICES + global_meta/constants.py) still carry instance_segmentation and aren't tied to the schema — a separate PR: it needs a choices migration, and global_meta is slated for deletion. #1005 stays open until that lands.

Type

Tech-debt / correctness · cli · RFC-0002 foundation. Part of backend#1005 (ties RFC-0002 §9 / cli#174). Part of the data-ingest epic backend#1008.


Note

Low Risk
Category taxonomy and validation messaging only; no auth, staging, or submit path changes. Slight behavior change for the removed dead category string.

Overview
Aligns the CLI category registry with the embedded ingest.v1 schema enum by removing dead instance_segmentation (not in schema/ingestor; previously caused half-ingest risk) and tightening parity tests.

Registry & behavior: instance_segmentation is gone from categoryRegistry and related docs/comments. --category=instance_segmentation now follows the unrecognized category path (exit 2), not the known-but-unsupported message. README roadmap/status no longer lists it as a future CLI task.

Tests: Adds TestRegistryWithinSchema (registry ⊆ schema, with an explicit empty registryAliases allow-list) alongside the existing schema ⊆ registry test, so registry == schema both ways. Shared schemaCategoryEnum helper reads the embedded schema; hand-maintained expected lists and ingest gate tests are updated accordingly.

Reviewed by Cursor Bugbot for commit 6e40580. Bugbot is set up for automated code reviews on this repo. Configure here.

…ad instance_segmentation (#1005)

The task taxonomy lives in 5 hand-synced copies across 3 repos; the only
divergence today is instance_segmentation — present in the CLI registry (16th
entry) but deliberately absent from the ingest.v1 schema + the ingestor
registry. #1005's "decide first" question (planned vs dead) is settled by the
ingestor: instance_segmentation is DEAD — it "briefly shipped with no
validators and no file transfer, so configs half-ingested" and was removed
(data-ingestors constants.py, #240/#99). So this drops it from the CLI, rather
than keeping a misleading "not implemented" placeholder.

- Remove instance_segmentation from categoryRegistry (registry now == the
  schema enum, 15 == 15) and from the two tests + code comments that named it
  as a known/pending category. It now falls to the "unrecognized category"
  gate like any other non-category (still exit 2; test unchanged in outcome).
- Add TestRegistryWithinSchema — the reverse of the existing
  TestRegistryCoversSchemaCategories (schema ⊆ registry). Together they pin
  registry == schema BOTH ways, so the registry can neither fall behind the
  schema (a valid --category rejected as "unrecognized" — the
  token_classification RC drift) nor carry an extra the ingestor won't accept
  (the instance_segmentation half-ingest class). A future known-but-unschema'd
  placeholder must be DECLARED in the new registryAliases allow-list (empty
  today), so an intentional superset is explicit, never silent — exactly the
  #1005 proposal. Factored the schema-enum parse into a shared helper.
- Mutation-verified the new gate bites: re-adding instance_segmentation to the
  registry fails TestRegistryWithinSchema with an actionable message.

This is the CLI third of #1005. data-ingestors already pins registry == schema
(tests/test_category_congruence.py + test_schema_validation). Remaining: the
backend copies (UserDataSet.CATEGORY_CHOICES + global_meta/constants.py) still
carry instance_segmentation and aren't tied to the schema — a separate PR
(it needs a choices migration, and global_meta is slated for deletion).

Part of backend#1005 (ties RFC-0002 §9 / cli#174). Part of the data-ingest
epic backend#1008.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LukasWodka

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6e40580. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant