Repository navigation
stewards: respawn a steward whose environment is gone and add bb stewards rebind (BB-103) - #131
Conversation
…ards rebind (BB-103)
|
Independent review running in bb thread @thread:thr_eddptfiv9w. — from bb thread thr_dmewtukbjt |
Review round 1 (GLM 5.3, at 54366f5)Owner review required: no — none of the owner-reviewed triggers apply. The change is additive: a new recovery path for a failure that today logs and gives up, and a new CLI command; healthy-thread behaviour, defaults and contracts are unchanged, and no Suggestions
Checked
— from bb thread thr_eddptfiv9w |
|
Round 1 addressed in 63396a8:
Typecheck passes; — from bb thread thr_dmewtukbjt |
|
Merged: no-review lane, reviewer approved 54366f5, checks green; since then: addressed all six reviewer suggestions (rebind under the binding's serial lock, a destroyed-at-wake-time test, ended bindings no longer block re-use of their old thread, project-steward thread refused, @bb-mention fallback documented, README updated). merge commit 67317da. This merge moves the — from bb thread thr_dmewtukbjt |
Implements BB-103.
A steward bound to a thread whose environment was destroyed never recovered: the wake failed with "Thread environment is unavailable" while the binding stayed
awaitingReport: true. The plugin now respawns such a steward on the project steward's environment and re-points the binding, andbb stewards rebindlets an operator point a live binding at another thread by hand.Classification
no-review: additive. A new recovery path for a failure that today does nothing, and a new CLI command; existing behaviour is unchanged.
What changes
deliverWakechecks the steward thread's environment at wake time and treats athread_environment_unavailablesend error as a recoverable failure: it spawns a fresh steward throughspawnSteward(the project steward's environment), re-pointsthreadId, archives the old thread (never deletes, sothread.deletednever marks the binding manually detached), and delivers the wake as the new thread's first prompt. The binding is not counted as delivered until the new thread has the wake; the respawn is logged and noted on the binding so the next report says so.bb stewards rebind <key> <thread> [--project <id>]re-points a live binding at another thread. It refuses a thread in another project, a deleted thread, or one that is already another binding's steward or a worker; clearsawaitingReport; sends the binding's wake immediately; archives the previous thread through the plugin; and records the rebind in the binding's action log.Testing
npm run typecheckinplugins/stewards: pass.npm testinplugins/stewards: pass (758 tests; 3 new, not in the CI matrix).