Skip to content

Conversation

@shivasurya
Copy link
Owner

@shivasurya shivasurya commented Jan 10, 2026

Summary

Adds indexing status tracking, PostHog analytics, and comprehensive test coverage.

Indexing Status & Graceful Degradation:

  • State machine: uninitializedindexingready/failed
  • Phase tracking: parsing → module_registry → call_graph → complete
  • status JSON-RPC method for real-time status
  • Informative errors when index not ready

PostHog Analytics (anonymous, no PII):

Event Properties
mcp_server_started transport, os, arch
mcp_server_stopped transport, uptime
mcp_tool_call tool, duration_ms, success
mcp_indexing_complete function_count, module_count
mcp_client_connected client_name, client_version

Python Version Detection:

  • Auto-detects from .python-version or pyproject.toml
  • Falls back to 3.14, respects --python-version override

Test Coverage:

  • MCP package: 95.6% coverage
  • New tests for analytics, server methods, HTTP transport

@shivasurya shivasurya added the enhancement New feature or request label Jan 10, 2026
@shivasurya shivasurya self-assigned this Jan 10, 2026
@shivasurya shivasurya changed the title feat(mcp): add indexing status tracking and graceful degradation feat(mcp): add indexing status, analytics, and comprehensive tests Jan 10, 2026
@shivasurya shivasurya marked this pull request as ready for review January 10, 2026 04:05
@safedep
Copy link

safedep bot commented Jan 10, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 94.88818% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.64%. Comparing base (b746678) to head (89ddeb0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sast-engine/cmd/serve.go 11.11% 8 Missing ⚠️
sast-engine/analytics/usage.go 55.55% 3 Missing and 1 partial ⚠️
sast-engine/mcp/server.go 93.10% 2 Missing ⚠️
sast-engine/mcp/status.go 99.01% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #459      +/-   ##
==========================================
+ Coverage   80.79%   81.64%   +0.84%     
==========================================
  Files          92       94       +2     
  Lines       10207    10513     +306     
==========================================
+ Hits         8247     8583     +336     
+ Misses       1643     1615      -28     
+ Partials      317      315       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya shivasurya force-pushed the shiva/mcp-indexing-status branch from 53e9592 to 34d5aa3 Compare January 10, 2026 04:43
@shivasurya shivasurya force-pushed the shiva/mcp-http-transport branch from 966e931 to 0740d34 Compare January 10, 2026 04:43
Copy link
Owner Author

shivasurya commented Jan 10, 2026

Merge activity

  • Jan 10, 4:45 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 10, 4:54 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 10, 4:55 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from shiva/mcp-http-transport to graphite-base/459 January 10, 2026 04:52
@shivasurya shivasurya changed the base branch from graphite-base/459 to main January 10, 2026 04:53
shivasurya and others added 4 commits January 10, 2026 04:54
Add comprehensive indexing status tracking:
- StatusTracker: State machine tracking indexing phases (parsing, module_registry, call_graph)
- Progress tracking with phase progress and overall progress
- Subscriber pattern for real-time status updates
- GracefulDegradation: Returns informative errors when index not ready

New MCP features:
- "status" method returns current indexing state and progress
- IndexNotReadyError includes phase and progress percentage
- Server exposes IsReady() and GetStatusTracker() methods

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add anonymous telemetry events (no PII):
- mcp_server_started: Transport type, OS, arch
- mcp_server_stopped: Uptime duration
- mcp_tool_call: Tool name, duration, success/error
- mcp_indexing_complete: Aggregate counts (functions, edges, modules)
- mcp_client_connected: Client name/version from MCP protocol

Analytics helper:
- mcp/analytics.go: MCP-specific telemetry wrapper
- ReportEventWithProperties: Support for event properties
- ToolCallMetrics: Timing helper for tool calls

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Previously the serve command had a hardcoded default of "3.11" while
BuildCallGraph auto-detects from .python-version or pyproject.toml.
This caused inconsistency between the call graph build and MCP server.

Now:
- Auto-detect Python version using builder.DetectPythonVersion()
- --python-version flag becomes an optional override (empty default)
- Log the detected/overridden version at startup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Improve test coverage from 88.8% to 95.6%:
- Add analytics_test.go with tests for all Analytics methods
- Add server tests for SetTransport, handleStatus, GetStatusTracker, IsReady
- Add HTTP tests for Start blocking, SSE endpoint, invalid addresses
- Add streaming handler tests for write error paths

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@shivasurya shivasurya force-pushed the shiva/mcp-indexing-status branch from 34d5aa3 to 89ddeb0 Compare January 10, 2026 04:54
@shivasurya shivasurya merged commit 7e70eac into main Jan 10, 2026
3 checks passed
@shivasurya shivasurya deleted the shiva/mcp-indexing-status branch January 10, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants