Skip to main content

ProgressLattice

Struct ProgressLattice 

Source
pub struct ProgressLattice {
    pub review_depth: ProgressLevel,
    pub design_maturity: ProgressLevel,
    pub implementation: ProgressLevel,
    pub test_coverage: ProgressLevel,
    pub integration: ProgressLevel,
    pub merge_readiness: ProgressLevel,
}
Expand description

The work progress lattice: a product of 6 progress dimensions.

This is a bounded distributive lattice (and frame) with componentwise ordering. The partial order captures independence between dimensions: reviewed but untested code is incomparable with tested but unreviewed code.

§Lattice Properties

  • Bottom : all dimensions None (raw prompt, no work done)
  • Top : all dimensions Validated (fully validated, merged)
  • Meet : componentwise min (most restrictive)
  • Join : componentwise max (least restrictive)
  • Leq : componentwise <=

§Height

height() = Σ dimension.ordinal(), ranging from 0 (bottom) to 24 (top). The height function is a lattice homomorphism to (ℕ, min, max).

Fields§

§review_depth: ProgressLevel

How deeply the problem has been analyzed/reviewed.

§design_maturity: ProgressLevel

How mature the design/proposal is.

§implementation: ProgressLevel

How far along the implementation is.

§test_coverage: ProgressLevel

How well tested the implementation is.

§integration: ProgressLevel

How well integrated with the existing system.

§merge_readiness: ProgressLevel

How ready for final merge (PR created, CI passing, etc.).

Implementations§

Source§

impl ProgressLattice

Source

pub fn height(&self) -> u32

Height of a lattice position: sum of dimension ordinals.

height(⊥) = 0, height(⊤) = 24.

Source

pub fn signed_distance(&self, target: &Self) -> i32

Signed distance from self to target.

Positive means target is higher (forward progress). Negative means target is lower (backtracking). Zero means same height (not necessarily same position).

Source

pub fn dimension(&self, dim: ProgressDimension) -> ProgressLevel

Get the level for a specific dimension.

Source

pub fn set_dimension(&mut self, dim: ProgressDimension, level: ProgressLevel)

Set the level for a specific dimension.

Source

pub fn advance(&self, dim: ProgressDimension) -> Self

Advance a specific dimension by one level (saturating at Validated).

Returns a new lattice position. This is an inflationary operation: self.advance(dim) >= self for all dim.

Source

pub fn regress(&self, dim: ProgressDimension) -> Self

Regress a specific dimension by one level (saturating at None).

Returns a new lattice position. This is a deflationary operation: self.regress(dim) <= self for all dim.

Source

pub fn regressions( &self, target: &Self, ) -> Vec<(ProgressDimension, ProgressLevel, ProgressLevel)>

Per-dimension breakdown of which dimensions regressed between two positions.

Returns a list of (dimension, from_level, to_level) for each dimension where target < self.

Source

pub fn is_terminal(&self) -> bool

Check if this position is the terminal object (all Validated).

Source

pub fn completion_fraction(&self) -> f64

Fraction of progress toward the terminal object (0.0 to 1.0).

Trait Implementations§

Source§

impl BoundedLattice for ProgressLattice

Source§

fn top() -> Self

Top element (⊤): greatest element in the lattice.
Source§

fn bottom() -> Self

Bottom element (⊥): least element in the lattice.
Source§

impl Clone for ProgressLattice

Source§

fn clone(&self) -> ProgressLattice

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl CompleteLattice for ProgressLattice

Source§

fn meet_all<I: IntoIterator<Item = Self>>(iter: I) -> Self

Meet of all elements in an iterator.
Source§

fn join_all<I: IntoIterator<Item = Self>>(iter: I) -> Self

Join of all elements in an iterator.
Source§

impl Debug for ProgressLattice

Source§

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

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

impl Default for ProgressLattice

Source§

fn default() -> ProgressLattice

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

impl<'de> Deserialize<'de> for ProgressLattice

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ProgressLattice

Source§

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

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

impl Hash for ProgressLattice

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Lattice for ProgressLattice

Source§

fn meet(&self, other: &Self) -> Self

Greatest lower bound (meet, ∧).
Source§

fn join(&self, other: &Self) -> Self

Least upper bound (join, ∨).
Source§

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

Partial order: a ≤ b iff a ∧ b = a.
Source§

impl PartialEq for ProgressLattice

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ProgressLattice

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 DistributiveLattice for ProgressLattice

Source§

impl Eq for ProgressLattice

Source§

impl Frame for ProgressLattice

Source§

impl StructuralPartialEq for ProgressLattice

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,