Skip to content

feat: introduce global dependency graph for cross-language context resolution #169

Description

@Tanmay-008

Problem

Currently, Clawpatch uses separate mappers for each language (Node.js, Rust, Python, Go, etc.).

Each mapper can discover features and dependencies within its own language, but it has no knowledge of files written in other languages.

Because of this, Clawpatch cannot understand relationships that span across different services or languages.


Why This Matters

Modern monorepos are usually built with multiple languages.

For example:

Frontend (Next.js)
        │
        │ fetch("/api/login")
        ▼
Backend (Rust)

Although the frontend and backend are part of the same feature, Clawpatch currently treats them as two completely separate pieces of code.

This means AI agents only receive part of the picture instead of the complete workflow.


The Core Problem

Suppose we have the following files.

Frontend

// frontend/src/app.ts

await fetch("/api/login");

Backend

#[get("/api/login")]
async fn login() {
    ...
}

Current behavior:

  • The Node mapper creates a Feature Seed for app.ts, but it does not include main.rs.
  • The Rust mapper creates a Feature Seed for main.rs, but it does not include app.ts.

As a result, neither Feature Seed contains the complete context.

This Cross-Language Blindness makes it difficult for AI providers to perform:

  • Full-stack bug fixes
  • Cross-language refactoring
  • End-to-end code reviews
  • Repository-wide reasoning

Evidence

A failing test has been added to demonstrate this limitation.

src/cross-language.test.ts

The test creates a mock monorepo where:

  • A Node.js frontend calls a Rust backend.
  • The backend Feature Seed is expected to include the frontend file inside contextFiles.

Current result:

AssertionError:
expected undefined to be defined

This confirms that Clawpatch cannot currently discover cross-language relationships.


Why This Matters

To effectively support enterprise-scale monorepos, AI agents need visibility across the entire application—not just a single language.

Adding a Global Dependency Graph would eliminate cross-language blindness and enable Clawpatch to generate complete, repository-aware Feature Seeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions