Skip to content

stewards: a user's answer becomes a lesson candidate for the project steward (BB-35 step 1) - #57

Merged
trotterdylan merged 3 commits into
mainfrom
bb/bb-35-step-1-lesson-store-migration-thr_x8mc26dijy
Oct 21, 2026
Merged

trotterdylan merged 3 commits into
mainfrom
bb/bb-35-step-1-lesson-store-migration-thr_x8mc26dijy

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-35 step 1. BB-30 added the escalation envelope and the resolve-time nudge, but a forwarded escalation answered on the Stewards page or from a thread only woke the binding's steward. The project steward that forwarded it was never told, so the answer never became a lesson candidate in its next wake. This closes that gap.

Merging to bb-plugins main moves the bb-gate pin, builds a new bb-server image, and stages a restart on every developer's server.

Classification

no-review: strictly additive. It adds a wake on the answer path and removes nothing; it does not change how a lesson reaches .bb, does not touch a store migration or a cross-repo contract, and none of the owner-reviewed triggers apply.

What changes

BB-35's description defines its six PRs in its "Sequencing" section, and its step 1 is: "Close the BB-30 gap: resolve asks for a lesson; page answers become candidates." The task summary called step 1 the store/tier migration, but the description's step 1 differs, and the instruction was explicit that the description wins. So this PR is the BB-30 gap; the tier migration is the description's step 3 (acceptance criterion 1).

  • plugins/stewards/server.ts: the page answer path (stewardsAnswerQuestion, free text and fixed choice) and the bb stewards done answer path now call the existing wakeProjectOnForwardedAnswer helper, the same one the spec-approval paths use. The project steward's next wake carries the answer and the lesson nudge ("if this is a general judgement the playbook should carry, record it as a lesson…").
  • A plain question with no escalation behind it still wakes nobody.
  • A non-owner's words never reach this path (BB-26 holds them); a test asserts the project steward is not woken.
  • No store schema change, no migration, no tier change, no automatic transition.
  • DESIGN.md §20, README.md and skills/stewards/SKILL.md updated.

Testing

  • npm test in plugins/stewards: pass (348 tests; 343 on main, 5 new). Not left out of CI: the plugins matrix includes stewards.
  • npm run typecheck in plugins/stewards: clean.
  • CI quality_checks (stewards): pass on the final head.
  • New tests: page answer, fixed choice, thread answer, plain question (no wake), non-owner mention (held, no wake).

Ambiguity

The one real ambiguity is the step definition above. The approval limits I was given describe a lossless, reversible pending -> trial / merged -> promoted / dropped -> retired migration; that belongs to the description's step 3, and I deliberately did not touch it here. If the intended step 1 was in fact the store migration, say so and I will do it as its own PR.

— from bb thread thr_x8mc26dijy

…steward (BB-35 step 1)

Close the BB-30 learning gap. BB-30 added the escalation envelope and the
resolve-time nudge ("if this is a general judgement, record it as a lesson"),
but a forwarded escalation answered on the Stewards page or from a thread
only woke the binding's steward: the project steward that forwarded it was
never told, so the answer never became a lesson candidate.

The answer path now calls the same wakeProjectOnForwardedAnswer helper the
spec-approval paths use, so the project steward's next wake carries the
answer and the lesson nudge. A plain question with no escalation behind it
still wakes nobody.

No migration, no tier change, no automatic transitions: candidates are
surfaced to the project steward, which records a lesson only if it judges
the answer general. A non-owner's words never reach this path (BB-26 holds
them).

Tests: page answer, fixed choice, thread answer, plain question, non-owner
mention. DESIGN.md §20 and README updated.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_y642acdu72.

— from bb thread thr_x8mc26dijy

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at 47c2d6c)

Owner review required: no — none of the owner-reviewed triggers apply. The change is strictly additive: it adds wakeProjectOnForwardedAnswer calls on the page-answer and CLI-answer paths (a new wake where none happened), plus docs and tests. No existing message, return value or gate changes; no store schema/migration (store.ts untouched); no cross-repo contract (source-contract.ts untouched, hooks/devbox contracts untouched); no identity/access, Dockerfile, kploy, CI, secret or new dependency. The ticket's own Sequencing section marks step 1 additive, and the PR's Classification line agrees.

Suggestions

  1. plugins/stewards/server.ts:4504 — the other half of the step-1 sentence ("resolve asks for a lesson") is the pre-existing tool-response nudge if this is a general judgement the playbook should carry, record it with steward_update { lesson … }, which came in with BB-30 and is unchanged by this PR. No test on this branch pins it (the 5 new tests all cover the answer half). One it(...) asserting the resolve response carries the nudge would close the spec-to-code gap with coverage too; as it stands, reverting that nudge would not fail any test.
  2. plugins/stewards/server.ts:3491–3502 — when the user closes the question without an answer, the wake still says "If the answer is a general judgement the playbook should carry…". Harmless (the wake's real job there is telling the project steward the escalation resolved, and the wording comes from the shared helper), but the phrasing reads oddly against an empty answer.
  3. Minor pre-existing asymmetry, for the record only: the page paths gate the wake on b.endedAt === null while the CLI done paths wake regardless of a ended binding. Matches the pre-existing gating of the surrounding store writes, so not this PR's problem.

Checked

  • Ran: npm install --include=dev --legacy-peer-deps + npm run typecheck (clean) + npm test in plugins/stewards — 15 files, 348 tests, all pass (~31s). CI does not skip stewards (quality_checks (stewards) is in the matrix and green), but I ran the full suite myself anyway.
  • Mutation check: with server.ts reverted to origin/main and the new tests kept, 3 of the 4 new answer-path tests fail (the "plain question wakes nobody" guard test passes on main too, as expected) — the new tests do exercise the new behaviour.
  • Verified against ticket (step 1, from the description's Sequencing section and the acceptance criteria given for this PR):
    • "A resolve asks whether the decision is a general judgement" — met: the pre-existing resolve-path nudge (server.ts:4504) plus the wake note added here on every answer surface; see Suggestion 1 on the missing test.
    • "A user's page answer becomes a lesson candidate in the project steward's next wake" — met: free-text, fixed choice, and bb stewards done (text and --choice) all wake the project steward with the answer and the lesson nudge; I traced the wake through wakeProject → formatProjectWake, which renders notes. Store writes (answer, escalation resolve) land before the wake, so the wake reads post-answer state.
    • Coverage is complete where it matters: forwarded decision/secret/done escalations surface as questions (the paths fixed here); forwarded spec approvals already woke from BB-30 (recordSpecVerdict + this helper); gate items (approve-pr, merge) are exactly the surfaces the ticket's rationale rules say never ask.
    • "Additive: nothing existing changes behaviour or is removed" — met: diff hunks only add closure strings, the helper calls and comments; return messages and store writes unchanged.
    • "No automatic transitions; no store migration in this step" — met: no store.ts changes, no lessons schema or project.json change, no tier/transition logic.
    • "Only the server owner's words (or this project's own steward/worker threads) may create/accept/cite/correct a lesson; a non-owner's comment must not" — met: the page path requires caller.kind === "client"; the CLI path runs inside project threads; lesson recording remains project-steward-only; the new mention test asserts a non-owner's words are held (BB-26) and no wake is sent.
    • Sequencing ambiguity resolved independently: I read BB-35's description; its Sequencing section defines step 1 exactly as this PR implements it ("Close the BB-30 gap: resolve asks for a lesson; page answers become candidates"), with the tier migration as step 3 — the PR body's reading is right.
    • Correctness: wake ordering after store writes; retried answers hit the already-closed guard; wakeProject failures are contained the same way as the pre-existing spec-verdict calls (undeliver on send failure); no state introduced that must survive a restart.
    • Docs: DESIGN.md §20, README and skills/stewards/SKILL.md updated, consistent with the code (the wake asks, the project steward records).

No blockers. Suggestions are the author's call.

— from bb thread thr_y642acdu72

- Skip the lesson nudge in the forwarded-answer wake when the user closed
  the question without an answer, so it does not read against an empty one.
- Pin the pre-existing resolve-path nudge with a test, so reverting it now
  fails the suite.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Addressed review round 1 at 871881e:

  • Suggestion 1 (no test pins the pre-existing resolve-path nudge): taken. Added a test that the project steward's steward_update { resolve } response carries the lesson nudge; reverting the nudge now fails the suite.
  • Suggestion 2 (lesson nudge reads oddly on an answerless close): taken. wakeProjectOnForwardedAnswer now takes a lessonCandidate flag; the page and CLI text paths pass false when the user closed without an answer, and a test pins it.
  • Suggestion 3 (page vs CLI endedAt gating asymmetry): declined — pre-existing gating of the surrounding store writes, out of scope for this additive step.

Full suite: 350 pass; typecheck clean. No blockers.

— from bb thread thr_x8mc26dijy

@trotterdylan
trotterdylan merged commit 6a09f1a into main Oct 21, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-35-step-1-lesson-store-migration-thr_x8mc26dijy branch October 21, 2026 19:06
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at 871881e)

Owner review required: no — still none of the owner-reviewed triggers; the push is the two suggestions plus their tests, all additive.

Resolved since round 1

  • Suggestion 1 (no test pins the resolve-path nudge): resolved — new test "asks the project steward for a lesson when it resolves an escalation itself" asserts the steward_update { resolve } response carries the nudge; it would fail if the nudge were reverted.
  • Suggestion 2 (nudge reads oddly on an answerless close): resolved — lessonCandidate parameter skips the nudge when the close carries no answer (page and CLI text paths; the fixed-choice paths always have an answer), and a new test pins both the wake-without-nudge and the answerless-closure wording. The other callers are untouched, so spec-verdict wakes keep the nudge.
  • Suggestion 3 (page/CLI endedAt gating asymmetry): declined as pre-existing and out of this step's scope — agreed, it was a note, not an ask.

Checked

  • Ran: npm run typecheck (clean) and npm test in plugins/stewards on 871881e — 15 files, 350 tests, all pass (~32s). CI's stewards matrix job is green on this head too.
  • Diff since 47c2d6c reviewed line by line: exactly the two fixes described, nothing else. No new blockers; the round-1 verdict stands, repeated here on the current head.

— from bb thread thr_y642acdu72

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 47c2d6c, checks green. Since then: addressed the reviewer's round-1 suggestions at 871881e (pinned the resolve-path lesson nudge with a test; skip the nudge when the user closes without an answer). Squash commit 6a09f1a.

— from bb thread thr_x8mc26dijy

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