Add proper lifecycle and superseding support for Architectural Decision Records
This commit is contained in:
1 parent
70edfa4389
commit
54aead2151
4 files changed
+28
-3
No files matched your search
@@ -25,6 +25,17 @@ impl McpTool for LogDecisionHandler {
|
||||
let mut final_id = String::new();
|
||||
|
||||
state.adrs.modify(|adrs| {
|
||||
if let Some(superseded_id) = &req.supersedes {
|
||||
for old_adr in adrs.iter_mut() {
|
||||
if old_adr.id == *superseded_id {
|
||||
old_adr.status = "superseded".to_string();
|
||||
// Re-index the modified old ADR
|
||||
drop(idx.index_adr(old_adr));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final_id = format!("ADR-{:04}", adrs.len() + 1);
|
||||
let a = Adr {
|
||||
id: final_id.clone(),
|
||||
@@ -32,6 +43,8 @@ impl McpTool for LogDecisionHandler {
|
||||
context: req.context,
|
||||
decision: req.decision,
|
||||
consequence: req.consequence,
|
||||
status: "accepted".to_string(),
|
||||
supersedes: req.supersedes,
|
||||
timestamp: crate::handlers::utils::now_secs(),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user