Skip to main content

Selection

Struct Selection 

Source
pub struct Selection {
Show 22 fields pub policy: &'static str, pub default: &'static str, pub source: &'static str, pub gate: f64, pub fit: String, pub at: u64, pub checks: u64, pub sessions: u64, pub deviations: Vec<Count>, pub fallbacks: Vec<Count>, pub spend: Vec<Spend>, pub budget: Option<Budget>, pub effects: Vec<Estimate>, pub half_life: Option<u32>, pub labels: Vec<Count>, pub declaration: Option<Estimate>, pub delivery: Option<Rates>, pub evaluation: Option<Evaluation>, pub measurement: Option<Measurement>, pub pool: Vec<Yield>, pub latency: Vec<Latency>, pub test: Option<Test>,
}
Expand description

Lesson selection (select.rs) as the monitor shows it: one line per collective in borg status and borg top, in full on borg web’s Conscience tab (/api/select). Every number is read from the store’s selection summary (select/summary.rs load: its counts, its fit, its monitor) and the policy’s own functions, never refitted here; only shares, the declaration’s difference and the latency quantiles are taken of the summary’s counts. A section the summary does not carry yet is empty, which every surface shows as not measured yet, never as 0. Spend is measured and shown, and priced only under a budget an engineer set for the collective (budget).

Fields§

§policy: &'static str

The policy a hook started from this environment runs under (select.rs Policy::name): learned (the default), fixed (BORG_SELECT=fixed), cap or attention under an evaluation switch.

§default: &'static str

The policy a hook runs under when no switch is set (select.rs precedence without one): the fixed rule until the pre-registered checks pass (tasks/todo.md, amendment 2026-10-29).

§source: &'static str

What decides: the policy, or reverted (select.rs REVERTED_SOURCE) when the monitor saw harm beyond the gate’s share and put the fixed rule back (sticky).

§gate: f64

The conservative gate’s budget (select.rs Log::gate): the replayed quality (mistakes avoided) the learned policy may still risk below the fixed rule, at the collective’s risk share (Test::risk, select/policy.rs remaining_at). Not money. 0 at cold start, where every decision is the fixed rule’s.

§fit: String

The fit decisions draw from (select/policy.rs Fit::key); empty: the prior.

§at: u64

The bytes of outcomes.jsonl the summary has folded.

§checks: u64

The graded checks and the sessions folded.

§sessions: u64§deviations: Vec<Count>

Per decision type the summary counts, the decisions that differed from the fixed rule’s (part) of those made (whole): route, the learned checks under the current fit whose routes did, on evidence or by a played draw of the question-count test (select/summary.rs Gate; the test’s own draws, all-time, are in test). The pool’s size and early delivery are not counted yet.

§fallbacks: Vec<Count>

Per reason a learned decision fell back to the fixed rule (select/summary.rs FELL_BACK, named as the record’s reason: lock_busy, lock_failed, unrecorded), the graded checks it did (part) of those folded (whole, checks), every reason listed: a guard that binds often shows.

§spend: Vec<Spend>

What selection spent per cost source: its model calls, stop and live checks (select/summary.rs Spent). Judging rides in them: a check’s call also judges its session’s pending questions and placebos (predict.rs judge_section). borg learn’s own calls are not selection’s; borg stats counts them (stats.rs MODEL_CALL).

§budget: Option<Budget>

The spend budget an engineer set for the collective and its price; None without one.

§effects: Vec<Estimate>

Effects with their intervals: grade × route, ask vs free, free vs placebo, dilution, the spread between sessions and between lessons.

§half_life: Option<u32>

The forgetting half-life chosen, in session ticks; Some(0): no forgetting.

§labels: Vec<Count>

Label health: the judged share per route, the unclear share, the placebo rate.

§declaration: Option<Estimate>

Label health: how the apply/skip declaration moves the judge (a random half is judged without it).

§delivery: Option<Rates>

The delivery rates the fit learned (select/policy.rs Rates): free_stop, free_live and ask_live weigh a route’s value, later and wait are only shown. None before a fit.

§evaluation: Option<Evaluation>

The monitor’s off-policy estimate and its health; None before it weighed a labelled apply.

§measurement: Option<Measurement>

What the checks measure for the learned policy at no cost to the fixed rule’s quality; None before a graded check is folded.

§pool: Vec<Yield>

The pool’s yield by fill position.

§latency: Vec<Latency>

Stop check latency per harness against its stop budget.

§test: Option<Test>

The learned policy’s randomised question-count test; None under another policy while the summary counts none of its checks.

Implementations§

Source§

impl Selection

Source

pub fn of(summary: &Summary, policy: Policy, risk: Option<f64>) -> Selection

What summary says, under policy and the risk share risk its collective sets (select.rs risk_of; None: the default): copied from the summary, its fit and its monitor, never refitted. What it does not hold yet stays empty: not measured.

Source

pub fn shown(&self) -> bool

Whether borg top shows the line: once the summary has folded a graded check, or while another policy than the default (a switch) or the monitor’s revert decides.

Trait Implementations§

Source§

impl Clone for Selection

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Selection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Selection

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Selection

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Selection

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Selection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.