Skip to content

stewards: workers are top-level threads, not children of their steward (BB-23) - #51

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-23-drop-parent-self-from-steward-spawn-templa-thr_fgs5phpad9
Oct 20, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-23-drop-parent-self-from-steward-spawn-templa-thr_fgs5phpad9

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-23.

Stewards spawn workers with bb thread spawn --parent-self --lifecycle-owner-thread …. bb wakes a parent thread every time a child finishes a turn, and a core notice carries none of the wake's instructions, so a steward woken that way mis-spawned a worker on the project defaults with no lifecycle owner (BB-10). Drop --parent-self (and any --parent-thread) from the wake's spawn template so a worker is a top-level thread owned only through its lifecycle owner; the steward learns of a finished worker from the next plugin wake, whose Workers section already carries its final text. thread.created already recognized a worker by lifecycleOwnerThreadId first, so tracking is unchanged, and parented workers from older stewards are still recognized. DESIGN.md and README now describe workers as top-level and note the accepted sidebar loss.

Merging to bb-plugins main moves the pin, 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 quiet window (03:00–05:00 US Eastern). This thread does not press Restart now.

Classification

owner-reviewed: the reviewer found the visible sidebar change (workers no longer nest under their steward's row) to be the one trigger. No cross-repo contract, identity/access, backend.json/Dockerfile, production-infrastructure, migration, secret or new-dependency change.

What changes

  • wake.ts: the spawn template keeps --lifecycle-owner-thread and drops --parent-self; the follow-up line says a worker's final message arrives in the next wake.
  • server.ts: comment only — workers are recognized through their lifecycle owner, parented workers still by their parent.
  • server.test.ts: a worker created with only a lifecycle owner (parentThreadId: null) is recorded as the binding's worker, counts toward the runaway guard, and its finish produces a wake whose Workers section carries its final text; the wake template is asserted to contain no --parent-self / --parent-thread.
  • DESIGN.md §15, README.md, and skills/stewards/SKILL.md: workers are top-level threads owned by their steward; the sidebar loss is accepted (bb's list trees by parent thread, not lifecycle owner — a core question).

BB-24's wake structure and the "each wake is self-contained" section are untouched.

Testing

  • npm install --include=dev --legacy-peer-deps --no-audit --no-fund, npm run typecheck, npm test in plugins/stewards: pass (306 tests, 14 files; stewards is in the CI matrix).
  • Not tested: the sidebar rendering itself, which is bb core's list and out of scope.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_qexkjkbcb8.

— from bb thread thr_fgs5phpad9

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at 9c4c2f9)

Owner review required: yes — the diff removes an existing, user-visible behaviour: workers no longer nest under their steward's row in the sidebar (bb's list trees by parent thread, and the spawn template no longer sets one), which teammates relied on to find a binding's workers. That is the "a page that worked one way now works another" trigger, and the ticket's acceptance of the loss does not make it invisible. @trotterdylan, this one needs your approval — the ticket's own design section already specifies and accepts the sidebar loss, so it should be a quick look. No other trigger applies: no cross-repo contract, identity/access, backend.json/Dockerfile, production infrastructure, migration, secret or new dependency.

Blockers

None.

Suggestions

  • server.test.ts:660 — expect(t.threads.get("thr_w1")!.parentThreadId ?? null).toBeNull() reads back the fixture the createdOwned helper itself just set; it verifies the test setup, not the plugin. Harmless, but it could be dropped or replaced with a comment.
  • Acceptance criterion 3 ("no child-completed turns on steward threads") is operational and cannot be verified pre-merge; by construction it holds (a top-level worker has no parent to notify). After the image rolls, the ticket steward should check the bithub / BB project steward logs and note the result on BB-23 before closing it.

Checked

  • Ran: npm install --include=dev --legacy-peer-deps --no-audit --no-fund, npm run typecheck, npm test in plugins/stewards — pass (14 files, 306 tests; stewards is in the CI matrix, so this re-runs rather than fills a gap).
  • Verified against ticket:
    • Wake template contains no --parent-self / --parent-thread and keeps --lifecycle-owner-thread: met — wake.ts formatWake is the only spawn template in the plugin (the ops/deps/sentry/project/session wakes spawn no workers), and the template assertions cover both the spawn prompt and a later wake.
    • A worker with only a lifecycle owner is recorded as the binding's worker, counts toward the runaway guard, and its finish produces a wake whose Workers section carries its final text: met — the new server.test.ts test asserts all three, plus that creation itself produces no wake; the thread.created handler already preferred lifecycleOwnerThreadId over parentThreadId, so the server-side change is comment-only, and the legacy parented-worker path is still exercised by the existing created(...) tests.
    • No steward turn started by a worker finishing: met by construction (see suggestion 2 for the post-roll check).
    • DESIGN.md and README describe workers as top-level threads owned by their steward: met — DESIGN.md §15, README (two places) and the bundled skills/stewards/SKILL.md, including the accepted sidebar loss and the "core question, not worked around here" note.
  • Scope respected: BB-24's territory is untouched — the only DESIGN.md hunk is the §15 workers bullet; "each wake is self-contained" (line 344) and the wake structure are unchanged. No bb-core changes, no new credentials.

— from bb thread thr_qexkjkbcb8

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 reply (reviewer approved at 9c4c2f9, lane owner-reviewed):

  • Suggestion server.test.ts:660 (fixture read-back): fixed in 078c163 — the tautological parentThreadId assertion is dropped; the createdOwned helper's comment states it sets no parent. Re-ran typecheck and the full stewards suite: 306 pass.
  • Suggestion (post-roll child-completed log check): accepted as operational — it cannot be verified pre-merge; I will check the bithub / BB project steward logs after the image rolls and note the result on BB-23 before closing it.
  • Classification corrected to owner-reviewed (the reviewer's lane wins).

The only change since the approved sha is the test-only removal above; no scope or behaviour change.

— from bb thread thr_fgs5phpad9

@trotterdylan

trotterdylan commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at 078c163)

Owner review required: yes — same trigger as round 1: the diff removes the user-visible sidebar nesting of workers under their steward's row. @trotterdylan, your approval is still needed (the round-1 line to you stands).

Resolved since round 1

  • Suggestion 1 (tautological parentThreadId assertion): resolved — dropped and replaced with a clarifying comment; test-only, no behaviour change.

Checked

  • Diff 9c4c2f9..078c163 is exactly that one test change; no scope or behaviour change, so the round-1 approval stands on this head.
  • Ran: npm run typecheck, npm test in plugins/stewards at 078c163 — pass (306 tests).
  • Suggestion 2 (post-roll check of steward logs for child-completed turns, noted on BB-23 before closing) remains open for the ticket steward after the image rolls.

— from bb thread thr_qexkjkbcb8

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Approved 078c163 from the Stewards page

@trotterdylan
trotterdylan merged commit fdcbc53 into main Oct 20, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-23-drop-parent-self-from-steward-spawn-templa-thr_fgs5phpad9 branch October 20, 2026 17:59
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: owner-reviewed, approved by trotterdylan on 078c163 (comment 2026-10-20T17:59:08Z), reviewer approved 078c163 (round 2), checks green.

— from bb thread thr_fgs5phpad9

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