pub struct Detection {Show 16 fields
pub head: String,
pub gates: Gates,
pub walked: usize,
pub recorded: usize,
pub latest: Vec<Step>,
pub earlier: Vec<Step>,
pub drift: Vec<Drift>,
pub new_at_head: Vec<Key>,
pub missing_at_head: Vec<Key>,
pub trend: Trend,
pub cutoff: Option<Cutoff>,
pub allow_empty: bool,
pub no_gate: bool,
pub accepted: BTreeMap<Key, Acceptances>,
pub offered: Acceptances,
pub ignored_trailers: Acceptances,
}Fields§
§head: String§gates: GatesEvery series’ gate, from tak.toml and [gate]. Policy of whoever runs
the check, as for tak compare: never read from the notes.
walked: usizeFirst-parent commits in the walk, recorded or not.
recorded: usizeHow many of them carry any measurement.
latest: Vec<Step>For every series measured at the head with an earlier point in the window: its step onto the head. The only steps that can fail.
earlier: Vec<Step>Steps above the gate that end before the head. Report-only.
drift: Vec<Drift>Report-only.
new_at_head: Vec<Key>Measured at the head with nothing earlier in the window to compare to.
missing_at_head: Vec<Key>Measured earlier in the window and not at the head.
trend: Trend§cutoff: Option<Cutoff>Set when the walk stopped before the window filled for a reason of its own, so a short history here may be the walk’s rather than the project’s.
allow_empty: boolWhether an empty comparison is accepted (allow_empty, from tak.toml,
TAK_ALLOW_EMPTY or --allow-empty) rather than failed. Carried here so
the report and the exit status cannot disagree.
no_gate: boolReport-only (--no-gate): nothing fails, an empty comparison included.
The same promise tak compare --no-gate makes, so a workflow that must
always exit successfully needs one flag, not two.
accepted: BTreeMap<Key, Acceptances>What each step onto the head may be accepted by: --accept, plus the
Tak-Accept trailers in that step’s own range. Per series, because two
series’ previous points can lie at different commits, and a trailer
outside a step’s range says nothing about that step.
offered: AcceptancesEvery acceptance offered, across all ranges, for reporting the ones that accepted nothing.
ignored_trailers: AcceptancesTrailers found but not honoured because accept_trailers is off.
Implementations§
Source§impl Detection
impl Detection
Sourcepub fn accept(
&mut self,
flags: &Acceptances,
trailer_logs: &BTreeMap<String, String>,
)
pub fn accept( &mut self, flags: &Acceptances, trailer_logs: &BTreeMap<String, String>, )
Apply acceptances to the steps onto the head.
flags is --accept, which covers every step. trailer_logs maps a
step’s from commit to the crate::notes::trailers output for
from..head, which is exactly that step’s range: pass it only when
accept_trailers is on. A benchmark name covers every tool and runner
class it was measured on, as in tak compare.
Sourcepub fn accepted_steps(&self) -> Vec<&Step>
pub fn accepted_steps(&self) -> Vec<&Step>
Steps onto the head that would fail, waived by an acceptance.
Sourcepub fn failures(&self) -> Vec<&Step>
pub fn failures(&self) -> Vec<&Step>
Steps onto the head beyond an enabled gate: what makes the command fail.
Only the head’s. A main-branch workflow runs this once per push, so failing on an older step would fail every run after the one that caused it, and a job that is always red is a job nobody reads.
Sourcepub fn reported(&self) -> Vec<&Step>
pub fn reported(&self) -> Vec<&Step>
Steps onto the head beyond a report-only gate: flagged, never failed on.
Sourcepub fn uniform(&self) -> bool
pub fn uniform(&self) -> bool
Whether every series in the report is held to the global gate.
When it is, the report reads exactly as it did before per-benchmark
gates existed — one N% in the prose, no gate column — for the same
reason tak compare keeps its wording: a project that never wrote a
per-benchmark gate should not have its output change under it.
Sourcepub fn nothing_compared(&self) -> bool
pub fn nothing_compared(&self) -> bool
No series at the head had anything to be compared against.
Sourcepub fn empty_fails(&self) -> bool
pub fn empty_fails(&self) -> bool
Whether comparing nothing fails the command.
By default it does. A check that passes when it examined nothing is indistinguishable, from the outside, from one that examined everything and found it clean — and the ways to get here by accident (a shallow checkout, a recording step that stopped producing instruction counts, a runner class that drifted) are exactly the ones nobody reads a green job’s summary to find. The legitimate cases, a first recording or a new runner class, are rare and known in advance, so they are the ones asked to opt out.