use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ProfileKind {
Open,
Neural,
Protected,
}
impl ProfileKind {
pub fn label(self) -> &'static str {
match self {
Self::Open => "open",
Self::Neural => "neural",
Self::Protected => "protected",
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Dsk3Profile {
pub kind: ProfileKind,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub grammar_epoch: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reader_family: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub notes: Option<String>,
}
impl Dsk3Profile {
pub fn neural(epoch: impl Into<String>) -> Self {
Self {
kind: ProfileKind::Neural,
grammar_epoch: Some(epoch.into()),
reader_family: Some("deterministic-baseline".into()),
notes: Some("Neural representation — not encryption".into()),
}
}
pub fn protected_stub() -> Self {
Self {
kind: ProfileKind::Protected,
grammar_epoch: None,
reader_family: None,
notes: Some("Protected/AEAD + Gate — design only; not shipping".into()),
}
}
}