MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / install_intent_body_fm

Function install_intent_body_fm

atomic-cli/src/commands/triage/project.rs:1250–1274  ·  view source on GitHub ↗

Like `install_intent_body` but sets arbitrary frontmatter string fields (e.g. `kind`, `attributedTo`, `status`) so tests can control the review gate's inputs. `lift_intent` reads these straight off the frontmatter.

(
        repo: &Repository,
        intent_file: &str,
        body: &str,
        overrides: &[(&str, &str)],
    )

Source from the content-addressed store, hash-verified

1248 /// (e.g. `kind`, `attributedTo`, `status`) so tests can control the review
1249 /// gate's inputs. `lift_intent` reads these straight off the frontmatter.
1250 fn install_intent_body_fm(
1251 repo: &Repository,
1252 intent_file: &str,
1253 body: &str,
1254 overrides: &[(&str, &str)],
1255 ) {
1256 use atomic_core::pristine::VaultEntryType;
1257 let entry = repo.vault_retrieve(intent_file).unwrap().unwrap();
1258 let mut fm: serde_json::Map<String, serde_json::Value> =
1259 serde_json::from_str(&entry.frontmatter_json).unwrap();
1260 for (k, v) in overrides {
1261 fm.insert(
1262 (*k).to_string(),
1263 serde_json::Value::String((*v).to_string()),
1264 );
1265 }
1266 repo.vault_store(
1267 intent_file,
1268 VaultEntryType::Intent,
1269 body.as_bytes().to_vec(),
1270 serde_json::to_string(&fm).unwrap(),
1271 )
1272 .unwrap();
1273 repo.vault_index_kg(intent_file).unwrap();
1274 }
1275
1276 /// Build a report where intent A (reached by a candidate change that edits
1277 /// `a.txt`) is remediated by intent B. `b_done` controls whether the

Callers 1

review_gate_reportFunction · 0.85

Calls 6

vault_retrieveMethod · 0.80
vault_storeMethod · 0.80
vault_index_kgMethod · 0.80
unwrapMethod · 0.45
insertMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected