feat: support exclusion patterns in agent file globs - #583
Conversation
monit-reviewer
left a comment
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: 846e323aaa7b
Profile: pi-codex-monit-reviewer - Posting as: monit-reviewer
Summary
| Reviewer | Findings |
|---|---|
| go:implementation-tests | 1 |
| policies:conventions | 1 |
| structure:repo-health | 0 |
| architecture:solid-reviewer-agnostic | 1 |
| harness-engineering:repo-health | 0 |
go:implementation-tests (1 finding)
Minor - internal/agents/agents_test.go:130
The new validation test covers an exclusions-only catalog but not a malformed exclusion. Add a case for
file_globs: ["!"]:glob.Compile("!")can treat it as a literal include pattern in an implementation that forgets to strip the exclusion prefix, while the intended contract must reject it as an empty exclusion. This protects the new empty-pattern branch invalidateAgentYAML.
policies:conventions (1 finding)
Minor - internal/agents/agents_test.go:129
Add a fixture for a malformed negated pattern such as
![bad. The existing invalid-pattern case only exercises an include, while the new prefix-stripping path is what must preserve validation for exclusions. This keeps the documented malformed-exclusion contract from regressing.
architecture:solid-reviewer-agnostic (1 finding)
Blocking - internal/pipeline/prompts.go:184
U-L1: The documented exclusion contract is not enforced on reviewer assignments.
globsMatchFileprevents force-assignment, but an LLM selection that already lists an excluded path remains unchanged; an empty/broad assignment bypasses matching entirely, and reused cohorts retain persisted excluded files. Thus**/*.tsxplus!**/*.test.*can still send tests to this reviewer and mark them covered. Reconcile every fresh and rebased selection against the catalog matcher before reviewer execution, materializing broad scopes when exclusions exist, removing excluded paths, and assigning them only to another eligible reviewer or leaving them uncovered for coverage accounting. Add regressions for direct selection and saved-cohort assignments containing excluded files.
Reviewer Coverage
go:implementation-tests— complete (broad); inspected 5 assigned files (6 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Static review only; CR tools are read-only, so I did not run the Go test suite.policies:conventions— complete (broad); inspected 5 assigned files (6 inspected across reviewers):README.md,internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review limited to the assigned changed files and repository-local guidance; shared CLI standards were not available in the repository context.structure:repo-health— complete (broad); inspected 5 assigned files (6 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review limited to assigned changed files and pinned diff; no test execution tool is available.architecture:solid-reviewer-agnostic— complete (broad); inspected 5 assigned files (6 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Static review only; the available CR tools are read-only and cannot runmake checkor targeted tests.harness-engineering:repo-health— complete (broad); skipped: none; constraints: Read-only review; I inspected code and tests but did not execute the test suite.
Inspected files (6)
README.mdinternal/agents/agents.gointernal/agents/agents_test.gointernal/pipeline/pipeline_test.gointernal/pipeline/prompts.gointernal/pipeline/prompts_test.go
0 PR discussion threads considered. 0 summarized; 0 resolved.
Completed in 3m 26s | $0.18 | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol | cr 0.10.295
| Field | Value |
|---|---|
| Model | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewers | go:implementation-tests, policies:conventions, structure:repo-health, architecture:solid-reviewer-agnostic, harness-engineering:repo-health |
| Engine | pi_rpc · openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewed by | cr · monit-reviewer |
| Duration | 3m 26s wall · 9m 05s compute |
| Cost | $0.18 |
| Tokens | 24.6k in / 6.0k out |
Per-workstream usage
orchestrator-selection— openai-codex/gpt-5.6-terra- In: 8.1k
- Out: 601
- Cache read: 0
- Cache create: 0
- Cost: $0.02
- Duration: 13s
go:implementation-tests— openai-codex/gpt-5.6-terra- In: 5.8k
- Out: 1.0k
- Cache read: 26.1k
- Cache create: 0
- Cost: $0.03
- Duration: 1m 40s
policies:conventions— openai-codex/gpt-5.6-terra- In: 1.4k
- Out: 591
- Cache read: 7.7k
- Cache create: 0
- Cost: $0.01
- Duration: 56s
structure:repo-health— openai-codex/gpt-5.6-terra- In: 3.9k
- Out: 802
- Cache read: 18.9k
- Cache create: 0
- Cost: $0.02
- Duration: 1m 09s
architecture:solid-reviewer-agnostic— openai-codex/gpt-5.6-sol- In: 911
- Out: 1.8k
- Cache read: 55.7k
- Cache create: 0
- Cost: $0.06
- Duration: 2m 52s
harness-engineering:repo-health— openai-codex/gpt-5.6-terra- In: 1.5k
- Out: 804
- Cache read: 44.5k
- Cache create: 0
- Cost: $0.02
- Duration: 2m 05s
orchestrator-rollup— openai-codex/gpt-5.6-terra- In: 3.0k
- Out: 358
- Cache read: 2.8k
- Cache create: 0
- Cost: $0.01
- Duration: 8s
846e323 to
dd0500d
Compare
monit-reviewer
left a comment
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: dd0500d8ec15
Profile: pi-codex-monit-reviewer - Posting as: monit-reviewer
Summary
| Reviewer | Findings |
|---|---|
| go:implementation-tests | 1 |
| policies:conventions | 0 |
| structure:repo-health | 0 |
| architecture:solid-reviewer-agnostic | 1 |
| harness-engineering:repo-health | 0 |
go:implementation-tests (1 finding)
Major - internal/pipeline/pipeline.go:1742
A reused broad member with exclusions still claims every uncovered file in the candidate-allocation loop before this code materializes and filters its scope. If a later scoped cohort member is the only agent matching an excluded new file, it receives no files and is omitted; reconciliation then drops the file from the broad member, leaving it unassigned. Treat broad members with exclusions as glob-constrained during rebase allocation (and filter persisted files before marking coverage), and add a cohort regression with a broad excluded reviewer followed by a scoped reviewer for the excluded file.
architecture:solid-reviewer-agnostic (1 finding)
Minor - internal/pipeline/prompts.go:184
U-S1/U-O1: The agent glob language is now interpreted independently in
agentsvalidation, this matcher, and the pipeline's exclusion detection. This PR already demonstrates that the syntax evolves; future operators or matching rules can therefore require synchronized edits across packages and silently drift. Put parsing, exclusion detection, and matching behind one small agent-domain abstraction (for example, a parsed glob-set type ininternal/agents) and have validation and assignment consume it.
Reviewer Coverage
go:implementation-tests— complete (constrained); inspected 6 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Read-only review; tests were not executed.policies:conventions— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):README.md,internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review limited to the five assigned changed files; pipeline.go and pipeline_test.go were outside this reviewer’s allowed-file scope.structure:repo-health— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review scope was limited to assigned changed files;internal/pipeline/pipeline.gowas visible only through the pinned diff.architecture:solid-reviewer-agnostic— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Read-only review tools prevented running the test suite. Review was limited to the five assigned files;internal/pipeline/pipeline.gowas visible only through the pinned diff. The external harness-engineering principles file was outside the disposable repository and could not be inspected.harness-engineering:repo-health— complete (constrained); inspected 6 assigned files (7 inspected across reviewers):README.md,internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Assignment scope excluded internal/pipeline/pipeline.go; its enforcement changes were inspected only through the pinned diff.
Inspected files (7)
README.mdinternal/agents/agents.gointernal/agents/agents_test.gointernal/pipeline/pipeline.gointernal/pipeline/pipeline_test.gointernal/pipeline/prompts.gointernal/pipeline/prompts_test.go
0 PR discussion threads considered. 0 summarized; 0 resolved.
Completed in 3m 21s | $0.17 | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol | cr 0.10.295
| Field | Value |
|---|---|
| Model | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewers | go:implementation-tests, policies:conventions, structure:repo-health, architecture:solid-reviewer-agnostic, harness-engineering:repo-health |
| Engine | pi_rpc · openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewed by | cr · monit-reviewer |
| Duration | 3m 21s wall · 7m 13s compute |
| Cost | $0.17 |
| Tokens | 25.2k in / 5.1k out |
Per-workstream usage
go:implementation-tests— openai-codex/gpt-5.6-terra- In: 4.7k
- Out: 1.4k
- Cache read: 36.4k
- Cache create: 0
- Cost: $0.03
- Duration: 1m 18s
policies:conventions— openai-codex/gpt-5.6-terra- In: 5.3k
- Out: 320
- Cache read: 13.8k
- Cache create: 0
- Cost: $0.02
- Duration: 46s
structure:repo-health— openai-codex/gpt-5.6-terra- In: 320
- Out: 1.0k
- Cache read: 11.8k
- Cache create: 0
- Cost: $0.02
- Duration: 51s
architecture:solid-reviewer-agnostic— openai-codex/gpt-5.6-sol- In: 2.8k
- Out: 1.8k
- Cache read: 57.1k
- Cache create: 0
- Cost: $0.07
- Duration: 2m 55s
harness-engineering:repo-health— openai-codex/gpt-5.6-terra- In: 7.0k
- Out: 416
- Cache read: 16.9k
- Cache create: 0
- Cost: $0.02
- Duration: 1m 14s
orchestrator-rollup— openai-codex/gpt-5.6-terra- In: 5.1k
- Out: 122
- Cache read: 0
- Cache create: 0
- Cost: $0.01
- Duration: 6s
dd0500d to
af616d1
Compare
monit-reviewer
left a comment
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: af616d1302bf
Profile: pi-codex-monit-reviewer - Posting as: monit-reviewer
Summary
| Reviewer | Findings |
|---|---|
| go:implementation-tests | 1 |
| policies:conventions | 0 |
| structure:repo-health | 0 |
| architecture:solid-reviewer-agnostic | 0 |
| harness-engineering:repo-health | 0 |
go:implementation-tests (1 finding)
Major - internal/pipeline/pipeline.go:1625
A files-only direct selection for an agent with exclusions remains unconstrained after reconciliation:
Filesis filtered, butAllowedFilesstays empty. EmptyAllowedFilesis passed toPrepareReviewerRequestas an unrestricted workspace, so the reviewer can still read excluded files. MaterializeAllowedFilesfrom the filteredFileswhenever an exclusion-bearing agent has an explicit files scope but no remaining allowed-files scope. Add a regression test usingFiles: ["Button.tsx", "Button.test.tsx"]with noAllowedFiles, and assert both fields become["Button.tsx"].
Reviewer Coverage
go:implementation-tests— complete (constrained); inspected 6 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Inspected the pinned diff and assigned source/tests; did not execute tests because only read-only CR tools are available.policies:conventions— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):README.md,internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review limited to the five assigned changed files. Shared CLI and automation source-of-truth documentation was not present in the allowed review context.structure:repo-health— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review was limited to assigned files.internal/pipeline/pipeline.gowas visible in the required pinned diff but was not an allowed file for independent source inspection.architecture:solid-reviewer-agnostic— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: No command-execution tool was available, so I inspected tests but did not run them. Review was limited to the five assigned files;internal/pipeline/pipeline.goproduction changes were outside the allowed file scope, though visible in the pinned diff as context.harness-engineering:repo-health— complete (constrained); inspected 6 assigned files (7 inspected across reviewers):README.md,internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: none
Inspected files (7)
README.mdinternal/agents/agents.gointernal/agents/agents_test.gointernal/pipeline/pipeline.gointernal/pipeline/pipeline_test.gointernal/pipeline/prompts.gointernal/pipeline/prompts_test.go
0 PR discussion threads considered. 0 summarized; 0 resolved.
Completed in 10m 49s | $0.18 | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol | cr 0.10.295
| Field | Value |
|---|---|
| Model | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewers | go:implementation-tests, policies:conventions, structure:repo-health, architecture:solid-reviewer-agnostic, harness-engineering:repo-health |
| Engine | pi_rpc · openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewed by | cr · monit-reviewer |
| Duration | 10m 49s wall · 16m 04s compute |
| Cost | $0.18 |
| Tokens | 26.7k in / 4.1k out |
Per-workstream usage
go:implementation-tests— openai-codex/gpt-5.6-terra- In: 5.4k
- Out: 1.3k
- Cache read: 46.6k
- Cache create: 0
- Cost: $0.04
- Duration: 2m 03s
policies:conventions— openai-codex/gpt-5.6-terra- In: 1.0k
- Out: 475
- Cache read: 10.8k
- Cache create: 0
- Cost: $0.01
- Duration: 39s
structure:repo-health— openai-codex/gpt-5.6-terra- In: 3.4k
- Out: 393
- Cache read: 25.1k
- Cache create: 0
- Cost: $0.02
- Duration: 1m 33s
architecture:solid-reviewer-agnostic— openai-codex/gpt-5.6-sol- In: 13.0k
- Out: 1.6k
- Cache read: 44.2k
- Cache create: 0
- Cost: $0.10
- Duration: 10m 22s
harness-engineering:repo-health— openai-codex/gpt-5.6-terra- In: 1.7k
- Out: 316
- Cache read: 23.0k
- Cache create: 0
- Cost: $0.01
- Duration: 1m 20s
orchestrator-rollup— openai-codex/gpt-5.6-terra- In: 2.1k
- Out: 73
- Cache read: 2.8k
- Cache create: 0
- Cost: $0.01
- Duration: 4s
af616d1 to
fdc5788
Compare
monit-reviewer
left a comment
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: fdc5788a9807
Profile: pi-codex-monit-reviewer - Posting as: monit-reviewer
Summary
| Reviewer | Findings |
|---|---|
| go:implementation-tests | 0 |
| policies:conventions | 0 |
| structure:repo-health | 0 |
| architecture:solid-reviewer-agnostic | 0 |
| harness-engineering:repo-health | 0 |
Reviewer Coverage
go:implementation-tests— complete (constrained); inspected 6 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: nonepolicies:conventions— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):README.md,internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review limited to assigned changed files; shared CLI convention sources were not provided in the review context.structure:repo-health— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review scope was limited to the five assigned changed files; the related implementation in internal/pipeline/pipeline.go was not inspected directly.architecture:solid-reviewer-agnostic— complete (constrained); inspected 5 assigned files (7 inspected across reviewers):internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review was limited to the five assigned files;internal/pipeline/pipeline.gowas visible in the pinned diff but outside the allowed file scope. Static inspection only; the available CR tools cannot runmake checkor other verification commands. The external SignalFT harness principles path was outside the disposable repository and unavailable through CR-owned tools.harness-engineering:repo-health— complete (constrained); inspected 6 assigned files (7 inspected across reviewers):README.md,internal/agents/agents.go,internal/agents/agents_test.go,internal/pipeline/pipeline_test.go,internal/pipeline/prompts.go,internal/pipeline/prompts_test.go; skipped: none; constraints: Review scope was limited to the six assigned changed files;internal/pipeline/pipeline.goimplementation was not inspected beyond the pinned diff.
Inspected files (7)
README.mdinternal/agents/agents.gointernal/agents/agents_test.gointernal/pipeline/pipeline.gointernal/pipeline/pipeline_test.gointernal/pipeline/prompts.gointernal/pipeline/prompts_test.go
0 PR discussion threads considered. 0 summarized; 0 resolved.
Completed in 3m 19s | $0.17 | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol | cr 0.10.295
| Field | Value |
|---|---|
| Model | openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewers | go:implementation-tests, policies:conventions, structure:repo-health, architecture:solid-reviewer-agnostic, harness-engineering:repo-health |
| Engine | pi_rpc · openai-codex/gpt-5.6-terra, openai-codex/gpt-5.6-sol |
| Reviewed by | cr · monit-reviewer |
| Duration | 3m 19s wall · 7m 05s compute |
| Cost | $0.17 |
| Tokens | 23.3k in / 3.9k out |
Per-workstream usage
go:implementation-tests— openai-codex/gpt-5.6-terra- In: 3.2k
- Out: 349
- Cache read: 28.2k
- Cache create: 0
- Cost: $0.02
- Duration: 1m 21s
policies:conventions— openai-codex/gpt-5.6-terra- In: 4.0k
- Out: 316
- Cache read: 8.7k
- Cache create: 0
- Cost: $0.01
- Duration: 38s
structure:repo-health— openai-codex/gpt-5.6-terra- In: 1.8k
- Out: 512
- Cache read: 11.8k
- Cache create: 0
- Cost: $0.01
- Duration: 55s
architecture:solid-reviewer-agnostic— openai-codex/gpt-5.6-sol- In: 9.2k
- Out: 2.1k
- Cache read: 70.5k
- Cache create: 0
- Cost: $0.11
- Duration: 2m 52s
harness-engineering:repo-health— openai-codex/gpt-5.6-terra- In: 3.3k
- Out: 595
- Cache read: 12.8k
- Cache create: 0
- Cost: $0.02
- Duration: 1m 14s
orchestrator-rollup— openai-codex/gpt-5.6-terra- In: 1.8k
- Out: 38
- Cache read: 2.8k
- Cache create: 0
- Cost: $0.00
- Duration: 3s
Summary
Add
!-prefixed exclusions to agentfile_globsso specialized reviewers can avoid files outside their contract without weakening coverage accounting.Closes #582.
Changes
**/include and exclusion patternsTesting
make check