pub struct Pack {
pub name: String,
pub schema: u32,
pub dir: PathBuf,
pub gates: Vec<PackGateDecl>,
pub prompts: Vec<PackPrompt>,
pub checklists: Vec<PackChecklist>,
pub artefact_stores: Vec<PackArtefactStore>,
pub standards: Option<StandardsManifest>,
}Expand description
A validated pack: the manifest’s declarations, load-resolved (prompt
textFiles already read) and ready for the consuming surfaces.
Fields§
§name: String§schema: u32§dir: PathBufThe directory the manifest was loaded from (textFile resolution root, reported by lint and the run-start decision).
gates: Vec<PackGateDecl>§prompts: Vec<PackPrompt>§checklists: Vec<PackChecklist>§artefact_stores: Vec<PackArtefactStore>§standards: Option<StandardsManifest>The loaded Flight Rules standards corpus (KRZ-341) — Some exactly
when a schema-4 manifest declares [standards] root. Loaded EAGERLY
at pack load (same fail-closed posture as every other section): a
configured pack whose corpus cannot be fully accounted for is a load
error, never a quiet skip.
Implementations§
Source§impl Pack
impl Pack
Sourcepub fn load(dir: &Path) -> Result<Option<Pack>, String>
pub fn load(dir: &Path) -> Result<Option<Pack>, String>
Load and validate the pack at dir. Ok(None) means the directory
is not a pack (no pack.toml) — the lint surface says so plainly;
config-pointed loads (load_for_config) turn it into an error.
Any contract violation is an Err naming the offending field.
Equivalent to Self::load_with_trust with
standards::StandardsTrust::External — the fail-closed default for
a directory whose repo relationship the caller has not established.
Sourcepub fn load_with_trust(
dir: &Path,
trust: StandardsTrust,
) -> Result<Option<Pack>, String>
pub fn load_with_trust( dir: &Path, trust: StandardsTrust, ) -> Result<Option<Pack>, String>
Self::load with an explicit Flight Rules trust level (KRZ-341
D-A/D-J): an external/untracked pack may carry approved advisory
rules, but an effectively ENFORCED rule fails the load naming the
trust remedy.
Sourcepub fn parse(dir: &Path, source: &str) -> Result<Pack, String>
pub fn parse(dir: &Path, source: &str) -> Result<Pack, String>
Parse and validate a manifest’s text (the load path minus the file
read, so tests exercise the identical validation). Trust defaults to
standards::StandardsTrust::External; the corpus walk still reads
dir (standards root, prompt textFiles).
Sourcepub fn parse_with_trust(
dir: &Path,
source: &str,
trust: StandardsTrust,
) -> Result<Pack, String>
pub fn parse_with_trust( dir: &Path, source: &str, trust: StandardsTrust, ) -> Result<Pack, String>
Self::parse with an explicit Flight Rules trust level.
Sourcepub fn gates_for_paths(&self, changed_paths: &[String]) -> Vec<&PackGateDecl>
pub fn gates_for_paths(&self, changed_paths: &[String]) -> Vec<&PackGateDecl>
The gates applicable to a diff: unconditional gates plus those whose
whenPaths match at least one changed path (the merge-gate idiom,
[crate::merge_gate::when_paths_match]).
Sourcepub fn prompt_section(&self, role: Role) -> String
pub fn prompt_section(&self, role: Role) -> String
The prompt block appended to role’s rendered prompt: one marked
section per pack prompt targeting the role, in declared order. Empty
when no prompt targets the role — the caller leaves the role prompt
(and its recorded hash) byte-identical.