MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / pc_source_hash

Function pc_source_hash

tests/test_pipeline_conventions.c:216–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 strcmp(now, before->generation) == 0 && pc_ordinary_graph(f->db, "preserved");
215}
216static bool pc_source_hash(const char *db, char out[65]) {
217 cbm_store_t *s = cbm_store_open_path_query(db); cbm_file_hash_t h = {0};
218 bool ok = s && cbm_store_get_file_hash(s, PC_PROJECT, "unit.c", &h) == CBM_STORE_OK && h.sha256 && strlen(h.sha256) == 64;
219 if (ok) memcpy(out, h.sha256, 65);
220 cbm_store_clear_file_hash(&h); cbm_store_close(s); return ok;
221}
222static bool pc_missing(const char *db, const char *qn) {
223 cbm_store_t *s = cbm_store_open_path_query(db); cbm_node_t n = {0};
224 bool ok = s && cbm_store_find_node_by_qn(s, PC_PROJECT, qn, &n) == CBM_STORE_NOT_FOUND;

Callers 1

Calls 4

cbm_store_get_file_hashFunction · 0.85
cbm_store_closeFunction · 0.85

Tested by

no test coverage detected