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

Function review_gate_report

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

Build a report where work intent A (author `WORK_AUTHOR`, touching `a.txt`) is optionally covered by a review intent R. `review` is `(review_author, review_done)`. Target is the shared `dev` view.

(review: Option<(&str, bool)>)

Source from the content-addressed store, hash-verified

1727 /// `a.txt`) is optionally covered by a review intent R. `review` is
1728 /// `(review_author, review_done)`. Target is the shared `dev` view.
1729 fn review_gate_report(review: Option<(&str, bool)>) -> (TriageReport, String) {
1730 let temp = TempDir::new().unwrap();
1731 let mut repo = Repository::init(temp.path()).unwrap();
1732 repo.init_vault().unwrap();
1733 let base_view = repo.current_view().to_string(); // "dev" (shared)
1734
1735 let file = temp.path().join("a.txt");
1736 std::fs::write(&file, "base\n").unwrap();
1737 repo.add("a.txt", Default::default()).unwrap();
1738 record_all(&repo, "base change");
1739
1740 // Work intent A: a task touching a.txt (so the candidate reaches it),
1741 // authored by WORK_AUTHOR. kind stays default `feature`.
1742 let a = repo.vault_intent_create(intent_opts("Work A")).unwrap();
1743 let body_a = "\
1744:::why
1745Own a.txt.
1746:::
1747
1748:::acceptance-criterion{#a-ac-1 status=unmet}
1749Works.
1750:::
1751
1752:::task{#a-1 status=unmet criteria=a-ac-1}
1753Edit a.txt.
1754::file-ref{path=a.txt}
1755:::";
1756 install_intent_body_fm(
1757 &repo,
1758 &a.intent_file,
1759 body_a,
1760 &[("attributedTo", WORK_AUTHOR), ("status", "in-progress")],
1761 );
1762 let a_node_id = format!("intent:{}", a.uid.to_uppercase());
1763
1764 // Optional review intent R: kind=review, `reviews` A.
1765 if let Some((review_author, done)) = review {
1766 let r = repo.vault_intent_create(intent_opts("Review R")).unwrap();
1767 let body_r = format!(
1768 "\
1769:::why
1770Reviewed A independently.
1771:::
1772
1773:::ref{{to=urn:atomic:intent:{} edge=reviews}}
1774:::",
1775 a.uid
1776 );
1777 install_intent_body_fm(
1778 &repo,
1779 &r.intent_file,
1780 &body_r,
1781 &[
1782 ("kind", "review"),
1783 ("attributedTo", review_author),
1784 ("status", if done { "done" } else { "in-progress" }),
1785 ],
1786 );

Calls 15

writeFunction · 0.85
intent_optsFunction · 0.85
install_intent_body_fmFunction · 0.85
build_reportFunction · 0.85
current_viewMethod · 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
save_to_storeMethod · 0.80