Enhance context resolution with exclusion patterns and sorting fixes - #82
Merged
Merged
Conversation
…ontext files Global and per-review-set context patterns are now resolved as a single ordered sequence. This allows per-review-set exclusion patterns (! prefix) to suppress files added by the global context, using GlobMatcher's existing ordered include/exclude semantics. - Simplify ElaborateReviewSet() to use a single combined GlobMatcher call - Remove now-redundant Distinct() call (GlobMatcher deduplicates internally) - Add requirement ReviewMark-Config-ContextExclusionPatterns - Add design note for combined ordered context resolution - Add tests for exclusion and isolation across review sets - Add verification entries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…c sort Context files are sorted lexicographically (consistent with Files), not ordered by source (global before local). The ordering guarantee was undocumented intent that was never reliably preserved by GlobMatcher's sorted output. Removing it simplifies the implementation and aligns context with the Files section behaviour. - Rename GlobalContextBeforeLocalContext test to BothGlobalAndLocalContextAppear - Replace index-comparison ordering assertion with order-agnostic presence checks - Update requirement, design, and verification docs to reflect lexicographic sort Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates ReviewMark’s ElaborateReviewSet context resolution so global and per-review-set context patterns are evaluated as one ordered include/exclude sequence (enabling per-set ! exclusions to override globally included context), and aligns the documented expectation that the rendered Context list is lexicographically ordered.
Changes:
- Combine global + per-review-set context patterns into a single ordered list when resolving context files.
- Update design/requirements/verification docs to describe combined ordered context resolution and lexicographic
Contextoutput ordering. - Add tests for mixed global/local context presence and for per-review-set exclusion behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/DemaConsulting.ReviewMark/Configuration/ReviewMarkConfiguration.cs |
Resolves context via a single combined pattern list so per-set exclusions can suppress global context matches. |
test/DemaConsulting.ReviewMark.Tests/Configuration/ReviewMarkConfigurationTests.cs |
Updates/adds tests for combined context presence and exclusion semantics. |
docs/design/review-mark/configuration/review-mark-configuration.md |
Documents combined ordered context resolution and lexicographic ordering expectations. |
docs/reqstream/review-mark/configuration/review-mark-configuration.yaml |
Updates requirements to specify lexicographic ordering and adds a new requirement for exclusion override behavior. |
docs/verification/review-mark/configuration/review-mark-configuration.md |
Updates verification scenarios and requirement coverage tables for the new behaviors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ordering is an implementation detail of GlobMatcher, not a user requirement. Removed the 'in lexicographic order (consistent with the Files section)' language from ReviewMark-Config-ContextInElaboration and the corresponding design description. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 24, 2026
3 tasks
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.
This pull request enhances how context files are resolved and documented in the ReviewMark configuration system. The main improvement is that global and per-review-set context patterns are now combined into a single ordered list, allowing per-review-set exclusion patterns to override global inclusions. This makes context resolution more flexible and predictable, especially when review sets need to exclude files included by global context. The changes are supported by new and updated tests, documentation, and requirements.
Context resolution improvements:
ReviewMarkConfiguration.csnow concatenates global and per-review-set context patterns and resolves them in a singleGlobMatcher.GetMatchingFiles()call. This allows per-review-set exclusion patterns (those prefixed with!) to suppress files added by the global context, leveragingGlobMatcher's ordered include/exclude semantics.review-mark-configuration.mdis updated to clearly describe the new context resolution process, including the handling of exclusions and deduplication.Requirements and test coverage:
review-mark-configuration.yaml) adds a new requirement (ReviewMark-Config-ContextExclusionPatterns) specifying that context patterns are treated as a single sequence, enabling per-review-set exclusions. Associated tests are listed for this and other related requirements. [1] [2]review-mark-configuration.md) is updated to describe and associate new test scenarios covering both combined context resolution and exclusion patterns. [1] [2]Test additions and updates:
ReviewMarkConfigurationTests.cs) adds tests to verify that per-review-set exclusion patterns correctly suppress global context files for specific review sets, and that exclusions are isolated to the relevant set. Existing tests are updated to reflect the new context resolution order and logic. [1] [2] [3]