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

Function cbm_index_mark

internal/cbm/cbm.c:551–561  ·  view source on GitHub ↗

Test-only deterministic fault injection for the crash/hang supervisor tests. * Gated entirely behind env vars that are never set in production; a matching * rel_path either aborts (a fault signal the supervisor classifies as a crash) * or spins forever (an external-scanner infinite loop the quiet-timeout kills). * This gives an honest guard — green iff the supervisor actually contains a real

Source from the content-addressed store, hash-verified

549 * unlucky in-flight file is never quarantined alone. The env var is set
550 * solely by the supervisor during recovery — a no-op on normal runs. */
551static void cbm_index_mark(const char *rel_path, char event) {
552 const char *mf = getenv("CBM_INDEX_MARKER_FILE");
553 if (!mf || !mf[0] || !rel_path || !rel_path[0]) {
554 return;
555 }
556 FILE *f = cbm_fopen(mf, "ab");
557 if (f) {
558 (void)fprintf(f, "%c %s\n", event, rel_path);
559 (void)fclose(f);
560 }
561}
562
563void cbm_index_mark_start(const char *rel_path) {
564 cbm_index_mark(rel_path, 'S');

Callers 2

cbm_index_mark_startFunction · 0.85
cbm_index_mark_doneFunction · 0.85

Calls 1

cbm_fopenFunction · 0.85

Tested by

no test coverage detected