% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rule-engine.R
\name{run_taxonomic_key}
\alias{run_taxonomic_key}
\title{Run a taxonomic key (system-agnostic engine)}
\usage{
run_taxonomic_key(pedon, rules, level_key)
}
\arguments{
\item{pedon}{A \code{\link{PedonRecord}}.}

\item{rules}{A parsed rule set (output of \code{\link{load_rules}}).}

\item{level_key}{Name of the taxa list inside \code{rules}: typically
\code{"rsgs"} (WRB), \code{"orders"} (USDA), or
\code{"ordens"} (SiBCS).}
}
\value{
A list with \code{assigned} (the YAML entry of the assigned
        taxon) and \code{trace} (one entry per taxon tested).
}
\description{
Iterates over the taxa list at \code{rules[[level_key]]} in
canonical order; the first taxon whose tests pass is assigned.
\code{evaluate_rsg_tests} is reused as the per-taxon evaluator
regardless of system -- the test combinator semantics
(\code{all_of} / \code{any_of} / \code{default} /
\code{not_implemented_v01}) are the same in all three systems.
}
\details{
Used at the TOP level (RSG / Order / Ordem). For nested categorical
levels (subordens, grandes grupos, subgrupos, familias) iterate the
flat taxa list directly via \code{\link{run_taxa_list}}.
}
