Skip to content

feat: publish a monthly Agent Activity Index to GitHub Pages - #688

Open
shaidar wants to merge 6 commits into
mainfrom
feat/agent-activity-index
Open

shaidar wants to merge 6 commits into
mainfrom
feat/agent-activity-index

Conversation

@shaidar

@shaidar shaidar commented Nov 19, 2026

Copy link
Copy Markdown

What are the relevant tickets?

Closes #687

Description (What does it do?)

Adds a monthly report of how agents and bots show up in pull requests across the public mitodl repos, published to GitHub Pages with one JSON snapshot kept per month for trends.

Implementation details
  • bin/agent_activity_index.py classifies each PR as human, human + agent, agent-authored or bot, from fingerprints (author app, body footer, branch prefix, commit trailer), and counts bot reviews, merge rate, outcomes and instruction files. Any GitHub App account counts as a bot.
  • History lives on the live Pages site: update downloads earlier months, adds the new one and redeploys. A clean 404 on index.json starts empty and backfills from 2026-01. Any other download failure aborts, so the real history is not replaced.
  • Each run fills every month after the newest published one, so a failed run leaves a one-month gap and not a permanent one.
  • .github/workflows/agent-activity.yml runs on the 1st of each month and on manual dispatch. It also runs the tests on pull requests. Actions are pinned by SHA.
  • Dependencies are declared inline in the script, so no pyproject.toml or uv.lock change and no package release.
  • Limits: figures are a floor (agents with no fingerprint are not counted); only the first 50 reviews and 100 commits per PR are read; open PRs stay "open" in the month's snapshot; repos archived later drop out of backfills.

How can this be tested?

  • just test-agent-activity (30 unit tests: classification, month planning, the download guard, page build).
  • Locally, ./bin/agent_activity_index.py snapshot --month 2026-10 --repo agent-kit --out /tmp/snap.json ran against the live API (761 PRs across two repos).
  • The page script was run in Node against sample snapshots with no errors. I have not viewed it in a browser.
  • The workflow has not run. It needs Pages enabled (Settings → Pages → Source: GitHub Actions); then run it once with workflow_dispatch and check https://mitodl.github.io/agent-kit/agent-activity/.

Checklist:

  • A repo admin sets Pages source to GitHub Actions
  • Run the agent-activity workflow once by hand after merge

🤖 Generated with Claude Code

shaidar and others added 2 commits November 19, 2026 09:17
Adds bin/agent_activity_index.py, which classifies the pull requests opened in
the public mitodl repositories by fingerprint (human, human + agent,
agent-authored, bot), counts bot reviews, merge rate and outcomes, and keeps
one JSON snapshot per month. A scheduled workflow adds last month, rebuilds the
page and deploys it to GitHub Pages.

History lives on the deployed site: `update` downloads the earlier months,
adds the new one and redeploys. A clean 404 starts empty and backfills from
2026-01; any other download failure aborts so a transient error cannot replace
the real history with an empty site.

The script declares its dependencies inline (PEP 723), so no pyproject.toml or
uv.lock changes and no package release is triggered.

Refs #687

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Count an agent only from a footer or Co-authored-by trailer, never a bare
  mention of its name, and only treat an account as an agent when it is a Bot
  account, so a person named "claude" or a PR documenting the Claude Code skill
  is not agent work.
- Fill every month after the newest published one, so a failed run leaves a gap
  of one month, not a permanent one. Reject --backfill-from after the month.
- Validate month names as YYYY-MM, including those read from the downloaded
  index, and require each downloaded file to describe the month it is named for.
- Scope the workflow's concurrency group to the publish job so a pull request's
  test run cannot displace a queued publish.
- Count commit trailers only from PRs that are not bot-authored.

Refs #687

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 15:24

@agent-optibot agent-optibot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Publishes monthly Agent Activity Index snapshots and trends to GitHub Pages.

  • Adds: monthly pull request classification, bot review counts, outcomes, and instruction file data.
  • Adds: history recovery and gap filling from previously published monthly snapshots.
  • Adds: a GitHub Pages report with trend charts, summaries, and monthly data selection.
Details for reviewers

Risks

  • A day with more than 1,000 pull requests uses only the first 1,000 results.
  • The report depends on live GitHub Pages history, so a successful deploy remains the only durable history copy.
  • The page loads fonts from Google Fonts, which can affect appearance or add an external browser request.

Core files: bin/agent_activity_index.py, .github/workflows/agent-activity.yml, bin/agent_activity_report.html

More changes

  • Adds: scheduled and manual publishing with pinned GitHub Actions and Pages deployment. (agent-activity.yml)
  • Adds: unit coverage for classification, month planning, history download failures, and page building. (test_agent_activity_index.py, justfile)
  • Changes: the contributor guidance to include the new activity reporting workflow. (AGENTS.md)

Unchanged

  • The report keeps only aggregate monthly data, not individual pull request records.
  • Unfingerprinted agent activity remains excluded, so published figures are lower-bound estimates.

Summary of 240ed82 · React 👍 or 👎 on my comments to tune what I raise · Commands · Review config

@shaidar shaidar added the Needs Review An open Pull Request that is ready for review label Nov 19, 2026
@shaidar
shaidar requested a review from blarghmatey November 19, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Separate-directory builds omit downloadable history from the deployed site, causing subsequent updates to restart backfills, while overly broad agent detection and period-dependent inventory reporting produce misleading results.

No open issues 🎉

What changed in this PR

Adds a monthly Agent Activity Index for public mitodl repositories, published to GitHub Pages independently of package releases and the documentation site.

Changes:

  • Collects PR classifications, outcomes, bot reviews, and instruction-file adoption into monthly JSON snapshots.
  • Builds an interactive report with historical trends and period selection.
  • Adds scheduled publishing, guarded history downloads, backfill support, and unit tests.
File Description
tests/​bin/​test_agent_activity_index.py Tests classification, aggregation, month planning, history downloads, and page generation.
justfile Adds the standalone test-agent-activity recipe.
bin/​agent_activity_report.html Provides the report layout, charts, tables, and period selector.
bin/​agent_activity_index.py Implements data collection, classification, snapshot management, and site generation.
AGENTS.md Documents the new test command.
.github/​workflows/​agent-activity.yml Runs tests and schedules or manually publishes the report to GitHub Pages.

Review effort: Balanced

… Code match

- build_site copies the monthly data into the output directory when it was read
  from elsewhere, so a page built with the `site` command carries its history and
  the next run can download it.
- A pasted claude.com/claude-code link no longer counts as an agent footer; only
  the "Generated with Claude Code" footer and Co-Authored-By trailer do.

Refs #687

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@agent-optibot agent-optibot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Status: Needs Changes 🔧

Blocking Issues:

  • An older-month rerun can drop newer snapshots when Pages serves a stale index.

📌 Reviewed up to commit 240ed82 · ⏱️ Review completed in 11 minutes
🔄 Newer commits have been pushed since — comment #optibot review to include them.

  • 🔄 re-review this PR

Comment thread bin/agent_activity_index.py Resolved
Comment thread bin/agent_activity_index.py Resolved
Comment thread bin/agent_activity_index.py Resolved
shaidar and others added 3 commits November 19, 2026 09:38
Pages serves index.json with max-age=600. A run that started inside that window
of the previous publish could read the old index and redeploy without the month
the previous publish added, for example an explicit rerun of an older month right
after a newer one. The concurrency group already serialises publishes, so the
publish job now waits until ten minutes after the last successful run.

Refs #687

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…esult cap

Refs #687

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Refs #687

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish a monthly Agent Activity Index report to GitHub Pages

2 participants