Skip to content

Feature/neo4j all tools - #2806

Closed
haiderRizvii wants to merge 2 commits into
DeusData:mainfrom
haiderRizvii:feature/neo4j-all-tools
Closed

haiderRizvii wants to merge 2 commits into
DeusData:mainfrom
haiderRizvii:feature/neo4j-all-tools

Conversation

@haiderRizvii

Copy link
Copy Markdown

What does this PR do?

Checklist

  • Every commit is signed off (git commit -s) — required, CI rejects
    unsigned commits (DCO, see CONTRIBUTING.md)
  • Tests pass locally (make -f Makefile.cbm test)
  • Lint passes (make -f Makefile.cbm lint-ci)
  • New behavior is covered by a test (reproduce-first for bug fixes)

haiderRizvii and others added 2 commits October 23, 2026 12:01
* feat: add Neo4j as a graph backend

index_repository accepts graph_db (http://host:7474), graph_user,
graph_password and graph_database (CLI: --graph-db ...), with
NEO4J_USER / NEO4J_PASSWORD / NEO4J_DATABASE as fallbacks.

- src/neo4j: HTTP client for Neo4j's transactional endpoint (WinHTTP
  for https on Windows), config + in-process credential cache, sync of a
  published project database into Neo4j as an atomic generation swap,
  and a remote store that answers the graph read primitives.
- The pipeline mirrors every publish (full, incremental, no-op) into
  Neo4j; a <project>.db.graph.json marker (no password) keeps later
  re-indexes syncing to the same target. An unchanged re-run re-uploads
  when Neo4j no longer holds the published generation.
- store: a remote-ops seam routes node/edge lookups, degrees, counts and
  every BFS to Neo4j; reads fall back to the identical local copy when
  Neo4j is unreachable or holds another generation.
- query_graph native:true runs read-only Cypher in Neo4j; index_status
  reports graph_backend; delete_project drops the Neo4j graph.
- The index supervisor passes the password to the worker through its
  environment, never on its command line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(java): never resolve a call onto a Field

Java has no callable fields: `lock.lock()` invokes ReentrantLock.lock,
not the `lock` field, but the unique_name strategy bound it to the
field. cbm_call_onto_field_policy now drops every Java call that lands
on a Field (sequential and parallel resolvers share the policy).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(docker): cbm-graph image to build code graphs into Neo4j

docker/graph builds the binary in a container and indexes a mounted
repository (read-only) into Neo4j. cbm-graph.cmd / cbm-graph.ps1 wrap it
on Windows; an extra .cbmignore (e.g. a fleet-wide one) is merged in and
re-runs are incremental through a named cache volume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* build: make the fork installable from its own releases

- install.sh / install.ps1 / scripts/setup* download from
  haiderRizvii/codebase-memory-mcp; `update` re-runs the installer
  shipped beside the binary, so it updates from the fork too.
- fork-release.yml: build all eight targets (VirusTotal optional),
  smoke-test, publish a full "latest" release with checksums.txt.
- release.yml stops at preflight outside the upstream repository; it
  publishes through upstream's VirusTotal/npm/PyPI/MCP Registry accounts.
- UI issue link points at the fork; URL allowlists updated.
- README: fork notice, install commands, Neo4j backend section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: satisfy the security and no-skips gates for the Neo4j backend

- security-network-source-audit.py: new configured-tcp transport, pinned
  to src/neo4j/neo4j_http.c and to a getaddrinfo() walk over the parsed
  graph_db host with a stream-socket hint; self-tests cover the accepted
  shape and reject other files, other hosts, datagram sockets and
  addresses outside the resolved list.
- security-allowlist.txt: the two configured-tcp calls and the
  graph-backend marker write.
- mcp.c: describe graph_db without a literal example URL.
- test_neo4j.c: register the live test only when a server is configured
  instead of SKIP(), which the no-skips policy forbids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(neo4j): narrow a variable's scope (cppcheck variableScope)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(neo4j): reject malformed responses; make fallback visible

Review follow-up (Copilot):

- A 2xx body is accepted only when "results" holds exactly one entry per
  statement, each with columns/data arrays and rows matching the
  columns (cbm_neo4j_result_shape_error). A malformed reply used to read
  as "no rows": an empty graph to readers, and generation 0 to the sync,
  whose stale-generation cleanup could then delete the live graph. The
  sync additionally requires exactly one integer generation row.
- A Neo4j-backed project answered from the local index now says so in
  every tool reply: a content notice plus structuredContent.graph_backend
  {status: sqlite_fallback, reason}. (The local index is the newest
  generation; the fallback is current, Neo4j is not.)
- A failed background sync is recorded as last_sync_error in the
  project's marker, keeping the last good synced_generation;
  index_status reports local_generation, in_sync and last_sync_error.
- clang-format 20 over the Neo4j sources and the store routing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Route the remaining store reads through the remote backend: structured
search_graph (local regex/LIKE predicates applied to remote candidates),
QN-suffix and overload lookups, caller/callee names, file listing and
get_graph_schema (new prop_keys; sync_format 2 forces a one-time resync).

Every tool reply now names its source (neo4j, neo4j+local, or
sqlite_fallback) and logs a graph.backend line; reads that still need the
local copy (BM25/semantic search, architecture aggregates, impact walk,
file outlines) are marked as local.

Also: renamed .db files still find their Neo4j marker; the project's
remembered login is tried before NEO4J_PASSWORD; a rejected login is not
retried for 60 s (avoids Neo4j's lockout); debug log per Cypher round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant