feat: add Wikipedia plugin with 2 question templates#21
Open
dataCenter430 wants to merge 1 commit intoAffineFoundation:mainfrom
Open
feat: add Wikipedia plugin with 2 question templates#21dataCenter430 wants to merge 1 commit intoAffineFoundation:mainfrom
dataCenter430 wants to merge 1 commit intoAffineFoundation:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Wikipedia plugin that fills two capability gaps identified in
CLAUDE.md that no existing plugin covers:
edit_count: article → "View history" tab → count dated revisionscategory_count: main page → navigate to Category page → read countPlugin (
wikipedia)en.wikipedia.org- Blocked:*/w/api.php*and*/api/rest_v1/metrics*— forces agents to use the web interface, not the raw APIneeds_api_datafires only for category pages and?action=historypages; all other Wikipedia pages are navigation-only (no wasted API calls)aiohttp.ClientSession, 1 req/s rate limitTemplates
wikipedia_category_countCategory:Xand reads the count from the page header("The following N pages are in this category")
categoryinfo.pages/categoryinfo.subcats— exact same numbershown on page
wikipedia_edit_countfetched_atas the reference "now" so GT reflects what the agent saw, not a later wall-clock timeRed Team Review (all 6 checks pass)
category_countedit_countcategoryinfo.pages= page header count ✓rvprop=timestamp= history timestamps ✓Tests
tests/plugins/wikipedia/test_wikipedia_templates.py— 69 tests, all passing:category_countGT: found, fuzzy/underscore title match, not_collected, no-collector system_error, ignores non-category dataedit_countGT: 7/14/30-day window counts, zero-edit case, malformedfetched_at→ system_error, ignores non-history dataneeds_api_datacases, dispatch mocked correctlytitles_match/normalize_titlehelpersChecklist
eval.pytested with multiple seeds (10-minute timeout)or 0, bareexcept: pass)needs_api_datareturnsFalsefor navigation-only pages