← Back to Pull requests

Use astral-yaml for diagnostics and autofixes #2576

Open
unknown opened this pull request with 221 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 22, 2026 18:03 UTC
Author

<details>
<summary>Automated notes</summary>

Use the same Astral parse stream to deserialize each audit input, locate findings, and read ignore comments. Finding snippets use the parser's source spans. The patch crate applies each list of YAML edits in one Astral editor transaction and returns its rendered output. Applying a fix can change indentation, quoting, and line endings. Autofixes insert named fields through Astral’s mapping editor, which chooses when to quote their keys. Adding a field to a compact workflow step keeps its first key on the dash line. New mappings inherit their enclosing mapping’s style, so fixes that add with, env, or cooldown to a block mapping indent the new entries.

Script fixes edit the decoded scalar. For example, the template-injection fix rewrites the shell expression and sets its environment variable together. The obfuscation audit scans the original file for expressions, so it keeps a whole-source edit and validates the resulting YAML. Removing the last member leaves a valid empty collection. Edits through an alias apply to that use. An edit that would change a shared anchor definition fails atomically.

Remove yaml_serde, tree-sitter-yaml, and the tree-sitter-iter workspace member. Inline patch snapshots show the rendered YAML for edits to mappings, comments, and aliases. On 38 workflow fixtures the baseline and this branch produced the same 487 auditor-persona findings, including severity, ignore state, and symbolic locations. The same comparison matched all 14 findings on zizmor's own workflows. The pinning and version-comment tests use inline snapshots for both LF and CRLF inputs.

This is the final PR in the YAML migration stack.

</details>

Diff: 221 lines (+165 / -56) across 2 files Reviewer: woodruffw Review duration: 9302m
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 221 lines diff across 2 files
0.37
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.323
Real PR Conversation Timeline
1 comments
"Review active on #2576"
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: 36.8% (MEDIUM) · Higher = larger blast radius
36.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: 19.6% · Safe to merge
19.6%