fix(review): production reliability pass (budget/loop/merge/notify) - #1084
Conversation
…at dead-lettered reviews ROOT CAUSE of the dead-lettered reviews + stale head SHAs: createInstallationToken minted a FRESH GitHub token on EVERY call (no cache). The converged review path mints several tokens per review (live CI aggregate, mergeable fetch, file resolve, visual capture, permission check) and across the sweep + re-reviews this exhausted the hourly GitHub rate limit (observed min_remaining=0 at 6753 calls/hr) → reviews errored → dead-lettered → missed synchronize webhooks → stale stored head SHAs → reviews ran against the old (green) commit → wrong 'CI is green' approvals after a rebase. FIX: in-isolate token cache (valid ~1h, 2-min safety margin) → ~1 mint/hour/installation instead of per-call. Tests: clear the cache per-test; token-count assertions drop to the cached count.
…s on idle PRs)
The sweep re-gated + ran auto-maintain but never re-published the unified comment, so an idle PR kept a stale
comment ('safe to merge' from before a fix) + stale status label forever even after the head was re-synced.
Switch to reReviewStoredPullRequest (rebuild advisory → re-publish comment with current head/CI → re-run
auto-maintain) so comment + label + action reflect reality. Paced at SWEEP_MAX_PRS/sweep; cheap with token caching.
…rise) + interactive re-run checkbox The 10k AI_DAILY_NEURON_BUDGET default starved EVERY dual-AI review (~573 neurons each) into quota_exceeded on the enterprise Workers AI plan (account does hundreds of k/day), so no review ever produced its synthesis. Models were correct all along (gpt-oss-120b + nemotron-3-120b-a12b); the self-imposed cap was the sole blocker. - AI_DAILY_NEURON_BUDGET 10k -> 2M; code clamp ceiling 1M -> 10M (runaway backstop, not a cap) - AI_MAX_OUTPUT_TOKENS 256 -> 1024 (room for a real assessment + suggestions + risks) - unified-comment: render the re-run checkbox OUTSIDE the alert blockquote — GitHub disables task-list checkboxes inside a blockquote, so clicking it never fired issue_comment.edited - sweep: keep the full re-review re-publish (affordable under the raised budget) so idle PRs refresh their comment/label/synthesis and dead-lettered reviews get a fresh verdict
… review (no comment/audit/close) THE root cause of 'nothing works': formatGateCheckOutput returned output.title unbounded. GitHub 422s an over-long check-run title; the throw escaped createOrUpdateGateCheckRun (unwrapped) and the outer catch RE-THREW, so the review aborted before publishing the comment, writing the audit row, and running auto-maintain (merge/close). #1075 appended failing-check names to the title, so RED-CI PRs got long titles → 422 → they were never reviewed or closed — exactly the PRs that should auto-close. - advisory.ts: cap gate output.title at 255 (matches the annotation cap) — prevents the 422 - processors.ts: wrap createOrUpdateGateCheckRun in a local try/catch — a check-run API failure now finalizes the pending check to neutral and CONTINUES (records github_app.gate_check_failed_nonfatal) instead of dead-lettering the whole review - tests updated for the non-fatal-continue behavior
- ai-review: neuron budget defaults to the safe max when unset/empty/NaN. The deployed worker read the 10k free-tier default off main and starved every dual-AI review into quota_exceeded; an explicit value (incl. "0" to disable) still wins. - review loop: refresh reviewDecision live so the action planner does not re-post a review every cycle. - CI gate: only branch-protection REQUIRED red checks block; non-required reds are surfaced, not blocking. - merges: classify terminal merge failures (perm/conflict/required-absent) and stop retrying them every sweep; transient failures retry to a cap (+ migration 0052). - safety: dial back the secret_leak heuristic so config/workflow PRs are not false-blocked. - stats: read the live audit_events overlay for homepage counters. - notify: per-repo Discord embeds on merge/close/manual. - rebase: update-branch before review when behind base.
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review — closed
🛑 Closed — Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key) — Remove the secret from the diff, rotate the exposed credential, then re-run the gate. Why this is blocked
CI checks failing
Nits — 1 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
ghost
left a comment
There was a problem hiding this comment.
Gittensory requests changes — CI is not green:
- CI is failing (Gittensory Gate)
- Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key)
ghost
left a comment
There was a problem hiding this comment.
Gittensory requests changes — CI is not green:
- CI is failing (Gittensory Gate)
- Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key)
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
ghost
left a comment
There was a problem hiding this comment.
Gittensory requests changes — CI is not green:
- CI is failing (Gittensory Gate)
- Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key)
…ors + public-stats) Resolved: processors.ts kept the live CI aggregate + adopted main's changedPathsForGuardrail; public-stats.ts took main's #1059 rewrite (RC8 live-overlay to be re-applied cleanly as a follow-up). 3424 tests pass.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1084 +/- ##
==========================================
- Coverage 95.12% 94.75% -0.38%
==========================================
Files 151 153 +2
Lines 18353 18465 +112
Branches 6638 6683 +45
==========================================
+ Hits 17459 17497 +38
- Misses 366 416 +50
- Partials 528 552 +24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ghost
left a comment
There was a problem hiding this comment.
Gittensory requests changes — CI is not green:
- CI is failing (Gittensory Gate, codecov/patch, codecov/project)
- Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key)
ghost
left a comment
There was a problem hiding this comment.
Gittensory requests changes — CI is not green:
- CI is failing (Gittensory Gate, codecov/patch, codecov/project)
- Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key)
ghost
left a comment
There was a problem hiding this comment.
Gittensory requests changes — CI is not green:
- CI is failing (Gittensory Gate, codecov/patch, codecov/project)
- Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key)
ghost
left a comment
There was a problem hiding this comment.
Gittensory requests changes — CI is not green:
- CI is failing (Gittensory Gate, codecov/patch, codecov/project)
- Possible leaked secret in the diff (seed_or_mnemonic, bittensor_key)
Fixes the deploy/branch split that left production running old
main(10k free-tier budget, old gate) while these fixes sat on a branch.What this lands on main (what Workers Builds deploys):
mainand starving every dual-AI review intoquota_exceeded(the bot couldn't review at all). Explicit values (incl.0to disable) still win.reviewDecisionlive so the planner stops re-posting a review every cycle.Follow-up PR: the full reviewbot-gate re-alignment (one-shot per head, close-on-red-CI for contributors, event-driven trigger) per the canonical
non-content-gate.tsmodel.All 3399 unit tests pass; tsc clean.