Skip to content

fix: get_architecture should honor path scope#614

Merged
DeusData merged 5 commits into
DeusData:mainfrom
linze0721:berserk/fd632085-2b69-4b14-930b-47025d80d973
Jun 25, 2026
Merged

fix: get_architecture should honor path scope#614
DeusData merged 5 commits into
DeusData:mainfrom
linze0721:berserk/fd632085-2b69-4b14-930b-47025d80d973

Conversation

@linze0721

Copy link
Copy Markdown
Contributor

Summary

Fix for #604: get_architecture path scoping

Problem

get_architecture ignored the optional path argument and always returned whole-project architecture (same total_nodes / package lists for root vs subdirectory scopes).

Solution (3 commits on branch)

  1. Store layer (src/store/store.c, src/store/store.h): Extended cbm_store_get_architecture with optional path (directory prefix on nodes.file_path). Threaded scoping through arch_* builders (languages, file tree, clusters, hotspots, entry points, routes, packages/modules, schema counts). When path is set, responses expose distinct root vs scoped node/edge totals.
  2. MCP/CLI (src/mcp/mcp.c): Added path to the get_architecture tool schema; handler parses and forwards path, emits root_total_* / scoped_total_* (and related fields) when scoped.
  3. Polish (55058c0): Normalize trailing slashes on path; align MCP path_scoped flag with store behavior.

Tests

  • tests/test_store_arch.c: arch_path_scoping (+ trailing-slash equivalence)
  • tests/test_mcp.c: tool_get_architecture_path_scoping

Verification

make -j$(nproc) -f Makefile.cbm test: 5695 passed, 1 failed — tests/test_incremental.c RSS threshold (pre-existing, unrelated to #604). Targeted architecture path tests passed.

Push

Branch berserk/fd632085-2b69-4b14-930b-47025d80d973 pushed to origin (HEAD 55058c0).

PR

https://github.com/linze0721/codebase-memory-mcp/pull/new/berserk/fd632085-2b69-4b14-930b-47025d80d973

Commit

55058c0

Branch

berserk/fd632085-2b69-4b14-930b-47025d80d973

Closes #604

Berserk Agent and others added 5 commits June 24, 2026 12:38
Signed-off-by: Berserk Agent <berserk@agent.local>
…ls (DeusData#604)

Signed-off-by: Berserk Agent <berserk@agent.local>
…h store (DeusData#604)

Signed-off-by: Berserk Agent <berserk@agent.local>
Signed-off-by: Berserk Agent <berserk@agent.local>
@DeusData

Copy link
Copy Markdown
Owner

Excellent work, @linze0721 — a thorough fix for #604. get_architecture was ignoring the path argument entirely; threading a scoped file_path predicate through every aspect builder (plus the node/edge/schema counts) is genuinely the right shape for this. I appreciate that it's all parameterized SQL and that the unset-path case falls back to the exact prior queries, so default behavior is fully preserved. The root-vs-scoped totals are a useful addition, and both the store-level and end-to-end MCP tests are reproduce-first. All CI green including Windows + CodeQL. Merging — thank you!

@DeusData DeusData merged commit 66b3e30 into DeusData:main Jun 25, 2026
13 checks passed
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.

get_architecture should honor path scope

2 participants