Skip to main content

Module strategy

Module strategy 

Source
Expand description

§4.5 auto-strategy selection and §4.5 fallback grouping-field pick.

auto_strategy inspects an axis field’s value distribution across the items list and picks one of the §5.2 / §5.3 strategies:

  • Strategy::Exact for enum-detected fields (cardinality ≤ 20 OR ≤ √N, top values cover ≥ 80%) and small-cardinality integer enums.
  • Strategy::Prefix for path-like strings (≥ 50% contain a path separator (/, ::, or .) AND share at least one 2-segment prefix on that separator).
  • Strategy::Top for free-form strings as the catchall.
  • Strategy::Bands for continuous numeric fields.

pick_grouping_field is used when the user supplied no --by and no score was detected: scan all top-level string fields for a “discriminating” choice, with a small canonical preference list (data.path.text, path, file, module, kind, status, type).

Structs§

StrategyDetectionOptions
Tunable inputs for §4.5 strategy and grouping-field detection.

Functions§

auto_strategy
Auto-pick a strategy for a given axis field, given the items list.
auto_strategy_with_options
Auto-pick a strategy with caller-supplied heuristic thresholds.
pick_grouping_field
Pick the most-discriminating string field when no explicit --by was given AND no score was detected (§4.5 fallback).
pick_grouping_field_with_options
Pick the fallback grouping field with caller-supplied preferences.