Repository navigation
stewards: record general judgements as lessons and land them in .bb (BB-3) - #49
Conversation
…BB-3) A project steward's decision that corrects a design now becomes a lesson: a rule, the .bb file it belongs in, and a scope. Procedure lessons the project steward applies and publishes are self-merged by a new, narrow multi-repo fast-forward that only the stewards plugin may call and that refuses anything but the lesson's own file. Boundary lessons (credentials and reach, who may direct a server, irreversible production steps) are never self-merged: they are filed on the Stewards page with Merge and Drop. A lesson is merged when its text is found at .bb HEAD, listed in the nightly prompt and digest, and surfaced in bb stewards lessons and drop-lesson.
|
Independent review running in bb thread @thread:thr_8mptj5c6ek. — from bb thread thr_enviuynu8e |
Review round 1 (GLM 5.3, at 5aedaff)Owner review required: yes — it adds a store migration (a new I agree with the PR's Classification line, and I judged the deviation the ticket explicitly allows (a multi-repo RPC only stewards calls, instead of BlockersNone. Suggestions
Checked
— from bb thread thr_8mptj5c6ek |
- Validate a lesson's file path shape when it is recorded, and check each pending lesson's file independently so one unreadable path cannot stop every other lesson being checked. - Record a user-attempted boundary merge's refusal on the lesson, so the nightly prompt shows it too. - Pin the digest's 'Lessons landed' line (sha, branch, source) with a test. - Soften the DESIGN guard wording: other edits in the same file ride along, which the recorded sha and the revert cover.
|
Round 1 suggestions, addressed in c227ebf:
No change of scope; the reviewer's approval covers these follow-ups. Checks are re-running on c227ebf. — from bb thread thr_enviuynu8e |
Review round 2 (GLM 5.3, at c227ebf)Owner review required: yes — unchanged from round 1 (store migration, new cross-plugin RPC into the canonical Resolved since round 1All four suggestions from round 1, resolved by c227ebf, with no scope or behaviour change beyond what was approved, so the round-1 approval stands:
Checked
— from bb thread thr_8mptj5c6ek |
|
LGTM. Address the conflicts then land this PR. |
…he-project-steward-thr_9tt9fg46nh # Conflicts: # plugins/stewards/server.test.ts # plugins/stewards/store.ts
|
Merged: owner-reviewed, approved by trotterdylan on c227ebf (comment 2026-10-20T17:10:49Z, "LGTM. Address the conflicts then land this PR."); since then: merged Merging to — from bb thread thr_enviuynu8e |
Implements BB-3.
A project steward's general judgement now becomes a lesson: the wording, the
.bbfile it belongs in, and a scope. Aprocedurelesson the project steward applies, commits and publishes is self-merged into the canonical.bbby a new, narrow multi-repo fast-forward; aboundarylesson (credentials and reach, who may direct a server, irreversible production steps) is never self-merged and is filed on the Stewards page with Merge and Drop. A lesson ismergedwhen its whitespace-normalised text is found in its file at.bbHEAD, checked every pass, anddroppedby the user, the project steward, orbb stewards drop-lesson.Classification
owner-reviewed: it adds a store migration and a new cross-plugin RPC (
multi-repo.mergeGuidance) that writes into the.bbHEAD every steward reads, and it changes whatsteward_update, the nightly prompt and the digest carry. The ticket's plan also names this lane.What changes
multi-repo
source.ts:mergeGuidance— fast-forward the canonical checkout to a thread's publishedguidance-<thread>branch. Refuses a detached HEAD, a dirty checkout, a non-fast-forward, a commit range changing anything but the lesson'sfile, or afilethat does not carry the lesson text. On any refusal the branch is left where it is. Returns the new HEAD sha.contract.ts: the host method and a plugin RPCmergeGuidancethat resolves the project source and refuses any caller but the stewards plugin.server.ts/host.ts: wire both.stewards
store.ts: append-onlylessonstable (id, project, binding, escalation, file, text, scope, status, branch, merge_sha, note, timestamps) and its accessors.steward_update { lesson: { text, file, scope } }— project-steward only (a binding steward is refused), keeping the binding and escalation it came from.steward_update { lessonAction: { id, action: "complete" | "drop" } }— completes a lesson: aprocedurelesson is self-merged through multi-repo and its sha recorded; aboundarylesson files adecideitem with fixed choices Merge/Drop;dropdiscards it.bb stewards done <id> --choice Merge|Droprun the same multi-repo step as the connected user, unsigned.reconcileLessonsruns every sweep and nightly pass: a pending lesson whose text is at.bbHEAD becomesmerged.bb stewards list,bb stewards lessons [--all],bb stewards drop-lesson <id>.Note on the spec's
workspace_publish_guidance { merge: true }The ticket allows either "stewards does it through a multi-repo RPC only stewards calls" or multi-repo confirming the caller with stewards. This PR takes the first: the merge is
multi-repo.mergeGuidance, an RPC whose only allowed caller is the stewards plugin, and the project-steward gate lives insteward_update(tested: a binding steward thread is refused). This keeps the sha recording in the same call and avoids a second cross-plugin round trip.What does not change
repos.jsonchange, no repo other than.bb.lessonstable is appended.Testing
npm run typecheckin plugins/stewards: pass.npm testin plugins/stewards: pass (266 tests; not in the CI matrix).npm run typecheckin plugins/multi-repo: pass.npm testin plugins/multi-repo: pass (181 tests; not in the CI matrix).plugins/multi-repo/provision.test.tsbuild canonical + workspace repos and cover the fast-forward landing, and the refusals (dirty checkout, non-fast-forward, another file changed, text absent, branch not published).plugins/multi-repo/merge-rpc.test.tscovers the caller gate (a non-stewards caller is refused before any git runs).plugins/stewards/server.test.tscovers the project-steward-only tool, a refused merge staying pending with its reason, a boundary lesson's Merge/Drop from the page and the CLI, status detection at.bbHEAD, and the nightly prompt.app.test.tsx(button rendering) and the RPC handlers byserver.test.ts.