97001e1544
Move all 29 workspace members from packages/<name>/ to crates/<name>/. Updates: workspace Cargo.toml (members + path deps), justfile, root CLAUDE.md, scripts/build/CARGO_INSTALL.md, docs/architecture/crates.md (renamed from packages.md), structural references in docs/architecture and docs/configuration, per-crate CLAUDE.md self-references. Historical plans, reports, and building/ docs are left untouched. No behavior change; just check-all stays green and fermata tests pass.
31 lines
739 B
Rust
31 lines
739 B
Rust
use serde::{Deserialize, Serialize};
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct Rule {
|
|
/// Source file the rule came from (e.g. `/proj/.botignore`).
|
|
pub source: PathBuf,
|
|
/// Pattern text as it appeared in the source.
|
|
pub pattern: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct Reason {
|
|
pub message: String,
|
|
pub rule: Option<Rule>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
#[serde(tag = "kind", rename_all = "lowercase")]
|
|
pub enum Decision {
|
|
Allow,
|
|
Ask(Reason),
|
|
Deny(Reason),
|
|
}
|
|
|
|
impl Decision {
|
|
pub fn is_blocking(&self) -> bool {
|
|
matches!(self, Decision::Deny(_))
|
|
}
|
|
}
|