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:986–1010  ·  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

984 /// (e.g. `kind`, `attributedTo`, `status`) so tests can control the review
985 /// gate's inputs. `lift_intent` reads these straight off the frontmatter.
986 fn install_intent_body_fm(
987 repo: &Repository,
988 intent_file: &str,
989 body: &str,
990 overrides: &[(&str, &str)],
991 ) {
992 use atomic_core::pristine::VaultEntryType;
993 let entry = repo.vault_retrieve(intent_file).unwrap().unwrap();
994 let mut fm: serde_json::Map<String, serde_json::Value> =
995 serde_json::from_str(&entry.frontmatter_json).unwrap();
996 for (k, v) in overrides {
997 fm.insert(
998 (*k).to_string(),
999 serde_json::Value::String((*v).to_string()),
1000 );
1001 }
1002 repo.vault_store(
1003 intent_file,
1004 VaultEntryType::Intent,
1005 body.as_bytes().to_vec(),
1006 serde_json::to_string(&fm).unwrap(),
1007 )
1008 .unwrap();
1009 repo.vault_index_kg(intent_file).unwrap();
1010 }
1011
1012 /// Build a report where intent A (reached by a candidate change that edits
1013 /// `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