Repository navigation
stewards: the pull merge gate becomes the github contributor's (BB-387) - #430
Conversation
|
Independent review running in bb thread @thread:thr_ww9vb3hfww. — from bb thread thr_52dg5mc7r6 |
Review round 1 (Claude Opus 5.5, at 024d5f6)Owner review required: no — none of the owner-reviewed triggers apply. The PR moves the per-pull gate code and leaves its inputs alone (same Suggestions
Tested
Looks good. — from bb thread thr_ww9vb3hfww |
|
Review round 1 (approved, no-review) addressed in 351f762:
Re-ran — from bb thread thr_52dg5mc7r6 |
Review round 2 (Claude Opus 5.5, at 351f762)The round-1 approval stands. This push changes comments and one test only. Resolved since round 1
Tested
— from bb thread thr_ww9vb3hfww |
Implements [BB-379](https://linear.app/bit-complete/issue/BB-379). Follow-up to BB-375: `steward_report` still wrote `noWakeSource` for an ops binding because `reconcileOps` never ran the assessment. `reconcileOps` now derives the flag itself, from `observedStall(b, liveWakeSourceFor(b, new Set()), now())`, before the per-target dispatch, and the report stores nothing for any kind. > A merge to `bb-plugins` `main` moves the pin, builds a new `bb-server` image and stages a restart for every developer's server, including this one. The restart happens when each developer presses Restart now, or in the 03:00-05:00 quiet window. Sibling PR: #430 (this PR's base; BB-387). This is a stacked PR. ## Classification no-review: the reviewer's lane. The change moves the ops write of `noWakeSource` to the reconcile, the same move BB-375 made for tickets; the flag's value and every surface that reads it are unchanged, and the merge/spec gates are untouched. The `store.ts` change is a comment only. ## What changes - `server.ts` `reconcileOps` derives `noWakeSource` from `observedStall(b, liveWakeSourceFor(b, new Set()), now())` before the per-target dispatch, patching only when it changes, so every ops target kind (dependabot, sentry-project, alertmanager, backlog, generic look) and its early returns get it. - `server.ts` `steward_report` drops the `...(b.source === "ops" ? { noWakeSource } : {})` spread and its carve-out comments; it still computes the sentence for its reply. - Docs/comments updated: README "A wait with no wake source (BB-154)", DESIGN.md, `assessment.ts`, `store.ts`, the `wait-divergences` CLI description. - `server.test.ts` ops test rewritten: the report stores nothing, the ops reconcile sets the mark, a cleared wait clears it on the next reconcile. ## Testing - `npm run typecheck`: pass. - `npx vitest run` (full stewards suite): pass (56 files, 2352 tests; in the CI matrix). - `read-counts.test.ts` passes unchanged: the pinned fixture has no ops binding, so the +4 store reads per ops reconcile do not enter the budget. No budget raised.
Implements BB-387. Slice C3 of BB-291 criterion 8 (design in BB-376, C2 in BB-380). The per-pull merge-gate derivation (
pullGate/prGate,gateInputKey, the gate options and the BB-321 forwarded-owner rule) moves fromassessed-gate.ts/assessment.tsto the github contributor's home incontribution.ts;assess()composes the contributor'smergegate items instead of naming the pull-specific code itself.assessed-gate.tskeeps the store read/refresh helpers. Refactor only: the stored assessment's shape and every gate result are unchanged, and the redundant shadowcompose.gatecomparison is removed.Classification
no-review: a refactor of the existing merge-gate code with no behaviour change. It touches no authority-seam or self-widening path; the reviewer decides the lane.
What changes
contribution.tsis now the github contributor's home:pullGate(the singleprGatecall site),gateOptions,gateInputKey,assessedPullGate,rememberedForandforwardedToOwnermove here fromassessment.ts/assessed-gate.ts, andcomposeGate()folds the contributors' gate items into theAssessment["gate"]shape (with the core ready gate filled in).assessment.tscallscomposeGate(input)(or takes an already-composed answer) and no longer importsassessedPullGateorprGate.comparekeeps the waits/holds comparisons and drops thecompose.gateone.assessed-gate.tskeepsassessedGate,storedGates,storedPullGate,currentStoredGateand the stored types; it imports the computation fromcontribution.tsand re-exportsassessedPullGatefor the existing tests.server.ts'sassessBindingcomposes once and hands the answer toassessandcompare, so the gate is no longer computed twice per reconcile.Fail-closed is unchanged: a missing or head-stale stored gate is still never met (
assessedGaterecomputes and stores it for the pull's current head).Testing
npm run typecheck: pass.npx vitest run(full stewards suite): pass (56 files, 2352 tests).read-counts.test.tsunchanged and passing: reconcile{ storeReads: 197, sourceCalls: 12, reconciles: 4, bindings: 4 }, wake{ storeReads: 15, sourceCalls: 0, wakes: 1 }. No added store or source read - the composition is in-process.assess()latency over the read-count fixture's gate-met binding (20k iterations; mean / median / p95, milliseconds):assess0.0152 / 0.0136 / 0.0226assess0.0183 / 0.0169 / 0.0219 (standaloneassessnow also derives waits/holds)assess + composeAssessment0.0351 / 0.0301 / 0.0470; aftercomposeAssessment + assess(composed)0.0192 / 0.0163 / 0.0256 (about 45% lower, because the gate is computed once instead of twice).contribution.test.ts: a stubbedgithubContributor.contributechangesassess()'s gate;assessment.tshas noassessedPullGate/prGateimport;prGatehas exactly one call site in the plugin source (pullGateincontribution.ts).characterization-assessment.test.ts),assessment.test.tsandassessed-gate.test.tspass unchanged.