Attempted workflow
A BB CLI process and an authorized plugin both update different keys in the managed env.json file.
Actual result
Each writer can read a whole document, project its change, and atomically rename that projection later. The rename is atomic but not conditional at the commit boundary, so the last writer can silently erase an unrelated concurrent update.
Evidence:
packages/bb-app/src/launcher.ts:1183-1211 performs whole-document merge and temp-file rename with no expected revision or shared writer lock.
packages/bb-app/src/launcher.ts:1905-1938 routes both env set and env unset through that read-then-write shape.
Expected result
BB owns one transactional env.json mutation surface used by CLI, server, and authorized plugins. A stale writer receives a conflict and performs no rename or partial mutation.
Acceptance criteria
- Set and unset share the same transaction path.
- Successful mutation preserves unrelated top-level fields, unrelated environment keys, and private file mode.
- Tests coordinate two real concurrent writers and prove only one stale whole-file projection can commit, the loser receives a conflict, and unrelated keys are never silently lost.
- Plugins can configure non-secret launcher paths without editing
env.json through a private file protocol.
AGENT GENERATED: by GPT-5.6 Sol
Attempted workflow
A BB CLI process and an authorized plugin both update different keys in the managed
env.jsonfile.Actual result
Each writer can read a whole document, project its change, and atomically rename that projection later. The rename is atomic but not conditional at the commit boundary, so the last writer can silently erase an unrelated concurrent update.
Evidence:
packages/bb-app/src/launcher.ts:1183-1211performs whole-document merge and temp-file rename with no expected revision or shared writer lock.packages/bb-app/src/launcher.ts:1905-1938routes bothenv setandenv unsetthrough that read-then-write shape.Expected result
BB owns one transactional
env.jsonmutation surface used by CLI, server, and authorized plugins. A stale writer receives a conflict and performs no rename or partial mutation.Acceptance criteria
env.jsonthrough a private file protocol.