Skip to content

Centralize Changed File projections#74

Merged
dbrosio3 merged 1 commit into
mainfrom
centralize-changed-file-projections
Jul 1, 2026
Merged

Centralize Changed File projections#74
dbrosio3 merged 1 commit into
mainfrom
centralize-changed-file-projections

Conversation

@dbrosio3

@dbrosio3 dbrosio3 commented Jul 1, 2026

Copy link
Copy Markdown
Member

This pull request introduces a set of improvements and refactorings to the path policy and AI review modules, focusing on more precise handling of changed files, especially around live (non-deleted) files and changed line metrics. The changes add new helper utilities for selecting live files, counting changed text lines, and projecting file paths, and they update both internal logic and documentation to reflect these enhancements.

Path policy and changed file utilities:

  • Added new helpers in src/path-policy/filtering.ts for selecting live changed files (selectLiveChangedFiles), projecting their paths (selectLiveChangedFilePaths), and counting changed text lines (countChangedTextLines). These utilities improve accuracy and code clarity when working with changed files. [1] [2]
  • Updated selectToolChangedFilePaths to use the new selectLiveChangedFilePaths helper, ensuring only live files are considered for tool commands.

AI review and guardrails integration:

  • Refactored src/ai/guardrails.ts and src/ai/review-context.ts to use countChangedTextLines and selectLiveChangedFiles, ensuring binary and deleted files are handled correctly in AI guardrail checks and when collecting full-file context. [1] [2] [3] [4] [5]

Policy enforcement improvements:

  • Updated built-in policy logic in src/runner/policies.ts to use the new helpers for counting changed lines and filtering live files, improving accuracy and consistency in diff size and forbidden path checks. [1] [2] [3]

Documentation updates:

  • Revised docs/architecture/modules.md to document the new projections, metrics, and helper functions, reflecting the expanded capabilities of the path policy module. [1] [2] [3]

Testing enhancements:

  • Added and updated tests in test/path-policy.test.ts to cover the new helpers and ensure correct behavior for live file selection and changed line counting. [1] [2]
  • Minor test fixture cleanup in test/ai.test.ts to align with new logic.

@dbrosio3 dbrosio3 merged commit 41be9a9 into main Jul 1, 2026
1 check passed
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