Skip to content

Move the ASTRAL and ModelTest-NG command builders out of Run.ts #421

Done

Description

@jtklein-agents

Parent

#419

What to build

Create src/app/store/command/ and move the two small command builders, the command string and the settings-file text into it. The RAxML and RAxML-NG builders stay in Run.ts for the next ticket.

  • command/astral.ts: astralArgs( run: AstralInput, platform: Platform ): string[][].
  • command/modeltestNg.ts: modeltestNgArgs( run: ModeltestNgInput, platform: Platform ): CmdArg[][].
  • command/index.ts: the CmdArg type, the Platform type ({ windows: boolean }), the command string function and the settings-text function.

Each builder declares its own input interface in its own file, listing only the members it reads, mirroring the nesting Run has today. AstralInput is outputDir, outputNameSafe and astralTree. ModeltestNgInput is outputDir, outputNameSafe, dataType, finalAlignment: { path } and numThreads: { value }. The platform is the second argument; no file under command/ reads host.

The command string function takes the binary name, the argument lists, and whether the binary is ASTRAL. The settings-text function takes the app version, the analysis title, the binary's name and version, the output folder, and the argument lists. Neither takes a run.

In Run.ts: the astralArgs and modeltestNgArgs methods are removed. The args getter calls the two moved builders with this and { windows }, and still calls this.raxmlNgArgs() and this.raxmlArgs(). The command and settingsFileContent getters stay and call the two new functions. CmdArg is imported from command/.

Builder bodies move with this. replaced by run. and no other edit; comments move with the code. The typed shape was checked against the real Run in commandInput.prototype.ts; copy from it, don't merge its branch.

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

Acceptance criteria

  • command/astral.ts, command/modeltestNg.ts and command/index.ts exist with the signatures above
  • No file under command/ imports Run, MobX or host
  • Run has no astralArgs or modeltestNgArgs member
  • run.args, run.command and run.settingsFileContent are still getters on Run and still listed in its makeObservable call
  • 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
  • No view, RunOptions.ts, Alignment.ts or FinalAlignment.ts changes
  • yarn verify passes

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