Skip to content

Commit e176ae5

Browse files
authored
Merge branch 'main' into fix/issue-2175
2 parents 3b7f255 + 59a05eb commit e176ae5

70 files changed

Lines changed: 5762 additions & 821 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Makefile.cbm‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ FOUNDATION_SRCS = \
248248
src/foundation/compat_fs.c \
249249
src/foundation/compat_regex.c \
250250
src/foundation/mem.c \
251+
src/foundation/mem_core.c \
251252
src/foundation/diagnostics.c \
252253
src/foundation/profile.c \
253254
src/foundation/dump_verify.c \
@@ -275,6 +276,8 @@ EXTRACTION_SRCS = \
275276
$(CBM_DIR)/extract_k8s.c \
276277
$(CBM_DIR)/extract_dbt.c \
277278
$(CBM_DIR)/helpers.c \
279+
$(CBM_DIR)/result_compact.c \
280+
$(CBM_DIR)/result_spill.c \
278281
$(CBM_DIR)/lang_specs.c \
279282
$(CBM_DIR)/macro_table.c \
280283
$(CBM_DIR)/iris_export_xml.c \
@@ -1188,8 +1191,17 @@ lint-no-suppress:
11881191
lint: lint-tidy lint-cppcheck lint-format lint-no-suppress
11891192
@echo "=== All linters passed ==="
11901193

1194+
# Memory-core linter: memory is allocated through src/foundation/mem_core.h,
1195+
# not through raw malloc/calloc/realloc/free/strdup. A checked-in baseline
1196+
# (scripts/memory-core-baseline.txt) records each file's raw-site count and the
1197+
# gate goes red the moment any file grows. Files only ever go down; lower the
1198+
# baseline line in the same change that migrates the file.
1199+
lint-memory-core:
1200+
@echo "=== memory-core linter ==="
1201+
@python3 scripts/lint-memory-core.py
1202+
11911203
# CI linters (no clang-tidy — platform-dependent, enforced locally via pre-commit)
1192-
lint-ci: lint-cppcheck lint-format lint-no-suppress
1204+
lint-ci: lint-cppcheck lint-format lint-no-suppress lint-memory-core
11931205
@echo "=== CI linters passed ==="
11941206

11951207
# ── Local memory-diagnostic lanes (not PR-CI gates by decision: the diag

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![GitHub Release](https://img.shields.io/github/v/release/DeusData/codebase-memory-mcp?style=flat&color=blue)](https://github.com/DeusData/codebase-memory-mcp/releases/latest)
44
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
55
[![CI](https://img.shields.io/github/actions/workflow/status/DeusData/codebase-memory-mcp/dry-run.yml?label=CI)](https://github.com/DeusData/codebase-memory-mcp/actions/workflows/dry-run.yml)
6-
[![Tests](https://img.shields.io/badge/tests-6768_passing-brightgreen)](https://github.com/DeusData/codebase-memory-mcp)
6+
[![Tests](https://img.shields.io/badge/tests-8050_passing-brightgreen)](https://github.com/DeusData/codebase-memory-mcp)
77
[![Languages](https://img.shields.io/badge/languages-162-orange)](https://github.com/DeusData/codebase-memory-mcp)
88
[![Hybrid LSP](https://img.shields.io/badge/Hybrid_LSP-10_languages-blue)](#hybrid-lsp)
99
[![Agents](https://img.shields.io/badge/agent_surfaces-45-purple)](https://github.com/DeusData/codebase-memory-mcp)
@@ -425,7 +425,7 @@ scripts/build.sh # without the UI (development only)
425425

426426
Every platform ships **one self-contained executable**: the graph UI and the agent integration templates are linked into the binary, so an extracted archive is immediately complete.
427427

428-
Run the test suite (6,768 tests across 120 suites):
428+
Run the test suite (8,060 tests across 141 suites):
429429

430430
```bash
431431
scripts/test.sh # full: clean sanitizer build + all suites + guards

‎flake.nix‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
packages = forAllSystems (pkgs: rec {
6464
default = pkgs.stdenv.mkDerivation {
6565
pname = "codebase-memory-mcp";
66-
version = "0.10.8";
66+
version = "0.11.0";
6767

6868
src = ./.;
6969

‎internal/cbm/arena.h‎

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,7 @@
1-
#ifndef CBM_ARENA_H
2-
#define CBM_ARENA_H
3-
4-
#include <stddef.h>
5-
6-
// CBMArena is a simple bump allocator that allocates from fixed-size blocks.
7-
// All memory is freed at once via cbm_arena_destroy(). Individual frees are not
8-
// supported — this is by design for per-file extraction where all data has the
9-
// same lifetime.
10-
#define CBM_ARENA_MAX_BLOCKS 256
11-
#define CBM_ARENA_DEFAULT_BLOCK_SIZE (64 * 1024) // 64KB initial
12-
13-
typedef struct {
14-
char *blocks[CBM_ARENA_MAX_BLOCKS];
15-
size_t block_sizes[CBM_ARENA_MAX_BLOCKS]; // per-block sizes (for stats)
16-
int nblocks;
17-
size_t block_size;
18-
size_t used; // bytes used in current block
19-
size_t total_alloc; // cumulative bytes allocated (for stats)
20-
} CBMArena;
21-
22-
// Initialize an arena with the default block size.
23-
void cbm_arena_init(CBMArena *a);
24-
25-
// Allocate n bytes from the arena. Returns NULL on OOM or block exhaustion.
26-
// All returned pointers are 8-byte aligned.
27-
void *cbm_arena_alloc(CBMArena *a, size_t n);
28-
29-
// Duplicate a string into arena memory. Returns arena-owned copy.
30-
char *cbm_arena_strdup(CBMArena *a, const char *s);
31-
32-
// Duplicate a string of known length into arena memory. NUL-terminates.
33-
char *cbm_arena_strndup(CBMArena *a, const char *s, size_t len);
34-
35-
// sprintf into arena memory. Returns arena-owned string.
36-
char *cbm_arena_sprintf(CBMArena *a, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
37-
38-
// Free all blocks. Arena is invalid after this call.
39-
void cbm_arena_destroy(CBMArena *a);
40-
41-
#endif // CBM_ARENA_H
1+
/* The arena lives in src/foundation/arena.h. This file used to be a stale
2+
* copy with the same include guard and a shorter API; whichever header a
3+
* translation unit included first won, silently. One definition now. */
4+
#ifndef CBM_INTERNAL_ARENA_SHIM_H
5+
#define CBM_INTERNAL_ARENA_SHIM_H
6+
#include "../../src/foundation/arena.h" /* relative: the lsp_all unit has no -Isrc */
7+
#endif /* CBM_INTERNAL_ARENA_SHIM_H */

0 commit comments

Comments
 (0)