Comfy-Org / Comfy-Org/ComfyUI_frontend
[test-recorder] Consolidate duplicated flag/target/tag parsing; unify divergent --backend/--distribution and tag semantics
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 702
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 512
Description
### Problem
Flag parsing/validation is duplicated per command with divergent semantics:
- Backend/distribution precedence, URL normalization, and lookup are implemented independently in `src/commands/recordPrefill.ts:30-46` and `src/index.ts:116-163` — `check` rejects `--backend` + `--distribution` together while `record` silently gives backend precedence.
- Tag validation: `plan` uses `filterKnownTags` and keeps valid tags (`src/commands/plan.ts:130-133`), while `recordPrefill` rebuilds a registry Set and discards the entire prefill on one unknown tag (`src/commands/recordPrefill.ts:62-67`).
- Each command re-lists value-taking flags and re-converts tags/feature-flags (`src/index.ts:13-28,45-73,86-113,116-164,202-239`); unknown flags are silently accepted.
- `--description` is validated in both the entry point and `runPlan` (`src/index.ts:95-102`, `src/commands/plan.ts:111-114`).
### Suggested fix
One typed command definition per command (positionals, flags, defaults, validation, handler) with shared codecs for tags, feature flags, and target (distribution/backend) resolution; reject unknown flags before dispatch.
_Line references are against branch `cb/comfy-test-usability` (PR #15837); adjust after merge._
Contributor guide
Assessment
This issue has not been assessed yet.