Skip to content

Move the RAxML and RAxML-NG command builders out of Run.ts #422

Done

Description

@jtklein-agents

Parent

#419

What to build

Move the two large command builders and the dispatch out of Run.ts. After this ticket Run.ts holds no command-building code.

  • command/raxmlNg.ts: raxmlNgArgs( run: RaxmlNgInput, platform: Platform ): CmdArg[][].
  • command/raxml.ts: raxmlArgs( run: RaxmlInput, platform: Platform ): CmdArg[][].
  • command/index.ts gains commandArgs( run: CommandInput, platform: Platform ): CmdArg[][], the dispatch that today lives in the args getter.

Each builder declares its own input interface in its own file, listing only the members it reads, mirroring the nesting Run has today. The partition choice (havePartitionFile, partitionFile, finalAlignment: { path, partitionFilePath, partition: { isDefault } }) and the two constraint trees ({ isSet, filePath }) are shared pieces used by both. Value types are copied as they are, including numRepetitions.value and numRepetitionsNg.value as number | string. CommandInput is the intersection of the four builder inputs plus usesAstral, usesModeltestNg and usesRaxmlNg; it must be a type intersection, because the two builders read different parts of tree. The full typed shape is in commandInput.prototype.ts; copy from it, don't merge its branch.

In Run.ts: the raxmlNgArgs and raxmlArgs methods are removed, and the args getter becomes return commandArgs( this, { windows } );. Imports that only the builders used (for example lodash/remove) leave with them.

Builder bodies move with this. replaced by run. and no other edit. Comments move with the code, including the old Python command notes. The 495-line RAxML switch is not restructured. The RAxML-NG ancestral-states builder keeps choosing its partition by "more than one alignment".

Add one small direct test per builder file that runs the builder on a plain object for both platforms.

Acceptance criteria

  • command/raxmlNg.ts and command/raxml.ts exist with the signatures above, and command/index.ts exports commandArgs
  • No file under command/ imports Run, MobX or host
  • Run has no raxmlArgs or raxmlNgArgs member, and its args getter only calls commandArgs
  • The moved builder bodies differ from the originals only by this. becoming run.; their comments moved with them
  • One direct test per builder file runs it on a plain object with windows: true and windows: false
  • No command pin snapshot file appears in the diff
  • The two @ts-expect-error lines in start and startAstral are unchanged
  • No view, RunOptions.ts, Alignment.ts or FinalAlignment.ts changes
  • yarn verify passes

Activity

  1. added
    ready-for-agent
    on Nov 27, 2026
  2. jtklein-agents commented on Nov 27, 2026

    @jtklein-agents
    OwnerAuthor

    Merged into spec/419-split-command-building-out-of-run-ts in #425 (966414f).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions