feat(family-api): add FAMILIES const and family-taxonomy tests#60
Open
kingchenc wants to merge 2 commits into
Open
feat(family-api): add FAMILIES const and family-taxonomy tests#60kingchenc wants to merge 2 commits into
kingchenc wants to merge 2 commits into
Conversation
Introduce `wickra_core::FAMILIES`, a `&'static [(&str, &[&str])]` mapping every built-in indicator to one of 16 families (Moving Averages, Momentum Oscillators, Trend & Directional, Price Oscillators, Volatility & Bands, Bands & Channels, Trailing Stops, Volume, Price Statistics, Ehlers / Cycle (DSP), Pivots & S/R, DeMark, Ichimoku & Charts, Candlestick Patterns, Market Profile, Risk / Performance). Two compile-time-anchored guards make sure the const stays trustworthy: - `no_duplicates_across_families`: no indicator is listed in two families - `total_count_matches_expected`: hard-coded total bumps in lockstep with the indicator catalogue (214 today), so any new indicator added without being filed under a family trips the test. Also corrects the module doc comment which falsely claimed indicators were grouped by category internally; the `mod` block is alphabetical, and the canonical taxonomy now lives in `FAMILIES`.
This was referenced May 27, 2026
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
wickra_core::FAMILIES: &[(&str, &[&str])]mapping every built-in indicator to one of 16 families (the same taxonomy already used in README's Indicators table).family_testsmodule with two guards:no_duplicates_across_families— every indicator lives in exactly one family.total_count_matches_expected— hard-coded total (214 today) drifts in lockstep with the indicator catalogue. Adding a new indicator without filing it under a family trips this test, surfacing the omission early.crates/wickra-core/src/indicators/mod.rsthat claimed modules were grouped by category — they are alphabetical, the canonical taxonomy now lives inFAMILIES.Why
Today, family membership is duplicated across the README table, the Wiki overview, and per-binding section comments — each maintained by hand.
FAMILIESbecomes the machine-readable single source of truth that downstream surfaces can be generated from in follow-up work (Python__init__.py, Nodeindex.d.ts, Wiki sidebar, etc.). This PR ships the Rust surface only; binding surfaces are deliberately out of scope.Scope
crates/wickra-core/src/indicators/mod.rs,crates/wickra-core/src/lib.rs(re-export).