Skip to content

v0.23.0 — SDK-aware project detection, per-file incremental reindex

Choose a tag to compare

@turbyho turbyho released this 16 Jul 18:14
v0.23.0
cf3699b

Overview

This release fundamentally reworks how fw-context determines project vs. vendor/SDK code. Instead of filtering files at index time (source_roots/exclude_paths), all files from compile_commands.json are now indexed, and is_project is computed after indexing via automatic SDK pattern detection. The reindex flow has been rebuilt for per-file incremental updates, making fw-context index --build as fast as a plain index. Config keys have changed — see breaking changes below.

IMPORTANT: This release requires a full reindex. Run fw-context index --build --force after upgrading.

Changes

Features

  • SDK-aware project detectionis_project is now determined by automatic SDK pattern matching (Mbed OS, Zephyr, PlatformIO, ESP-IDF, STM32Cube, NRF, etc.) with user overrides via vendor_paths/project_paths config keys. All files from compile_commands.json are indexed; filtering happens only at query time.
  • Per-file incremental reindexfw-context index --build now only re-parses files that actually changed, using git-aware file-level tracking in manifest.json. Previously every --build re-parsed all files.
  • Centralized SDK filtering — new sdk_detect.py and mcp/shared/filtering.py modules ensure the same exclusion logic is used by both the indexer and MCP tools.
  • Redesigned fw-context list — aligned column table with thousand-separated symbol counts, adaptive terminal-width-aware path truncation, and a * stale marker next to the project name.
  • analyze_vendor column — stored in build_configs at index time, reported by get_active_build so agents know whether vendor analysis ran.
  • Git-aware staleness detection — new git_context.py captures the git commit hash in the manifest, enabling git diff --name-only for content-based staleness checks.

Fixes

  • Removed config_hash dependency — the per-TU structural hash approach was replaced by file-level mtime + git tracking, eliminating stale cache issues.

Files changed

File Change
src/fw_context_mcp/cli.py Add --vendor-paths/--project-paths, git context integration, list redesign
src/fw_context_mcp/config/settings.py Replace source_roots/exclude_paths with vendor_paths/project_paths
src/fw_context_mcp/indexer/db.py Schema migrations: analyze_vendor, is_project, description, first_indexed_at
src/fw_context_mcp/indexer/manifest.py Restructure for per-file git-aware tracking
src/fw_context_mcp/indexer/runner.py Per-file incremental reindex, centralized SDK filtering
src/fw_context_mcp/indexer/symbols.py is_project computed via SDK detection
src/fw_context_mcp/indexer/ops.py Remove config_hash, add per-file migration helpers
src/fw_context_mcp/indexer/sdk_detect.py New — automatic SDK/vendor pattern detection
src/fw_context_mcp/indexer/git_context.py New — git commit hash capture for staleness detection
src/fw_context_mcp/mcp/shared/filtering.py Centralized compute_exclude_like / detect_sdk_exclude_like
src/fw_context_mcp/mcp/handlers/callgraph.py Use centralized filtering, is_project column
src/fw_context_mcp/mcp/handlers/maintenance.py New manifest structure, analyze_vendor reporting
src/fw_context_mcp/mcp/handlers/search.py Use is_project for project-only filtering
src/fw_context_mcp/mcp/handlers/source.py Use is_project column
src/fw_context_mcp/search/scoring.py Remove _is_project_local, use is_project column
tests/ New tests: test_sdk_detect.py; updated: test_config.py, test_db.py, test_filtering.py, test_manifest.py, test_scoring.py

Breaking changes

  • Config keys renamed: source_roots and exclude_paths in [index] are removed. Use vendor_paths (additional vendor/SDK patterns, additive to auto-detection) and project_paths (manual project directory overrides). Update your .fw-context/config.toml or local.toml.
  • Schema changed: The index database has new columns (is_project, analyze_vendor, description, first_indexed_at). Existing indexes are incompatible — a full reindex is required: fw-context index --build --force
  • manifest.json format changed: The manifest now uses per-file tracking instead of per-TU structural hashes. The first fw-context index --build after upgrade will regenerate it automatically.