Skip to content

fix(gh): add shared request governor and audit - #531

Merged
joelteply merged 1 commit into
canaryfrom
codex/gh-request-governor
May 6, 2026
Merged

joelteply merged 1 commit into
canaryfrom
codex/gh-request-governor

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • route shell gh calls through a shared AIRC guard function after PATH resolution
  • add airc_core.gh_backoff.run_gh() for Python bearer/channel-gist calls
  • enforce a per-user request budget with a cross-process lock so multiple agents cannot burst through together
  • record a JSONL audit of gh call class, cwd, outcome, blocked state, and backoff state
  • add airc gh-audit for inspection plus airc gh-audit --reset to clear bad local backoff/budget state without deleting the audit log
  • classify guard-blocked auth probes as rate-limited/degraded, not invalid auth

Safety notes

  • airc update is git-based and is not behind the gh guard
  • gh auth login / gh auth refresh remain interactive pass-throughs, not blocked by the guard
  • escape hatch remains: AIRC_GH_GUARD_DISABLE=1 for emergency debugging
  • local guard budget defaults to 30 guarded gh calls/min/user (AIRC_GH_MAX_REQUESTS_PER_MIN)

Validation

  • bash -n airc lib/airc_bash/lib_auth.sh
  • python3 -m py_compile lib/airc_core/gh_backoff.py lib/airc_core/bearer_gh.py lib/airc_core/channel_gist.py test/test_gh_backoff.py
  • cd test && python3 test_gh_backoff.py && python3 test_bearer.py && python3 test_channel_gist.py
  • ./test/integration.sh python_units
  • ./test/integration.sh gh_secondary_rate_limit_degraded_startup
  • ./test/integration.sh send_gone_gist_does_not_claim_delivery
  • live: airc gh-audit --summary --count 30; airc status

Copilot AI review requested due to automatic review settings May 6, 2026 15:59
@joelteply
joelteply merged commit c361122 into canary May 6, 2026
8 checks passed
@joelteply
joelteply deleted the codex/gh-request-governor branch May 6, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant