Skip to content

Enhance context resolution with exclusion patterns and sorting fixes - #82

Merged
Malcolmnixon merged 5 commits into
mainfrom
feature/context-exclusion-patterns
Jun 23, 2026
Merged

Malcolmnixon merged 5 commits into
mainfrom
feature/context-exclusion-patterns

Conversation

@Malcolmnixon

@Malcolmnixon Malcolmnixon commented Jun 23, 2026

Copy link
Copy Markdown
Member

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:

  • The implementation in ReviewMarkConfiguration.cs now concatenates global and per-review-set context patterns and resolves them in a single GlobMatcher.GetMatchingFiles() call. This allows per-review-set exclusion patterns (those prefixed with !) to suppress files added by the global context, leveraging GlobMatcher's ordered include/exclude semantics.
  • The documentation in review-mark-configuration.md is updated to clearly describe the new context resolution process, including the handling of exclusions and deduplication.

Requirements and test coverage:

  • The requirements YAML (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]
  • The verification documentation (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:

  • The test suite (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]

Malcolm Nixon and others added 4 commits June 23, 2026 07:57
…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>
Copilot AI review requested due to automatic review settings June 23, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 Context output 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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 2 comments.

@Malcolmnixon
Malcolmnixon merged commit f79441c into main Jun 23, 2026
16 checks passed
@Malcolmnixon
Malcolmnixon deleted the feature/context-exclusion-patterns branch June 23, 2026 15:53
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.

2 participants