buildfix_core_runtime/
ports.rs1use buildfix_receipts::LoadedReceipt;
4use camino::Utf8Path;
5
6pub trait ReceiptSource {
8 fn load_receipts(&self) -> anyhow::Result<Vec<LoadedReceipt>>;
9}
10
11pub trait GitPort {
13 fn head_sha(&self, repo_root: &Utf8Path) -> anyhow::Result<Option<String>>;
14 fn is_dirty(&self, repo_root: &Utf8Path) -> anyhow::Result<Option<bool>>;
15 fn commit_all(&self, _repo_root: &Utf8Path, _message: &str) -> anyhow::Result<Option<String>> {
16 Ok(None)
17 }
18}
19
20pub trait WritePort {
22 fn write_file(&self, path: &Utf8Path, contents: &[u8]) -> anyhow::Result<()>;
23 fn create_dir_all(&self, path: &Utf8Path) -> anyhow::Result<()>;
24}