From 9773653a4e6ba9bed57f068a5bc8bda05bb9c4c7 Mon Sep 17 00:00:00 2001 From: maria-hambardzumian Date: Thu, 25 Jun 2026 12:42:12 +0400 Subject: [PATCH 1/2] EPMRPP-117079 || Introduce a code knowledge graph for search/read operations --- .codegraph/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .codegraph/.gitignore diff --git a/.codegraph/.gitignore b/.codegraph/.gitignore new file mode 100644 index 0000000..d20c0fe --- /dev/null +++ b/.codegraph/.gitignore @@ -0,0 +1,5 @@ +# CodeGraph data files — local to each machine, not for committing. +# Ignore everything in .codegraph/ except this file itself, so transient +# files (the database, daemon.pid, sockets, logs) never show up in git. +* +!.gitignore From c8d696da9b2692130283aa487b14df6c537fb769 Mon Sep 17 00:00:00 2001 From: maria-hambardzumian Date: Thu, 25 Jun 2026 13:12:14 +0400 Subject: [PATCH 2/2] EPMRPP-117079 || Add codegraph index generation command (npm run codegraph) --- README.md | 15 +++++++++++++++ package.json | 1 + scripts/codegraph.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100755 scripts/codegraph.sh diff --git a/README.md b/README.md index 43e66e9..3492e11 100644 --- a/README.md +++ b/README.md @@ -634,3 +634,18 @@ The method takes one argument: Licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) license (see the LICENSE.txt file). +## Code knowledge graph + +This repo carries a local **code knowledge graph** ([colbymchenry/codegraph](https://github.com/colbymchenry/codegraph)) +that the ReportPortal AI agents (and your own tooling) use to resolve symbols and +references without scanning raw files. + +```bash +npm run codegraph # build it the first time, fast incremental sync after +npm run codegraph -- --force # rebuild from scratch +``` + +The graph lives in `.codegraph/codegraph.db` — it is **gitignored and local to your +machine** (only `.codegraph/.gitignore` is committed). It is a pure derivative of the +source, so regenerate it any time. The engine is fetched on demand via `npx`, so there +is no added project dependency. diff --git a/package.json b/package.json index 4738b71..71016be 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "ReportPortal client for Node.js", "author": "ReportPortal.io", "scripts": { + "codegraph": "bash scripts/codegraph.sh", "build": "npm run clean && tsc", "clean": "rimraf ./build", "lint": "eslint ./statistics/**/* ./lib/**/*", diff --git a/scripts/codegraph.sh b/scripts/codegraph.sh new file mode 100755 index 0000000..61d9b9b --- /dev/null +++ b/scripts/codegraph.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Build or update this repo's local code knowledge graph (.codegraph/codegraph.db). +# +# Idempotent — safe to run any time: +# (no args) first run -> init (full index); after that -> sync (fast, incremental) +# --force rebuild the graph from scratch +# +# The DB is gitignored and local to your machine; only .codegraph/.gitignore is +# committed. Engine: https://github.com/colbymchenry/codegraph (run via npx, no +# global or project install required). +set -u +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +ENGINE="@colbymchenry/codegraph@^1.1.0" +export CODEGRAPH_TELEMETRY="${CODEGRAPH_TELEMETRY:-0}" + +case "${1:-}" in + --force) + echo "[codegraph] rebuild: $DIR" + npx -y "$ENGINE" index "$DIR" + ;; + *) + if [ -f "$DIR/.codegraph/codegraph.db" ]; then + echo "[codegraph] update (sync): $DIR" + npx -y "$ENGINE" sync "$DIR" + else + echo "[codegraph] init: $DIR" + npx -y "$ENGINE" init "$DIR" + fi + ;; +esac