← Back to Pull requests

fix(runs): #3920 webhook 409 scoped to the run surface + #3910 deferred test hygiene #4920

Open
unknown opened this pull request with 241 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 22, 2026 19:20 UTC
Author

Implements #3920 (AT0.10035, CHECKED, T1). Items 1-11.

Production touches (two, both small): bootPromptRefusalCode(err, surface?) + webhook passes 'run' (item 1, behavior change per cor:agt:040:10, FIT COMPLIANT); scheduler hoists the code to a const (item 9, neutral). The scheduler stays surface-blind on purpose (the issue scopes item 1 to the webhook).

Tests: all in 3689-apprun-agent-required.test.ts unless noted. Item 4 is cherry-picked 3c600840 (rollback pin, loud restore hook). Item 2: real-state pins (NOT_SET with an existing Agent, TARGET_DELETED, NOT_APPROVED) and forced run-surface pins (INSTALL_LICENSE_INACTIVE, NOT_SIGNED) at webhook and scheduler, each asserting no run and no served record. Item 1 red pin: every code raised for bind/chat inside the handler is not a 409 (12 red without the check). Item 8: note PL/pgSQL WHEN OTHERS never matches 57014 (query_canceled), so the issue's example alone cannot kill a widened catch (my first mutant survived); the pin runs 57014 plus 22012 and 23505, and the OTHERS mutant is killed by the last two. Item 10: post-push SET NOT NULL line pinned. Items 5, 6, 7, 11 as written. Item 7 audit: of 58 inline testRunAgentId uses only server.contentValidation1332.test.ts asserted on an Agent it had in scope; it now passes it explicitly, the rest do not depend on which Agent the run names. Rename of the helper not taken (optional, 58 sites).

Mutants killed: webhook surface check dropped (12 red); WHEN OTHERS in block+migration (22012, 23505 red); post-push line removed (pin red); restore without SET NOT NULL (hook throws, 5 red). migration.sql and app-run-agent-pre-push.sql byte-identical. Local: pin file 33/33, bootPrompt + webhooks + jobs + contentValidation 813/813, tsc = the 2 known Prisma TS2305s, check:loc-scope and null-context OK.

Closes #3920.

🤖 Generated with Claude Code

Diff: 241 lines (+180 / -61) across 3 files Reviewer: claude[bot] Review duration: 11m
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 241 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.328
Real PR Conversation Timeline
1 comments
"Review active on #4920"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% 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: 38.8% (MEDIUM) · Higher = larger blast radius
38.8%
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: 46.7% · Lower = rushed or shallow review
46.7%
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: 20.7% · Safe to merge
20.7%