Repository navigation
Centralize allow-only repos normalization - #17148
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change centralizing allow-only repos normalization.
No open issues 🎉
What changed in this PR
Centralizes allow-only repos normalization so policy loading and WASM payload construction share validation rules and error messages, addressing #17141.
Changes:
- Routes policy normalization and the validity wrapper through one helper, with a shared array-validation path.
- Removes redundant validation during WASM payload construction.
- Expands regression coverage for input types, typed nil slices, normalized duplicates, and non-ASCII scopes.
| File | Description |
|---|---|
internal/guard/wasm_payload.go |
Removes the redundant repos validation pre-check. |
internal/guard/wasm_payload_test.go |
Adds normalization and validation-error cases. |
internal/guard/guard_test.go |
Updates the expected empty-array error. |
internal/config/guard_policy_validation.go |
Centralizes repos normalization and array handling. |
internal/config/guard_policy_test.go |
Aligns the expected unsupported-type error. |
internal/config/guard_policy_string_validation_test.go |
Updates validity expectations for string slices. |
internal/config/guard_policy_normalize_repos_test.go |
Checks consistent outputs and errors across normalization entry points. |
Review effort: Balanced (adaptive)
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked through any surface. Part B is INCONCLUSIVE because all targeted write tools (star_repository, issue_write, add_issue_comment, create_branch, create_or_update_file, create_pull_request) are entirely absent from the GitHub MCP tool catalog exposed to this workflow — this reflects gh-aw's own Full ReportPart A detail: All 4 MCP reads (list_issues, list_pull_requests, get_file_contents README.md, list_commits) against github/gh-aw-mcpg returned valid JSON data via the gateway-backed Part B detail: Catalog discovery ( Part C detail: Part D/E detail: No artifacts were created, no reactions/stars applied, no comments posted, no branches/files/PRs created. Results saved to
|
Allow-only
reposvalidation duplicated type switches across policy loading and WASM payload construction, allowing acceptance rules and errors to drift. WASM payloads also validated each value twice.NormalizeGuardPolicythroughNormalizeAllowOnlyReposValue; convert[]stringonce into the shared array-validation path.IsValidAllowOnlyReposValueas a delegating wrapper, now consistent for[]string.