pub struct Spec {
pub id: String,
pub frontmatter: SpecFrontmatter,
pub title: Option<String>,
pub body: String,
}Fields§
§id: String§frontmatter: SpecFrontmatter§title: Option<String>§body: StringImplementations§
Source§impl Spec
impl Spec
Sourcepub fn set_status(
&mut self,
new_status: SpecStatus,
) -> Result<(), TransitionError>
pub fn set_status( &mut self, new_status: SpecStatus, ) -> Result<(), TransitionError>
Set the spec status using validated transitions. This method validates the transition through the state machine.
Sourcepub fn load_with_branch_resolution(spec_path: &Path) -> Result<Self>
pub fn load_with_branch_resolution(spec_path: &Path) -> Result<Self>
Load a spec, optionally resolving from its working branch.
If the spec is in_progress and has a branch (frontmatter.branch or chant/{id}), attempt to read the spec content from that branch for live progress.
Sourcepub fn count_unchecked_checkboxes(&self) -> usize
pub fn count_unchecked_checkboxes(&self) -> usize
Count unchecked checkboxes (- [ ]) in the Acceptance Criteria section only.
Returns the count of unchecked items in that section, skipping code fences.
Uses the LAST ## Acceptance Criteria heading outside code fences.
Sourcepub fn count_total_checkboxes(&self) -> usize
pub fn count_total_checkboxes(&self) -> usize
Count total checkboxes (both checked and unchecked) in the Acceptance Criteria section. Used to assess spec complexity.
Sourcepub fn add_derived_fields(&mut self, fields: HashMap<String, String>)
pub fn add_derived_fields(&mut self, fields: HashMap<String, String>)
Add derived fields to the spec’s frontmatter. Updates the frontmatter with the provided derived fields.
Sourcepub fn auto_check_acceptance_criteria(&mut self) -> bool
pub fn auto_check_acceptance_criteria(&mut self) -> bool
Auto-check all acceptance criteria checkboxes in the spec body.
Replaces all - [ ] with - [x] in the Acceptance Criteria section.
Returns true if any checkboxes were checked, false otherwise.
Sourcepub fn has_acceptance_criteria(&self) -> bool
pub fn has_acceptance_criteria(&self) -> bool
Check if this spec has acceptance criteria. Returns true if the spec body contains an “## Acceptance Criteria” section with at least one checkbox item.
Sourcepub fn is_blocked(&self, all_specs: &[Spec]) -> bool
pub fn is_blocked(&self, all_specs: &[Spec]) -> bool
Check if this spec has unmet dependencies or approval requirements that would block it.
Sourcepub fn get_blocking_dependencies(
&self,
all_specs: &[Spec],
specs_dir: &Path,
) -> Vec<BlockingDependency>
pub fn get_blocking_dependencies( &self, all_specs: &[Spec], specs_dir: &Path, ) -> Vec<BlockingDependency>
Get the list of dependencies that are blocking this spec.
Sourcepub fn has_frontmatter_field(&self, field: &str) -> bool
pub fn has_frontmatter_field(&self, field: &str) -> bool
Check if the spec’s frontmatter contains a specific field.
Sourcepub fn requires_approval(&self) -> bool
pub fn requires_approval(&self) -> bool
Check if this spec requires approval before work can begin.
Sourcepub fn is_approved(&self) -> bool
pub fn is_approved(&self) -> bool
Check if this spec has been approved.
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Check if this spec has been rejected.