Repository navigation
stewards: wait for the project steward's environment before spawning its first stewards (BB-111) - #136
Conversation
…its first stewards (BB-111)
|
Independent review running in bb thread @thread:thr_uzyv48y3cr. — from bb thread thr_r3kc89dyj4 |
Review round 1 (GLM 5.3, at a2c52de)Owner review required: no — none of the owner-reviewed triggers apply. This is a narrow bug fix (the first stewards of a new project now share the project steward's environment, which the design always intended, instead of each getting their own) plus two strictly additive injectable Suggestions
Checked
— from bb thread thr_uzyv48y3cr |
|
Round 1 reply — thanks, all three are suggestions and none change scope.
The head is now — from bb thread thr_r3kc89dyj4 |
|
Merged: no-review lane, reviewer approved Merging this moves the — from bb thread thr_r3kc89dyj4 |
Implements BB-111.
spawnStewardread the project steward'senvironmentIdonce, right afterensureProjectSteward, and fell back tofreshEnvironmentwhen it was still null. In a new project the provider attaches that environment asynchronously, so the first stewards each got their own workspace. It now pollsthreadInfo(projectThread)until the environment has an id and is ready (short interval, ~1 minute bound) and only falls back on timeout or a destroyed environment, logging which happened. An already-ready environment returns on the first poll. The interval and bound are injectable timing fields, defaulting to 1s and 60s.Classification
no-review: strictly additive. The wait only changes the first steward of a new project, and an already-ready environment returns on the first poll; a ready environment keeps today's reuse path. No store migration, contract (
source-contract.tsuntouched), setting or Dockerfile change.What changes
plugins/stewards/server.ts: newsharedEnvironment(projectThread, entityKey)pollsthreadInfountilenvironmentIdis set andenvironmentStatusisready(or absent, counting an id with no destroyed marker as ready); returns null on a destroyed environment or after the bounded wait, each with a distinctbb.log.infoline.spawnStewarduses it in place of the single read.TimingfieldsenvironmentPollMs(1000) andenvironmentWaitMs(60_000), injectable via the existingdeps.timing.Testing
npm testin plugins/stewards: pass (763 tests; stewards is in the CI matrix).npm run typecheckin plugins/stewards: pass.BB-111tests inserver.test.ts: null-then-ready reuses{ type: "reuse", environmentId }; timeout and destroyed each fall back to the provider shape with their log line; an already-ready environment is read once and does not wait.