pub enum Tier {
Task,
Governance,
Source,
Decision,
Knowledge,
History,
}Expand description
Where an entry sits in the order the budget spends in.
The order is this repository’s own: lib/context.sh assembles its sections “in
authority order, highest first, because a worker that runs out of budget must lose the
least reliable evidence rather than the most: git, then the task and its policy, then
blockers, then authored records, then event history.” These six tiers are that
sentence, applied to objects instead of to sections.
The derived Ord is load-bearing: the variants are declared in authority order, so
< means “spent before” and “harder to drop”, and the budget’s ordering is a plain
sort rather than a table mapping tiers to ranks. A variant added in the wrong place
would silently re-rank the whole answer, which is why the declaration order is the one
thing about this enum to be careful with.
use majordomus_cli::devcontext::Tier;
// the declaration order *is* the order the budget spends in
let mut sorted = Tier::ORDER.to_vec();
sorted.sort();
assert_eq!(sorted, Tier::ORDER.to_vec());
// so the strongest authority is the smallest, and it is the one never dropped
assert_eq!(Tier::ORDER.iter().copied().min(), Some(Tier::Task));
assert!(Tier::Task < Tier::Governance && Tier::Governance < Tier::History);
// and the serialised word is the lowercase one the report is read under
assert_eq!(
serde_json::to_value(Tier::Governance).unwrap(),
serde_json::json!(Tier::Governance.as_str()),
);Variants§
Task
What was asked for: the issue, its milestone, the paths named, the intent. Never dropped — a context that lost the thing it was compiled about is not a smaller answer, it is the wrong one.
Governance
What the work will be judged against: the policy, the scope, the directory contracts that reach the named paths, and the rules. A blocking rule is never dropped.
Source
The code and the cases the work touches.
Decision
The architectural decisions already in force over it.
Knowledge
What a previous session left: handovers, session records, curated knowledge.
History
Supporting evidence: use cases, claims, features, and the rest of the layer.
Implementations§
Source§impl Tier
impl Tier
Sourcepub const ORDER: &'static [Tier]
pub const ORDER: &'static [Tier]
Every tier, in the order the budget spends in.
use majordomus_cli::devcontext::Tier;
assert_eq!(Tier::ORDER.len(), 6);
assert_eq!(Tier::ORDER[0], Tier::Task);Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word this tier is reported under.
use majordomus_cli::devcontext::Tier;
assert_eq!(Tier::Governance.as_str(), "governance");Sourcepub fn meaning(self) -> &'static str
pub fn meaning(self) -> &'static str
What this tier is for, in one line, so that a reader of the answer never has to find this file.
This is carried into the answer — TierSpend::meaning is this
string — rather than left for a consumer to look up, because the per-tier spend is
read by people who are deciding what to raise the budget for and “knowledge: 4
excluded” is not actionable without knowing what the tier holds.
use majordomus_cli::devcontext::Tier;
// it explains the tier rather than naming it, so it is never just the word again
for t in Tier::ORDER {
assert!(t.meaning().len() > t.as_str().len(), "{} restates itself", t.as_str());
}
// and it says what is actually in there
assert!(Tier::Governance.meaning().contains("policy"));
assert!(Tier::Decision.meaning().contains("architectural decisions"));Trait Implementations§
impl Copy for Tier
Source§impl<'de> Deserialize<'de> for Tier
impl<'de> Deserialize<'de> for Tier
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Tier
Source§impl JsonSchema for Tier
impl JsonSchema for Tier
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for Tier
impl Ord for Tier
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Tier
impl PartialOrd for Tier
impl StructuralPartialEq for Tier
Auto Trait Implementations§
impl Freeze for Tier
impl RefUnwindSafe for Tier
impl Send for Tier
impl Sync for Tier
impl Unpin for Tier
impl UnsafeUnpin for Tier
impl UnwindSafe for Tier
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.