Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions .github/workflows/glossary-maintainer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 58 additions & 16 deletions .github/workflows/glossary-maintainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

permissions:
contents: read
issues: read
pull-requests: read
actions: read

Expand Down Expand Up @@ -41,12 +40,46 @@ tools:
wiki: true
description: "Project glossary and terminology reference"
github:
toolsets: [default]
toolsets: [repos, pull_requests] # scoped to avoid search_repositories (in default); repos covers commits/files, pull_requests covers PRs
edit:
bash: true

timeout-minutes: 20

checkout:
fetch-depth: 0 # full history required so git log --since works across all commits

steps:
- name: Fetch recent changes
run: |
set -euo pipefail
mkdir -p /tmp/gh-aw/agent

# Determine scan scope: Monday = full weekly scan, other weekdays = daily
DAY=$(date +%u)
if [ "$DAY" -eq 1 ]; then
SINCE="7 days ago"
SCOPE="weekly"
else
SINCE="24 hours ago"
SCOPE="daily"
fi

echo "Scan scope: $SCOPE (since: $SINCE)"

# Fetch recent commits (all files) — includes file names for context
git log --since="$SINCE" --oneline --name-only \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use the checkout feature to get a non-sparse checkout of the repo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added checkout: fetch-depth: 0 to the frontmatter in 4e0511b. This configures a full (non-sparse) checkout with complete git history, ensuring git log --since='24 hours ago' and --since='7 days ago' in the pre-step can see all commits rather than just the shallow single-commit default.

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recent-commits.txt is generated with git log --oneline, which outputs an abbreviated SHA. Later instructions tell the agent to call get_commit using SHAs from this file; using full SHAs (e.g., via --pretty=format:%H ...) avoids ambiguity and ensures the SHA is valid for API calls.

Also consider adding an explicit --max-count here to match the later “analyze at most 20 commits” constraint, so the pre-fetched file can’t grow unexpectedly large.

This issue also appears on line 79 of the same file.

Suggested change
git log --since="$SINCE" --oneline --name-only \
git log --since="$SINCE" --max-count=20 --format="%H %s" --name-only \

Copilot uses AI. Check for mistakes.
> /tmp/gh-aw/agent/recent-commits.txt

# Fetch commits that touched docs
git log --since="$SINCE" --name-only \
--format="%H %s" -- 'docs/**/*.md' 'docs/**/*.mdx' \
> /tmp/gh-aw/agent/doc-changes.txt

echo "Recent commits: $(wc -l < /tmp/gh-aw/agent/recent-commits.txt)"
echo "Doc file changes: $(wc -l < /tmp/gh-aw/agent/doc-changes.txt)"
echo "$SCOPE" > /tmp/gh-aw/agent/scan-scope.txt

---

# Glossary Maintainer
Expand Down Expand Up @@ -96,20 +129,19 @@ Use Serena to:

### 1. Determine Scan Scope

Check what day it is:
- **Monday**: Full scan (review changes from last 7 days)
- **Other weekdays**: Incremental scan (review changes from last 24 hours)

Use bash commands to check recent activity:
The pre-step has already determined the scan scope. Read it from the file:

```bash
# For incremental (daily) scan
git log --since='24 hours ago' --oneline

# For full (weekly) scan on Monday
git log --since='7 days ago' --oneline
cat /tmp/gh-aw/agent/scan-scope.txt # "daily" or "weekly"
cat /tmp/gh-aw/agent/recent-commits.txt # pre-fetched commit list
cat /tmp/gh-aw/agent/doc-changes.txt # commits that touched docs
```

- **`weekly`** (Monday): Full scan — review changes from the last 7 days
- **`daily`** (other weekdays): Incremental scan — review changes from the last 24 hours

Do not run additional `git log` commands to re-fetch this data; the files above are already populated.

### 2. Load Cache Memory

You have access to cache-memory to track:
Expand All @@ -129,10 +161,10 @@ Based on the scope (daily or weekly):
- e.g., `search("cache-memory workflow persistence")` to check for existing docs before adding a term
- e.g., `search("MCP server configuration tools")` to find all documentation on a concept

**Use GitHub tools to:**
- List recent commits using `list_commits` for the appropriate timeframe
- Get detailed commit information using `get_commit` for commits that might introduce new terminology
- Search for merged pull requests using `search_pull_requests`
**Use GitHub tools sparingly** — prefer the pre-fetched files above:
- Use `get_commit` for detailed diff of specific commit SHAs from `recent-commits.txt` (at most 20 commits)
- Use `search_pull_requests` to find merged PRs from the timeframe (at most 10 PRs)
- Use `pull_request_read` to inspect specific PR changes — pass `method: get_files` or `method: get_diff` as the operation

**Look for new terminology in `docs/**/*.{md,mdx}` (and nowhere else)**
- New configuration fields in frontmatter (YAML keys)
Expand Down Expand Up @@ -310,6 +342,16 @@ If you made any changes to the glossary:
- **Use Cache**: Track your work to avoid duplicates
- **Link Appropriately**: Add references to related documentation

## Constraints

To keep this workflow efficient, adhere to these hard limits:

- **Do not use `search_repositories`** — it searches GitHub globally and is irrelevant to this task
- **Do not read issues** — terminology should come from commits, PRs, and documentation files, not issue discussions
- **Analyze at most 20 commits** — use the pre-fetched `recent-commits.txt` file and pick the most relevant ones
- **Read at most 10 pull requests** — focus on PRs that clearly introduce new features or terminology
- **The only repository that matters is the current one** — do not query or search other repositories

## Important Notes

- You have edit tool access to modify the glossary
Expand Down
Loading