← Back to Pull requests

fix(init): what --init makes under .asb/ is static: a replaced path refuses (exit 2); --env-dir for a project that tracks .env (#389) #399

Closed
unknown closed this pull request without merging on Nov 13, 2026 10:53 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 20:16 UTC
Author

asb --init runs on the host and writes into .asb/, which a role with the project read-write can change. #387 made it skip a path a role had replaced with a symbolic link and carry on with exit 0: a linked .asb/impl got no clone while the rest was written, and a linked .asb/migrate still lost files, because _init_purpose's rm -f .asb/migrate/<name> ran through the link.

What --init makes under .asb/ is now static. Before it writes anything, .agent-sandbox included, it checks every path it would write or write under. A path that is a link, or is not what --init makes there, refuses the run with exit 2, naming the path and what to do; a link you made under .asb/ is refused too. A link that appears while --init runs stops it at the next write. A path declared under .asb/ with a .. in it is refused as well; --init used to create it, empty, outside the project. Outside .asb/ nothing changes: an environment reached through your own link is fine.

The two reads that copy the dot-file into its new version (the completion of the environment's lines, and --apply's insert) now go through _as_dotfile_read. That read pattern also exited silently with status 1 under errexit, #387's append included; each now prints its refusal.

--env-dir DIR. A project that tracks .env has one in every Implementer's clone, exactly where the roles model puts the environment. --init --env now refuses that case and suggests --env-dir with a name the project does not track. The default stays .env with byte-identical output, so existing projects see no change. A re-run keeps each clone's name, read from its active prefix line, a name changed by hand included. --env-dir renames a clone's lines where no environment is built at any name they have, and is refused where one is (--init never moves an environment), and with --shared-env. Without --env, nothing is made there and nothing is refused.

The --shared-env note about a setup role no longer claims the role came from an --init without an environment. docs/config.md, docs/roles.md and models/README.md state the refusals and the option; docs/design.md lists what remains for host-side writes; CHANGELOG says the refusal instead of the skip. The new unit tests fail against main's engine. Not here: #389 points 1, 2 and 7.

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

Diff: 302 lines (+226 / -76) across 3 files Reviewer: pearu Review duration: 876m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 302 lines diff across 3 files
0.40
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.342
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #399"
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: 40.1% (MEDIUM) · Higher = larger blast radius
40.1%
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: 15.8% · Safe to merge
15.8%