Skip to main content

IssueSnapshot

Struct IssueSnapshot 

Source
pub struct IssueSnapshot { /* private fields */ }
Expand description

The one indexed issue snapshot capacity calculations read (T011).

Built by IssueSnapshot::build and immutable afterwards: every lookup is a map read, so a calculation never touches a file, re-parses an estimate, or walks the issue list again — there is no seam a lookup could parse through, and no interior mutability to cache one in. The tally it exposes (issue_visits, estimates_parsed, conversions_resolved) is the pass’s own record of the parse and conversion work it performed, so a test can assert how much work the build did instead of only that it was fast. What those counters do not observe is stated on each of them.

Implementations§

Source§

impl IssueSnapshot

Source

pub fn build(config: &Config, index: &ScheduleIndex, issues: &[Issue]) -> Self

Index issues in one pass against the repository’s scopes and units.

index is the caller’s ScheduleIndex, built from the cycle records (crate::capacity::schedule_index, or crate::cycle_schedule::registry::load_index — the same index either way). The units an estimate is converted into are the board’s declared units plus every unit a configured capacity entry names, read from the config here: the conversion table is resolved once, at build time, so no calculation repeats it (R10).

Conversions use the default board’s registry (config.default_config(), the board the CLI and other single-config surfaces run under, and the same board crate::workflow::resolution is built for here). A capacity scope names a cycle, a team, or an assignee and never a board, so there is no other board the arithmetic could run under; a unit that board does not declare is a missing_conversion/unknown_unit diagnostic per issue, never a guess.

Completion is crate::workflow::is_completed’s answer (C-002): the snapshot records what the one status-category service decides and never re-derives it.

Source

pub fn issues(&self) -> &[u32]

Every issue number, in the order the pass saw them.

Source

pub fn len(&self) -> usize

How many issues the snapshot indexed.

Source

pub fn is_empty(&self) -> bool

Whether the snapshot indexed no issues.

Source

pub fn targets(&self) -> &[String]

The units every estimate was converted into, in a stable order (T007).

Source

pub fn estimate(&self, number: u32) -> Option<&EstimateValue>

An issue’s estimate as stated: the raw text, the parsed unit and value, and the parse diagnostics. No conversion has been applied.

Source

pub fn estimate_in(&self, number: u32, unit: &str) -> Option<&EstimateValue>

An issue’s estimate converted into unit, conversion included.

None only when the issue is not in the snapshot or unit was not in the conversion table — the units targets lists. Every issue in the snapshot otherwise answers, including an unestimated one (which stays unestimated) and an invalid one (whose diagnostics say why).

Source

pub fn is_completed(&self, number: u32) -> bool

Whether #183’s category service calls this issue completed.

Source

pub fn completed(&self) -> &BTreeSet<u32>

The issues #183’s category service calls completed, in issue order.

Source

pub fn cycle_members(&self, index: &ScheduleIndex, reference: &str) -> &[u32]

The issues whose cycles resolve to reference’s identity.

reference may be a hand-written cycle’s name, a generated cycle’s name, or a generated cycle’s stable id: all three go through resolve_cycle, so all three select the same set (T010). An unknown reference selects nobody.

Source

pub fn team_members(&self, label: &str) -> &[u32]

The issues whose assignee is a member of team label.

Source

pub fn assignee_members(&self, reference: &str) -> &[u32]

The issues assigned to reference, by the model’s assignee identity.

The reference folds the way crate::assignee::parse_assignee folds it, so ada and @ada select the same issues and Ada Lovelace <ada@example.com> is its own identity — the same folding super::config::validate applies.

Source

pub fn members( &self, kind: CapacityScopeKind, reference: &str, index: &ScheduleIndex, ) -> &[u32]

The issues in one scope, whichever dimension it is.

The one call a calculation needs: it dispatches on the entry’s scope kind, so no surface re-implements the per-kind lookup.

Source

pub fn cycle_scopes(&self) -> Vec<&str>

The cycles with at least one member, by the name they answer to.

Source

pub fn team_scopes(&self) -> Vec<&str>

The teams with at least one member.

Source

pub fn assignee_scopes(&self) -> Vec<&str>

The assignee identities with at least one member.

Source

pub fn unscoped(&self) -> &[u32]

The issues that belong to no cycle, team, or assignee scope, in issue order.

An issue naming only a cycle that does not resolve is here too: it is in no scope a capacity entry could select.

Source

pub fn diagnostics(&self) -> &[ScopeDiagnostic]

The membership findings the pass produced, in the order it found them.

Source

pub fn issue_visits(&self) -> usize

How many issue records the pass’s estimate seam walked — the cursor’s record.

One per issue by construction: the pass walks the slice once and this counts the walk. It is a discipline about this pass, not evidence about code outside it — a second scan elsewhere in the crate would not appear here, and neither would a re-parse that bypassed the seam. The counters that can catch duplicated work are estimates_parsed and conversions_resolved, which are incremented by the work itself.

Source

pub fn estimates_parsed(&self) -> usize

How many estimates the pass parsed: one per issue that stated one.

Counted where the parse happens, so a second read of the estimates through the same seam counts twice and is visible; the counters measure the work performed, not the absence of other code. A lookup adds nothing, because a lookup does not parse (NFR-001).

Source

pub fn conversions_resolved(&self) -> usize

How many explicit conversions the pass attempted: one per issue with a readable estimate, per unit in targets.

This counts the attempts — the conversion seam was consulted exactly that many times, in this pass and nowhere else. Whether a particular attempt produced a number is read from the value itself (is_converted), because a refusal is a diagnostic on the value, not the loss of one.

Trait Implementations§

Source§

impl Clone for IssueSnapshot

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 IssueSnapshot

Source§

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

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

impl Default for IssueSnapshot

Source§

fn default() -> Self

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

impl Eq for IssueSnapshot

Source§

impl From<&IssueSnapshot> for CapacitySource

Source§

fn from(snapshot: &IssueSnapshot) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for IssueSnapshot

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 StructuralPartialEq for IssueSnapshot

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.