Repository navigation
Unified gene search for client, CLI & MCP (sub-project C) - #14
Merged
Merged
Conversation
…e bronze by default
Shared fixture (Ensembl-keyed, legacy NA feature_id, bronze dataset) and the expected memberships from spec §3, mirrored by the engine's A tests.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
==========================================
+ Coverage 91.67% 92.00% +0.33%
==========================================
Files 19 19
Lines 1429 1476 +47
==========================================
+ Hits 1310 1358 +48
+ Misses 119 118 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Unified gene search for the client, CLI & MCP (sub-project C)
Brings the
sddbSDK, CLI, andsddb-mcpserver to the same gene-search semantics as the web (sub-project B) and engine (A): multi-gene AND, search by symbol OR Ensembl id, and bronze included by default (flagged) — fixing today's single-symbol, exact-match,validation="pass"behavior.Sub-project C of the unified gene-search design (
docs/superpowers/specs/2026-10-08-gene-search-design.md, §5). No new server-side artifact — the client builds the symbol↔feature_id resolution from the existinggene_index.parquetit already downloads.What changed
GeneIndex(genes.py) — newresolve(tokens);where_expressed(genes: str | list[str], *, mode="all"|"any", min_fraction=None, validation=None)resolves each token by symbol OR Ensemblfeature_id(casefolded), AND-intersects (or unions) across genes;rankednow also matches Ensembl ids. Default flipped tovalidation=None→ bronze included, with avalidation=opt-out; rows carryvalidation_status/tier. Casefolded columns cached once (the index is ~11M rows).Catalog.query—expressingaccepts one gene or a list +mode; single-string stays back-compat; validatesmodeup front; no double validation filtering.genestool —genes(symbols, organism, tissue, disease, assay, mode="all", include_bronze=True); facets + genes compose throughquery.query --generepeatable (AND;--expressingkept as alias);genesaccepts multiple genes (one → ranked detection table, several → AND membership) with a--validationopt-out; bronze flagged in output.datasets_withalias, single-symbol calls, andcatalog.query(expressing="SYM")all unchanged in behavior (minus the deliberate bronze-default flip).Safety
feature_idis nullable"string"(pd.NAfor legacy symbol-only genes) — all resolution is vectorised with.fillna(False), never a scalar NA truth-test (the crash class that bit sub-project A, caught there by the final review).Tests
pytest— 270 passing, including a cross-surface consistency guard (test_cross_surface_canonical_membership) pinning the client's gene→dataset membership to the spec §3 canonical rules A's engine tests encode, so the two repos can't silently diverge; plus real-pd.NAfixtures, AND/ANY, bronze default, and symbol↔Ensembl parity across SDK/CLI/MCP.Built subagent-driven (per-task + opus whole-branch review); the per-task review caught a CLI single-gene Ensembl gap, now fixed at the source (
ranked) with a parity test.Follow-up (non-blocking)
Spec §5 asks the MCP/CLI-multi results to carry per-gene detection (
fraction_obs_detected) per dataset; v1 returns catalog rows + membership only (detection is ambiguous under multi-gene AND — which gene's number?). The single-gene CLIgenestable already shows detection viaranked. A per-gene detection sub-record is a clean fast-follow if wanted.