← Back to Pull requests

fix(init): --init MODEL --env NAME completes the environment's lines a no-env --init left commented; the setup roles stop and ask when none is declared #387

Closed
unknown closed this pull request without merging on Nov 10, 2026 16:27 UTC
View on GitHub
unknown unknown commented on Nov 10, 2026 14:31 UTC
Author

asb --init MODEL without --env writes the environment's lines commented out, and its advice was to run --init again with --env NAME. That re-run changed nothing: --init never touches a section that exists, so it then said to uncomment the lines by hand. A setup role launched meanwhile (the github model's gh-setup, the roles model's setup) had no environment to build into and improvised asb --apply lines with a name of its own.

A re-run completes the environment's lines. asb --init MODEL --env NAME (or --shared-env NAME) on a file a no-env --init MODEL wrote replaces each environment line that is still exactly as that run wrote it with the line a first --init MODEL --env NAME would have written, and changes nothing else; the result is the same file, and the usual --trust review follows. Only this model's sections are touched, between its --init marks. A line edited by hand is left and reported with the model's line. An active prefix = PATH naming another environment is refused before anything is written. A file without the marks, or with CRLF lines, is not completed: the lines to complete by hand are named. The file keeps its mode and last line. The no-env advice now says the re-run completes them. A re-run completes exactly the instances present in the model's sections, adds those a count asks for above them, and never fills a gap or drops one.

A setup role with no environment stops and asks. When its prefix reads ENVPATH (what --init writes without --env), gh-setup and the roles model's setup role stop and ask the user for exactly asb --init MODEL --env NAME, asb --trust, the shutdown and a relaunch, and choose no name. When the project declares a shared environment instead, there is nothing for them to build: they say so, and that they are left over from the earlier --init, with how to remove them. A --shared-env re-run says the same of a setup role a no-env --init wrote, and leaves its removal to the user.

No write through a link. --init and --apply refuse a symlinked .agent-sandbox before any write: when no dot-file existed at launch, a role with the project read-write could create it as a link, to ~/.bashrc say, and the next host-side --init or --apply would have written into it. The dot-file is rewritten by a rename and read through a descriptor proven not to be a link, so a link swapped in meanwhile is replaced, never followed. A link under .asb/ (a purpose file, the coordination file, .asb/.gitignore, the Implementers' clones and environments) is skipped and said, never followed.

Docs: models/README.md, models/github/README.md, models/roles/README.md, docs/roles.md, the engine's help, CHANGELOG.

Tests (tests/unit/init.bats): a no-env init completed by an --env re-run equals a fresh --env init and a second re-run changes nothing, for both models (the roles model's Implementer clones included); a hand-edited line left and reported; a different prefix refused with nothing written; --shared-env, with the left-over setup role reported; a file without marks and a CRLF file named; mode and last line kept; a linked .agent-sandbox refused and a link under .asb/ skipped; the purpose clauses. scripts/check.sh passes locally.

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

Diff: 418 lines (+313 / -105) across 5 files Reviewer: pearu Review duration: 116m
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 418 lines diff across 5 files
0.45
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
Real PR Conversation Timeline
1 comments
"Review active on #387"
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: 45.0% (MEDIUM) · Higher = larger blast radius
45.0%
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: 17.8% · Safe to merge
17.8%