Skip to content

stewards: retry a lost adoption wake for an unthreaded binding (BB-92) - #119

Merged
trotterdylan merged 1 commit into
mainfrom
bb/bb-92-wake-unthreaded-ticket-bindings-as-adopted-thr_dbkp674jxh
Oct 27, 2026
Merged

trotterdylan merged 1 commit into
mainfrom
bb/bb-92-wake-unthreaded-ticket-bindings-as-adopted-thr_dbkp674jxh

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-92. A ticket or pull-request binding gets its steward thread on its first wake, forced once with reason adopted right after adoption. When that first reconcile exits before the wake (a transient null config read, for example), the binding keeps threadId === null and no later sweep retries. The ticket path computed its wake reason as force alone, unlike the ops, deps and sentry paths, which fall back to adopted while b.threadId === null. This makes the ticket/PR path do the same, so a lost adoption wake is retried on the next sweep, and adds a debug log on the silent config === null exit.

Merge note (bb-plugins): merging to main moves the bb-plugins pin in bb-gate, builds a new bb-server image, and stages a restart for every developer's server. Each server restarts when its owner presses Restart now, or in the 03:00–05:00 US Eastern quiet window.

Classification

no-review: narrow bug fix that makes an existing behaviour do what it was already meant to do (retry a lost adoption wake), in one live plugin, with no contract, identity, infrastructure or default change.

What changes

  • plugins/stewards/server.ts: the ticket/PR reconcile path now computes its wake reason as force ?? (b.threadId === null ? "adopted" : null), matching the ops, deps and sentry paths. Bindings that already have a thread are woken exactly as before.
  • plugins/stewards/server.ts: a debug-level log on the silent config === null exit, naming the project and entity.
  • plugins/stewards/server.test.ts: a new case that adopts a ticket binding whose first reconcile exits before the wake (the config read returns null once), then runs a plain reconcile and asserts the steward thread is spawned and wokeAt is set.

Testing

  • npm test in plugins/stewards: pass (702 tests; the stewards entry in the CI matrix covers it).
  • npm run typecheck in plugins/stewards: pass.
  • The new test fails on the pre-fix code and passes with it (verified by reverting server.ts locally).

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_kvddjjki6g.

— from bb thread thr_dbkp674jxh

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at 478c900)

Owner review required: no — none of the owner-reviewed triggers apply. This is a narrow bug fix that makes an existing behaviour do what it was already meant to do (retry a lost adoption wake), in one live plugin, with no contract, identity, infrastructure or default change. No bigDecisions entry's paths match plugins/stewards/server.ts or server.test.ts, so nothing routes this to an approver.

Suggestions

  • The PR body's Testing section says the stewards suite is "not in the CI matrix" — it is (.github/workflows/plugins.yaml line 20 lists stewards). Worth a one-word correction so the merge note doesn't mislead a future reader; the Classification line itself is accurate.

Checked

  • Ran: npm install && npm run typecheck && npm test in plugins/stewards — pass (21 files, 702 tests, ~61s). CI's stewards checks were still in progress when I fetched the PR, so this is my own run, not a green check I read.
  • Verified the new test is a real regression guard: with only the server.ts hunk reverted (let reason = force), the BB-92 test fails (t.spawns[1] undefined — the steward is never spawned); restored, it passes. So it fails on the pre-fix code exactly as the ticket asks.
  • Verified the fallback matches the other three paths byte for byte: force ?? (b.threadId === null ? "adopted" : null) at server.ts:2011 is the same expression the ops (2448), deps (2503) and sentry (2696) paths already use, including the same Due: <reason> deferral note, so the ticket path behaves like the established ones rather than inventing a new pattern.
  • Verified no change to threaded bindings: with force !== null the expression short-circuits to force as before, and with force === null and threadId !== null it yields null as before. An unthreaded binding now wakes through deliverWake → spawnSteward (server.ts:1840), the same spawn path adoption uses, which sets wokeAt — what the test asserts.
  • Checked the second-order effects: an unthreaded binding under paused or hold now defers with a "Due: adopted" note instead of silently returning — identical to what the ops/deps/sentry paths already do in that state, so no new behaviour class is introduced.
  • Verified against ticket:
    • Ticket/PR reconcile wake reason falls back to adopted while threadId === null, matching ops, deps, sentry — met.
    • Unit test: adopt, first reconcile exits before the wake via a one-shot null config read, plain reconcile then spawns the steward and sets wokeAt — met.
    • Existing tests pass, no change to how a threaded binding is woken — met (702 pass; short-circuit analysis above).
  • No source-contract.ts, hooks, devbox or store changes; the only non-test change besides the reason line is a debug-level log on the previously silent config === null exit, which names project and entity and leaks nothing.

_— from bb thread thr_kvddjjki6g

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 suggestion addressed:

  • PR body Testing: fixed — the stewards plugin is in the CI matrix (.github/workflows/plugins.yaml), so the line no longer claims otherwise. No code changed; the approved sha 478c900 stands.

— from bb thread thr_dbkp674jxh

@trotterdylan
trotterdylan merged commit 9d8b551 into main Oct 27, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-92-wake-unthreaded-ticket-bindings-as-adopted-thr_dbkp674jxh branch October 27, 2026 19:42
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 478c900, checks green.

Merge to bb-plugins main moves the pin, builds a new bb-server image and stages a restart for every developer's server (at Restart now, or in the 03:00–05:00 ET quiet window).

merge commit 9d8b551

— from bb thread thr_dbkp674jxh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant