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

Function report_with_intent

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

Build a report where a single intent A (installed with `body_a`) is reached by a candidate that modifies every path in `files`. Each path is created + tracked on the base view and edited on the feature view. `enrich_change_kg` controls whether the candidate record projects the change's `MODIFIES` KG edges. Passing `false` proves the change→intent join no longer depends on KG enrichment (it source

(
        body_a: &str,
        files: &[&str],
        enrich_change_kg: bool,
    )

Source from the content-addressed store, hash-verified

1388 /// join no longer depends on KG enrichment (it sources modified files from
1389 /// the change itself via `change_modified_paths`).
1390 fn report_with_intent(
1391 body_a: &str,
1392 files: &[&str],
1393 enrich_change_kg: bool,
1394 ) -> (TriageReport, String) {
1395 let temp = TempDir::new().unwrap();
1396 let mut repo = Repository::init(temp.path()).unwrap();
1397 repo.init_vault().unwrap();
1398 let base_view = repo.current_view().to_string();
1399
1400 for rel in files {
1401 let p = temp.path().join(rel);
1402 if let Some(parent) = p.parent() {
1403 std::fs::create_dir_all(parent).unwrap();
1404 }
1405 std::fs::write(&p, "base\n").unwrap();
1406 repo.add(rel, Default::default()).unwrap();
1407 }
1408 record_all(&repo, "base change");
1409
1410 let a = repo.vault_intent_create(intent_opts("Intent A")).unwrap();
1411 install_intent_body(&repo, &a.intent_file, body_a, None);
1412 let a_node_id = format!("intent:{}", a.uid.to_uppercase());
1413
1414 repo.create_view_from("feature", &base_view).unwrap();
1415 repo.switch_view("feature").unwrap();
1416 for rel in files {
1417 let p = temp.path().join(rel);
1418 std::fs::write(&p, "base\nfeature edit\n").unwrap();
1419 }
1420 repo.record(
1421 ChangeHeader::new("feature change"),
1422 RecordOptions::new()
1423 .with_all(true)
1424 .save_to_store(true)
1425 .apply_after_record(true)
1426 .enrich_kg(enrich_change_kg)
1427 .sync_vault(false),
1428 )
1429 .unwrap();
1430
1431 let report = build_report(&repo, "feature", &base_view).unwrap();
1432 (report, a_node_id)
1433 }
1434
1435 /// A reached intent that declares a file out of scope (via a `:::scope-out`
1436 /// `::file-ref`) which a candidate change modifies → SCOPE_OUT_BREACH (block).

Calls 15

writeFunction · 0.85
intent_optsFunction · 0.85
install_intent_bodyFunction · 0.85
build_reportFunction · 0.85
current_viewMethod · 0.80
parentMethod · 0.80
vault_intent_createMethod · 0.80
create_view_fromMethod · 0.80
switch_viewMethod · 0.80
sync_vaultMethod · 0.80
enrich_kgMethod · 0.80
apply_after_recordMethod · 0.80