Comfy-Org / Comfy-Org/ComfyUI_frontend

[test-recorder] Decompose record.ts monolith into prompt-free services plus an interactive adapter

Open
#15,847 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:testing developer experience
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Problem
`src/commands/record.ts` (~590 lines of `runRecord`) directly owns prompts, git/PR checkout, prerequisite checks, dependency install, dev-server lifecycle, recorder execution, transformation, file writing, agent cleanup, and PR creation (`src/commands/record.ts:1-45,146-223,225-279,281-615,617-719,759-814`). Consequences:

- Interactive concerns leak across every subsystem; any new prompt/mode requires editing one long causal sequence with hidden ordering.
- The prefill layer (`src/commands/recordPrefill.ts:14-87`) validates most fields but passes `workflow` through unchecked — "valid prefill skips prompts" depends on filesystem state deep inside the interactive command.
- `record` bypasses `transform`'s own command boundary, calling transform internals and file writes directly (`src/commands/record.ts:642-719` vs `src/commands/transform.ts:8-65`), so defaults/overwrite policy/summaries can diverge.

### Suggested fix
Introduce a typed `RecordingSessionConfig` and prompt-free services (`prepareCheckout`, `resolveSetup`, `prepareEnvironment`, `captureSession`, `transformToSpec`, `publishRecording`) returning structured outcomes. Keep Clack prompts in an adapter that only fills missing/invalid config fields. This also directly serves the parity contract (see companion issue).

_Line references are against branch `cb/comfy-test-usability` (PR #15837); adjust after merge._

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.