← Back to Pull requests

feat(models): the github roles get the gh commands they post with; a handed command says where it runs (#391) #392

Closed
unknown closed this pull request without merging on Nov 11, 2026 20:15 UTC
View on GitHub
unknown unknown commented on Nov 11, 2026 10:09 UTC
Author

Closes #391.

The github model's roles get the commands they publish with. In Claude Code's auto mode, permission rules are applied before its classifier; with none granted, a gh-review role's gh pr review was left to the classifier, which blocked it, and the user had to post the review by hand. The model's template now grants each role exactly the publishing commands its purpose file names, as [permissions:<role>-*] sections, the way the roles model already grants its Gate:

| Role | Runs without asking |
|---|---|
| gh-review | gh pr review, gh pr comment, gh issue create |
| gh-triage | gh issue comment, gh issue edit, gh issue create |
| gh-fix | ghstack submit, gh pr create, gh pr comment, gh issue comment, gh issue create |

gh-setup publishes nothing and gets none. There is no rule for gh api: the roles only read and render with it, and a rule would allow any API write. Pushes get no rule: by Claude Code's documented defaults its classifier already allows a push to the repository being worked in, and blocks a force push or a push to another repository unless the user named it; a rule would remove those blocks. A push it refuses goes to the user. A rebuild gets no rule either: .asb/build_env.sh is writable in a review, triage or fix role, so a rule approving it would approve whatever the role writes into it; the classifier refused only the apply chained with the rebuild, so the purpose files now run them as two commands, and a rebuild it refuses goes to the user. (Carrying a role's change of the script back to gh-setup is #394.) The rules are prefix rules, so they do not keep a comment to issue N; the purpose files do, and still publish only on the user's word: gh-fix says it pushes only fix-N, never by force and never to another person's branch without the user's explicit word, and, like the other two, files an unrelated finding as an issue only when the user says so. The review (--trust, --check) lists each rule as a widening. A project set up before this gets the three sections appended by asb --init github run again, then asb --trust.

A stand-in marker is never posted. The lead paragraph a role drafts in the user's voice is marked as a stand-in only in the copy it shows; once the user approves the text the role drops the marker itself, and it asks first if told to post text the user has not approved.

Every command a role hands the user says where it runs. The briefing's handing rule gains one: in this session, behind its shell escape (claude: !), with inside paths; or on the host, in the user's shell, with host paths. A role handed out ! gh pr review N --body-file .asb/scratch/review-N.md, which works at the role's prompt but not in a host shell, where .asb/scratch/ is the role's private store.

Not verified live: whether a gh-fix push to the HTTPS URL its purpose file uses passes the classifier; if it does not, a narrow rule follows.

Tests: tests/unit/init.bats (each section's exact lines, no gh api or gh-setup rule, --check listing a role's own rules, the re-run appending the sections, the purpose clauses); tests/unit/briefing.bats (the handing rule, long and short). scripts/check.sh passes locally.

---
_🤖 Drafted by Claude Code (an AI agent) and reviewed & approved by pearu._

Diff: 415 lines (+311 / -104) across 5 files Reviewer: pearu Review duration: 606m
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 415 lines diff across 5 files
0.50
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
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.361
Shallow Review Depth shallow_review_depth
0.289
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #392"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.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.9% (MEDIUM) · Higher = larger blast radius
49.9%
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: 60.5% · Lower = rushed or shallow review
60.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: 19.7% · Safe to merge
19.7%