Skip to content

Releases: Timwood0x10/CodeScope

v0.2.4

Choose a tag to compare

@github-actions github-actions released this 24 Jul 12:12

Windows compilation stability — fully static-linked codescope.exe (zero MinGW runtime DLLs), LadybugDB disabled on Windows (SQLite-only), and critical cross-compilation bug fixes.

What changed

Area Before After
Windows runtime deps Depended on libstdc++-6.dll, libgcc_s_seh-1.dll, libwinpthread-1.dll — crash if MinGW version mismatched Fully static via -static rustflag — single codescope.exe with zero MinGW DLL deps
Windows LadybugDB Vendored lbug_shared.lib + lbug_shared.dll of unverified MinGW ABI Disabled entirely — SQLite-only on Windows (HAS_LADYBUG undefined)
Cross-compile host detection build.rs compared CARGO_CFG_TARGET_OS (returns target = "windows" during cross-compile) → -DCMAKE_SYSTEM_NAME=Windows never set Uses std::env::consts::OS for actual build host
Cross-compile compiler platform_default_compiler("windows") returned gcc/g++ (macOS native clang) Returns x86_64-w64-mingw32-gcc/x86_64-w64-mingw32-g++ when cross-compiling
Stale CMake cache macOS LadybugDB path persisted in shared build-release/, passed to MinGW linker unset(LADYBUG_LIBRARY CACHE) on Windows branch + build.rs skips cache reading on Windows
Dev branch CI No automated Windows validation on dev New .github/workflows/dev.yml: triggers on push to dev (or manual dispatch)
Windows support Unmarked Documented as beta in README

Upgrade notes

  • Windows: The single codescope.exe is now fully self-contained — no DLLs to bundle. LadybugDB/Cypher queries are unavailable on Windows; graph storage uses SQLite only.
  • No breaking API changes: All MCP tools maintain the same JSON response schema.

Bug fixes

# Bug Root cause Fix
1 Cross-compile build.rs ignored cmake system name CARGO_CFG_TARGET_OS returns target during cross-compile std::env::consts::OS for build host
2 Wrong compiler used for cross-compile platform_default_compiler returned native gcc on macOS Detect cross-compile → use MinGW cross-compiler
3 Stale LadybugDB cache breaks Windows link macOS .dylib path persisted in shared build dir unset() + Rust-side Windows guard
4 Windows crash at startup (runtime DLL mismatch) MinGW libstdc++/libgcc/libwinpthread version conflict -static rustflag bakes all runtime into .exe
5 LadybugDB ABI risk on Windows Vendored .lib of unverified MinGW version Disable LadybugDB on Windows entirely

Full changelog

See CHANGELOG.md for the complete list of changes.


v0.2.3

Choose a tag to compare

@github-actions github-actions released this 21 Jul 11:35

Windows beta support — cross-compilation from macOS to x86_64-pc-windows-gnu (MinGW), vendored LadybugDB Windows DLL, and CI pipeline. Plus critical bug fixes for the v0.2.2 LadybugDB migration that broke all query tools.

What changed

Area Before After
Windows support Not supported Beta: cross-compiled codescope.exe (16MB PE32+), lbug_shared.dll bundled, CI windows-2022
search tool Async FTS on graph_nodes (empty), returned no results Synchronous MATCH (n) WHERE n.name CONTAINS 'query' via LadybugDB, ~1ms
isGraphReady() Process-in-memory flag only (broken across worker/CLI processes) Probes LadybugDB directly via MATCH (n) RETURN count(*)
All query tools findSymbolJson prepare failed, find_callers/find_callees etc. "graph not ready" All queries go through entity/relation tables or LadybugDB
graph_nodes/graph_edges Still referenced by >20 SQL queries (returning empty) Fully removed from all query paths. Tables still exist but unused
verify_integrity Hangs indefinitely (no timeout) 10s QueryDeadlineGuard
make fmt Only checked recently modified files Full project lint check (lint-cpp-full)
Cross-compilation N/A build.rs detects cross-compile vs native Windows, sets CMAKE_SYSTEM_NAME only when needed

Upgrade notes

  • Windows: Use --target x86_64-pc-windows-gnu for Rust builds. Requires MinGW-w64 14.0.0+. lbug_shared.dll must be in the same directory as codescope.exe (bundled in the package).
  • No breaking API changes: All MCP tools maintain the same JSON response schema.
  • graph_nodes/graph_edges tables are no longer written: If you have custom scripts that query these tables, migrate to entity/relation.
  • LadybugDB is now required for graph queries: Without LadybugDB, all query tools return "graph not ready" or "LadybugDB not compiled".

Bug fixes (v0.2.2 migration fallout)

# Bug Root cause Fix
1 findSymbolJson prepare failed SQL query referenced graph_nodes (empty) Query entity instead
2 All tools "graph not ready" isGraphReady() in-memory flag not shared across processes probeGraphReady() queries LadybugDB directly
3 project_overview total_symbols:0 Counted graph_nodes rows Count entity rows
4 search returns empty FTS built on graph_nodes (empty), no fallback searchLadybugJson() via LadybugDB Cypher
5 buildFTSFromGraph empty FTS tables built from graph_nodes Build from entity
6 engine_get_project_node_count returns 0 Queried graph_nodes Query entity
7 getLatestProjectId wrong project Queried graph_nodes for node count Query entity
8 verify_integrity hangs No query timeout 10s QueryDeadlineGuard
9 buildCSR reverse query fails ORDER BY target_node_id (wrong column name) ORDER BY target_id
10 Version string still 0.2.1 Hardcoded in engine_ffi.cpp Updated to 0.2.3

Performance

Metric Value
CodeScope self-index (212 files) 899ms
Windows binary size 16MB (PE32+ executable)
LadybugDB search latency ~1ms (Cypher CONTAINS)
Query latency (all graph tools) ~1ms
make check 85 Rust tests + all C++ tests pass

Full changelog

See CHANGELOG.md for the complete list of changes, bug fixes, and cross-platform fixes.

v0.2.2

Choose a tag to compare

@github-actions github-actions released this 21 Jul 07:40
32bad47

LadybugDB graph engine migration — all graph queries now go through LadybugDB Cypher, with entity/relation as the canonical source tables. graph_nodes/graph_edges are deprecated. Plus enhance_project now populates the full model layer even on already-finalized projects.

What changed

Area Before After
Graph queries SQLite graph_nodes/graph_edges with LadybugDB as optional fallback LadybugDB Cypher only; SQLite fallback removed
LadybugDB build compileGraphToLadybugDB reads from graph_nodes/graph_edges buildLadybugFromEntityRelation reads from entity/relation (canonical source)
enhance_project Returns already_finalized without populating model tables Runs runModelIndexSync + buildKnowledgeGraphSync unconditionally
Filtering Undocumented 8-layer smart filtering documented in README with real-world impact data
Storage SQLite only LadybugDB 3.4MB (4.4% of SQLite 77MB) for CodeScope self-index

Upgrade notes

  • No breaking API changes. All MCP tools maintain the same JSON response schema.
  • enhance_project now runs model building even on finalized projects — expect ~2s additional time on first call after upgrade.
  • LadybugDB is now required (was optional). Install via brew install ladybugdb (macOS) or curl -fsSL https://install.ladybugdb.com | sh (Linux).
  • graph_nodes/graph_edges tables are still written but no longer queried. Will be removed in v0.3.

Performance

Metric Value
LadybugDB build (CodeScope, 1,387 nodes) 579ms
LadybugDB file size 3.4MB (4.4% of SQLite)
Query latency (all graph tools) ~1ms
enhance_project total 2,655ms
make check 85 Rust tests + 17 C++ LadybugDB tests — all pass

Full changelog

See CHANGELOG.md for the complete list of changes, bug fixes, and code review findings.

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 19 Jul 13:01
bdc9556

Bug-fix release. No new features; closes the gap between the Resolver Pipeline and the query/verify surfaces that caused third-party false positives, dead verifiers, and invalid JSON.

What broke (the bugs we hit)

# Bug Symptom Class
1 resolve_strategy not propagated to graph_edges find_callees / find_callers / engine_get_callees / engine_get_callers always returned empty resolve_strategy; third-party symbols (dropout, backward_hook, means, stds, LSTMLayer) surfaced as in-project callees — frontends could not filter them Data-flow break
2 buildCallEdgesSQL dead code buildGraph() casts build_calls to (void) (store_graph.cpp:320), so buildCallEdgesSQL was never called — but edits to it (including a resolve_strategy write attempt) silently had no effect. Root cause of Bug 1's missed fix path Dead code / maintenance hazard
3 get_module_tree invalid JSON GraphStore::getModuleTreeJson used one shared first flag across the whole recursion; after the first root, every children array started with a leading comma [{,...},{...}]json.loads crashed on the client Serialisation correctness
4 verify_claim(capability_exists) always Contradicted capability_verifier.cpp LIKE direction reversed: `LOWER(?) LIKE LOWER(name)
5 modules table always empty GraphStore::insertModule existed but was never called; explain_module / get_module_tree degraded to reading only module_edge (dependency edges), no module hierarchy (parent_id / name / path / language) Missing write call

What we fixed (the bugs we solved)

  • Bug 1 closed by threading resolve_strategy through the full chain semantic_records → reference → _resolved_edges → graph_edges: schema migration in store_schema.cpp:921-994, staging in pipeline.cpp:332/431/711/747-752, output restored in query_engine.cpp (QueryEngine::getCallers/getCallees — the actual FFI path) + store_query.cpp (findCallersJson/findCalleesJson). Verified on bun (8 languages): 100% of edge_type=1 (call) edges carry a non-empty strategy. Frontends can now filter external / unresolved out of callee/caller results.
  • Bug 2 closed by fully removing buildCallEdgesSQL (store_intern.cpp 704 → 17 lines) + the stale docstring in store.h. A comment block now points to the Resolver Pipeline and the bug doc for rationale, so future maintainers don't edit dead code.
  • Bug 3 closed by threading first as a bool & parameter through outMod so each sibling list owns its own flag. Language-agnostic — any project with ≥2 module-tree levels reproduced and is now fixed.
  • Bug 4 closed by flipping both LIKE clauses in capability_verifier.cpp (capabilityDeclared + entitiesWithCallers) to LOWER(name) LIKE LOWER(?)||'%', aligning with the correct name LIKE pattern direction already used by architecture_verifier.cpp and contract_verifier.cpp.
  • Bug 5 closed by adding populateModulesHierarchy (async_knowledge.cpp) called after buildKnowledgeGraphSync COMMIT — collapses entity.module_path directories into one modules row per distinct path, with parent_id resolved by next-shorter prefix, file_count and majority language per directory. Idempotent via insertModule's existence check. Verified on bun: 253 modules rows, 21 roots, nested tree JSON valid.

Also shipped

  • test_bun.cpp parameterised (argv[1] restored, hardcoded path retained as default).
  • containment edges (edge_type=3) now write resolve_strategy via JOIN semantic_records psr — keeps the column populated for schema consistency (the strategy value itself is correctly empty for declarations).
  • Bilingual bug-fix records in docs/bugs/bug_resolve_strategy.{zh,en}.md.
  • FFI static-detection development plan in docs/dev_plans/ffi_detection_plan.md (next-next step, not shipped in 0.2.1).

Open-source release preparation — documentation accuracy, build portability fixes, and new developer tooling

New Features

  • FFI Boundary Detection (codescope_ffi_boundaries): Automatically detects cross-language FFI boundaries in the codebase — identifies extern "C" blocks, #[no_mangle] symbols, JNI declarations, and C ABI function exports. Helps developers audit unsafe interop surface.
  • Paginated Graph Export (codescope_export_graph): Full graph export with cursor-based pagination. Supports configurable page size, filter by edge type, and streaming output for large codebases. Integrates with MCP tooling for seamless client-side consumption.
  • One-Click Bootstrap (codescope_bootstrap): Zero-configuration project setup — auto-detects project language, runs indexing, and verifies the graph is ready. Single command from clone to queryable graph.
  • LadybugDB Embedded Storage: Optional LadybugDB backend for graph storage — provides faster local graph queries vs SQLite, with automatic fallback.
  • LadybugDB incremental sync: Added lbug_sync_state table to track incremental sync progress (last synced node id, edge rowid, and full-sync flag) so re-syncs only process new graph data.
  • ISSUE_TEMPLATE and CONTRIBUTING guidelines: Added GitHub issue templates and CONTRIBUTING.md to guide open-source contributors.

Improvements

  • Query Limits & Error Handling: Added configurable query timeouts and result caps. Graceful error recovery for malformed queries — returns partial results instead of failing.
  • Graph Building Logic: Optimized buildGraph to handle orphaned nodes and broken references without crashing. Better error messages for cycle detection and constraint violations.
  • MemberExpr False Positives Eliminated: Fixed a bug where C++ MemberExpr (e.g., obj.method()) was incorrectly resolved as a direct call edge to unrelated functions. Now correctly distinguishes qualified member access from free function calls, improving call graph accuracy by ~15% on C++ codebases.

Bug Fixes

  • macOS install instructions missing LadybugDB: README.md, QUICK_START.md, and bootstrap.sh did not list LadybugDB as a dependency, but server/build.rs unconditionally links liblbug. Added brew install ladybug (macOS) and curl -fsSL https://install.ladybugdb.com | sh (Linux) to all install paths.
  • build.rs Linux library path portability: The LadybugDB link search path was hardcoded to /opt/homebrew/lib (macOS-only). Now resolves the correct path per platform.
  • C++ FFI exception safety: All extern "C" boundary functions are now wrapped in try/catch so a C++ exception never crosses the FFI boundary into Rust (which would abort the process).
  • CI now runs C++ tests: GitHub Actions workflow updated to compile and execute the C++ test suite on every push.
  • Documentation consistency: Corrected tool count (37, not 19 or 32), replaced stale 11-table list with the actual 40-table schema, expanded environment variables table from 3 to 11 entries, removed graph_query from the "does not exist" list (it is implemented), standardized token savings to 98.9%, and removed the stale codebase-memory-mcp benchmark table.
  • MemberExpr call edges: C++ a->foo() and b.foo() no longer generate false positive edges to every function named foo in the project. Resolution now checks the qualifier type before matching.
  • Query timeout: Long-running fuzzy searches no longer block the server. Configurable max_query_time_ms (default 5000ms).
  • Graph export OOM: Paginated export prevents memory exhaustion on large graphs (100k+ nodes) by streaming results in pages of configurable size.

Code Review Fixes

  • LadybugDB stale data on re-index: buildGraph now calls resetLadybugSyncState before sync to force a full sync when the SQLite graph was rebuilt, preventing stale nodes/edges from accumulating in LadybugDB.
  • build.rs / CMakeLists.txt LadybugDB synchronization: build.rs now reads the CMake cache (CMakeCache.txt) to determine whether CMake found liblbug, ensuring the Rust link step stays in sync with the HAS_LADYBUG compile definition. Eliminates the mismatch risk when LadybugDB is installed under a custom prefix.
  • CSV temp file collision risk: Incremental sync CSV filenames now include project_id to prevent concurrent-project collisions.
  • CSV cleanup consistency: Node and edge CSV error handling now uniformly retain the CSV for debugging on COPY FROM failure.
  • FFI contract clarity: Added exemption comment to engine_free_string documenting why free() is exempt from the try/catch wrapper requirement.
  • Redundant try/catch removed: Simplified engine_find_connected_components by merging the redundant inner/outer try/catch into a single wrapper.
  • ffi::init() return value checked: tools/mod.rs now verifies the engine re-init return code after worker subprocess, preventing silent permanent failure.
  • Rust server panic safety: Replaced 4 serde_json::to_value().expect() calls in server.rs with proper -32603 error responses — server no longer crashes on serialization failure.
  • Removed dead tokio dependency: The server is fully synchronous; tokio was unused and added compile time/binary size.
  • engine_version() FFI: Added version function + --version CLI flag for runtime version inspection.
  • .clang-format rewrite: Replaced 807-line Linux kernel config with 94-line project-specific config (c++17, removed GPL header, removed 600 irrelevant ForEachMacros).
  • C-style casts eliminated: 12 (const char *) casts replaced with `reinterpret_cast...
Read more

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 16 Jul 13:18

Open-source release preparation — documentation accuracy, build portability fixes, and new developer tooling.

New Features

  • FFI Boundary Detection (codescope_ffi_boundaries): Automatically detects cross-language FFI boundaries in the codebase — identifies extern "C" blocks, #[no_mangle] symbols, JNI declarations, and C ABI function exports. Helps developers audit unsafe interop surface.
  • Paginated Graph Export (codescope_export_graph): Full graph export with cursor-based pagination. Supports configurable page size, filter by edge type, and streaming output for large codebases. Integrates with MCP tooling for seamless client-side consumption.
  • One-Click Bootstrap (codescope_bootstrap): Zero-configuration project setup — auto-detects project language, runs indexing, and verifies the graph is ready. Single command from clone to queryable graph.
  • LadybugDB Embedded Storage: Optional LadybugDB backend for graph storage — provides faster local graph queries vs SQLite, with automatic fallback.
  • LadybugDB incremental sync: Added lbug_sync_state table to track incremental sync progress (last synced node id, edge rowid, and full-sync flag) so re-syncs only process new graph data.
  • ISSUE_TEMPLATE and CONTRIBUTING guidelines: Added GitHub issue templates and CONTRIBUTING.md to guide open-source contributors.

Improvements

  • Query Limits & Error Handling: Added configurable query timeouts and result caps. Graceful error recovery for malformed queries — returns partial results instead of failing.
  • Graph Building Logic: Optimized buildGraph to handle orphaned nodes and broken references without crashing. Better error messages for cycle detection and constraint violations.
  • MemberExpr False Positives Eliminated: Fixed a bug where C++ MemberExpr (e.g., obj.method()) was incorrectly resolved as a direct call edge to unrelated functions. Now correctly distinguishes qualified member access from free function calls, improving call graph accuracy by ~15% on C++ codebases.

Bug Fixes

  • macOS install instructions missing LadybugDB: README.md, QUICK_START.md, and bootstrap.sh did not list LadybugDB as a dependency, but server/build.rs unconditionally links liblbug. Added brew install ladybug (macOS) and curl -fsSL https://install.ladybugdb.com | sh (Linux) to all install paths.
  • build.rs Linux library path portability: The LadybugDB link search path was hardcoded to /opt/homebrew/lib (macOS-only). Now resolves the correct path per platform.
  • C++ FFI exception safety: All extern "C" boundary functions are now wrapped in try/catch so a C++ exception never crosses the FFI boundary into Rust (which would abort the process).
  • CI now runs C++ tests: GitHub Actions workflow updated to compile and execute the C++ test suite on every push.
  • Documentation consistency: Corrected tool count (37, not 19 or 32), replaced stale 11-table list with the actual 40-table schema, expanded environment variables table from 3 to 11 entries, removed graph_query from the "does not exist" list (it is implemented), standardized token savings to 98.9%, and removed the stale codebase-memory-mcp benchmark table.
  • MemberExpr call edges: C++ a->foo() and b.foo() no longer generate false positive edges to every function named foo in the project. Resolution now checks the qualifier type before matching.
  • Query timeout: Long-running fuzzy searches no longer block the server. Configurable max_query_time_ms (default 5000ms).
  • Graph export OOM: Paginated export prevents memory exhaustion on large graphs (100k+ nodes) by streaming results in pages of configurable size.

Code Review Fixes

  • LadybugDB stale data on re-index: buildGraph now calls resetLadybugSyncState before sync to force a full sync when the SQLite graph was rebuilt, preventing stale nodes/edges from accumulating in LadybugDB.
  • build.rs / CMakeLists.txt LadybugDB synchronization: build.rs now reads the CMake cache (CMakeCache.txt) to determine whether CMake found liblbug, ensuring the Rust link step stays in sync with the HAS_LADYBUG compile definition. Eliminates the mismatch risk when LadybugDB is installed under a custom prefix.
  • CSV temp file collision risk: Incremental sync CSV filenames now include project_id to prevent concurrent-project collisions.
  • CSV cleanup consistency: Node and edge CSV error handling now uniformly retain the CSV for debugging on COPY FROM failure.
  • FFI contract clarity: Added exemption comment to engine_free_string documenting why free() is exempt from the try/catch wrapper requirement.
  • Redundant try/catch removed: Simplified engine_find_connected_components by merging the redundant inner/outer try/catch into a single wrapper.
  • ffi::init() return value checked: tools/mod.rs now verifies the engine re-init return code after worker subprocess, preventing silent permanent failure.
  • Rust server panic safety: Replaced 4 serde_json::to_value().expect() calls in server.rs with proper -32603 error responses — server no longer crashes on serialization failure.
  • Removed dead tokio dependency: The server is fully synchronous; tokio was unused and added compile time/binary size.
  • engine_version() FFI: Added version function + --version CLI flag for runtime version inspection.
  • .clang-format rewrite: Replaced 807-line Linux kernel config with 94-line project-specific config (c++17, removed GPL header, removed 600 irrelevant ForEachMacros).
  • C-style casts eliminated: 12 (const char *) casts replaced with reinterpret_cast across engine_ffi.cpp and query_analysis.cpp.
  • Configurable synchronous mode: PRAGMA synchronous now defaults to OFF but can be overridden via CODESCOPE_SYNCHRONOUS=NORMAL|FULL|OFF env var.
  • Chinese comments translated: All CJK comments in engine/src/ and engine/include/ translated to English.
  • Global singleton thread-safety documented: Added prominent contract block in engine_internal.h documenting the sequential-dispatch model and future migration path.

Chores

  • Removed accidentally committed binary version file: A stray binary artifact was removed from the repository.
  • Committed Cargo.lock: Required for reproducible builds of the binary crate. Was previously gitignored.
  • Gitignored runtime artifacts: runtimelog/, llvm_ir/output/, and *.lbug files are now properly ignored.
  • Open-source community files: Added CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, .github/CODEOWNERS.
  • GitHub Actions SHA-pinned: All workflow actions pinned to commit SHAs for supply-chain security.
  • Non-destructive release pipeline: build.yml no longer force-pushes tags or deletes existing releases. Added semver monotonicity validation.
  • CI timeout reduced: 120min → 45min to fail fast on hangs.
  • Test suite expanded: TEST_EXES expanded from 28 to 37 (added test_fp_*, test_graph_semantic, test_semantic_unit, test_type_extraction, etc.). Manual debug tools moved to engine/manual/.
  • Known-failing tests documented: test_enhance_e2e, test_fp_rust, test_fp_java, test_{js,ts,tsx}_visitor excluded from TEST_EXES with documented reasons.

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 16 Jul 08:29

Project Knowledge Layer for AI — Code analysis service that turns source code into structured knowledge (facts, indexes, graphs) via MCP protocol.


What's New in v0.1.0

Context Builder (Primary Feature)

codescope_build_context — a single MCP tool that replaces manual chains of find_symbol + get_module_tree + get_entry_points + find_callers. Given a natural language query like "Explain USB initialization", it automatically determines what data is relevant, checks readiness flags, fetches the right information, and assembles a comprehensive context bundle for the LLM — no multi-step tool switching needed.

codescope_build_context({"query": "Explain USB initialization"})
→ {
    "intent": "module:usb",
    "project_overview": {...},
    "entry_points": {"probe": [...], "initcall": [...]},
    "related_symbols": [...],
    "callgraph_available": false,
    "ready_features": {...}
}

Call Path Tracing

codescope_trace — BFS shortest call path between two functions. Returns the full chain with file paths and line numbers. Eliminates LLM hallucination about execution paths.

codescope_trace("copy_process", "dup_mm")
→ copy_process(kernel/fork.c:1994)
  → copy_mm(kernel/fork.c:1568)
  → dup_mm(kernel/fork.c:1527)

Capability API

codescope_capabilities — standardized feature readiness report. LLM can check exactly what data is available before calling deeper tools.

🔍 Incremental Indexing

  • Git-aware: Uses git status --porcelain to detect changed files — only rescan what changed
  • mtime-based: Falls back to file modification time for non-git projects
  • Read-only: Never runs git checkout or git commit — pure read operations

🔎 Stub Detection

  • Fast Scan: Identifies single-line empty stubs (func foo() {})
  • AST Enhancement: Detects multi-line empty bodies via tree-sitter AST traversal
  • Marked as is_stub=true in symbol_status table — LLM can filter them out

🎯 Accuracy

  • 39% fewer false positives in C/C++: strict detector now requires C type keywords in return types
  • Fixed startsWithKW bug: Rust/Python/JS/Go declarations were silently skipped
  • Entry point expansion: Added module_init, device_initcall, subsys_initcall, probe
  • Conservative matching: Removed setup/start/handler from common entry point names to reduce false positives

🏗 Schema Realignment

Change Before After
analysis_state bitmask 3 flags in symbols table Separate symbol_status table
dependency_edges symbol-based module-based (supports external deps)
search_index name/signature/content title/summary/body
metrics symbol_id PK owner_type/owner_id (supports modules)

11 tables total: modules, symbols, entry_points, call_edges, dependency_edges, metrics, search_index (FTS5), embeddings (vec0), symbol_status, index_tasks, file_scan_state.

🧹 Bug Fixes

  • startsWithKW() silent skip: Rust/Python/JS/Go declarations were never matched because keyword patterns with trailing spaces were incorrectly rejected
  • recursive_directory_iterator infinite loop: Fixed iterator management in directory walk
  • disable_recursion_pending() on wrong type: Fixed to use iterator method instead of entry method
  • Cross-file call edges not generated: Enhancement phase now resolves callees globally via findSymbolJson
  • sqlite3_enable_load_extension not found on system SQLite: Added Homebrew SQLite auto-detection
  • vec0 table crash on missing extension: Graceful fallback with warning
  • Module tree file_count always 0: Simplified to single UPDATE with subquery
  • get_enhancement_status returning 0: Fixed SQL to JOIN with symbol_status table

🚀 Performance

Scan Time Symbols Notes
CodeScope (self) 32 ms 2,902
SQLite 89 ms 6,921 141 source files
Linux kernel/sched 45 ms 4,913 36 files
Linux kernel/ (core) 360 ms 40,335 495 syms
Linux fs/ 1.8 s 120,602
drivers/usb/ 351 ms 37,286
Enhancement (kernel/) 27 s 11,925 45,573 call edges

Average throughput: ~100,000 symbols/second

📦 Platform Support

Platform Binary
macOS (Apple Silicon) codescope-macos-arm64.tar.gz
Linux (x86_64) codescope-linux-x86_64.tar.gz
Windows (x86_64) codescope-windows-x86_64.exe.tar.gz

🛠 Build Improvements

  • ccache auto-detection in CMake
  • sccache for Rust builds
  • Linux kernel .clang-format (808 rules)
  • Zero warnings: Both C++ and Rust builds emit no warnings
  • Boundary tests: 15/15 edge case tests pass

Quick Start

# Download the release for your platform:
# macOS ARM64:
curl -sL "https://github.com/Timwood0x10/CodeScope/releases/latest/download/codescope-macos-arm64.tar.gz" | tar xz

# Run the server:
./codescope

# Or configure as an MCP server:
# {
#   "mcpServers": {
#     "codescope": {
#       "command": "/path/to/codescope",
#       "env": {
#         "CODESCOPE_DB_PATH": "/tmp/codescope.db",
#         "GRAMMARS_DIR": "/path/to/grammars"
#       }
#     }
#   }
# }

Full documentation: docs/architecture.md | docs/linux-analysis.md