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

Function log_project

src/ui/activity.c:107–129  ·  view source on GitHub ↗

Only explicit top-level provenance from a producer. Never infer a project * from a page URL, path, nested worker record or message text. Text-format * cbm_log atoms cannot contain spaces; canonical index project names are safe * atoms. Existing journal rows remain NULL during migration. */

Source from the content-addressed store, hash-verified

105 * cbm_log atoms cannot contain spaces; canonical index project names are safe
106 * atoms. Existing journal rows remain NULL during migration. */
107static const char *log_project(yyjson_val *root, const char *line, char out[256]) {
108 if (root) {
109 const char *value = string_field(root, "project");
110 return *value && strlen(value) < 256 ? value : NULL;
111 }
112 if (strncmp(line, "level=", strlen("level=")))
113 return NULL;
114 const char *atom = line;
115 while (*atom) {
116 size_t length = strcspn(atom, " \r\n\t");
117 if (length > strlen("project=") && !strncmp(atom, "project=", strlen("project="))) {
118 size_t size = length - strlen("project=");
119 if (size >= 256)
120 return NULL;
121 memcpy(out, atom + strlen("project="), size);
122 out[size] = '\0';
123 return out;
124 }
125 atom += length;
126 atom += strspn(atom, " \r\n\t");
127 }
128 return NULL;
129}
130
131/* Expiring payloads also retires their frontend sequence identity. Delayed
132 * batch retries cannot resurrect an old warning after routine/error retention. */

Callers 1

activity_logFunction · 0.85

Calls 1

string_fieldFunction · 0.85

Tested by

no test coverage detected