Skip to content

Feature/competitive roadmap - #9

Merged
mohanagy merged 7 commits into
mainfrom
feature/competitive-roadmap
Apr 23, 2026
Merged

mohanagy merged 7 commits into
mainfrom
feature/competitive-roadmap

Conversation

@mohanagy

@mohanagy mohanagy commented Apr 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Testing

  • npm run test:run
  • npm run typecheck
  • npm run build
  • npm pack --dry-run (if packaging or install behavior changed)

Checklist

  • I updated docs for any user-visible change
  • I added or updated tests when behavior changed
  • I did not commit secrets, private corpora, or accidental generated artifacts
  • I kept this PR focused on a single change or tightly related set of changes

Related issues

Summary by CodeRabbit

  • New Features
    • Added federate CLI subcommand to merge multiple knowledge graphs
    • Added --docs flag for automatic community documentation generation
    • Added community analysis at three zoom levels (micro/mid/macro)
    • Added impact analysis for nodes and pull requests
    • Added call chain discovery between source and target nodes
    • Added related nodes section to community summary UI
    • Added new tools for community details, impact, and call-chain analysis

Phase 1 of the competitive roadmap:

- New `impact` MCP tool: analyzes blast radius of changing any node —
  direct dependents, transitive dependents, affected files/communities
- New `call_chain` MCP tool: finds all execution paths between two nodes
  filtered by edge type (calls, imports_from)
- New `pr_impact` MCP tool: parses git diff, maps changed files to graph
  nodes, computes aggregate blast radius across all changes
- 13 new tests covering impact analysis and call chain tracing
…to-generated docs

Phase 2 of the competitive roadmap:

- New `community_details` MCP tool with micro/mid/macro zoom levels
  for token-efficient codebase exploration
- New `community_overview` MCP tool for quick overview of all communities
- Related nodes panel in HTML community pages — selecting a node shows
  its neighbors with edge types
- New `--docs` flag generates per-community markdown documentation in
  graphify-out/docs/ with key components, entry/exit points, bridges,
  and code snippets
- 10 new tests for community details
Phase 3 of the competitive roadmap:

- New `graphify-ts federate <g1.json> <g2.json>` command merges graphs
  from multiple repos into a single queryable super-graph
- Cross-repo edges inferred from shared type/function names across repos
- Each node tagged with `source_repo` for origin tracking
- Federated graph gets full clustering, report, and JSON output
- All existing MCP tools (retrieve, impact, call_chain) work on the
  federated graph
- 3 new tests for federation
@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@mohanagy has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 30 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 30 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ee636af-78cc-4f7e-85b5-e5f619c3a7a0

📥 Commits

Reviewing files that changed from the base of the PR and between ccde967 and d1ed2be.

📒 Files selected for processing (2)
  • README.md
  • tests/unit/cli.test.ts
📝 Walkthrough

Walkthrough

This pull request introduces comprehensive knowledge graph analysis and documentation features, including a new federate CLI subcommand for merging multiple graph repositories, optional markdown documentation generation integrated into the graph generation pipeline, community-level analysis at three zoom levels (micro, mid, macro), runtime impact analysis for tracing code dependencies, PR-specific change impact computation, and five new MCP tools for community introspection and dependency analysis. Configuration files related to prior AI integration are removed.

Changes

Cohort / File(s) Summary
Configuration Cleanup
.claude/settings.json, CLAUDE.md, .gitignore
Removes AI hook configuration and guidance files; updates gitignore to exclude .claude directory and CLAUDE.md.
CLI Enhancement
src/cli/main.ts, src/cli/parser.ts
Introduces federate subcommand with --output-dir parsing and repo/graph statistics logging; adds --docs boolean flag to generate flow with logging of generated documentation paths.
Graph Generation
src/infrastructure/generate.ts
Integrates optional docs generation into generateGraph when docs flag enabled, invokes docs generator after export steps, captures output path, and includes path in result.
Community Analysis Pipeline
src/pipeline/community-details.ts
New module providing three zoom-level community views: micro (per-community labels and top nodes), mid (entry/exit/bridge points), macro (node attributes and cross-community edges), with helper function communityDetailsAtZoom for dispatch.
Documentation Generation
src/pipeline/docs.ts
Generates markdown documentation with index page and per-community pages (when node count > 1); includes metadata, key components, entry/exit points, bridge nodes, and safe code snippet extraction centered on recorded line numbers.
Federated Graphs
src/pipeline/federate.ts
New pipeline to merge multiple source graphs with repo-prefixed node IDs; infers shared labels for cross-repo edges, clusters federated graph, generates analysis report, and returns merged counts and paths.
Export & UI Updates
src/pipeline/export.ts, src/pipeline/export/community-summary.ts
Adds "Related nodes" section to community summary UI with neighbor discovery via edge parsing; extends CommunitySummaryNode interface to include id property propagated from source data.
Impact Analysis
src/runtime/impact.ts
Adds analyzeImpact (bounded BFS to collect direct and transitive dependents) and callChains (bounded DFS for import/call paths); deduplicates files, aggregates communities, and returns comprehensive impact results.
PR Impact Analysis
src/runtime/pr-impact.ts
Computes PR impact by detecting changed files via git, mapping to graph nodes, running impact analysis per node, and aggregating blast radius, affected files/communities, and risk summary.
Server Tool Handlers
src/runtime/stdio-server.ts, src/runtime/stdio/definitions.ts
Adds five MCP tool handlers (community_details, community_overview, impact, call_chain, pr_impact) with input validation and corresponding tool definitions with JSON schemas.
Test Coverage
tests/unit/cli.test.ts, tests/unit/community-details.test.ts, tests/unit/federate.test.ts, tests/unit/impact.test.ts
Updates CLI tests for docs flag; adds comprehensive tests for community details at all zoom levels, federate pipeline with multi-repo merging, and impact analysis with depth/edge-type filtering.

Sequence Diagram(s)

sequenceDiagram
    participant User as User/CLI
    participant Main as src/cli/main.ts
    participant Generate as src/infrastructure/generate.ts
    participant Export as src/pipeline/export.*
    participant Docs as src/pipeline/docs.ts
    
    User->>Main: generate --docs
    Main->>Generate: generateGraph(options{docs:true})
    activate Generate
    Generate->>Export: Export to HTML/Wiki/SVG/etc
    activate Export
    Export-->>Generate: Export complete
    deactivate Export
    Generate->>Docs: generateDocs(graph, communities)
    activate Docs
    Docs->>Docs: Create docs dir, generate index.md
    Docs->>Docs: Per community: extract snippets, write pages
    Docs-->>Generate: {docsPath, fileCount}
    deactivate Docs
    Generate->>Generate: Append doc generation note
    Generate-->>Main: {graphPath, docsPath, ...}
    deactivate Generate
    Main-->>User: Output with docs location
Loading
sequenceDiagram
    participant User as User/CLI
    participant Main as src/cli/main.ts
    participant Federate as src/pipeline/federate.ts
    participant Graph as KnowledgeGraph
    participant Analysis as Community/Report
    
    User->>Main: federate graph1.json graph2.json
    Main->>Federate: federate([paths], options)
    activate Federate
    Federate->>Federate: Load & validate source graphs
    Federate->>Federate: Infer repo names from paths
    Federate->>Graph: Merge nodes/edges (repo-prefixed)
    activate Graph
    Graph-->>Federate: Merged graph
    deactivate Graph
    Federate->>Federate: Infer cross-repo relationships
    Federate->>Federate: Add shared_across_repos edges
    Federate->>Analysis: Cluster & compute communities
    Federate->>Analysis: Generate markdown report
    Federate->>Federate: Export graph.json
    Federate-->>Main: {graphPath, reportPath, repos, totalNodes, totalEdges, crossRepoEdges}
    deactivate Federate
    Main-->>User: Federation summary
Loading
sequenceDiagram
    participant MCP as MCP Client
    participant Server as src/runtime/stdio-server.ts
    participant Impact as src/runtime/impact.ts
    participant Graph as KnowledgeGraph
    
    MCP->>Server: call_tool(impact, {label, depth})
    activate Server
    Server->>Server: Validate label parameter
    Server->>Impact: analyzeImpact(graph, communityLabels, {label, depth})
    activate Impact
    Impact->>Graph: findNode(label)
    activate Graph
    Graph-->>Impact: targetNode
    deactivate Graph
    Impact->>Impact: BFS neighbors up to depth
    Impact->>Impact: Deduplicate files & aggregate communities
    Impact-->>Server: {target_label, total_affected, affected_files, affected_communities, dependents[]}
    deactivate Impact
    Server->>Server: Serialize to JSON text
    Server-->>MCP: tool_result(text)
    deactivate Server
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PR #1: Overlapping modifications to CLI argument parsing, generateGraph infrastructure, and stdio-server tool dispatch logic.
  • PR #3: Direct modifications to GenerateGraphOptions and GenerateGraphResult interfaces in src/infrastructure/generate.ts.
  • PR #8: Related modifications to src/pipeline/export.ts and CommunitySummaryNode shape for graph data enrichment.

Poem

Hopping through graphs with glee and care,
Federating repos everywhere!
Communities deep, impacts crystal clear,
Dependencies mapped from far to near.
Docs bloom like clover—what a sight,
My knowledge graph shines ever bright! 🐰

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description is a template skeleton with no prose summary of changes, missing key sections like what changed and why, and has conflicting checklist statuses. Add a detailed summary explaining the three phases of changes (impact/call_chain/pr_impact tools, community details tools, and federation), why these features were added, and ensure all checklist items are properly reviewed and checked.
Title check ❓ Inconclusive The title 'Feature/competitive roadmap' is vague and generic, using a branch-naming convention that does not convey meaningful information about the specific changes. Replace with a concise, specific title describing the primary feature (e.g., 'Add impact analysis, community details, and graph federation tools').
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/competitive-roadmap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant