Module pr_taxonomy

Module pr_taxonomy 

Source
Expand description

2026-09-26: The PR intent taxonomy (.github/pr-taxonomy.json): a tree of what a change is for (performance/decode, correctness/kv-cache), and the benchmarks each path implies. crate::gate::taxon is the separate hardware taxonomy derived from kernels/ paths.

Owner: bench gate (intent). Invariants:

  • benches_for is the union of _benches along the matched prefix, so descending further never removes a benchmark.
  • load returns only a tree that passed validate: at least two roots, kebab-case keys, no single-child node, and every _benches id in coverage::REQUIRED.

Structs§

Node
2026-09-26: One node of the parsed tree. Children keep the JSON file’s key order (the workspace enables serde_json’s preserve_order).

Functions§

benches_for
2026-09-26: Every benchmark a path implies: the union of _benches along it, so an ancestor’s benchmarks apply to every descendant. The walk stops at the first unknown segment and returns what matched so far.
benches_for_matched
2026-09-26: benches_for, plus how many leading segments matched, so a caller can report a stale segment (performance/decodes implies the same set as performance).
is_complete
2026-09-26: Whether path matches and ends at a leaf.
load
2026-09-26: Load and validate .github/pr-taxonomy.json from a repo root.
options_at
2026-09-26: The children of the node at path, when there are at least two. None for a leaf, a lone child (which resolve follows) or a path that does not match.
resolve
2026-09-26: path extended through every single-child step below it. validate refuses single-child nodes, so on a loaded tree this returns path unchanged.