Skip to content

Commit 2a40909

Browse files
lpcoxCopilot
andcommitted
chore: add guard filtering summary to repo-assist monthly activity issue
Add a 'Guard Filtering Summary' section to the Monthly Activity Issue template (Task 11) that renders which objects were filtered by the guard policy during each run. Changes to repo-assist.md: - New 'Guard Filtering Summary' section in the issue body template showing filtered issues, PRs, and other resources in a table - New step 6 in Task 11 instructions: agent reads /tmp/gh-aw/mcp-logs/rpc-messages.jsonl via bash and parses DIFC_FILTERED entries to populate the summary - Python one-liner groups filtered items by type (issues, PRs, other) and deduplicates across multiple tool calls This gives maintainers visibility into what the guard policy blocked during each run, helping them understand the guard's impact and tune policies as needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0f464bf commit 2a40909

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)