Documentation
¶
Overview ¶
Package examples embeds the catalogue of runnable Pulse request JSON files and exposes a search/get API over them.
Every embedded JSON carries a top-level _meta block describing the example's name, category, taxonomy tags, the operators it uses, and a one-sentence description. Pulse's types.Request unmarshaler ignores unknown fields by default, so _meta is invisible at execution time — the examples remain runnable verbatim.
Get returns the example with the _meta block stripped, so callers can hand the JSON straight to pulse_process / pulse_predict.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CanonicalTags = []string{
"time-series", "cohort-analysis", "experiment-analysis", "correlation-analysis",
"comparison", "before-after", "top-n", "distribution-shape", "cross-tabulation",
"proportion-analysis", "trend-detection", "outlier-detection", "cardinality-analysis",
"data-quality", "financial", "feature-engineering",
"hypothesis-test", "t-test", "parametric", "nonparametric", "paired", "one-sample",
"two-sample", "k-sample", "repeated-measures", "post-hoc",
"normality-test", "homogeneity-test", "exact-test",
"regression", "ecological",
"ols", "glm", "logistic", "bayesian",
"regularization", "ridge", "lasso", "elasticnet",
"polynomial", "resampling", "jackknife", "selection", "stepwise",
"tier-1-test", "tier-2-test", "composed", "pre-filter", "feature-pipeline",
"window-operator", "streaming-friendly", "buffered-pipeline",
"leakage-safe", "leakage-risk", "small-sample",
"facet",
"sharded", "anchor",
}
CanonicalTags is the curated taxonomy every annotated example must draw from. Kept here (rather than embedded in a separate file) so the validation gate can compare directly without round-tripping through a disk asset.
Functions ¶
func AllCategories ¶
func AllCategories() []string
AllCategories returns every directory the library indexes, sorted alphabetically.
func AllTags ¶
func AllTags() []string
AllTags returns every taxonomy tag the library currently uses, sorted alphabetically. Derived from the indexed examples — not the canonical allowlist — so callers see exactly what is tagged today.
func IsCanonicalTag ¶
IsCanonicalTag reports whether tag belongs to the curated taxonomy.
Types ¶
type Example ¶
type Example struct {
Name string `json:"name"`
Category string `json:"category"`
Tags []string `json:"tags"`
Operators []string `json:"operators"`
Description string `json:"description"`
Body json.RawMessage `json:"body"`
}
Example is the full record returned by Get. Body carries the request JSON with the _meta block stripped, so it can be handed verbatim to pulse_process / pulse_predict.
type ExampleSummary ¶
type ExampleSummary struct {
Name string `json:"name"`
Category string `json:"category"`
Tags []string `json:"tags"`
Operators []string `json:"operators"`
Description string `json:"description"`
}
ExampleSummary is the lightweight projection used by Search results.
func Search ¶
func Search(query string, tags []string, category string) []ExampleSummary
Search returns summaries matching all three filters. An empty filter is treated as "no constraint" for that dimension.
- query (case-insensitive substring) matches against name, description, and every operator. Score = number of distinct matches across the three fields; ties break alphabetically by name.
- tags is ANDed: an example must carry every requested tag.
- category is an exact directory match.
Returns a non-nil empty slice when nothing matches.