leaderboard anti-cheat health #40
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
| name: leaderboard anti-cheat health | |
| # The backend detector runs hourly and high-confidence anomalies are soft- | |
| # excluded automatically by leaderboard refresh. This workflow is deliberately | |
| # read-only: it verifies that the public counts-only health endpoint remains | |
| # reachable and records the current state in the run summary. It never publishes | |
| # account identities or opens an operator ticket. | |
| # Poll shortly after the detector's :41 pg_cron pass. | |
| on: | |
| schedule: | |
| - cron: "53 * * * *" | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: leaderboard-anticheat | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| jobs: | |
| poll: | |
| runs-on: ubuntu-latest | |
| env: | |
| API: https://srctyff5.us-east.insforge.app/functions/tokentracker-leaderboard-refresh | |
| steps: | |
| - name: Poll anomaly health | |
| run: | | |
| set -euo pipefail | |
| resp=$(curl -sS --max-time 30 "$API?anomalies=1") | |
| echo "raw: $resp" | |
| if ! jq -e ' | |
| .ok == true and | |
| (.auto_excluded | type == "number") and | |
| (.review | type == "number") and | |
| (.max_peak_tokens | type == "number") | |
| ' >/dev/null <<<"$resp"; then | |
| echo "::error::anomaly health endpoint returned an invalid payload" | |
| exit 1 | |
| fi | |
| excluded=$(jq -r '.auto_excluded' <<<"$resp") | |
| review=$(jq -r '.review' <<<"$resp") | |
| peak=$(jq -r '.max_peak_tokens' <<<"$resp") | |
| latest=$(jq -r '.latest_detected_at // "n/a"' <<<"$resp") | |
| { | |
| echo "### Leaderboard anti-cheat health" | |
| echo | |
| echo "| state | count |" | |
| echo "|---|---:|" | |
| echo "| automatically excluded | $excluded |" | |
| echo "| review-only flags | $review |" | |
| echo | |
| echo "- Largest flagged half-hour bucket: \`$peak\` tokens" | |
| echo "- Latest detection: \`$latest\`" | |
| echo | |
| echo "High-confidence exclusions are enforced automatically by the backend." | |
| } >> "$GITHUB_STEP_SUMMARY" |