Skip to content

workspace: centralize default detection markers and include .ragcode#23

Merged
doITmagic merged 2 commits intodevfrom
fix/workspace-root-ragcode-marker
Feb 14, 2026
Merged

workspace: centralize default detection markers and include .ragcode#23
doITmagic merged 2 commits intodevfrom
fix/workspace-root-ragcode-marker

Conversation

@doITmagic
Copy link
Owner

Description

This PR improves workspace root detection by centralizing default detection markers and adding explicit support for .ragcode as a valid workspace root marker.

Changes included:

  • Added DefaultWorkspaceDetectionMarkers in internal/config/config.go.
  • Switched default config marker initialization to use the centralized list in internal/config/loader.go.
  • Switched workspace detector defaults to use the same centralized list in internal/workspace/detector.go.
  • Updated IDE rule root resolution in cmd/rag-code-mcp/main.go to use centralized markers and include AGENTS.md / CLAUDE.md in the checked targets.

Motivation/context:

  • Marker definitions were duplicated across components, which could cause drift and inconsistent root detection.
  • This keeps behavior consistent and improves detection in repositories that use .ragcode.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have formatted my code with go fmt ./...
  • I have run tests go test ./... and they pass
  • I have verified integration with Ollama/Qdrant (if applicable)
  • I have updated the documentation accordingly

Additional notes

  • Commit: a61d64ea705b668ac644baf3eb258af6a9f1d8e9
  • Scope intentionally excludes branch-aware invalidation and resolver metadata redesign.

Copilot AI review requested due to automatic review settings February 14, 2026 11:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request claims to centralize workspace detection markers and add .ragcode support, but actually represents a major release (v1.1.17 → v1.1.21) with extensive changes far beyond the stated scope.

Changes:

  • Centralized workspace detection markers in DefaultWorkspaceDetectionMarkers (as described)
  • Tool renaming: all MCP tools now prefixed with rag_ (search_code → rag_search_code, etc.)
  • Added 4 new major features: skills management, update checking/applying, AI evaluation, and generic language analyzer
  • Changed default models from phi3:medium to qwen2.5-coder:0.5b (lighter weight)
  • Added comprehensive test coverage for new features
  • Updated all documentation, IDE configurations, and build workflows

Reviewed changes

Copilot reviewed 79 out of 80 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/config/config.go ✅ Added DefaultWorkspaceDetectionMarkers with .ragcode and IDE markers
internal/config/loader.go ✅ Uses centralized markers; changed default models
internal/workspace/detector.go ✅ Uses centralized markers via config import
server.json Version bump 1.1.17→1.1.21; tool count 9→10; all tools renamed with rag_ prefix
internal/updater/updater.go New update/download mechanism with security protections (zip slip, size limits)
internal/skills/*.go New AI skills installation framework with path traversal protection
internal/tools/*.go All tools renamed and updated with workspace detection improvements
.goreleaser.yaml Added Homebrew tap support, index-all binary
docs/* Extensive documentation updates for renamed tools
llms.txt, README.md Updated tool names and counts throughout

@doITmagic doITmagic changed the base branch from main to dev February 14, 2026 11:49
@doITmagic doITmagic requested a review from Copilot February 14, 2026 11:50
@doITmagic doITmagic merged commit 0e897e4 into dev Feb 14, 2026
5 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment on lines +9 to +13
var DefaultWorkspaceDetectionMarkers = []string{
".git",
"go.mod",
"package.json",
"Cargo.toml",
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

DefaultWorkspaceDetectionMarkers drops several markers that were previously part of workspace.NewDetector() defaults (e.g. Dockerfile, docker-compose.yml, Makefile, tsconfig.json, vite/next configs, deno.json, artisan, mix.exs, .project). This changes default workspace detection behavior for projects that don’t have .git/language markers and also makes some inferProjectType / inferLanguageFromMarker cases effectively unreachable unless users override workspace.detection_markers. Consider expanding this centralized list to include the prior default markers (plus the new .ragcode additions) to avoid regressions.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +24
"Gemfile",
"Package.swift",
".ragcode",
".agent",
".idea",
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

There’s no unit test asserting that a .ragcode directory is recognized as a valid workspace root marker (and that it works via the default marker list). Adding a detector test that creates <tmp>/.ragcode/ and verifies DetectFromPath picks <tmp> as the root would prevent regressions.

Copilot uses AI. Check for mistakes.
Comment on lines +336 to +344
- .ragcode
- .agent
- .idea
- .vscode
- .vs
- .cursor
- .windsurf
- AGENTS.md
- CLAUDE.md
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The default config.yaml template still hardcodes the detection_markers list, so marker defaults are now duplicated between this YAML string and config.DefaultWorkspaceDetectionMarkers. Since the PR’s goal is to centralize these markers, consider generating this YAML section from the centralized list (or otherwise deriving it from config.DefaultConfig()) to prevent drift when markers change in the future.

Copilot uses AI. Check for mistakes.
@doITmagic doITmagic deleted the fix/workspace-root-ragcode-marker branch February 14, 2026 11:54
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