Skip to content

refactor(cli P1): CategorySpec registry — one source for category dispatch (#74) - #80

Merged
shujaatTracebloc merged 2 commits into
developfrom
refactor/p1-category-registry
Jun 19, 2026
Merged

refactor(cli P1): CategorySpec registry — one source for category dispatch (#74)#80
shujaatTracebloc merged 2 commits into
developfrom
refactor/p1-category-registry

Conversation

@LukasWodka

Copy link
Copy Markdown
Contributor

Summary

Phase 1 of the CLI ingestion consolidation (epic backend#828) — collapse the four drifting category enumerations into one CategorySpec registry.

The CLI enumerated task categories in four hand-maintained places that had drifted:

This consolidates them into one ordered CategorySpec registry. The family predicates (IsImage / IsTabular / IsText / IsRegressionClass), the --category help, 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_segmentation stay known-but-unsupported, each carrying a per-category UnsupportedNote.

Test plan

  • gofmt clean · go build ./... · go test ./... (all 6 packages) green.
  • ✅ New 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

…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>
Sign up for freeto 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.

3 participants

@LukasWodka@shujaatTracebloc@saadqbal