Skip to content

Commit 2377d43

Browse files
authored
chore: add guard filtering summary to repo-assist monthly activity issue (#2158)
## Summary Adds a **Guard Filtering Summary** section to the repo-assist Monthly Activity Issue so maintainers can see what objects the guard policy blocked during each run. ## What it looks like When the guard filters objects, the monthly activity issue will include: ```markdown ## Guard Filtering Summary | Type | Count | Resources | |------|-------|-----------| | Issues | 7 | #1711, #2049, #2086, #2087, #2089, #2093, #2100 | | PRs | 7 | #2037, #2042, #2061, #2063, #2064, #2092, #2096 | | Other | 2 | actions_list, get_repository_tree | **Policy**: `repos: [github/*], min-integrity: merged` **Total filtered**: 54 items across 17 tool calls ``` When no filtering occurs, it states "No objects were filtered by the guard policy." ## How it works 1. **New section in issue template** — "Guard Filtering Summary" sits between "Future Work" and "Run History" 2. **New step 6** — Agent reads `/tmp/gh-aw/mcp-logs/rpc-messages.jsonl` via bash, parses `DIFC_FILTERED` entries, groups by type (issues/PRs/other), deduplicates across tool calls 3. **Python one-liner** — Extracts resource descriptions, groups into a JSON summary the agent uses to populate the template ## Motivation From [run 23274488766](https://github.com/github/gh-aw-mcpg/actions/runs/23274488766), 54 objects were silently filtered with `min-integrity: merged`. The agent reported "GitHub API access to private repo issues unavailable" without understanding why. This change gives both the agent and maintainers explicit visibility into guard policy impact.
2 parents 0f464bf + 2a40909 commit 2377d43

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/repo-assist.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,21 @@ Maintain a single open issue titled `[Repo Assist] Monthly Activity {YYYY}-{MM}`
339339

340340
*(If nothing pending, skip this section.)*
341341

342+
## Guard Filtering Summary
343+
344+
{Summary of objects filtered by the guard policy during this run. Read the JSONL log (see step 6 below) and render a table of filtered resources grouped by type.}
345+
346+
| Type | Count | Resources |
347+
|------|-------|-----------|
348+
| Issues | <N> | #1, #2, ... |
349+
| PRs | <N> | #1, #2, ... |
350+
| Other | <N> | <resource descriptions> |
351+
352+
**Policy**: `repos: [<scope>], min-integrity: <level>`
353+
**Total filtered**: <N> items across <M> tool calls
354+
355+
*(If no items were filtered, state "No objects were filtered by the guard policy." and skip the table.)*
356+
342357
## Run History
343358

344359
### <YYYY-MM-DD HH:MM UTC> - [Run](<https://github.com/<repo>/actions/runs/<run-id>>)
@@ -367,6 +382,32 @@ Maintain a single open issue titled `[Repo Assist] Monthly Activity {YYYY}-{MM}`
367382
- Any strategic suggestions (goals, priorities)
368383
Use repo memory and the activity log to compile this list. Include direct links for every item. Keep entries to one line each.
369384
5. Do not update the activity issue if nothing was done in the current run. However, if you conclude "nothing to do", first verify this by checking: (a) Are there any open issues without a Repo Assist comment? (b) Are there issues in your memory flagged for attention? (c) Are there any bugs that could be investigated or fixed? If any of these are true, go back and do that work instead of concluding with no action.
385+
6. **Guard filtering summary**: Before writing the activity issue, read the MCP Gateway's JSONL log to discover which objects were filtered by the guard policy. Run this bash command:
386+
```bash
387+
cat /tmp/gh-aw/mcp-logs/rpc-messages.jsonl 2>/dev/null | python3 -c "
388+
import json, sys
389+
from collections import defaultdict
390+
filtered = defaultdict(set)
391+
total = 0
392+
for line in sys.stdin:
393+
entry = json.loads(line.strip())
394+
if entry.get('type') != 'DIFC_FILTERED':
395+
continue
396+
total += 1
397+
desc = entry.get('description', '')
398+
tool = entry.get('tool_name', '')
399+
if desc.startswith('issue:'):
400+
num = desc.split('#')[-1] if '#' in desc else desc
401+
filtered['Issues'].add(num)
402+
elif desc.startswith('pr:'):
403+
num = desc.split('#')[-1] if '#' in desc else desc
404+
filtered['PRs'].add(num)
405+
else:
406+
filtered['Other'].add(desc or tool)
407+
print(json.dumps({'total': total, 'groups': {k: sorted(v) for k, v in filtered.items()}}, indent=2))
408+
" || echo '{"total":0,"groups":{}}'
409+
```
410+
Use the output to populate the "Guard Filtering Summary" section. If `total` is 0, state that no objects were filtered. If the log file doesn't exist, skip the section entirely.
370411

371412
## Guidelines
372413

0 commit comments

Comments
 (0)