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:1215–1239  ·  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

1213 /// (e.g. `kind`, `attributedTo`, `status`) so tests can control the review
1214 /// gate's inputs. `lift_intent` reads these straight off the frontmatter.
1215 fn install_intent_body_fm(
1216 repo: &Repository,
1217 intent_file: &str,
1218 body: &str,
1219 overrides: &[(&str, &str)],
1220 ) {
1221 use atomic_core::pristine::VaultEntryType;
1222 let entry = repo.vault_retrieve(intent_file).unwrap().unwrap();
1223 let mut fm: serde_json::Map<String, serde_json::Value> =
1224 serde_json::from_str(&entry.frontmatter_json).unwrap();
1225 for (k, v) in overrides {
1226 fm.insert(
1227 (*k).to_string(),
1228 serde_json::Value::String((*v).to_string()),
1229 );
1230 }
1231 repo.vault_store(
1232 intent_file,
1233 VaultEntryType::Intent,
1234 body.as_bytes().to_vec(),
1235 serde_json::to_string(&fm).unwrap(),
1236 )
1237 .unwrap();
1238 repo.vault_index_kg(intent_file).unwrap();
1239 }
1240
1241 /// Build a report where intent A (reached by a candidate change that edits
1242 /// `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