Skip to content

Pin the generated commands for every analysis (#420) - #423

Merged
jtklein-agents merged 1 commit into
spec/419-split-command-building-out-of-run-tsfrom
420-pin-the-generated-commands-for-every-analysis
Nov 27, 2026
Merged

jtklein-agents merged 1 commit into
spec/419-split-command-building-out-of-run-tsfrom
420-pin-the-generated-commands-for-every-analysis

Conversation

@jtklein-agents

Copy link
Copy Markdown
Owner

Closes #420. Part of #419.

Summary

Command pins for today's Run: tests only, no production file changes.

src/
├── test/
│   └── commandPins.ts              # the one table of cases; imports the store inside pinCommands()
└── app/store/
    ├── Run.pins.test.ts            # host from the test setup, paths like /out
    ├── Run.pins.windows.test.ts    # sets a Windows host, resets modules, paths like C:\out
    └── __snapshots__/              # 61 snapshots per platform (the repo's first snapshot files)

Each pin builds a real Run (seed 123, 3 threads, fixed output folder and name, app version 2.0.0) and snapshots run.args.

per platform (57 tests, 61 snapshots)
  RAxML      8 analyses x bare / full / alternate      24
  RAxML-NG   6 analyses x bare / full / alternate      18
  branches the three variants miss                      4
    RAxML FT alternate with branch lengths
    RAxML FT with branch lengths + SH-like, default partition
    RAxML ML with SH-like, default partition
    RAxML-NG AS with two alignments (Run.ts:792, pinned as it is)
  unknown analysis (the empty `default:` arm)           2
  ModelTest-NG  nucleotide / protein / binary           3
  ASTRAL        with / without a loaded tree            2
  run.command + run.settingsFileContent, per binary     4  (8 snapshots)

Decisions a reviewer should know about:

  • Binaries are added to the list, not only picked from it. ASTRAL is commented out of the binary list on every platform and RAxML-NG is absent on Windows, so the table pushes the missing entries onto the exported binaries array. This also keeps the snapshots identical on ARM, x64 and one-CPU machines.
  • The RAxML-NG --threads branch is unreachable in the shipped app. The flag needs PTHREADS in the binary name and raxml-ng has none. The RAxML-NG full pins use a stand-in binary named raxml-ng-PTHREADS, so they record a command no shipped binary produces.
  • Bare ancestral-states pins end in a dangling -t / --tree: with no tree loaded the empty path is dropped and the flag stays. Today's behaviour, pinned as it is.
  • Overlap left in place. Four tests in Run.computeds.test.ts (settings file content, command start, raxml-ng/modeltest-ng command, && joining) partly overlap the pins. The ticket forbids changing other files, so they stay.

Evidence

  • Before: no test fixes a whole generated command.
    After:
$ CI=1 vitest run src/app/store/Run.pins      # second run, no snapshot writes
 Test Files  2 passed (2)
      Tests  114 passed (114)

$ yarn verify                                  # lint, typecheck, full suite
 Test Files  76 passed (76)
      Tests  618 passed (618)
  • Coverage figures: not available. The one-off coverage run asked for by the ticket did not happen: installing @vitest/coverage-v8 was blocked in the implementing session. Branch coverage of raxmlArgs, raxmlNgArgs, modeltestNgArgs, astralArgs, the args getter and the command getter was checked by reading the code, twice (implementer and an independent review that found three missed arms, now covered). To get the figures:
yarn add -D @vitest/coverage-v8@5.1.1
yarn vitest run src/app/store/Run.pins --coverage --coverage.include=src/app/store/Run.ts
git checkout package.json yarn.lock

package.json and yarn.lock are unchanged in this pull request. test:e2e was not run locally.

Merge Danger

Door: two-way

Tests and snapshots only; reverting the commit removes them.

Blast Radius: tests

A later change to a binary version in RunOptions.ts, or to any generated argument, now fails these snapshots. That is the point for #419; outside that spec it means a deliberate vitest -u.

🤖 Generated with Claude Code

One table of cases in src/test/commandPins.ts, run by two test files:
the host the test setup installs, and a Windows host with C: paths.
Each pin builds a real Run and snapshots run.args; run.command and
run.settingsFileContent are pinned once per binary.

Binaries the host's list lacks (ASTRAL, RAxML-NG on Windows, and a
PTHREADS-named RAxML-NG stand-in for the --threads branch) are added
to the list by the table.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jtklein-agents
jtklein-agents merged commit 97e7041 into spec/419-split-command-building-out-of-run-ts Nov 27, 2026
4 checks passed
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.

1 participant