Skip to content

Codebase/Colocated Rules Cache #6603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Jul 13, 2025

Description

A major source of slow config loading is walk dir to find colocated rules.md files. This PR adds a codebase/colocated rules cache that initializes on startup and then updates and triggers a config reload when a rules.md file is edited. This way it's not doing a full walk dir for any config reload.


Summary by cubic

Added a cache for codebase colocated rules.md files to speed up config loading. The cache initializes on startup and updates when a rules.md file is edited, avoiding full directory scans on each config reload.

  • Performance
    • Config reloads now use the cached rules, reducing file system operations.
    • Editing a rules.md file updates the cache and triggers a config reload automatically.

@RomneyDa RomneyDa requested a review from a team as a code owner July 13, 2025 20:24
@RomneyDa RomneyDa requested review from Patrick-Erichsen and removed request for a team July 13, 2025 20:24
Copy link

netlify bot commented Jul 13, 2025

Deploy Preview for continuedev failed. Why did it fail? →

Name Link
🔨 Latest commit c123f80
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/687415e6b121210008e64496

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 13, 2025
Copy link

⚠️ Conventional Commit Format

Your commit messages don't follow the conventional commit format, but this won't block your PR from being merged. We recommend downloading this extension if you are using VS Code.

Expected Format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic found 1 issue across 8 files. Review it in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

await loadCodebaseRules(ide);
newConfig.rules.unshift(...codebaseRules);
errors.push(...codebaseRulesErrors);
const codebaseRulesCache = CodebaseRulesCache.getInstance();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doLoadConfig relies on the cache being populated, but it never calls await codebaseRulesCache.refresh(ide) (or checks that it has already run). If this function executes before another component refreshes the cache, codebaseRulesCache.rules and errors will both be empty, silently dropping colocated rules from the loaded config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant