Skip to content

refactor(cli): rename the dynamic command to run + tighten CLI option typing#12

Merged
burrows99 merged 1 commit into
masterfrom
refactor/rename-dynamic-to-run
Jun 19, 2026
Merged

refactor(cli): rename the dynamic command to run + tighten CLI option typing#12
burrows99 merged 1 commit into
masterfrom
refactor/rename-dynamic-to-run

Conversation

@burrows99

Copy link
Copy Markdown
Owner

What

Two cleanups requested together:

1. dynamicrun rename

The user-facing command has been run for a while, but internal symbols and prose still said dynamic. This aligns the code with the shipped name.

  • DynamicCommandRunCommand (+ file rename), DynamicRequestRunRequest, DynamicResultRunResult, DynamicTargetKindRunTargetKind, DynamicInputRunInput, DynamicFieldsRunFields
  • validateDynamicvalidateRun, ProcessingManager.runDynamic/Cli.#runDynamicrunTrace/#runTrace
  • the colliding descriptors RunRequest (the Omit<…, "onProgress"> alias) → NormalizedRunRequest
  • logger component, help/hint strings, comments, README API example, Dockerfile/docker-compose/MIGRATION.md examples, and the dynamic-diagnostics test → run-diagnostics

2. CLI option typing

The Cli handlers took options: any even though typed Raw*Input interfaces already existed. They're now typed (RawRunInput/RawGraphInput/…, OutputOptions). CDP-boundary anys (untyped chrome-remote-interface) and catch (error: any) left as-is — those are justified.

Deliberately NOT renamed

  • Next.js export const dynamic = "force-dynamic" route config (4 routes) — framework-reserved export name + enum value; renaming silently breaks route caching.
  • LSP dynamicRegistration capability — a field of the protocol's ClientCapabilities type; renaming fails tsc.
  • MIGRATION.md:225 — the line that documents the rename ("trace run — chosen over the earlier dynamic working name"); removing the word would make it self-contradictory.

Verification

  • tsc --noEmit clean
  • full build (CLI + Next.js UI) green
  • 76/77 tests pass (1 Postgres round-trip skipped — needs a live DB)

🤖 Generated with Claude Code

… 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>
Copilot AI review requested due to automatic review settings June 19, 2026 11:20
@burrows99 burrows99 merged commit 1430928 into master Jun 19, 2026
2 checks passed
@burrows99 burrows99 deleted the refactor/rename-dynamic-to-run branch June 19, 2026 11:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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” (DynamicCommandRunCommand, validateDynamicvalidateRun, runDynamicrunTrace, etc.) and updates logs/help text/docs accordingly.
  • Tightens CLI handler typing by switching options: any to RawRunInput/RawGraphInput/… and OutputOptions.
  • Resolves the RunRequest type-name collision by renaming the IO-tier “normalized request” alias to NormalizedRunRequest.

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 runDynamicrunTrace.
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 dynamicrun.
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.

Sign up for free to 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.

2 participants