diff --git a/atomic-canonical/src/vocab.rs b/atomic-canonical/src/vocab.rs index 228d6650..cc25e1bc 100644 --- a/atomic-canonical/src/vocab.rs +++ b/atomic-canonical/src/vocab.rs @@ -38,10 +38,13 @@ impl NodeType { } /// Intent status value set (mirrors the doc's `IntentShape` `sh:in`). -pub const INTENT_STATUS: &[&str] = &["backlog", "todo", "in_progress", "done"]; +/// `icebox` is a terminal state (an intent reviewed and set aside — not built). +pub const INTENT_STATUS: &[&str] = &["backlog", "todo", "in_progress", "done", "icebox"]; -/// Acceptance-criterion status value set. -pub const AC_STATUS: &[&str] = &["open", "met"]; +/// Acceptance-criterion status value set. `unmet`/`met` are the official values +/// (an acceptance criterion is either met or not); the legacy `open` is still +/// accepted by [`is_known_ac_status`] so pre-existing intents keep conforming. +pub const AC_STATUS: &[&str] = &["unmet", "met"]; /// Directive names recognized by the parser + lift (closed set). /// Container directives wrap prose; leaf directives carry only edges. @@ -125,9 +128,10 @@ pub fn is_known_intent_status(value: &str) -> bool { INTENT_STATUS.contains(&value) } -/// Is this a valid acceptance-criterion status value? +/// Is this a valid acceptance-criterion status value? Accepts the official +/// `unmet`/`met` plus the deprecated legacy `open` (== `unmet`) for back-compat. pub fn is_known_ac_status(value: &str) -> bool { - AC_STATUS.contains(&value) + AC_STATUS.contains(&value) || value == "open" } /// Is this a valid memory kind? Unknown ⇒ gate error (closed vocabulary). diff --git a/atomic-cli/src/commands/intent/new.rs b/atomic-cli/src/commands/intent/new.rs index 8d9c5bad..f18a051e 100644 --- a/atomic-cli/src/commands/intent/new.rs +++ b/atomic-cli/src/commands/intent/new.rs @@ -29,11 +29,11 @@ const FEATURE_SCAFFOLD: &str = "\ content is never graded — but it must be present. Replace this stub. --> ::: -:::acceptance-criterion{#{id}-ac-1 status=open} +:::acceptance-criterion{#{id}-ac-1 status=unmet} ::: -:::task{#{id}-1 status=open criteria={id}-ac-1} +:::task{#{id}-1 status=unmet criteria={id}-ac-1} ::file-ref{path=path/to/file} diff --git a/atomic-cli/src/commands/intent/update.rs b/atomic-cli/src/commands/intent/update.rs index 58adb409..2900be30 100644 --- a/atomic-cli/src/commands/intent/update.rs +++ b/atomic-cli/src/commands/intent/update.rs @@ -40,6 +40,11 @@ pub struct IntentUpdate { #[arg(long)] pub title: Option, + /// Reason the intent is being iceboxed. Persisted as `icebox_reason` + + /// `iceboxed_at` (normally passed alongside `--status icebox`). + #[arg(long)] + pub reason: Option, + /// New Markdown body content, provided inline. #[arg(long, conflicts_with = "body_stdin")] pub body: Option, @@ -80,12 +85,13 @@ impl Command for IntentUpdate { && self.assignee.is_none() && self.priority.is_none() && self.title.is_none() + && self.reason.is_none() && content.is_none() { return Err(CliError::InvalidArgument { message: "Nothing to update. Provide at least one of \ - --status, --assignee, --priority, --title, --body, \ - or --body-stdin." + --status, --assignee, --priority, --title, --reason, \ + --body, or --body-stdin." .to_string(), }); } @@ -100,6 +106,7 @@ impl Command for IntentUpdate { priority: self.priority.clone(), title: self.title.clone(), content, + reason: self.reason.clone(), force: self.force, }, ) diff --git a/atomic-cli/src/commands/vault/intent.rs b/atomic-cli/src/commands/vault/intent.rs index 70542f8c..e874f62f 100644 --- a/atomic-cli/src/commands/vault/intent.rs +++ b/atomic-cli/src/commands/vault/intent.rs @@ -482,6 +482,7 @@ impl Command for IntentUpdate { priority: self.priority.clone(), title: self.title.clone(), content, + reason: None, force: self.force, }, ) diff --git a/atomic-repository/src/repository/vault_intent.rs b/atomic-repository/src/repository/vault_intent.rs index 563e7cfc..813cd72c 100644 --- a/atomic-repository/src/repository/vault_intent.rs +++ b/atomic-repository/src/repository/vault_intent.rs @@ -75,6 +75,9 @@ pub struct IntentUpdateOptions { pub title: Option, /// New Markdown body content. When `None`, the existing body is kept. pub content: Option, + /// Icebox reason. When set, persists `icebox_reason` and stamps + /// `iceboxed_at` (normally accompanies `status = icebox`). + pub reason: Option, /// Allow rewriting the body after the intent has started or been linked. pub force: bool, } @@ -495,6 +498,16 @@ impl Repository { serde_json::Value::String(title.clone()), ); } + if let Some(ref reason) = options.reason { + fm.insert( + "icebox_reason".to_string(), + serde_json::Value::String(reason.clone()), + ); + fm.insert( + "iceboxed_at".to_string(), + serde_json::Value::String(chrono::Utc::now().to_rfc3339()), + ); + } let new_fm = serde_json::to_string(&fm).unwrap_or_else(|_| "{}".to_string()); let new_content = match options.content {