Commit Graph
419 Commits
Author SHA1 Message Date
Martin Vogel f7d6d34457 feat(diag): persistent memory trajectory + query-leak CI soak for #581
#581 (query-path memory growth) does not reproduce in our soak: a 10-min,
200-file query-only run shows RSS flat-to-shrinking and committed plateauing
(mimalloc already purges on free, purge_delay=0). Rather than ship speculative
mitigations for a leak we cannot measure, this adds the observability to find it
where it actually occurs, plus a continuous guard.

- diag: the diagnostics writer now appends a PERSISTENT NDJSON memory trajectory
  (one sample / 5s: rss, committed, peak fields, page_faults, fd, queries), kept
  on exit (rotates to a .1 generation past 8 MB) so users can send the time
  series post-mortem. The previous latest-snapshot file was overwritten every 5s
  and deleted on stop.
- ci: the soak now also runs a read-only query-leak leg (CBM_SOAK_MODE query-leak,
  no reindex/mutate) on every platform including Windows, so a regression that
  introduces a query-path leak is caught. soak-test.sh RESULTS_DIR is now
  env-overridable so both legs keep separate artifacts.
- docs: README Troubleshooting and Diagnostics section + a bug-report field
  explain the no-telemetry stance and how to capture and share the trajectory.

Build clean; unit suite 5714/0; trajectory verified to persist post-exit.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 23:28:01 +02:00
Martin Vogel b7f1a71a6b style: apply clang-format to new mcp/ui/logging lines
The CI lint gate (scripts/lint.sh --ci, clang-format-20) flagged 7 files whose
new lines were not run through the project formatter. Reformat only those lines
(line wrapping / continuation alignment) — no behavior change.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 21:49:17 +02:00
Martin Vogel 345425a1bb merge main into mcp protocol branch
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 21:34:18 +02:00
Martin Vogel d5414111b3 feat(ui): add i18n and index picker UX
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 21:21:32 +02:00
Martin Vogel 63ed6789df Merge pull request #656 from caioribeiroclw-pixel/fix/openclaw-mcp-config
Fix OpenClaw MCP config path
2026-06-28 21:05:38 +02:00
Martin Vogel d9d70656b4 fix(ui): cap graph rendering and index spawn
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 20:57:14 +02:00
Martin Vogel d30bccd772 fix(compat): include stdlib.h so getenv/_putenv_s compile on native ARM64 Windows
compat.h calls getenv (cbm_tmpdir) and _putenv_s (cbm_setenv/cbm_unsetenv) but
only included stddef.h and stdio.h. The x86-64 mingw toolchain pulled stdlib.h
in transitively, so it built there, but the aarch64 (CLANGARM64) include chain
does not — the calls became implicit declarations that conflict with the real
stdlib.h getenv type and fail to compile on native ARM64 Windows. Include
stdlib.h directly so the declarations are correct on every toolchain.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 14:59:25 +02:00
Martin Vogel 62a28fd36e fix(logging): use local log schema
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 13:05:05 +02:00
Martin Vogel 5b60045c55 fix(cpp): resolve implicit destructor, copy-ctor, and conversion-operator calls
Three C++ constructs invoke a member implicitly with no textual call node, so
the call walk produced nothing for the c-LSP to attach its resolution to
(callable=0, no CALLS edge):

  - delete p;        -> destructor   T::~T
  - T a = b;         -> copy/move ctor T::T
  - if (obj) { ... } -> conversion   T::operator bool

Synthesize a textual call sourced to the enclosing function at each trigger so
the lsp_{destructor,copy_constructor,conversion} resolution binds. The
destructor callee QN embeds the type (T.~T) which is not textually available
from `delete p`, so it joins via the reason gate (c_lsp stashes the operand
text); the other two join by callee short-name (the declared type / the
type-independent operator bool).

Two underlying defects surfaced and are fixed:

  - The conversion check evaluated the type of the `condition_clause` node
    (the `( expr )` wrapper, which has no type) instead of the inner
    expression, so `if (obj)` never resolved obj's type. Unwrap the clause.

  - A conversion operator's `operator_cast` node spans the full
    "operator bool() const" in this grammar (params + cv-qualifiers folded in),
    so the method was indexed under that malformed name and member lookups for
    "operator bool" missed. Add cbm_func_name_node_text to normalize it to
    "operator bool", shared by the defs and unified extractors so the def name
    and call-scope QN agree.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 09:55:27 +02:00
Martin Vogel f05f0df811 fix(logging): keep format selection local
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 09:42:03 +02:00
Martin Vogel 9b17927bf6 fix(php-lsp): resolve magic __call dispatch to the __call handler
$p->anything(1) on a class with a __call magic method emitted php_method_dynamic
to a synthetic <class>.anything target at confidence 0.20 — below the pipeline
join's 0.6 floor, and to a node that does not exist — so no CALLS edge ever
carried the strategy.

The call actually dispatches to the class's __call handler. Resolve to
<class>.__call (a real method node) at 0.85 (the dispatch is certain), and stash
the dynamic method name ("anything") in reason so the join binds it to the
textual call site whose callee differs from __call. Admit php_method_dynamic to
the reason-matched join (lsp_resolve.h), the same pattern used for func-pointer,
ctor-ref, and dict-dispatch resolutions.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 05:23:39 +02:00
Martin Vogel 9ef37e89be fix(py-lsp): resolve dict-dispatch calls funcs["a"](v) to the dispatch-table target
A Python call through a dict dispatch table, funcs["a"](v), produced no CALLS
edge at all: the call's function field is a subscript, which the textual
callee extractor did not handle, so no textual call existed for the py-LSP's
lsp_dict_dispatch resolution to attach to (callable=0, strategy absent).

Three coordinated changes, the same reason-field pattern used for func_ptr and
ctor refs:
- extract_calls: for a Python call whose function field is a subscript with an
  identifier base and a literal string key, emit the base identifier ("funcs")
  as the textual callee so a callable-sourced CALLS edge exists. Gated to that
  exact shape so other subscript calls (arr[i]()) are unaffected.
- py_lsp: the dict-dispatch resolution stashes the subscript base identifier in
  reason (the textual callee differs from the resolved target "foo"), via a new
  py_emit_resolved_call_reason; py_emit_resolved_call delegates with NULL.
- lsp_resolve: admit lsp_dict_dispatch into the reason-matched join so the
  resolution binds to the textual call site.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 04:34:54 +02:00
Martin Vogel c18e3dc304 fix(lsp): resolve Java constructor references via class node + reason-match
A constructor reference `ClassName::new` is extracted as a textual call to
`new`, but the LSP resolved it to a synthetic constructor QN with no graph
node, and the join keys on the callee short-name (`new` != the class/ctor
name), so both lsp_method_ref_ctor and lsp_method_ref_ctor_synth dropped
(callable=0).

Resolve the reference to the ClassName CLASS node (which exists, mirroring
the constructor-call handling) and stash the original textual callee `new`
in the resolved call's `reason` field; the join matches the textual `new`
call site on it, gated to the ctor-ref strategies. No struct/ABI change.
java_cs LSP reproductions 19->21.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 03:07:49 +02:00
Martin Vogel bef9ab08ff fix(lsp): resolve C/C++ function-pointer calls via the join (#func_ptr)
A function-pointer call `fp(args)` has textual callee `fp` (the pointer
variable), but c_lsp resolves it by data-flow to the pointed-to function
`target`. The pipeline join keys on the callee short-name, so `fp` != `target`
dropped the lsp_func_ptr/lsp_dll_resolve resolution and no edge formed.

Stash the original textual callee (`fp`) in the resolved call's `reason`
field (unused and NULL for resolved calls; already copied across all
cross-file paths) and have the join match the call site on it, gated to the
func_ptr/dll strategies so `reason` is never misread as an unresolved-call
diagnostic. No struct/ABI change. c_cpp LSP reproductions 11->12.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 02:38:49 +02:00
Martin Vogel 59b836e441 feat(logging): add operational server logs
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 02:32:05 +02:00
Martin Vogel beaa776ef1 fix(pipeline): emit HTTP_CALLS for external client calls masked by registry mis-resolution (#523)
A client call to an external HTTP library (`requests.get("/api/orders/{id}")`)
carries its service-pattern signal in the callee_name. But the registry
mis-resolves `requests.get` to a spurious builtin short-name match
(`builtins.dict.get` via "get", strategy unique_name) -- a non-empty,
non-HTTP QN. Both the empty-resolution fallback (checks the callee) and the
resolved-QN service check (checks the resolved QN) therefore miss it, the call
is dropped, no HTTP_CALLS edge is written, and cross-repo matching finds
nothing to link.

Detect the HTTP/ASYNC service pattern on the callee_name FIRST (before the
registry can mask it) and emit the edge to a synthesized route node. Applied
to both pipeline paths (pass_calls.c sequential + pass_parallel.c
resolve_file_calls). Cross-repo HTTP linking now works for external client
libraries whose source is not indexed.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 02:04:36 +02:00
Martin Vogel 0d3e24c77a feat(mcp): add tool schemas and pagination
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 02:02:29 +02:00
Martin Vogel 04697c632c fix(pipeline): deny-wins-by-value for infra Route extraction (#521)
A config/upstream URL is often extracted as several string_refs at
different key_path granularities (full path, leaf key, flat/null). Because
the Route node is keyed by the URL VALUE, a value was minted if ANY
granularity passed the per-ref guard -- a denied full path
`registries.terraform-registry.url` was defeated by a sibling leaf `url`,
and a healthcheck `curl ... || exit 1` minted under the leaf key `test`.

Restructure infra-route extraction into two passes: pass 1 collects every
URL value denied under ANY of its refs (whitespace value = command, NULL
key = context-less, or upstream/config/healthcheck key); pass 2 mints only
values never denied. A config-only file now yields zero spurious routes.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 01:46:51 +02:00
Martin Vogel 800476f284 feat(mcp): add structured tool metadata
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 01:37:41 +02:00
Caio Ribeiro 2358b3c452 Fix OpenClaw MCP config install path
Signed-off-by: Caio Ribeiro <caio.ribeiro.clw@gmail.com>
2026-06-27 23:17:49 +00:00
Martin Vogel e51c93554f fix(fqn): keep structural nodes from dir-module QN collision; correct dotfile module QN
A directory-based-module language (Go/Java) derives a file's module QN
from its directory: a root file's module == the project name and a file
in pkg/ has module proj.pkg -- exactly the QNs of the "Project" root and
the "pkg/" Folder structural nodes. The per-file Module def then clobbered
those nodes' labels through the gbuf upsert (last-write-wins on label),
turning Project/Folder into Module. Guard the upsert so a "Module" never
downgrades a "Project" or "Folder" -- the directory node is the package
container. One guard covers both the sequential upsert and the parallel
local-gbuf merge.

Separately, a dotfile such as .env had its leading dot stripped as an
"extension", leaving an empty stem whose module QN also collided with the
project root. Treat a leading dot as a dotfile marker (not an extension)
and drop it from the QN segment, so .env -> proj.env (a distinct module).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 23:13:01 +02:00
Martin Vogel b3b3a48998 fix(fqn): directory-based module QN for Java/Go (de-double) + nested-class enclosing
Java/Go QNs doubled the top-level class/package (proj.Outer.Outer.run; Go module
included the filename). Add cbm_fqn_module_source_lang / cbm_fqn_compute_source_lang
(dir-based module for Java/Go; legacy cbm_fqn_compute UNCHANGED for import paths),
route the single authority cbm.c:569 result->module_qn + the def/calls/pipeline
module derivations through them. Also fix unified compute_class_qn to prefix the
enclosing class for nested classes (was ignored) so def-QN == LSP caller_qn ==
calls-enclosing → lsp_outer_dispatch joins. Reproduce-first tests added; legacy
test_fqn.c/test_registry.c (generic helper) preserved. Per external second-opinion plan.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 21:12:07 +02:00
Martin Vogel 0849f28c3f fix: bulk parallel — Rust cross-crate, Python builtins, #607 reinstall, grammar reds
Four file-disjoint problem groups fixed in parallel, deployed together:
- G1 (lsp): wire the dead Rust cross-file LSP into pass_lsp_cross.c (CBM_LANG_RUST
  in has_cross_lsp + run_one, CBMLSPDef->CBMRustLSPDef conversion, Cargo manifest
  via cbm_cargo_parse threaded through) -> 8 in-crate Rust strategy reds + #56
  cross-crate (lsp_cross_crate disambiguation).
- G2 (lsp): the py typeshed registry already resolved builtins but no builtins.*
  graph node existed to target -> add py_builtins.c injecting builtin def nodes
  (len/str/list/dict + str.upper/list.append/...). Plus rescope the genuinely
  no-edge LSP markers (lsp_unresolved/_unindexed/external-import) to assert the
  accurate no-edge invariant (new inv_no_calls_edge_to_qn helper).
- G3 (cli): #607 — install now PRESERVES existing indexes by default + a
  --reset-indexes opt-in (cbm_install_handle_existing_indexes helper); uninstall/
  update unchanged; repro_issue607 retargeted to the helper.
- G4 (grammar): Swift struct (Swift uses class_declaration+declaration_kind),
  Nix function defs + a discovered Nix calls-extraction bug, Teal/Magma fixtures
  corrected. LLVM/NASM confirmed already green. (Meson/Nim flagged needs-decision.)

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 19:15:47 +02:00
Martin Vogel 49aab71489 fix(lint): clear cppcheck errors gating make-test (NULL-target guard + go.mod var shadow)
The CI lint job (cppcheck) failed, which SKIPS the gated make-test job:
- pass_parallel.c: emit_config_edge/emit_normal_calls_edge dereference target->id,
  but emit_service_edge can be reached with target==NULL on the #523 HTTP/ASYNC
  external-client bypass. cppcheck (ctunullpointer) flagged the potential NULL
  deref. Guard both emitters — a CONFIGURES/CALLS edge needs a real target.
- extract_defs.c: the go.mod require_spec local 'spec' shadowed the CBMLangSpec
  *spec parameter (cppcheck shadowArgument, treated as error here). Rename to
  req_spec. Full scripts/lint.sh --ci (clang-format-20 + cppcheck) now passes.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 15:04:27 +02:00
Martin Vogel 9cbb1aa90f style: clang-format-20 sweep (marathon-touched files)
The CI lint uses clang-format-20 (scripts/lint.sh --ci CLANG_FORMAT=clang-format-20).
Grammar/LSP/struct/issue edits across these files weren't formatted with cf-20,
failing lint and gating the make-test job. Format with cf-20.1.8 to match CI.
No logic change.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 14:34:57 +02:00
Martin Vogel ad33c9b359 fix(issues): #521 YAML config-URL Route dedup, #523 sequential external HTTP edge, #520 fixture project arg
#521: YAML leaf URLs were pushed to string_refs twice (once with NULL key_path
in handle_string_refs, once via the key_path-aware YAML walk); the NULL-key_path
copy bypassed the upstream/config-URL deny check and minted spurious Route nodes.
Skip YAML in handle_string_refs so the key_path walk is the sole authority.
#523: the sequential pass dropped calls to external/unindexed HTTP client libs
(requests.get) before the service-pattern check; classify on the raw callee_name
in the empty-resolution branch and emit the HTTP/ASYNC edge (target=NULL), mirroring
the parallel path, so cross-repo matching can link it.
#520: fixture omitted the required project arg to detect_changes (production
correct); pass project derived from the tmpdir.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 14:31:17 +02:00
Martin Vogel 554b171cf7 fix(graph): precise Struct label for Rust/Swift/D/Go structs (Option B)
Struct definitions were labelled 'Class', conflating a distinct kind. Emit
the precise 'Struct' label for Rust (struct_item), Swift/D (struct_declaration)
and Go (type_spec struct_type); C/C++/Obj-C struct_specifier stays 'Class'.

To avoid regressing type resolution, a struct must still behave as a type
everywhere a class does. Added a centralized predicate cbm_label_is_type_like()
(Class/Struct/Interface/Enum/Type/Trait) and routed every type-like consumer
through it: registry seeding (pass_definitions/pass_parallel/pipeline_incremental
kept in sync), class-resolution (pass_semantic/pass_parallel resolve_as_class),
Go interface satisfaction (collects Struct nodes), the cross-file LSP label map,
and the Go/Rust LSP type registrars. Class-only sites (protobuf services, K8s
kinds, the C-family LSPs) are left unchanged.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 13:54:51 +02:00
Martin Vogel 781456818f style: clang-format issue-batch additions (cypher/mcp)
Fixes the dry-run lint failure: the #627 cypher and #514/#520/#546 mcp
additions had lines exceeding the column limit. clang-format 22.1.1
(project version) wraps them; no logic change.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 13:13:26 +02:00
Martin Vogel fc1b6cc72d fix(lsp): join type-aware method calls (C++ ::/->, Go receiver QN, templates, ctor)
The pipeline join (cbm_pipeline_find_lsp_resolution) dropped LSP strategies
when the textual callee carried a member/scope separator the bare-segment
helper did not recognise:

- C++ '::' (Math::square) and '->' (p->run): bare-segment split only on '.',
  so the textual callee never matched the LSP's dotted callee_qn short name.
  Split on the last of '.', ':' or '>' (the latter only when closing '->'),
  recovering the method on both QN and textual sides.
- C++ explicit template calls f<T>(): the 'function' field is a
  template_function whose 'name' child is the bare callee; emit it so a
  textual callee (hence a CALLS edge for lsp_template) exists.
- Go methods: enclosing_func_qn was package.Method, but the textual extractor
  and registry qualify methods as package.Type.Method, so caller_qn never
  matched and every in-method call lost its type-aware strategy. Derive the
  receiver type (unwrapping *Type) and build package.Type.Method.
- C++ 'new Foo()': resolve to the existing Foo class node when the class has
  no user-declared constructor (no Foo.Foo node), mirroring java_lsp.c, so a
  CALLS edge carrying lsp_constructor still forms.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 12:26:46 +02:00
Martin Vogel 3f754cf449 fix: 17 reproduce-first issue + new-bug fixes (per-case verified)
Each was RED (reproduce-first). Verdicts: production bug unless noted.

- #510 nested .gitignore: load root .gitignore unconditionally (discover.c).
- #403 IDE dir: add "Antigravity" to ALWAYS_SKIP_DIRS.
- #571 CJK project name: transliterate non-ASCII bytes to hex in fqn.c (was -> "-").
- #520 detect_changes: include untracked files (git status --porcelain -uno) (mcp.c).
- #363 CBM_MEM_BUDGET_MB env override (mem.c).
- #570 Codex dual-hook: write the hook to hooks.json when present (cli.c).
- #431 VSCode per-profile mcp.json (cli.c).
- #521 routes from config URLs: deny upstream/jwks/healthcheck/... keys (pipeline.c).
- #548 D:\ browse: normalize sep before is_dir + drive-root self-parent (http_server.c);
  TEST A was a broken fixture (called is_dir on backslash) -> corrected to the
  production sequence; assertion unchanged.
- #495 Rust cfg-gated twins: fold #[cfg(...)] into the QN (extract_defs.c).
- new_py_tuple_unpack: handle pattern_list/tuple_pattern LHS -> Variable per id.
- new_ts_class_field_arrow: class arrow-field -> Method + scope (extract_defs.c).
- repro_extraction/#554 C++ out-of-line: compute_func_qn class-qualifies the call's
  enclosing QN via cbm_cpp_out_of_line_parent_class (extract_unified.c + helpers.h).
- #523 cross-repo HTTP_CALLS: emit service-pattern edge with target=NULL when the
  client lib is unindexed (pass_calls.c, pass_parallel.c).
- #514 data_flow arg expressions: serialize "args" on CALLS edges + propagate
  through store BFS + mcp data_flow (pass_calls.c, store.h/.c, mcp.c).
- #627 query_graph: size_t malloc + NULL-check; OPTIONAL MATCH from bound terminal
  so WHERE c IS NULL returns orphans correctly (cypher.c).
- #546/#480 trace_path: union BFS across same-name nodes (.d.ts dup) (mcp.c).

DEFERRED (need a maintainer decision, untouched): #56 cross-crate Rust (needs Cargo
workspace plumbing / Rust cross-LSP — architectural), #607 reinstall-deletes-index
(cbm_remove_indexes is shared with uninstall/update where deletion is intended).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 11:59:59 +02:00
Martin Vogel 9ebddb718a fix(cypher): LIMIT 0 returns 0 rows instead of all rows
The return-clause `limit` was zero-initialized (calloc) and every guard tested
`limit > 0`, so an explicit `LIMIT 0` was indistinguishable from "no LIMIT
clause" and returned ALL rows. Standard Cypher treats `LIMIT N` as an upper
bound, so `LIMIT 0` must return zero rows.

Default `limit` to the sentinel -1 ("no limit"); the parser still sets 0 for an
explicit `LIMIT 0`. Change the truncation guards (rb_apply_skip_limit,
bindings_skip_limit) and the apply call to `limit >= 0`, so limit 0 truncates to
0 while -1 returns all. The proj_cap optimization stays `> 0` (LIMIT 0 falls
through to full projection, then the final truncation yields 0).

Reproduced by repro_new_cypher_limit_zero (was RED): `RETURN ... LIMIT 0` must
yield row_count == 0.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 02:20:47 +02:00
Martin Vogel f8a7e8b715 fix(lsp): join method-dispatch resolutions by bare callee short-name
The LSP-resolution join compared the LSP's class-qualified callee short-name
(e.g. "inc" from "Counter.inc") against the call's RAW callee_name, which is
receiver-qualified for method/qualified calls ("c.inc", "A.Helper", "c.Add").
That comparison always missed for method dispatch, so every type-aware LSP
resolution (lsp_type_dispatch, cs_static_typed, lsp_method_dispatch, ...) was
silently dropped and the call fell through to the weaker textual registry
resolver — the LSP strategy never reached the CALLS edge's properties_json.

Reduce the call's callee_name to its bare last dot-separated segment before the
comparison, mirroring what is already done to callee_qn. The LSP has already
performed receiver->type resolution, so matching bare method names is correct;
free-function calls (already bare) are unaffected. This lets the more accurate
type-aware LSP resolution win over textual registry matching for method calls.

Reproduced by the repro_lsp_* per-pass strategy suites (java/cs/go/rust/kotlin/
php/ts), which asserted the LSP strategy is present on a CALLS edge and were RED.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-27 01:40:41 +02:00
Martin Vogel 639bac9c5d fix(mcp): back up corrupt DB instead of silently deleting it (#557)
Data-loss fix: resolve_store() unlink()'d a project DB (+WAL/SHM) when
cbm_store_check_integrity() failed, destroying the user's graph with no recovery.
Rename the DB to <path>.corrupt instead (clearing any prior backup first so rename
succeeds on Windows; fall back to unlink only if rename fails). Re-index rebuilds a
fresh DB. Flips repro_issue557 green (DB preserved / backup exists).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-26 23:49:33 +02:00
Martin Vogel 9c17b79aba fix(discover): skip .claude-worktrees during indexing
QUALITY_ANALYSIS gap #1: .claude-worktrees was indexed (nearly tripling this
repo's indexed surface + polluting queries with stale duplicate symbols).
Discovery skipped .claude and .worktrees but not .claude-worktrees. Add it to
ALWAYS_SKIP_DIRS. Flips the discovery-hygiene invariant green.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-26 22:10:02 +02:00
Martin Vogel 66b3e3004b Merge pull request #614 from linze0721/berserk/fd632085-2b69-4b14-930b-47025d80d973
fix: get_architecture should honor path scope
2026-06-25 21:18:49 +02:00
Martin Vogel 677582ccf8 Merge pull request #539 from RithvikReddy0-0/fix/516-adr-persistence
fix(pipeline): preserve ADR across full re-index (#516)fix(pipeline): preserve ADR across full re-index (#516)
2026-06-25 21:18:33 +02:00
saurav kumar 078e9e2d85 Merge branch 'main' into fix/json-escape 2026-06-24 20:36:59 +05:30
Saurav Kumar fdcafbb53f fix(foundation): properly escape JSON control characters as \u00XX
Signed-off-by: Saurav Kumar <sauravsk2507@gmail.com>
2026-06-24 20:33:52 +05:30
Berserk Agent e270ceb8a4 style(store,mcp): clang-format-20 for CI lint (#604)
Signed-off-by: Berserk Agent <berserk@agent.local>
2026-06-24 13:54:33 +00:00
Berserk Agent 55058c05f0 fix(arch): normalize path trailing slashes; align MCP path_scoped with store (#604)
Signed-off-by: Berserk Agent <berserk@agent.local>
2026-06-24 12:54:45 +00:00
Berserk Agent adf602ec94 fix(mcp): document path on get_architecture and emit root/scoped totals (#604)
Signed-off-by: Berserk Agent <berserk@agent.local>
2026-06-24 12:50:49 +00:00
Berserk Agent 9332593b26 Store path scoping for get_architecture
Signed-off-by: Berserk Agent <berserk@agent.local>
2026-06-24 12:38:11 +00:00
RithvikReddy0-0 98c4fc345a fix(pipeline): harden ADR preservation and add regression test (#516)
Addresses review on #539.

- Free p->saved_adr in cbm_pipeline_free so it is not leaked on error
  paths that exit before the restore in dump_and_persist_hashes (e.g. a
  cbm_gbuf_dump_to_sqlite failure).
- Check cbm_store_adr_store's return value on restore and log an error
  instead of silently dropping the ADR (the original #516 symptom).
- Add reproduce-first test pipeline_adr_survives_full_reindex: index,
  store an ADR, force a full re-index by adding files, assert the ADR
  survives unchanged. Passes against the fix.

Signed-off-by: RithvikReddy0-0 <rithvikreddymukkara@gmail.com>
2026-06-24 01:27:32 +00:00
RithvikReddy0-0 7f622b1cde fix(pipeline): preserve ADR across full re-index (#516)
manage_adr stores ADRs in project_summaries, but a full re-index
(triggered by file changes or new files) deletes the DB in
try_incremental_or_delete_db and rebuilds it from the graph buffer,
which writes an empty project_summaries table. file_hashes were
re-persisted after the rebuild but project_summaries were not, so the
ADR was silently lost.

Fix: capture the ADR before the DB is unlinked, stash it on the
pipeline struct, and restore it after the rebuilt DB is reopened in
dump_and_persist_hashes. The incremental path is unaffected (it never
rewrites the DB). Verified: ADR now survives a full re-index.

Signed-off-by: RithvikReddy0-0 <rithvikreddymukkara@gmail.com>
2026-06-24 01:24:06 +00:00
Martin Vogel 3d4236e861 Merge pull request #486 from mvanhorn/fix/400-windows-persistence-artifact-silent-failure
fix: Surface a real error when persistence artifact export silently fails on Windows
2026-06-23 23:52:36 +02:00
Martin Vogel 090a1a72d5 Merge pull request #542 from mvanhorn/fix/499-global-core-excludesfile-ignore-source
fix: honor git global core.excludesFile as an ignore source
2026-06-23 23:46:24 +02:00
Martin Vogel f82c6aee68 Merge pull request #526 from jstar0/fix/snippet-valid-utf8
fix(mcp): return valid UTF-8 snippets
2026-06-23 23:46:20 +02:00
Martin Vogel 96c1fc38fb Merge pull request #465 from KerseyFabrications/fix/cypher-with-node-props
fix(cypher): preserve node properties through WITH aggregation
2026-06-23 23:46:16 +02:00
Martin Vogel ca5c0d2a27 Merge pull request #588 from GothUncc/fix/gcc15-strstr-const-qualifier
fix(cli): const-qualify local pointers in codex_hook_strip for gcc 15
2026-06-23 23:08:24 +02:00
Martin Vogel 5e40a24326 Merge pull request #579 from BombaxCeiba/fix/list-projects-2gb-windows
fix(mcp): replace `.db`-targeting `stat()` with `cbm_file_size` on Windows (> 2 GB)
2026-06-23 23:08:17 +02:00