feat(runemetrics_scraper): emit players.banned on ban transition#155
Open
extreme4all-ai wants to merge 1 commit into
Open
feat(runemetrics_scraper): emit players.banned on ban transition#155extreme4all-ai wants to merge 1 commit into
extreme4all-ai wants to merge 1 commit into
Conversation
2 tasks
3d74c21 to
09e5aad
Compare
Implements PR 3 of the report-data-retention spec — makes the end-to-end ban-archival pipeline live by emitting the players.banned event at the moment of detection. - core.main(): add players.banned producer (QueueFactory, mirrors players.scraped) - core.work(): capture old label_jagex before update_player; emit PlayerBannedStruct only on the transition old != 2 -> new == 2 - tests: parametrized transition matrix — emits on 0->2 and 1->2, no emit on 2->2, 0->0, 0->1, or non-ban successes Stacked on PR 2 (needs PlayerBannedStruct + players.banned topic). After merge the worker_ban_migration consumer activates and newly-detected bans are archived into report_archive.
e7a5f43 to
78674f2
Compare
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
Implements PR 3 of the Report Data Retention & Ban Archival spec. This makes the end-to-end ban-archival pipeline live by emitting the
players.bannedevent at the moment of detection.The reactive trigger is what resolves the prune/migration race: by archiving at detection time (within the 90-day prune window), the location data is copied before the prune job (PR #153) can delete it.
Changes
runemetrics_scraper/core.pymain(): add aplayers.bannedproducer viaQueueFactory(mirrors the existingplayers.scrapedproducer), started and passed into eachwork()task.work(): captureold_label = player_data.label_jagexbeforeupdate_player(), then emit aPlayerBannedStructonly on the transitionold != 2 → new == 2.test/.../runemetrics_scraper/test_core.py— parametrized transition matrix:work()tests updated for the newplayer_banned_producerparam.After merge
The
worker_ban_migrationconsumer (from #154) starts receiving events, and newly-detected Jagex bans are archived intoreport_archive. Historical banned players remain uncovered until PR 4 (backfill).Test plan
uv run ruff check— cleanuv run pytest test/bases/bot_detector/runemetrics_scraper/— 19 passed (6 new transition cases)