Fix interactive branch-selection sending invalid --branches to HyPHY for FEL/SLAC/BUSTED/aBSREL (#141) - #142
Merged
Conversation
…ches (#141) The "Interactive" branch-selection mode is a UI concept (label branches on the tree). It must be translated to the HyPHY branch label "FG" before it reaches the --branches argument. The BUSTED and aBSREL backend parameter mappings passed config.branchesToTest verbatim, so an interactive selection produced `--branches Interactive`, which HyPHY rejects at startup: Error: 'Interactive' is not a valid choice passed to 'Choose the set of branches to test for selection'. PRIME already had this conversion; apply the same mapping to BUSTED and aBSREL. Built-in sets (All/Internal/Leaves/Unlabeled branches) still pass through unchanged. Add branch-selection-mapping.test.js covering the Interactive→FG conversion, built-in pass-through, and the default for all three single-set methods.
Auditing all methods for the same class of bug found two more reachable through the live UI (MethodSelector), which exposes an "Interactive" branch-selection option for FEL and SLAC: - FEL hardcoded `branches: 'All'`, silently discarding any user selection. - SLAC read `config.branches`, but the UI emits `config.branchesToTest`, so Interactive (and Internal/Leaves/Custom) fell back to 'All'. Both now use the same `Interactive -> FG` mapping as BUSTED/aBSREL/PRIME, keyed on `branchesToTest`. The WASM path already keyed on `branchesToTest` and was unaffected. FelOptions.svelte/SlacOptions.svelte are dead code (only imported by the orphaned MethodOptionsTab.svelte), so their differing key was not the live path. Extend branch-selection-mapping.test.js to cover FEL and SLAC.
Member
Author
|
Expanded scope after auditing all methods: the same bug class also affected FEL (hardcoded |
FelOptions.svelte and SlacOptions.svelte were the legacy per-method options UI, rendered only by MethodOptionsTab.svelte, which is itself imported by nothing — the live app uses MethodSelector.svelte (via AnalyzeTab.svelte). Their stale, differing `branches` config key was the source of confusion while fixing the interactive branch-selection bug in this PR. Removing them leaves a single source of truth for branch-selection UI. Deletes: - src/lib/MethodOptionsTab.svelte (orphaned) - src/lib/FelOptions.svelte - src/lib/SlacOptions.svelte - src/stories/FelOptions.stories.js - stale MethodOptionsTab entry in src/lib/README.md BranchSelector.svelte is retained (still used by MethodSelector.svelte). Build and full unit suite (245 tests) pass.
stevenweaver
force-pushed
the
fix/141-busted-interactive-branches
branch
from
July 14, 2026 16:36
c1bdc24 to
7cacef8
Compare
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.
Summary
Fixes #141 and audits the same bug class across every method. When a user picked the Interactive branch-selection mode, the backend runner passed a value HyPHY rejects (or silently dropped the selection), depending on the method:
"Interactive" is a UI concept (let the user label branches on the tree). The interactively-selected branches are tagged
{FG}in the submitted tree, so the correct--branchesvalue isFG.Root cause
In
BackendAnalysisRunner.prepareAnalysisParameters, the single-test-set methods handledconfig.branchesToTestinconsistently. Only PRIME convertedInteractive→FG. The rest were broken to varying degrees:config.branchesToTest || 'All'--branches Interactive→ job fails (the reported bug)config.branchesToTest || 'All'--branches Interactive→ job fails'All'config.branches || 'All'branchesToTest) → silently ignoredInteractive ? 'FG' : ...The live UI is
MethodSelector.svelte, which emitsbranchesToTestand exposes anInteractiveoption for FEL/SLAC/aBSREL/BUSTED/PRIME. (FelOptions.svelte/SlacOptions.svelteare dead code — only imported by the orphanedMethodOptionsTab.svelte— so their differing key was not the live path.)Fix
All five single-set methods now use the same mapping, keyed on
branchesToTest:Built-in sets (
All,Internal,Leaves,Unlabeled branches) pass through unchanged; default remainsAll. Tag-based methods (RELAX →test/reference, Contrast-FEL →branch-set) are unaffected and were verified correct. The WASM path (WasmAnalysisRunner) already keyed onbranchesToTestand converted correctly, so only the backend runner was affected.Tests
src/test/branch-selection-mapping.test.js(16 cases) covers, for FEL / SLAC / BUSTED / aBSREL / PRIME:Interactive→FGAllwhen unsetInteractivenever reaches--branchesFull unit suite passes (245 tests).