Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions atomic-canonical/src/vocab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions atomic-cli/src/commands/intent/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
<!-- A single, checkable outcome that means this intent is done. -->
:::

:::task{#{id}-1 status=open criteria={id}-ac-1}
:::task{#{id}-1 status=unmet criteria={id}-ac-1}
<!-- A concrete work item toward the criterion above. Name the file(s) it
touches with one or more ::file-ref leaves. -->
::file-ref{path=path/to/file}
Expand Down
11 changes: 9 additions & 2 deletions atomic-cli/src/commands/intent/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ pub struct IntentUpdate {
#[arg(long)]
pub title: Option<String>,

/// Reason the intent is being iceboxed. Persisted as `icebox_reason` +
/// `iceboxed_at` (normally passed alongside `--status icebox`).
#[arg(long)]
pub reason: Option<String>,

/// New Markdown body content, provided inline.
#[arg(long, conflicts_with = "body_stdin")]
pub body: Option<String>,
Expand Down Expand Up @@ -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(),
});
}
Expand All @@ -100,6 +106,7 @@ impl Command for IntentUpdate {
priority: self.priority.clone(),
title: self.title.clone(),
content,
reason: self.reason.clone(),
force: self.force,
},
)
Expand Down
1 change: 1 addition & 0 deletions atomic-cli/src/commands/vault/intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ impl Command for IntentUpdate {
priority: self.priority.clone(),
title: self.title.clone(),
content,
reason: None,
force: self.force,
},
)
Expand Down
13 changes: 13 additions & 0 deletions atomic-repository/src/repository/vault_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ pub struct IntentUpdateOptions {
pub title: Option<String>,
/// New Markdown body content. When `None`, the existing body is kept.
pub content: Option<String>,
/// Icebox reason. When set, persists `icebox_reason` and stamps
/// `iceboxed_at` (normally accompanies `status = icebox`).
pub reason: Option<String>,
/// Allow rewriting the body after the intent has started or been linked.
pub force: bool,
}
Expand Down Expand Up @@ -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 {
Expand Down
Loading