← Back to Pull requests

Report the API budget an audit drew on, and the GitHub App route to a larger one #10

Closed
unknown closed this pull request without merging on Nov 05, 2026 03:40 UTC
View on GitHub
unknown unknown commented on Nov 05, 2026 03:20 UTC
Author

What and why

An audit uses the action's token input, which defaults to the workflow's GITHUB_TOKEN: 1,000 requests an hour per repository, shared with every other step of the repository's CI that calls the API. A GitHub App's installation token has its own budget of 5,000 or more an hour. pitlane's runner App moved minting and polling onto such a budget (askalf/pitlane-box#35, #36). Until now ci-wizard didn't say which budget an audit drew on, or that a larger one exists.

  • src/github.mjs: the client records the token's hourly limit from x-ratelimit-limit (client.limit). A stop near the limit (RateLimitError) says which limit it hit and how to get a larger budget (RATE_LIMIT_HINT).

  • When GitHub's answers carry the rate-limit headers, as api.github.com's do, the report states the budget the audit drew on, for example "41 API calls, 959 of 1000 left this hour". It appears in the CLI's summary line, the action's log, the report's "How it was measured" and the JSON (rate_limit: { limit, remaining }). On a budget of 1,000 or less it adds that a GitHub App's token has its own 5,000 or more. Without the headers the line is left out, and an audit that finds no runs writes no report.

  • README: a "Rate limits" section sets up a GitHub App token for the action, with actions/create-github-app-token pinned as askalf/ci pins it and narrowed to the two permissions an audit needs (permission-actions: read, permission-contents: read).

  • CHANGELOG (Unreleased).
  • The merge commit on this branch only joins the already-merged #9 tip and changes no files.

    Checks

  • npm test passes (124; 4 new in test/budget.test.mjs)

  • npm run build run and dist/ committed

  • A new or changed rule has a fixture it must catch, a near miss it must leave alone, and an entry in docs/rules.md (no rule changes)

  • Fixtures are synthetic (no other project's run data)
  • Diff: 238 lines (+178 / -60) across 2 files Reviewer: askalf Review duration: 20m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 238 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.328
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.1% · Safe to merge
    16.1%