Repository navigation
Description
Q Workflow Optimization Report
Triggered by: /q investigate this failure and suggest prompting improvements in instructions on #24613
Root Cause Analysis
PR #24613 fixed 10 workflows using shared/repo-memory-standard.md that had incorrect file-glob patterns like memory/token-audit/*.json. But the root cause was never addressed: the reference documentation actively told AI agents to use exactly this wrong pattern.
The Misleading Documentation
docs/src/content/docs/reference/repo-memory.md contained:
Note: File glob patterns must include the full branch path structure. For branch
memory/custom-agent-for-aw, use patterns likememory/custom-agent-for-aw/*.jsonto match files stored at that path within the branch.
This is incorrect. From push_repo_memory.cjs:
IMPORTANT: Patterns are matched against the RELATIVE FILE PATH from the artifact directory, NOT against the branch path. Do NOT include the branch name in the patterns.
Every workflow an AI agent created after reading the docs would inherit this same bug — explaining the 10-workflow blast radius in #24613.
Changes Made
1. docs/src/content/docs/reference/repo-memory.md — Root cause fix
- Replaced "patterns must include the full branch path" with correct guidance: use bare extension patterns (
*.json, notmemory/branch-name/*.json) - Fixed all code examples in Advanced Configuration and Multiple Configurations sections
- Added explicit "Never include the branch name in patterns" warning
2. Remaining workflow files with incorrect patterns (6 files)
PR #24613 only fixed workflows using shared/repo-memory-standard.md. These were missed:
| Workflow | Before | After |
|---|---|---|
deep-report.md |
memory/deep-report/*.md |
*.md |
daily-cli-performance.md |
memory/cli-performance/*.json … |
*.json *.jsonl *.txt |
copilot-cli-deep-research.md |
memory/copilot-cli-research/*.json … |
*.json *.md |
daily-testify-uber-super-expert.md |
memory/testify-expert/*.json … |
*.json *.txt |
security-compliance.md |
memory/campaigns/security-compliance-*/** |
security-compliance-*/** |
shared/copilot-pr-analysis-base.md |
Template with memory/(name)/*.json |
Bare *.json + explicit warning |
3. shared/copilot-pr-analysis-base.md — Template used as agent reference
Added an explicit callout block warning against branch-name prefixes so any new workflow derived from this template generates correct patterns.
Validation
All 5 modified workflows compiled successfully:
- ✅
deep-report - ✅
daily-cli-performance - ✅
copilot-cli-deep-research - ✅
daily-testify-uber-super-expert - ✅
security-compliance
Note: .lock.yml files will be regenerated automatically after merge.
Expected Improvements
- Eliminates the "silent file skip" bug in 6 more workflows (patterns now match actual artifact paths)
- Corrects the documentation that will be read by AI agents creating future workflows — preventing recurrence
- Adds explicit warnings in the template that agents use as a reference when creating new analysis workflows
Warning
Protected Files — Push Permission Denied
This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.
Protected files
- .github/workflows/daily-cli-performance.md
- .github/workflows/daily-testify-uber-super-expert.md
- .github/workflows/deep-report.md
- .github/workflows/security-compliance.md
- .github/workflows/shared/copilot-pr-analysis-base.md
The push was rejected because GitHub Actions does not have
workflowspermission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.
Create the pull request manually
# Download the patch from the workflow run
gh run download 23990243736 -n agent -D /tmp/agent-23990243736
# Create a new branch
git checkout -b q/fix-repo-memory-file-glob-docs-638af7792a95d5d9 main
# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-23990243736/aw-q-fix-repo-memory-file-glob-docs.patch
# Push the branch and create the pull request
git push origin q/fix-repo-memory-file-glob-docs-638af7792a95d5d9
gh pr create --title '[q] fix: correct file-glob pattern docs and workflows for repo-memory (#24613)' --base main --head q/fix-repo-memory-file-glob-docs-638af7792a95d5d9 --repo github/gh-aw
- expires on Apr 7, 2026, 12:07 AM UTC
Activity