Uh oh!
There was an error while loading. Please reload this page.
refactor(cli P1): CategorySpec registry — one source for category dispatch (#74) - #80
Merged
Merged
Conversation
…patch (#74) The CLI enumerated task categories in four hand-maintained places that had drifted: the `--category` help listed 5 of 9 (#74), the push accept-gate hand-listed the supported set twice, the interactive picker kept its own list, and internal/push/category.go held four separate family maps. Consolidate into one CategorySpec registry (internal/push/category.go): each category's family, label, regression-class flag, and CLI-support status lives in one ordered table. The family predicates (IsImage/IsTabular/IsText/IsRegressionClass), the `--category` help, the gate's "Supported:" lists, and the interactive picker now all derive from it, so the enumerations can't drift apart again. The help now lists all 9 supported categories. Behaviour-preserving: the gate accepts/rejects exactly the same set (IsCLISupported == the prior nine-category condition); only the help text and the now-registry-derived error messages change. semantic_/ instance_segmentation stay known-but-unsupported, each with a per-category UnsupportedNote. Adds a registry parity + predicate-derivation test (the anti-drift guard). First phase of the CLI ingestion consolidation epic (backend#828). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 17, 2026
Merged
shujaatTracebloc
approved these changes
Jun 18, 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 freeto 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
Phase 1 of the CLI ingestion consolidation (epic backend#828) — collapse the four drifting category enumerations into one
CategorySpecregistry.The CLI enumerated task categories in four hand-maintained places that had drifted:
--categoryflag help listed 5 of 9 (dataset push: --category help lists 5 of 9 categories, and unknown-vs-empty category errors give two different lists (one leaks unsupported segmentation) #74),internal/push/category.goheld four separate family maps.This consolidates them into one ordered
CategorySpecregistry. The family predicates (IsImage/IsTabular/IsText/IsRegressionClass), the--categoryhelp, the gate's "Supported:" messages, and the interactive picker now all derive from it — so the enumerations can't drift apart again.Closes#74.
Behaviour-preserving
The accept-gate accepts/rejects exactly the same set (
IsCLISupported== the prior nine-category condition). Only the help text (now lists all 9 supported categories) and the now-derived error messages change.semantic_segmentation/instance_segmentationstay known-but-unsupported, each carrying a per-categoryUnsupportedNote.Test plan
gofmtclean ·go build ./...·go test ./...(all 6 packages) green.internal/push/category_registry_test.go: pins the 11-category registry set, the 9-category supported set (semantic_/instance_segmentation known-but-unsupported with a note), and that every family predicate derives from the registry — the anti-drift guard.Scope
The foundational, low-risk phase. The registry is intentionally extensible — P2 hangs the dispatch (
discoverFn/buildFn,allowedFlags) off the same specs (closing #77 and collapsing the remaining switches + the four parallel walkers). The decision-heavy phases (P4 push idempotency #70, P5 cross-repo extension de-drift #68) await the epic discussion.🤖 Generated with Claude Code