Skip to content

Skip ignored trees during Context discovery - #146

Merged
fgilio merged 4 commits into
mainfrom
fix/context-scan-ignored-worktrees
Aug 13, 2026
Merged

Skip ignored trees during Context discovery#146
fgilio merged 4 commits into
mainfrom
fix/context-scan-ignored-worktrees

Conversation

@fgilio

@fgilio fgilio commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace the recursive untracked-file walk with git ls-files --others --exclude-standard.
  • Apply context pathspecs and configured skip directories before Git traverses the repository.
  • Preserve untracked context discovery while excluding ignored worktrees and dependency trees.
  • Measure the fixed feedback bar and keep Context and Review sidebars above it as its height changes.

Performance

On /Users/fgilio/pla/farfalla, the scan keeps the same 44 files, 1,457 lines, and 95,902 bytes. Runtime falls from 11.35-11.95 seconds to 0.67-1.08 seconds.

Tests

  • composer test:lint
  • composer test:types
  • composer test (1,806 tests, 4,942 assertions)
  • composer test:js (349 tests)
  • composer test:browser (210 passed, 1 skipped)

Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dfca7880-1f85-46c0-ad74-de198bf52606

📥 Commits

Reviewing files that changed from the base of the PR and between c352c6d and 9b6f534.

📒 Files selected for processing (2)
  • app/Services/AgentContextFileScannerService.php
  • tests/Unit/Services/AgentContextFileScannerServiceTest.php

📝 Walkthrough

Walkthrough

The scanner now uses Git to discover untracked context files with standard excludes. It removes recursive filesystem traversal and separate ignore checks. Tests cover untracked files and ignored .worktrees paths.

Changes

Context-file discovery

Layer / File(s) Summary
Git-based untracked discovery
app/Services/AgentContextFileScannerService.php
The scanner uses git ls-files --others --exclude-standard with context-file pathspecs. It filters skip directories, handles Git errors, and removes recursive scanning and batch ignore checks.
Scanner behavior validation
tests/Unit/Services/AgentContextFileScannerServiceTest.php
Tests verify untracked AGENTS.md reporting, tracking status, and exclusion of ignored .worktrees paths.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to 9b6f5

The change preserves untracked context discovery while excluding ignored trees and substantially reduces scan time; only minor test-style follow-up remains, so no actionable merge-blocking risk remains after normal checks.

Sequence Diagram(s)

sequenceDiagram
  participant AgentContextFileScannerService
  participant GitProcessService
  participant Git
  AgentContextFileScannerService->>GitProcessService: Query untracked context-file paths
  GitProcessService->>Git: ls-files --others --exclude-standard
  Git-->>GitProcessService: Return null-delimited paths
  GitProcessService-->>AgentContextFileScannerService: Return candidates or no candidates on error
Loading

Possibly related PRs

  • fgilio/rfa#144: Both PRs modify untracked-file discovery and context-file pathspec handling in AgentContextFileScannerService.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: excluding ignored directory trees during context-file discovery.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b6f53472d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/Services/AgentContextFileScannerService.php
fgilio and others added 3 commits August 13, 2026 18:52
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
@fgilio
fgilio merged commit 87f18d0 into main Aug 13, 2026
15 checks passed
@fgilio
fgilio deleted the fix/context-scan-ignored-worktrees branch August 13, 2026 18:26
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