fix(init): keep a running role's read-only binds: the dot-file written in place, a breaking --init refused (#389) #402
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 502 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #402"
general
weight: 0.35
pearu
asb --initandasb --applyreplaced.agent-sandboxby renaming a new file over it. A running sandbox has single-file mounts on some of the project's files: the dot-file and the role's purpose file read-only, or a copy of the role's own over one. A host rename over such a file detaches the mount. In a role with the project read-write (the roles model's Supervisor and setup), the path then led to the host's new file, writable; this was measured with the Supervisor running..agent-sandboxkeeps its inode and mode; it is written through a descriptor shown to be the file, then cut to the new length. A running role sees the new text and still cannot write it.--setup-remote's policy write does the same, and brings back what the write said there. A file that is not writable is refused before anything is written. A write that fails midway says the file may be half-written and keeps the intended text in a file it names. A dot-file with another name (a hard link) is still written in place, with a warning and thefindline, starting at the file's mount point, that lists the other names.keeper/binds: the mount point's host path, whether its directory is read-write or read-only from the host, the mount's own mode, and whether its source is the file itself. A read-write mount of a file over itself on a copy-on-write project is recorded too.--initrefuses a breaking run. Before writing anything, it refuses (exit 2) a run that would:- replace such a file in a directory the role has read-write, unless the role had the file itself read-write (e.g. the Supervisor's purpose file when the model text changed, also when the role has its own copy over it);
- replace one where the role would lose its own copy or read-write mount in a read-only project;
- replace or remove one the role has read-write in a copy-on-write project, where its writes would stop reaching the project's file;
- remove one mounted into a running role with the project read-write or read-only (e.g.
implementer=1while implementer-2 runs);- add an instance again while a running sandbox has that instance's old clone declared, or as its project, which the backup would move from under it.
It looks at every running sandbox of yours, another project's included when it has this project's files mounted. It names each role (with its project when it is another's), the file, and the
asb --role ROLE --shutdownto run first. A sandbox started by an older asb, or one whose launch could not be recorded, has its declared files taken as mounted.--initno longer renames a file over one with the same text, and a plain re-run counts no bookkeeping file as changed..agent-sandbox, a purpose file, or a file in a host-bound directory that a role has read-only or as its own copy (e.g.CLAUDE.mdwithinstructions = read-only, or the role's.claude.json, under--preset shared) still detaches a running role's mount where that directory is read-write for it. Examples: an editor's save by rename,sed -i, agit checkout. docs/design.md lists it with what remains.Tests: unit tests for the in-place write and its failures, the mount record, and each refusal and go-ahead case; a new integration suite
tests/integration/init-running.batsunder real bwrap.Refs #389 (point 7)
---
_🤖 Drafted by Claude Code (an AI agent) and reviewed & approved by pearu._