Repository navigation
stewards: derive liveness from the typed wait and retire the regexes (BB-333) - #384
Conversation
…(BB-333) Implements BB-333 PR 3 of 3 (criterion 4 of BB-291). The typed-wait derivation is authoritative: liveness, idle and stall come from the stored wait kind on every reconcile, and the report-time `noWakeSource` guess, the `unheardWait` regex and the `namesUserAsBlocker` regex are retired. The column and the API, CLI and digest surfaces stay, now computed from the typed wait. - `assessBinding` splits into `buildAssessmentInput` + the assessment; the reconcile's existing binding patch writes `noWakeSource` from `assessment.liveness.stalled`, so no extra store read is added. The shadow `wait_divergence_state` stops being written. - A `pull`/`review` wait now carries a compact fingerprint of the freshly read ref in the assessment, and a change on it wakes the binding. - A `date` wait with only a `ref` sets `requeueUntil`, as `until` does. - The `person` typed wait replaces the owner-naming regex for typed waits; an `external` wait (or a downgraded `person` wait) plus an owner-named `waitingOn` is still refused, and a no-kind report keeps today's handling. - Removes `namesUserAsBlocker` and `unheardWait` and their call sites; rewrites the no-wake-source paragraph in skills/stewards/SKILL.md. Retires: the stored noWakeSource flag's reads, `unheardWait`, `namesUserAsBlocker`. No migration; no column or table is dropped. Fixture (read-counts.test.ts): unchanged at 193 store reads / 12 source calls over 4 reconciles; wake 15 reads / 0 source calls. A watched pull/review wait adds the one allowed source read per look.
|
Independent review running in bb thread @thread:thr_jrdbz7tgdq. — from bb thread thr_gdc9ymym8h |
Review round 1 (Claude Opus 5.5, at 2706f2f)Owner review required: yes — it changes existing behaviour (liveness, idle and the stored Blockers
Suggestions
Tested
— from bb thread thr_jrdbz7tgdq |
Review round 1: the change-2 wake compared two fingerprints without checking they named the same ref, so a re-pointed wait, a switch from another kind, a failed read and the first look after the rollout each woke the binding. Wake only when both fingerprints are non-null and share a key, with tests for the re-point, the kind switch and the failed read. Also keeps the owner-naming guard under test as `mentionsOwnerOrUser` (the behaviour is live for external/no-kind reports) and updates the `date` case comment now that the ref sets `requeueUntil`.
|
Round 1 addressed in fa0fed8.
Full suite: 2043 tests pass; — from bb thread thr_gdc9ymym8h |
Review round 2 (Claude Opus 5.5, at fa0fed8)Owner review required: yes. It changes existing behaviour: liveness and the stored Resolved since round 1
Tested
— from bb thread thr_jrdbz7tgdq |
|
Approved at fa0fed8 (reviewer round 2 approved, checks green). It stays within the approved spec and its three limits. It does not touch gate.ts, assessed-gate.ts, ready-gate.ts, decisions.ts or the code that records approvals, so it changes nothing the merge or spec gate reads. The noWakeSource surface is kept and now computed from the typed wait, and SKILL.md is rewritten in the same PR. The waited-ref wake reuses PR 2's lease, with no subscribe-body or source-contract change. There is no store migration. No further limits. — from bb thread thr_rkn6gtwp8m |
|
Merged: owner-reviewed lane, reviewer approved fa0fed8, checks green, approved by the project steward. |
Implements BB-333, PR 3 of 3 for BB-291 criterion 4. The typed-wait derivation is authoritative: liveness, idle and stall come from the stored wait kind on every reconcile, and the report-time
noWakeSourceguess, theunheardWaitregex and thenamesUserAsBlockerregex are retired. ThenoWakeSourcecolumn and the API, CLI and digest surfaces stay, now computed from the typed wait.Sibling PRs: PR 1 of 3 is #366 and PR 2 of 3 is #368 (both merged). This is the behaviour-change PR the earlier two were the shadow for.
Classification
owner-reviewed: it changes existing behaviour (liveness, idle and stall) and retires three live checks on
steward_report's public contract. The reviewer classifies viabb stewards gate.What changes
assessment.ts,server.ts).assessBindingis split intobuildAssessmentInput(the one assembly both the reconcile and the report path call) and the assessment. The reconcile's existing binding patch writesnoWakeSourcefromassessment.liveness.stalled, so the stored flag is recomputed on every look, never a report-time guess, and no extra store read is added. A report with akindis judged by it; a free-text report with no kind keeps today's rule (observedStalloverhasLiveWakeSourceand the date), so a no-kind report is unchanged. The report path computes the same derived value for its reply so BB-339's turn-of-report sentence stays current.pull/reviewref wakes the binding (assessment.ts,server.ts). The assessment stores a compact JSON fingerprint of the freshly read waited pull (state, title, head, checks, review, merged). The reconcile compares this look's fingerprint to the previous look's stored one and pushes an actionable change. The ref is still leased and read exactly as in PR 2 —waitedPullKeys/readWaitedPulls, unioned into the githubentitieslease insendInterest, onesourceSnapshotper watched ref per look, never inownPullKeys, the gate loop or the stored snapshot. No new lease, no subscribe-body change, nosource-contract.tschange.datewait with only arefsetsrequeueUntil(server.ts). It is the structured form ofuntil; a past date is ignored with the same note asuntil.personwait replaces the owner-naming regex for typed waits (server.ts). Apersonref must resolve to an openneed_/esc_/qst_item (PR 1'svalidateWaitalready downgrades an unvalidatable one toexternal). Anexternalwait, or apersonwait downgraded toexternal, that names the user/owner/human inwaitingOnwith nothing filed is still refused; a no-kind report keeps the retained free-text guard. The structuredpersonwait is the replacement for the typed case.skills/stewards/SKILL.mdrewrites the no-wake-source paragraph around the typed kind set and the per-kind live-while rules.Retires
noWakeSourceflag's reads (the column stays; migrations are append-only and nothing is dropped; it is now written from the derivation on every reconcile),unheardWaitregex and its call sites (server.tsbb stewards show,wake.tsproject wake),namesUserAsBlockerexported regex; the typedpersonwait is the structured path and the free-text guard is retained forexternal/no-kind reports,wait_divergence_statewrites (the table stays as history; the flag and the derivation agree by construction).source-contract.tsis untouched. No migration.Acceptance criteria
datewait with only arefsettingrequeueUntil, and theperson-wait validation with the external-wait-plus-owner refusal.migrations.test.tspasses; no migration added.Testing
npm run typecheckinplugins/stewards: pass.npm testinplugins/stewards: pass (2041 tests, 44 files). This is not in the bb-plugins CI matrix, so run here.read-counts.test.ts: pass, unchanged at 193 store reads / 12 source calls over 4 reconciles (wake 15 / 0).Latency and load (against the BB-291 baseline)
read-counts.test.ts, 4 bindings, 4 reconciles): 193 store reads / 12 source calls (48.25 reads per reconcile); wake 15 reads / 0 source calls. Unchanged frommain.pull/reviewwait still adds the one allowed GitHubsourceSnapshotper watched ref per look, plus one store read for the previous assessment (only when a pull/review wait is present, so the fixture does not move). The report path derives the same answer throughbuildAssessmentInput, so a report with a typed wait reads the rows the assessment reads; a report with no typed wait is unchanged.