Skip to content

feat(us6): drop graph subsystem (PR-v5-6)#187

Merged
thebtf merged 3 commits into
mainfrom
feat/v5-us6-graph
Apr 18, 2026
Merged

feat(us6): drop graph subsystem (PR-v5-6)#187
thebtf merged 3 commits into
mainfrom
feat/v5-us6-graph

Conversation

@thebtf
Copy link
Copy Markdown
Owner

@thebtf thebtf commented Apr 18, 2026

US6: Drop Graph Subsystem (BREAKING)

Part of engram v5.0.0 BREAKING cleanup — removes the internal/graph/* package and all FalkorDB integration.

Scope

  • DELETE files: internal/graph/{noop,store,writer}.go + falkordb/{client,integration_test}.go (5 files), ui/src/views/GraphView.vue
  • REMOVE from internal/mcp/server.go: graphpkg import, graphStore field, SetGraphStore method, tool registrations graph_query+get_graph_stats, dispatch cases (+ aliases), handleGetGraphStats, handleGraphQuery
  • REMOVE from internal/mcp/tools_admin.go: admin dispatch cases graph + graph_stats
  • REMOVE from internal/worker/service.go: graphpkg/falkordb imports, graphStore/graphWriter fields, FalkorDB init block, syncGraphFromRelations method, /api/graph/sync route, wiring+shutdown blocks
  • REMOVE from internal/worker/handlers_data.go / handlers_system.go: handleGraphSync handler, graph stats from system health, GraphStore: from StoreEntitiesParams{} literals
  • REMOVE from internal/search/manager.go: graphpkg import, graphStore field, SetGraphStore method, ExpandViaGraph method, graphExpansion* constants
  • REMOVE from internal/worker/retrieval.go / retrieval_helpers.go: expandViaGraph hook field, expandGraphNeighbors helper + caller
  • REMOVE from internal/synthesis/entity_store.go: graph import, GraphStore field from StoreEntitiesParams, FalkorDB edge creation block
  • REMOVE from internal/config/config.go: ENGRAM_GRAPH_*, ENGRAM_FALKORDB_*, ENGRAM_INJECT_GRAPH_* env vars and struct fields

Dependencies removed by go mod tidy

  • github.com/falkordb/falkordb-go v2.0.2+incompatible
  • github.com/gomodule/redigo v1.9.3 (transitive through falkordb-go)

FalkorDB Container RETAINED

Per ADR-07: docker-compose.yml falkordb service stays as inactive infrastructure reserved for v5.x graph-v2. Operator can wipe keyspace manually or leave it running.

Stats

  • 20 files changed, 53 insertions(+), 2309 deletions(-)
  • Build + vet + tests all green (internal/mcp, internal/worker, internal/search, internal/synthesis, internal/config)

Context

Follows US5 (patterns drop, #186), US7 (consolidation, #185), US4 (project_settings, #184). Next: US8 (learning/scoring/LLM drop), US9 (search/expansion drop), US3-PR-B (observations table drop), US10-14.

Conventions Applied

  • C1 (no stubs): direct git rm + surgical edits; NO //go:build ignore
  • C7 (CodeRabbit only): review via CodeRabbit, no Gemini

Reversibility

  • REVERSIBLE (code) — graph package can be re-added with git revert
  • IRREVERSIBLE (wiped data) — FalkorDB keyspace deletion is destructive, but per audit value=0

🤖 Generated with Claude Code

Summary by CodeRabbit

Refactor

  • Удалена поддержка графовой подсистемы — удалены интеграция с внешним графовым хранилищем, фоновые синки и асинхронная запись ребер.
  • Интерфейс графа удалён — компонент визуализации и маршрут в приложении больше не доступны.
  • Админ‑функции и API для графа убраны — соответствующие инструменты и эндпоинты возвращают заглушки/ошибки.
  • Конфигурация упрощена — все параметры графа удалены из настроек.
  • Тесты и вспомогательные механизмы, связанные с графом, удалены.

BREAKING: removes internal/graph/* package and all FalkorDB integration.

- Delete `internal/graph/{noop,store,writer}.go` + `falkordb/{client,integration_test}.go`
- Delete `ui/src/views/GraphView.vue`
- Remove graph tool handlers from internal/mcp/server.go: graph_query, get_graph_stats, SetGraphStore
- Remove graph admin dispatch cases from internal/mcp/tools_admin.go
- Remove graphStore/graphWriter fields and FalkorDB init block from internal/worker/service.go
- Remove syncGraphFromRelations method + /api/graph/sync route + handleGraphSync handler
- Remove ExpandViaGraph + expansion constants + SetGraphStore from internal/search/manager.go
- Remove expandViaGraph hook field + expandGraphNeighbors helper from internal/worker/retrieval*.go
- Remove GraphStore field + FalkorDB edge creation from internal/synthesis/StoreEntitiesParams
- Remove ENGRAM_GRAPH_* + ENGRAM_FALKORDB_* + ENGRAM_INJECT_GRAPH_* env vars from internal/config/config.go
- `go mod tidy` drops falkordb-go v2.0.2 + redigo v1.9.3

FalkorDB Docker container RETAINED in docker-compose.yml per ADR-07 as inactive infra
for future v5.x graph-v2 reservation.

Build+vet+tests green (internal/mcp, internal/worker, internal/search, internal/synthesis, internal/config).

REVERSIBLE (code). IRREVERSIBLE (wiped FalkorDB data — per audit value=0).

Per Cross-Phase Conventions: C1 (no stubs, direct deletion), C7 (CodeRabbit only).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Warning

Rate limit exceeded

@thebtf has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 29f8ce65-3349-45e1-956d-8d1b93f528f9

📥 Commits

Reviewing files that changed from the base of the PR and between a13447f and aec8143.

📒 Files selected for processing (4)
  • internal/mcp/server.go
  • internal/mcp/tools_admin.go
  • internal/worker/retrieval.go
  • internal/worker/retrieval_helpers.go

Walkthrough

Полное удаление подсистемы графов: конфигурации, интерфейса/реализаций GraphStore (FalkorDB/Noop), асинхронного писателя, интеграции с worker/mcp/search/synthesis, UI-компонента GraphView и связанных маршрутов/тестов/зависимостей.

Changes

Cohort / File(s) Summary
Зависимости
go.mod
Удалены прямые зависимости github.com/falkordb/falkordb-go v2.0.2+incompatible, github.com/gomodule/redigo v1.9.3 и несколько косвенных пакетов.
Конфигурация
internal/config/config.go, internal/config/config_test.go
Удалены все поля и загрузка настроек, связанные с графом (FalkorDB, граф-параметры, ENGRAM_GRAPH_*, InjectGraphBFSEnabled) и два теста.
Интерфейс и типы графа
internal/graph/store.go
Удалён интерфейс GraphStore и связанные типы (RelationEdge, Neighbor, GraphStoreStats).
Реализации графа
internal/graph/falkordb/client.go, internal/graph/noop.go, internal/graph/falkordb/integration_test.go
Полное удаление реализации FalkorDBGraphStore, NoopGraphStore и интеграционных тестов (запросы, MERGE/shortestPath/статистика и т.п.).
Асинхронный писатель
internal/graph/writer.go
Удалена реализация AsyncGraphWriter (буфер, батчи, периодический флаш, статистика).
Worker / сервис
internal/worker/service.go, internal/worker/handlers_data.go, internal/worker/handlers_system.go
Удалена инициализация/закрытие графового хранилища и писателя, REST-роут /api/graph/sync, и вывод конфигурации/статистик графа.
Извлечение / Fusion
internal/worker/retrieval.go, internal/worker/retrieval_helpers.go, internal/worker/retrieval_test.go
Удалены хук/логика инъекции соседей BFS в pipeline извлечения, вспомогательные lookup/expand функции и тест, проверявший фьюжн граф-нейборов.
Поиск
internal/search/manager.go
Удалены поле graphStore, метод SetGraphStore, константы и ExpandViaGraph — логика расширения результатов через граф удалена.
Синтез сущностей
internal/synthesis/entity_store.go
Удалено поле GraphStore из StoreEntitiesParams и логика генерации/записи рёбер в FalkorDB при сохранении сущностей.
MCP / админ-инструменты
internal/mcp/server.go, internal/mcp/tools_admin.go
Удалена проводка graphStore, метод SetGraphStore, инструменты graph_query/get_graph_stats и соответствующие маршруты/обработчики; теперь возвращают ошибки о снятом бэкенде.
UI: маршрут и компонент
ui/src/views/GraphView.vue, ui/src/router/index.ts, ui/src/components/layout/AppSidebar.vue
Удалён компонент GraphView, маршрут /graph/:observationId? и пункт навигации «Graph» в сайдбаре.

Estimated code review effort

🎯 4 (Сложная) | ⏱️ ~45 минут

Possibly related PRs

Poem

🐰
Веткой моркови черчу коммит,
Граф улетел за горизонт,
Falkor и редис — тихий мит,
Пакеты в памяти — как светлый фронт.
Пустой граф — и код стал чуть легче,
Я прыгаю в новый сбор — вперёд, влечён.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно отражает основное изменение: удаление всей графовой подсистемы и интеграции FalkorDB из проекта.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v5-us6-graph

Comment @coderabbitai help to get the list of available commands and usage tips.

@thebtf
Copy link
Copy Markdown
Owner Author

thebtf commented Apr 18, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the entire graph subsystem, including the FalkorDB backend, graph-related configuration parameters, and graph-augmented search logic. It also cleans up associated MCP tools, administrative actions, and frontend components. Feedback suggests removing several stub methods—specifically handleGetGraphNeighbors, handleGetGraphStats, and lookupGraphSeedNeighbors—that were left behind and are no longer functional or referenced.

Comment thread internal/mcp/server.go Outdated
Comment thread internal/mcp/server.go Outdated
Comment thread internal/worker/retrieval_helpers.go Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
internal/mcp/tools_admin.go (1)

16-16: Сведите список admin-action к одному источнику правды.

Сейчас перечень valid actions зашит строкой в двух ошибках здесь и ещё отдельно дублируется в описании admin-tool в internal/mcp/server.go. При следующем изменении они легко разъедутся. Лучше держать canonical []string/map и генерировать из него и валидацию, и тексты ошибок, и metadata инструмента.

Also applies to: 58-58

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/mcp/tools_admin.go` at line 16, The hard-coded list of valid admin
actions is duplicated; introduce a single canonical variable (e.g., a
package-level []string or map named validAdminActions or adminActionsSet) that
contains all actions, use that variable in the validation logic in
tools_admin.go (where the current error string is returned) to build the error
message text dynamically, and also reference the same canonical variable when
generating the admin tool metadata/description in internal/mcp/server.go so both
validation and help text come from one source of truth.
internal/worker/retrieval_helpers.go (1)

52-64: Добейте cleanup graph-пути в retrieval hooks.

После удаления graph-expansion этот helper либо проксирует тестовый hook, либо всегда возвращает nil. Пока lookupGraphSeedNeighbors и retrievalHooks.getGraphNeighbors остаются в коде, висит ложный интеграционный контракт для уже удалённой подсистемы. Лучше удалить или переименовать их вместе, чтобы graph-сurface исчез полностью.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/worker/retrieval_helpers.go` around lines 52 - 64, Удалите ложный
graph-surface: удалите функцию lookupGraphSeedNeighbors и поле/hook
retrievalHooks.getGraphNeighbors (или переименуйте его в явно тестовый символ,
например getGraphNeighborsForTests) и уберите все вызовы
normalizeObservationIDs(...) связанных с этим потоком; в коде ищите символы
lookupGraphSeedNeighbors, retrievalHooks.getGraphNeighbors и
normalizeObservationIDs, удалите/переименуйте определения и все места их
использования (включая тест-хуки), чтобы полностью убрать оставшийся контракт
graph-expansion из кода.
internal/mcp/server.go (1)

4155-4165: Удалите legacy graph-handlers целиком или возвращайте обычную ошибку.

Сейчас оба метода сериализуют успешный ответ с полем "error": "graph backend removed". Если какой-то внутренний вызов ещё дойдёт сюда напрямую, это будет выглядеть как валидный payload, а не как удалённая возможность. После удаления registration/dispatch безопаснее убрать эти методы совсем либо вернуть нормальный error из handler'а.

Also applies to: 4168-4177

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/mcp/server.go` around lines 4155 - 4165, The handlers that currently
build and return a serialized success payload (the local variable response
containing "error": "graph backend removed" and using params.ObservationID /
params.MaxHops) should not pretend to succeed; either remove these legacy
graph-handler functions entirely or change them to return a real error instead
of a JSON string payload (e.g., return an error from the handler or propagate
fmt.Errorf("graph backend removed")). Apply the same change to the other similar
block referenced (the one around the response map at the second occurrence) so
callers cannot receive a valid-looking payload when the graph backend is
removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@internal/mcp/server.go`:
- Around line 4155-4165: The handlers that currently build and return a
serialized success payload (the local variable response containing "error":
"graph backend removed" and using params.ObservationID / params.MaxHops) should
not pretend to succeed; either remove these legacy graph-handler functions
entirely or change them to return a real error instead of a JSON string payload
(e.g., return an error from the handler or propagate fmt.Errorf("graph backend
removed")). Apply the same change to the other similar block referenced (the one
around the response map at the second occurrence) so callers cannot receive a
valid-looking payload when the graph backend is removed.

In `@internal/mcp/tools_admin.go`:
- Line 16: The hard-coded list of valid admin actions is duplicated; introduce a
single canonical variable (e.g., a package-level []string or map named
validAdminActions or adminActionsSet) that contains all actions, use that
variable in the validation logic in tools_admin.go (where the current error
string is returned) to build the error message text dynamically, and also
reference the same canonical variable when generating the admin tool
metadata/description in internal/mcp/server.go so both validation and help text
come from one source of truth.

In `@internal/worker/retrieval_helpers.go`:
- Around line 52-64: Удалите ложный graph-surface: удалите функцию
lookupGraphSeedNeighbors и поле/hook retrievalHooks.getGraphNeighbors (или
переименуйте его в явно тестовый символ, например getGraphNeighborsForTests) и
уберите все вызовы normalizeObservationIDs(...) связанных с этим потоком; в коде
ищите символы lookupGraphSeedNeighbors, retrievalHooks.getGraphNeighbors и
normalizeObservationIDs, удалите/переименуйте определения и все места их
использования (включая тест-хуки), чтобы полностью убрать оставшийся контракт
graph-expansion из кода.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5d0f8b4b-4352-4729-a8b5-250d262cb1f2

📥 Commits

Reviewing files that changed from the base of the PR and between 7afd33f and c4fec63.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (19)
  • go.mod
  • internal/config/config.go
  • internal/config/config_test.go
  • internal/graph/falkordb/client.go
  • internal/graph/falkordb/integration_test.go
  • internal/graph/noop.go
  • internal/graph/store.go
  • internal/graph/writer.go
  • internal/mcp/server.go
  • internal/mcp/tools_admin.go
  • internal/search/manager.go
  • internal/synthesis/entity_store.go
  • internal/worker/handlers_data.go
  • internal/worker/handlers_system.go
  • internal/worker/retrieval.go
  • internal/worker/retrieval_helpers.go
  • internal/worker/retrieval_test.go
  • internal/worker/service.go
  • ui/src/views/GraphView.vue
💤 Files with no reviewable changes (12)
  • internal/config/config_test.go
  • internal/worker/retrieval_test.go
  • go.mod
  • internal/worker/retrieval.go
  • internal/worker/handlers_data.go
  • internal/worker/service.go
  • internal/graph/falkordb/integration_test.go
  • internal/graph/writer.go
  • internal/graph/noop.go
  • ui/src/views/GraphView.vue
  • internal/graph/store.go
  • internal/graph/falkordb/client.go

thebtf added 2 commits April 19, 2026 01:03
UI build failed because src/router/index.ts still had
'component: () => import(@/views/GraphView.vue)' after
GraphView.vue was deleted. Vite resolves lazy imports at build time.

Also removed the 'Graph' entry from AppSidebar nav items.

Fixes CI build failure on PR #187.
…ions

- Remove lookupGraphSeedNeighbors stub + normalizeObservationIDs (retrieval_helpers.go)
- Remove getGraphNeighbors field from retrievalHooks (retrieval.go)
- Introduce adminActions []string single-source-of-truth (tools_admin.go)
- Admin tool Description uses strings.Join(adminActions, ", ") (server.go)

Build+vet+tests green.
@thebtf thebtf merged commit a861b94 into main Apr 18, 2026
8 checks passed
@thebtf thebtf deleted the feat/v5-us6-graph branch April 18, 2026 22:15
thebtf added a commit that referenced this pull request Apr 18, 2026
Part of engram v5.0.0 US10 cleanup. Follows US6 (GraphView drop), US8-B (LearningView + AnalyticsView drop).

- Delete `ui/src/views/PatternsView.vue` (21KB — references dropped patterns API from US5)
- Delete `ui/src/views/MonitorView.vue` (15KB — observability view, replaced by server logs endpoint)
- Delete `ui/src/views/SystemView.vue` (19KB — scoring stats, dropped in US8-C)
- Remove router routes `/patterns`, `/monitor`, `/logs` (redirect), `/system`
- Remove sidebar nav items: patterns, monitor, system

Stats: 5 files changed, 1525 deletions.

UI build (`npm run build`) green with surviving views.

Companion PRs:
- US6 (#187) ✅ — GraphView
- US8-B (#188) ✅ — LearningView + AnalyticsView

Stale API helpers in `ui/src/utils/api.ts` (patterns/monitor) retained — unused exports; will be cleaned in a dedicated UI cleanup PR.

REVERSIBLE.

Per C7 (CodeRabbit only).
thebtf added a commit that referenced this pull request Apr 19, 2026
…0) (#190)

Part of engram v5.0.0 US10 cleanup. Follows US6 (GraphView drop), US8-B (LearningView + AnalyticsView drop).

- Delete `ui/src/views/PatternsView.vue` (21KB — references dropped patterns API from US5)
- Delete `ui/src/views/MonitorView.vue` (15KB — observability view, replaced by server logs endpoint)
- Delete `ui/src/views/SystemView.vue` (19KB — scoring stats, dropped in US8-C)
- Remove router routes `/patterns`, `/monitor`, `/logs` (redirect), `/system`
- Remove sidebar nav items: patterns, monitor, system

Stats: 5 files changed, 1525 deletions.

UI build (`npm run build`) green with surviving views.

Companion PRs:
- US6 (#187) ✅ — GraphView
- US8-B (#188) ✅ — LearningView + AnalyticsView

Stale API helpers in `ui/src/utils/api.ts` (patterns/monitor) retained — unused exports; will be cleaned in a dedicated UI cleanup PR.

REVERSIBLE.

Per C7 (CodeRabbit only).

Co-authored-by: Kirill Turanskiy <thebtf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant