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
impl IssueSnapshot
Sourcepub fn build(config: &Config, index: &ScheduleIndex, issues: &[Issue]) -> Self
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.
Sourcepub fn targets(&self) -> &[String]
pub fn targets(&self) -> &[String]
The units every estimate was converted into, in a stable order (T007).
Sourcepub fn estimate(&self, number: u32) -> Option<&EstimateValue>
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.
Sourcepub fn estimate_in(&self, number: u32, unit: &str) -> Option<&EstimateValue>
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).
Sourcepub fn is_completed(&self, number: u32) -> bool
pub fn is_completed(&self, number: u32) -> bool
Whether #183’s category service calls this issue completed.
Sourcepub fn completed(&self) -> &BTreeSet<u32>
pub fn completed(&self) -> &BTreeSet<u32>
The issues #183’s category service calls completed, in issue order.
Sourcepub fn cycle_members(&self, index: &ScheduleIndex, reference: &str) -> &[u32]
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.
Sourcepub fn team_members(&self, label: &str) -> &[u32]
pub fn team_members(&self, label: &str) -> &[u32]
The issues whose assignee is a member of team label.
Sourcepub fn assignee_members(&self, reference: &str) -> &[u32]
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.
Sourcepub fn members(
&self,
kind: CapacityScopeKind,
reference: &str,
index: &ScheduleIndex,
) -> &[u32]
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.
Sourcepub fn cycle_scopes(&self) -> Vec<&str>
pub fn cycle_scopes(&self) -> Vec<&str>
The cycles with at least one member, by the name they answer to.
Sourcepub fn team_scopes(&self) -> Vec<&str>
pub fn team_scopes(&self) -> Vec<&str>
The teams with at least one member.
Sourcepub fn assignee_scopes(&self) -> Vec<&str>
pub fn assignee_scopes(&self) -> Vec<&str>
The assignee identities with at least one member.
Sourcepub fn unscoped(&self) -> &[u32]
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.
Sourcepub fn diagnostics(&self) -> &[ScopeDiagnostic]
pub fn diagnostics(&self) -> &[ScopeDiagnostic]
The membership findings the pass produced, in the order it found them.
Sourcepub fn issue_visits(&self) -> usize
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.
Sourcepub fn estimates_parsed(&self) -> usize
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).
Sourcepub fn conversions_resolved(&self) -> usize
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
impl Clone for IssueSnapshot
Source§impl Debug for IssueSnapshot
impl Debug for IssueSnapshot
Source§impl Default for IssueSnapshot
impl Default for IssueSnapshot
impl Eq for IssueSnapshot
Source§impl From<&IssueSnapshot> for CapacitySource
impl From<&IssueSnapshot> for CapacitySource
Source§fn from(snapshot: &IssueSnapshot) -> Self
fn from(snapshot: &IssueSnapshot) -> Self
Source§impl PartialEq for IssueSnapshot
impl PartialEq for IssueSnapshot
impl StructuralPartialEq for IssueSnapshot
Auto Trait Implementations§
impl Freeze for IssueSnapshot
impl RefUnwindSafe for IssueSnapshot
impl Send for IssueSnapshot
impl Sync for IssueSnapshot
impl Unpin for IssueSnapshot
impl UnsafeUnpin for IssueSnapshot
impl UnwindSafe for IssueSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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