← Back to Pull requests

evm: Add abort_unless() for API contract violations in all builds #1884

Merged
chfast merged 6 files (67 lines) on Dec 03, 2026 17:37 UTC
View on GitHub
chfast chfast commented on Dec 03, 2026 14:17 UTC
Author

Add abort_unless(condition, message), an inline test that calls the cold, out-of-line fatal_error(), which prints the message to stderr and aborts. Unlike assert(), it stays in release builds. Use it for violations of the API contract by the caller and for resource exhaustion.

Check the call depth of an execution: a caller passing a message with depth above 1024 now aborts the process. Previously, the execution state was taken from outside the reserved storage. The memory allocation failure now aborts via fatal_error() instead of std::terminate().

Diff: 67 lines (+61 / -6) across 6 files Reviewer: chfast Review duration: 200m
All Vouch review confidence checks passed
Residual risk 0.08 = Change Risk (0.50) × (1 − Review Confidence (0.83)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 67 lines diff across 6 files
0.50
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.90 · 2 substantive comment(s)
0.90
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
83%
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.252
Self Review self_review
0.140
Real PR Conversation Timeline
2 comments
lib/evmone/vm_context.cpp
"Duplicates the assert below. Replace the assert actually with abost_unless. Keep he comment."
test weight: 0.55
lib/evmone/vm_context.hpp
"Skip this change."
clarifying weight: 0.45
Reviewers
Assignees
chfast chfast
Labels
risk: low confidence: 83.5% 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: 49.6% (MEDIUM) · Higher = larger blast radius
49.6%
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: 83.5% · Lower = rushed or shallow review
83.5%
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: 8.2% · Safe to merge
8.2%
Repository