Conversation
added 2 commits
March 15, 2026 21:23
… structured logging
- Laravel: walk UP parent directories looking for artisan / composer.json with laravel/framework
- WordPress: walk UP parent directories looking for wp-config.php, wp-content, plugin/theme headers
- Add detection caching (laravelCache, wordpressCache) to avoid repeated stat calls
- Replace all fmt.Fprintf(os.Stderr) with logger.Instance.{Debug,Info,Warn,Error}
- Add detailed enrichment pipeline logging (chunks before/after, route files, etc.)
- Bump version to 2.1.86
…esystem-detection
There was a problem hiding this comment.
Pull request overview
Adds filesystem “walk-up” framework detection to the PHP pipeline to better classify deeply nested files as Laravel/WordPress projects, and replaces stderr printing with the repo’s structured logger.
Changes:
- Implement WordPress parent-directory detection via
isWordPressByFilesystem()and integrate it intoIsWordPressProject. - Add Laravel parent-directory detection via
IsLaravelProjectByPaths()/isLaravelRoot()and extendphp.CodeAnalyzer.IsLaravelProject()with filesystem checks + caching. - Replace various
fmt.Fprintf(os.Stderr, ...)calls withlogger.Instance.{Debug,Info,Warn,Error}; bump version to2.1.86.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/parser/php/wordpress/enricher.go | Adds structured logging around WordPress enrichment flow. |
| pkg/parser/php/wordpress/analyzer.go | Adds upward filesystem walk WordPress detection helper and calls it from IsWordPressProject. |
| pkg/parser/php/php_analyzer.go | Adds structured logging for enricher registration/applicability/enrichment and route fallback. |
| pkg/parser/php/laravel/routes.go | Switches route analysis error output to structured logging. |
| pkg/parser/php/laravel/migrations.go | Switches migration analysis error output to structured logging. |
| pkg/parser/php/laravel/enricher.go | Adds Laravel parent-directory walk-up detection and logs enrichment steps. |
| pkg/parser/php/analyzer.go | Adds framework detection caches; extends Laravel detection with filesystem walk-up + logging. |
| cmd/rag-code-mcp/main.go | Version bump to 2.1.86. |
You can also share your feedback on Copilot code review. Take the survey.
- Add maxWalkUpDepth=10 to WordPress and Laravel filesystem walk-up detection - Read only first 4KB of files for WP plugin/theme header checks (readFilePrefix) - Downgrade per-file/per-enricher logs from Info to Debug to reduce noise - Remove unused wordpressCache field from CodeAnalyzer - Fix isLaravelByFilesystem caching to cache starting directory results - Clarify duplicate walk-up in Laravel IsApplicable (fallback for empty packages) - Add 8 unit tests for WordPress filesystem walk-up detection - Add 8 unit tests for Laravel filesystem walk-up detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements filesystem-based framework detection by walking UP parent directories, replacing the previous approach that only checked the immediate file/directory level. This dramatically improves detection accuracy for deeply nested PHP files in both Laravel and WordPress projects.
artisanorcomposer.jsoncontaininglaravel/frameworkdependency. Results are cached vialaravelCacheto avoid repeatedos.Statcalls across files in the same project.wp-config.php,wp-content,wp-includes,wp-admin, or plugin/theme headers (Plugin Name:,Theme Name:instyle.css). Results are cached viawordpressCache.fmt.Fprintf(os.Stderr, ...)calls withlogger.Instance.{Debug,Info,Warn,Error}throughout the PHP parser pipeline, adding detailed enrichment pipeline logging (chunks before/after, route files, enricher applicability).2.1.86.Key Changes & Impact:
pkg/parser/php/analyzer.go— Laravel walk-up detection withisLaravelByFilesystem()+laravelCachepkg/parser/php/laravel/enricher.go— Structured logging for enrichment pipeline (route files, migrations, chunk counts)pkg/parser/php/wordpress/analyzer.go— WordPress walk-up detection withisWordPressByFilesystem()pkg/parser/php/wordpress/enricher.go— Structured logging for WordPress enrichmentpkg/parser/php/php_analyzer.go— Logging for enricher applicability and chunk enrichment flowType of change
Checklist:
go fmt ./...go test ./...and they pass