Skip to content

fix(review): add a review-failure-burst signal alongside review-burst - #3991

Merged
JSONbored merged 1 commit into
mainfrom
fix/review-burst-failure-signal
Jul 7, 2026
Merged

fix(review): add a review-failure-burst signal alongside review-burst#3991
JSONbored merged 1 commit into
mainfrom
fix/review-burst-failure-signal

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Closes fix(review): review-burst rule can't see a repeat-failure retry storm, only repeat-success republish #3926. The existing review-burst anomaly (findHottestReviewTargetForRepo) only counts SUCCESSFUL pr_public_surface_published events, so a repeat-failure retry storm (every attempt inconclusive, never reaching a publish) is invisible to it -- the exact incident c707394/fix(review): stop the medium-effort retry storm burning tokens on zero output #3747 fixed.
  • Every AI review call already records a structured inconclusive boolean in ai_usage_events.metadata_json (set at record()'s call site in src/services/ai-review.ts) regardless of whether it published. Added findHottestInconclusiveReviewTargetForRepo, a companion query keyed on that field, and wired it into the same detectOutcomeAnomalies detector alongside the existing signal.
  • Deliberately does NOT touch the status column (always "ok" for a completed call, inconclusive or not) -- the daily neuron-budget sum filters status='ok', so repurposing that field would have silently excluded genuinely-spent tokens from budget accounting. Uses the existing metadata field instead.
  • The existing publish-burst signal is untouched; it still catches a different, valid incident shape (excessive successful re-reviews of an unchanged PR).

Scope

  • Conventional Commit title, focused single fix.
  • No issue-link checkbox in the template sense -- Closes #3926 above.

Validation

Safety

  • No secrets/private data.
  • No auth/API/UI changes.
  • Read-only observability change; never affects what blocks a live PR.

The existing review-burst anomaly only counts SUCCESSFUL publish
events, so a repeat-failure retry storm (every attempt inconclusive,
never reaching a publish) is invisible to it -- the exact incident
c707394 (#3747) fixed. Every AI review call already records an
`inconclusive` boolean in ai_usage_events' metadata_json regardless of
whether it published, so add a companion query keyed on that and wire
it into the same anomaly detector, alongside the existing publish-only
signal (kept as-is; it still catches a different, valid incident
shape: excessive successful re-reviews of an unchanged PR).

Closes #3926
@JSONbored JSONbored self-assigned this Jul 7, 2026
@JSONbored
JSONbored merged commit 0289182 into main Jul 7, 2026
3 of 4 checks passed
@JSONbored
JSONbored deleted the fix/review-burst-failure-signal branch July 7, 2026 09:19
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 7, 2026
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
11138 4 11134 7
View the top 3 failed test(s) by shortest run time
test/unit/moderation-config-db.test.ts > global moderation config DB round-trip (#selfhost-mod-engine) > a raw DB row with an over-max violation_decay_days is also clamped on READ (not just on write)
Stack Traces | 0.399s run time
AssertionError: expected 100 to be 3650 // Object.is equality

- Expected
+ Received

- 3650
+ 100

 ❯ test/unit/moderation-config-db.test.ts:108:41
test/unit/moderation-config-db.test.ts > global moderation config DB round-trip (#selfhost-mod-engine) > REGRESSION (gate-flagged): violationDecayDays above MAX_MODERATION_VIOLATION_DECAY_DAYS is CLAMPED, not passed through raw -- an unbounded value overflows Date arithmetic on the live close path
Stack Traces | 0.421s run time
AssertionError: expected 100 to be 3650 // Object.is equality

- Expected
+ Received

- 3650
+ 100

 ❯ test/unit/moderation-config-db.test.ts:91:41
test/unit/moderation-config-db.test.ts > global moderation config DB round-trip (#selfhost-mod-engine) > a violationDecayDays AT the max is preserved unclamped (boundary, not just strictly-under)
Stack Traces | 0.422s run time
AssertionError: expected 100 to be 3650 // Object.is equality

- Expected
+ Received

- 3650
+ 100

 ❯ test/unit/moderation-config-db.test.ts:101:41
test/unit/queue.test.ts > queue processors > a #1960 action-command verb with no dispatch handler wired yet (e.g. pause) is bailed out of the Q&A answer-card path, not misrendered as help (#2160)
Stack Traces | 0.792s run time
AssertionError: expected 1 to be +0 // Object.is equality

- Expected
+ Received

- 0
+ 1

 ❯ test/unit/queue.test.ts:22807:28

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(review): review-burst rule can't see a repeat-failure retry storm, only repeat-success republish

1 participant