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

Function te_receipt

src/mcp/test_impact_engine.c:464–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464static void te_receipt(te_ctx_t *c, cbm_test_result_receipt_t *r,
465 cbm_test_result_evidence_reason_t *graph_reason) {
466 memset(r, 0, sizeof(*r));
467 r->routes = CBM_TEST_RESULT_ROUTES_FOLLOWED;
468 if (c->id) {
469 r->object_format = c->id->oid_hex_length == 64 ? CBM_TEST_RESULT_OBJECT_SHA256
470 : CBM_TEST_RESULT_OBJECT_SHA1;
471 r->base = te_oid(c, c->id->base);
472 r->head = te_oid(c, c->id->head);
473 r->merge_base = te_oid(c, c->id->merge_base);
474 }
475 if (c->changes) {
476 r->diff_sha256 = te_digest_of(&c->diff.patch);
477 r->name_status_sha256 = te_digest_of(&c->diff.name_status);
478 }
479 if (c->config) {
480 r->config_sha256 = te_digest_hex(cbm_test_config_digest(c->config));
481 }
482 if (c->policy) {
483 r->policy_sha256 = te_digest_hex(cbm_test_policy_digest(c->policy));
484 }
485 if (c->graph_digest) {
486 r->graph.state = CBM_TEST_RESULT_GRAPH_CERTIFIED;
487 r->graph.commit = r->head;
488 r->graph.sha256.present = true;
489 memcpy(r->graph.sha256.bytes, c->graph_sha256, 32);
490 } else if (c->tree) {
491 r->graph.state = CBM_TEST_RESULT_GRAPH_REJECTED;
492 *graph_reason = CBM_TEST_RESULT_EVIDENCE_DIAGNOSTICS_INCOMPLETE;
493 r->graph.rejection_reasons = (cbm_test_result_evidence_reasons_t){graph_reason, 1};
494 }
495 te_artifact_receipt(c, &r->coverage, te_oid);
496}
497
498static cbm_test_impact_status_t te_answer(te_ctx_t *c, cbm_test_result_t **out) {
499 cbm_test_result_rule_match_t *matches =

Callers 1

te_answerFunction · 0.85

Calls 6

te_oidFunction · 0.85
te_digest_ofFunction · 0.85
te_digest_hexFunction · 0.85
cbm_test_config_digestFunction · 0.85
cbm_test_policy_digestFunction · 0.85
te_artifact_receiptFunction · 0.85

Tested by

no test coverage detected