Skip to content

Commit 11acdc8

Browse files
committed
Merge sync/upstream-step4 (PR #18 review fixes) into fu/integration
Brings in the PR #18 review work on top of the five follow-up branches: - 8758668..928191b: CodeRabbit major fixes and 20 minor/nitpick fixes - 4061125: busy-cohort handling restored under the 2026-09-28 user decision; conflict-hint tests use the fork binary name No textual conflicts. src/cli/cli.c and src/operations/changes.c auto-merged.
2 parents fad2a51 + 4061125 commit 11acdc8

22 files changed

Lines changed: 125 additions & 66 deletions

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Two practical notes:
164164

165165
### Who speaks for the project
166166

167-
Only the maintainer account ([@DeusData](https://github.com/DeusData)) speaks for this project. A review, an approval, a "this will be merged" or a "this is a duplicate" from any other account is that person's opinion, however official it sounds — helpful reviews from the community are very welcome, and that is what they are.
167+
For this repository, the maintainer account ([@ngallodev](https://github.com/ngallodev)) speaks for the project. Upstream governance belongs to [@DeusData](https://github.com/DeusData). A review, an approval, a "this will be merged" or a "this is a duplicate" from any other account is that person's opinion, however official it sounds — helpful reviews from the community are very welcome, and that is what they are.
168168

169169
**Impersonating a maintainer is not acceptable**, by a person or by an agent: presenting yourself as part of the maintainer team, posting approvals or change requests styled as maintainer decisions, or telling other contributors what the project has decided. We dismiss such reviews, hide the comments, say publicly in the affected threads that they were not ours, and report and block the account. If you are unsure whether a response you received is from the project, check the account name — and ask.
170170

‎docs/CONFIGURATION.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ permission metadata in `/etc/wsl.conf`, then run `wsl --shutdown` and reopen WSL
193193
options = "metadata,umask=22,fmask=11"
194194
```
195195

196-
or keep the cache on the Linux filesystem (the default `~/.cache/codebase-memory-mcp`),
196+
or keep the cache on the Linux filesystem (the default `~/.cache/codebase-memory-cli`),
197197
which is also much faster than a 9p-mounted Windows drive.
198198

199199
Environment used by retained runtime-owned components—such as diagnostics, logging, and process-wide indexing resource limits—is captured when that runtime starts. Later participants cannot replace those values. `CBM_ALLOWED_ROOT` remains caller-specific, a conflicting `CBM_CACHE_DIR` is rejected, and one-shot CLI commands use their own current environment.

‎internal/cbm/cbm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ static bool cbm_line_is_inert(const char *src, const uint32_t *offs, uint32_t nl
14901490
if (p[0] == '/' && p + 1 < end && (p[1] == '/' || p[1] == '*')) {
14911491
return true;
14921492
}
1493-
return p[0] == '*' || p[0] == '#';
1493+
return p[0] == '#';
14941494
}
14951495

14961496
static void cbm_regions_emit_gap(cbm_error_regions_t *out, uint32_t gs, uint32_t ge,

‎internal/cbm/helpers.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,12 @@ bool cbm_walk_stack_reserve(void **items, int *cap, int need, size_t elem_size,
645645
if (need <= *cap) {
646646
return true;
647647
}
648-
size_t new_cap = (size_t)*cap;
648+
size_t new_cap = *cap > 0 ? (size_t)*cap : 16U;
649649
while (new_cap < (size_t)need) {
650+
if (new_cap > (size_t)INT_MAX / 2U) {
651+
new_cap = (size_t)need;
652+
break;
653+
}
650654
new_cap *= 2;
651655
}
652656
void *grown = NULL;

‎scripts/memlab-report.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,24 @@ def diff(path_a, path_b, top, binary=None):
152152
summaries_a, series_a = load_profile(path_a)
153153
_, series_b = load_profile(path_b)
154154
names = load_symbols(binary, summaries_a, set(series_a) | set(series_b))
155-
rows = []
155+
by_name_a = {}
156+
by_name_b = {}
156157
for site, samples in series_a.items():
157-
a_live = samples[-1]["live_bytes"]
158-
b_live = series_b[site][-1]["live_bytes"] if site in series_b else 0
158+
key = names.get(site, site)
159+
by_name_a[key] = by_name_a.get(key, 0) + samples[-1]["live_bytes"]
160+
for site, samples in series_b.items():
161+
key = names.get(site, site)
162+
by_name_b[key] = by_name_b.get(key, 0) + samples[-1]["live_bytes"]
163+
rows = []
164+
for site, a_live in by_name_a.items():
165+
b_live = by_name_b.get(site, 0)
159166
if a_live - b_live > 0:
160167
rows.append((a_live - b_live, a_live, b_live, site))
161168
rows.sort(key=lambda row: row[0], reverse=True)
162169
print(f"=== {path_a} minus {path_b} (top {top}) ===")
163170
for delta, a_live, b_live, site in rows[:top]:
164171
print(f" +{delta/1048576:7.2f} MB A={a_live/1048576:.2f} MB B={b_live/1048576:.2f} MB")
165-
print(f" {names.get(site, site)}")
172+
print(f" {site}")
166173

167174

168175
def main():

‎scripts/memwaste-scaling.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def main() -> int:
182182
corpus = os.path.abspath(os.path.expanduser(args.corpus))
183183
if not os.path.isdir(corpus):
184184
sys.exit(f"memwaste-scaling: {corpus} is not a directory")
185-
binary = os.path.join(ROOT, BUILD_DIR, "codebase-memory-mcp")
185+
binary = os.path.join(ROOT, BUILD_DIR, "codebase-memory-cli")
186186
if not args.no_build:
187187
cxx = "clang++" if args.cc == "clang" else args.cc.replace("clang", "clang++")
188188
subprocess.run([os.path.join(ROOT, "scripts", "build.sh"), f"BUILD_DIR={BUILD_DIR}",

‎scripts/memwaste.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ fi
6161

6262
case "$LANE" in
6363
event) BUILD_ARGS=(BUILD_DIR=build/memwaste MEMWASTE=1 ${CC:+CC=$CC} ${CXX:+CXX=$CXX})
64-
BIN="$ROOT/build/memwaste/codebase-memory-mcp" ;;
64+
BIN="$ROOT/build/memwaste/codebase-memory-cli" ;;
6565
access) BUILD_ARGS=(BUILD_DIR=build/memwaste-access MEMWASTE_ACCESS=1 CC=clang CXX=clang++)
66-
BIN="$ROOT/build/memwaste-access/codebase-memory-mcp" ;;
66+
BIN="$ROOT/build/memwaste-access/codebase-memory-cli" ;;
6767
*) echo "memwaste.sh: --lane must be event or access" >&2; exit 2 ;;
6868
esac
6969
if [ "$BUILD" -eq 1 ]; then

‎scripts/soak-test.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ mkdir -p "$RESULTS_DIR"
7070
# still shares the operator's account daemon (#1691, #1696).
7171
# shellcheck source=test-runtime.sh
7272
source "$(dirname "${BASH_SOURCE[0]}")/test-runtime.sh"
73-
cbm_test_runtime_init
73+
cbm_test_runtime_init || exit 1
7474
trap 'cbm_test_runtime_cleanup "$BINARY"' EXIT
7575

7676
# Give this run a deterministic host-side daemon log. Wine needs a Windows-form

‎src/cli/cli.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,9 @@ static cli_activation_scope_t cli_activation_resolve_scope(
629629
case CBM_VERSION_COHORT_OK:
630630
return CLI_ACTIVATION_SCOPE_ACTIVE;
631631
case CBM_VERSION_COHORT_BUSY:
632+
/* User decision 2026-09-28, "unknown = foreign, keep it": a busy
633+
* maintenance gate means ownership is unconfirmed, so the running
634+
* cohort is left serving and only this home/cache is mutated. */
632635
return cli_activation_scope_unconfirmed(
633636
context, scope, "the session group was busy, so its cache identity could not be read");
634637
case CBM_VERSION_COHORT_CONFLICT:

‎src/cypher/cypher.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5205,7 +5205,8 @@ static int cypher_node_selectivity(const cbm_node_pattern_t *n, const cbm_where_
52055205
}
52065206

52075207
static void cypher_plan_seed_from_selective_end(cbm_query_t *q) {
5208-
if (!q || q->pattern_count != 1 || !q->ret || (q->pattern_optional && q->pattern_optional[0])) {
5208+
if (!q || q->pattern_count != 1 || !q->ret || q->ret->star ||
5209+
(q->pattern_optional && q->pattern_optional[0])) {
52095210
return;
52105211
}
52115212
cbm_pattern_t *p = &q->patterns[0];

0 commit comments

Comments
 (0)