feat: codebase map, Azure reader, type-aware ingestion, SonarCloud security gate#10
Merged
Conversation
…ation and graph fixes Add get_codebase_map MCP tool that builds a compact codebase map from file types, code communities, document communities, cross-links, and architectural hubs. Components: - codebase_map.py: Magika file-type detection, suffix fallback, caching - code_graph.py: tree-sitter AST extraction, NetworkX graph, Louvain - doc_graph.py: embedding similarity edges, metadata edges, heading edges Fixes applied during implementation review: - H1: Path boundary validation via relative_to(Path.cwd()) - H2: Fetch real ChromaDB collection instead of build_document_graph(None) - H3: Store inheritance on graph nodes, fix _get_inheritance(), fix class regex to match classes without parentheses - M1: CODEBASE_MAP_MAX_FILES/MAX_DEPTH limits, 30s Magika timeout - M2: Cache files added to .gitignore - M3: Shared _EXCLUDED_DIRS between Magika and suffix scanners ADR-022: Code graph via tree-sitter AST extraction ADR-023: Document graph via embedding similarity OpenSpec: add-fast-context-codebase-map, fix-codebase-map-review
…gestion - azure_reader.py: Azure Document Intelligence backend with lazy SDK import and automatic fallback to local parser chain - ingestion.py: type-aware chunking using Magika label to tree-sitter language mapping for code files - ADR-024: Dual deployment modes (local vs azure)
- test_mcp_tools: add get_codebase_map tool registration check - test_metadata_extractor: adjust assertions for updated metadata fields - test_async_ingest_responsiveness: fix timing assertions
- sonar-project.properties: project key, source/test dirs, exclusions - .github/workflows/sonarcloud.yml: runs on PR and push to master with coverage report generation - SONAR_TOKEN stored as GitHub Actions secret (not in code)
- opencode.json: add sonarqube MCP server (token via env vars, not hardcoded) - .sonarlint/connectedMode.json: link IDE to SonarCloud org cmdaltctr
…ning See TDR-003 for rationale.
Consolidate sonarcloud.yml into ci.yml as a second job so all checks appear under a single CI workflow in PR checks.
- Help tests failed in CI due to rich ANSI escape codes in output - Add _strip_ansi helper to clean --help output before assertions - Remove pdf-liteparse matrix variant (liteparse is now a core dep) - Slow tests now run on macOS via os check instead of extra
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
get_codebase_map): builds a compact codebase map from file types, code communities, document communities, cross-links, and architectural hubs. Uses Magika for file-type detection with suffix fallback. Cached per git commit hash.azure_reader.py): opt-in cloud OCR backend with lazy SDK import and automatic fallback to local parser chain. Controlled byDOCUMENT_BACKENDenv var.CodeSplitter.sonarCLI for pre-commit secrets scanning.Bug fixes (codebase map review)
relative_to(Path.cwd())build_document_graph(None)class Foo:CODEBASE_MAP_MAX_FILES/MAX_DEPTHlimits, 30s Magika timeout.gitignore_EXCLUDED_DIRSbetween Magika and suffix scannersDocumentation
Test plan
uv run pytest -m "not slow" -v)chdirpattern)src/,tests/,.env.exampleopenspec/changes/fix-codebase-map-review/tasks.md)OpenSpec
openspec/changes/add-fast-context-codebase-map/— original feature proposalopenspec/changes/fix-codebase-map-review/— review fixes🤖 Generated with Claude Code