refactor(cli): rename the dynamic command to run + tighten CLI option typing#12
Merged
Merged
Conversation
… typing The user-facing command has been `run` for a while, but the internal symbols and prose still said `dynamic`. Align the code with the shipped name and remove the leftover references. Renames (all internal/public API + docs): - DynamicCommand -> RunCommand (+ file), DynamicRequest -> RunRequest, DynamicResult -> RunResult, DynamicTargetKind -> RunTargetKind, DynamicInput -> RunInput, DynamicFields -> RunFields - validateDynamic -> validateRun, runDynamic/#runDynamic -> runTrace/#runTrace - the colliding descriptors `RunRequest` (Omit alias) -> NormalizedRunRequest - logger component, help/hint strings, comments, and the dynamic-diagnostics test -> run-diagnostics Typing: the Cli handlers took `options: any` despite typed Raw*Input interfaces already existing — type them (RawRunInput/RawGraphInput/…, OutputOptions). CDP-boundary and catch(error: any) left as-is (justified). Deliberately NOT renamed: Next.js `export const dynamic = "force-dynamic"` route config and the LSP `dynamicRegistration` capability — those are framework-owned identifiers, not our command. Verified: tsc --noEmit clean, full build (CLI + UI) green, 76/77 tests pass (1 Postgres test skipped, needs a live DB). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR aligns internal naming and documentation with the already-shipped trace run command by removing legacy dynamic terminology, and improves type safety in the CLI layer by replacing any option objects with the existing Raw*Input/OutputOptions types.
Changes:
- Renames internal “dynamic” symbols to “run” (
DynamicCommand→RunCommand,validateDynamic→validateRun,runDynamic→runTrace, etc.) and updates logs/help text/docs accordingly. - Tightens CLI handler typing by switching
options: anytoRawRunInput/RawGraphInput/… andOutputOptions. - Resolves the
RunRequesttype-name collision by renaming the IO-tier “normalized request” alias toNormalizedRunRequest.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ui/app/page.tsx | Updates UI hint text to use trace run … example. |
| test/run-diagnostics.test.js | Renames diagnostics test wiring to use RunCommand. |
| test/journey.test.js | Updates test prose to reference RunCommand. |
| test/io-validators.test.js | Updates validator test to call validateRun. |
| test/io-processing.test.js | Renames orchestration tests from runDynamic to runTrace and updates fake command naming. |
| test/io-input.test.js | Updates test prose to reference RunInput / #runTrace. |
| src/shared/runTool.ts | Updates comment to refer to “run/graph” commands. |
| src/shared/codes.ts | Updates section header comment for run-related codes. |
| src/io/ProcessingManager.ts | Switches injected command to RunCommand and renames runDynamic → runTrace. |
| src/io/InputValidator.ts | Renames DTO validation from DynamicInput/validateDynamic to RunInput/validateRun. |
| src/io/InputManager.ts | Calls validateRun and updates doc comment terminology. |
| src/io/InputError.ts | Updates comment to reference RunInput.validate(). |
| src/io/index.ts | Re-exports NormalizedRunRequest instead of the colliding RunRequest alias. |
| src/io/descriptors.ts | Renames normalized request alias to NormalizedRunRequest. |
| src/index.ts | Updates public exports to RunCommand (+ related types). |
| src/engine/Tracer.ts | Updates comment to reference RunCommand. |
| src/cli/commands/TraceCommand.ts | Updates comment to list (run, graph, doctor) trace-producing commands. |
| src/cli/commands/ShellAnalysisCommand.ts | Updates comment to reference “run/graph” commands. |
| src/cli/commands/ServeCommand.ts | Updates dashboard hint string to trace run …. |
| src/cli/commands/RunCommand.ts | Renamed command implementation/types to RunCommand/RunRequest/RunResult and updates logger component. |
| src/cli/commands/GraphCommand.ts | Updates comment to reference “run command” for failure behavior analogy. |
| src/cli/commands/DoctorCommand.ts | Updates tool-purpose string from dynamic → run. |
| src/cli/CommandInputs.ts | Renames validated DTO from DynamicInput to RunInput. |
| src/cli/Cli.ts | Types CLI action handlers with Raw*Input and renames #runDynamic → #runTrace. |
| README.md | Updates library example import/usage to RunCommand. |
| docs/MIGRATION.md | Updates legacy file-map example to run.js. |
| Dockerfile | Updates usage example from trace dynamic … to trace run …. |
| docker-compose.yml | Updates usage example from trace dynamic … to trace run …. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 free
to 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.
What
Two cleanups requested together:
1.
dynamic→runrenameThe user-facing command has been
runfor a while, but internal symbols and prose still saiddynamic. This aligns the code with the shipped name.DynamicCommand→RunCommand(+ file rename),DynamicRequest→RunRequest,DynamicResult→RunResult,DynamicTargetKind→RunTargetKind,DynamicInput→RunInput,DynamicFields→RunFieldsvalidateDynamic→validateRun,ProcessingManager.runDynamic/Cli.#runDynamic→runTrace/#runTraceRunRequest(theOmit<…, "onProgress">alias) →NormalizedRunRequestcomponent, help/hint strings, comments, README API example, Dockerfile/docker-compose/MIGRATION.md examples, and thedynamic-diagnosticstest →run-diagnostics2. CLI option typing
The
Clihandlers tookoptions: anyeven though typedRaw*Inputinterfaces already existed. They're now typed (RawRunInput/RawGraphInput/…,OutputOptions). CDP-boundaryanys (untypedchrome-remote-interface) andcatch (error: any)left as-is — those are justified.Deliberately NOT renamed
export const dynamic = "force-dynamic"route config (4 routes) — framework-reserved export name + enum value; renaming silently breaks route caching.dynamicRegistrationcapability — a field of the protocol'sClientCapabilitiestype; renaming failstsc.MIGRATION.md:225— the line that documents the rename ("trace run— chosen over the earlierdynamicworking name"); removing the word would make it self-contradictory.Verification
tsc --noEmitclean🤖 Generated with Claude Code