Skip to content

MCP: pileup draws its figure without gtf or bam; modules never fits again through options; version 0.18.3 - #39

Merged
YPARK merged 1 commit into
mainfrom
fix-mcp-pileup-figure-and-modules
Oct 31, 2026
Merged

YPARK merged 1 commit into
mainfrom
fix-mcp-pileup-figure-and-modules

Conversation

@YPARK

@YPARK YPARK commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Two bugs in the MCP server, found in an audit of faba's MCP coverage.

pileup with figure and neither gtf nor bam always failed

The pileup tool's figure flag only chose the SVG as the output. The command enters figure mode on a figure flag, --gtf or --bam, and a recorded GFF isn't consulted until after the mode is chosen. So the child printed the ASCII pileup, wrote no SVG, and the call failed with "finished without writing ….miami.svg". --svg is blocked in options, so an agent couldn't work around it.

  • The tool now passes --svg when figure is asked without gtf or bam. The gene model comes from the annotation recorded with the data, if any.
  • The command line is built in pileup_argv, which a new test checks: --svg alone, or gtf/bam instead of it.
  • The Miami figure no longer warns that --svg is ignored, since an SVG is what it writes. --format, --png and --no-pdf still warn.
  • The tool's description no longer says figure needs gtf or bam.

modules could refit, and write over its tables, through options

MODULES_TAKEN was a hand-written list that had drifted from the options modules holds against a run's record. It lacked --membership-alpha, --community-gamma, --gene-alpha, --shift-sd and --cell-sd. Passing any of them in options at a value different from the record made plan() fit again, into data itself, through run_reading, so the step was never recorded.

  • The refused flags are now read off the modules command from cluster::MODEL_OPTIONS (now pub(crate)), every long flag, alias and short included, plus the sampler's --chains, --sweeps and --burn-in. An option added to MODEL_OPTIONS is refused without another list to update.
  • A new test checks that all eleven blockmodel options, and the --communities and --prior-strength aliases, are refused.

Version

0.18.3.

Testing

  • cargo fmt --all --check, cargo clippy --all-targets -- -D warnings and cargo test (733 unit tests and the integration suites) pass. The --features hdf5 build was not run here (no libhdf5).
  • New: mcp::tests::modules_refuses_every_option_that_would_fit_again and mcp::tests::a_pileup_figure_asked_alone_is_drawn.
  • Not tested: a pileup figure run end to end through the MCP server; the test checks the command line it builds.

…gain through options; version 0.18.3

- `pileup` with `figure` and neither `gtf` nor `bam` always failed: the
  command drew only on a figure flag, a GTF or BAMs, so it printed the
  ASCII pileup and wrote no SVG. It now gets `--svg`, which puts it in
  figure mode (the annotation recorded with the data draws the genes, if
  any). The figure no longer warns that `--svg` is ignored: it writes
  just that.
- `modules` refused only some of the options that make it fit again, so
  `--membership-alpha`, `--community-gamma`, `--gene-alpha`, `--shift-sd`
  or `--cell-sd` in `options` could refit and write over the tables. The
  refused flags are now read off the command from the blockmodel options
  `modules` holds against the tables' record (`cluster::MODEL_OPTIONS`),
  with every alias, so none can be missed.
@YPARK
YPARK merged commit bfa74a5 into main Oct 31, 2026
6 checks passed
@YPARK
YPARK deleted the fix-mcp-pileup-figure-and-modules branch October 31, 2026 18:12
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