Repository navigation
stewards: deliver each escalation once and make steward_update safe to retry (BB-2) - #23
Conversation
|
Independent review running in bb thread @thread:thr_r87qadc2mg. _— from bb thread |
Review round 1 (glm-5p3, at 66a8706)Owner review required: yes — the diff changes a live plugin's runtime code ( I read the acceptance criteria from BB-2 with Suggestions
Checked
— from bb thread thr_r87qadc2mg |
…dance by author too Answers review round 1 on #23: a throw while building the prompt no longer leaves escalations marked delivered, and identical guidance from a different author within five minutes is saved rather than dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Round 1 answers (both suggestions taken):
#23 still has to be rebased after #22 merges; that head will go through another review round. — from bb thread thr_5j2t3zpeb2 |
Review round 2 (glm-5p3, at 8535134)Owner review required: yes — unchanged: a live plugin's runtime code plus store migrations. @trotterdylan, this approval is for head 8535134; a rebase after #22 merges will need one more round on the new head. Resolved since round 1
Checked
— from bb thread thr_r87qadc2mg |
…o retry Escalations carry delivered_at: the project steward's prompt lists undelivered ones as new and the rest as still open, reads them at send time so one resolved meanwhile is left out, and marks the new ones delivered in the same step. A new migration adds the column and a second backfills it for escalations already open, so they are not re-sent as new. steward_update checks every target (forward, resolve, approve, model) before its first write, so a failed call changes nothing. Resolving an escalation that is already resolved (the binding ended, a retry, an approve that closed it) records the answer after the earlier text instead of failing, and only a resolve that closes an open approval request declines the spec. Guidance identical to the binding's last within five minutes is a retry and is saved once. BB-2 On top of BB-1 (#22): the store's resolve keeps closing the question a forward made, and answerEscalation goes through it, so a late answer to an escalation the ending resolved is appended to its question too. A forwarded question that is already closed is answered through its escalation, and repeating a plain question's close with the same answer is a no-op. The question writes (close, ask) run after every check, like the rest of steward_update. Migrations go after #22's questions table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dance by author too Answers review round 1 on #23: a throw while building the prompt no longer leaves escalations marked delivered, and identical guidance from a different author within five minutes is saved rather than dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…resolve A retried close of a plain or forwarded question changes nothing and tells no one again; a forwarded question the ending closed takes the user's answer on both the question and its escalation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
LGTM |
8535134 to
fcfd01a
Compare
Review round 3 (glm-5p3, at fcfd01a)Owner review required: yes — unchanged: a live plugin's runtime code plus store migrations. @trotterdylan, this approval is for the rebased head fcfd01a (after #22). The PR's Classification line now says the same. I reviewed the rebase onto main (559cc17) rather than only the delta, since #22 touches the same functions this PR changes. Checked
— from bb thread thr_r87qadc2mg |
|
@trotterdylan this needs your approval on the current head, fcfd01a, before it can merge. Your "LGTM" (01:35:58Z) was posted while the head was still 8535134. The rebase onto main after #22 was force-pushed 14 seconds later (01:36:12Z), and a push after an approval needs a fresh one. Everything else is in place on fcfd01a: the reviewer approved it in round 3 (owner-reviewed lane, no open suggestions), all checks pass, and it is up to date with main (559cc17). A plain "LGTM" comment or a review on fcfd01a is enough. Note that merging moves the bb-gate pin and stages a new bb-server image, so every developer's server restarts when they press Restart now or in the 03:00–05:00 US Eastern window. — from bb thread thr_iwzxim3927 |
|
LGTM |
|
Merged as 27a5ccc: owner-reviewed lane. Reviewer thr_r87qadc2mg approved round 3 on fcfd01a, 16 checks green, approved by trotterdylan on fcfd01a (comment 2026-10-19T01:43:06Z). This merge restarts every developer's bb server: bb-gate re-pins bb-plugins main, builds a new bb-server image and stages it on every developer's Deployment. Each server restarts when its owner presses Restart now (Settings → Plugins → Team setup), or on its own in the 03:00-05:00 US Eastern quiet window. — from bb thread thr_33xvjuzbzr |
…310) Implements [BB-278](https://linear.app/bit-complete/issue/BB-278/bb-plugins-npm-batched-mediumlow-dependabot-alerts). `plugins/review-watch/package-lock.json` is regenerated so the tree resolves: | package | from | to | advisory | |---|---|---|---| | `@vitest/mocker` | 4.1.11 | 4.1.12 | [GHSA-qxg6-89mg-rqv8](https://github.com/bitcomplete/bb-plugins/security/dependabot/24) (#24), [GHSA-xp26-3454-mjgp](https://github.com/bitcomplete/bb-plugins/security/dependabot/23) (#23) | | `hono` | 4.13.8 | 4.13.17 | [GHSA-5r4p-p66f-jhc7](https://github.com/bitcomplete/bb-plugins/security/dependabot/16) (#16) | `@vitest/mocker` is transitive via `vitest` (whose range `^4.1.11` already allowed 4.1.12), so `vitest` moves 4.1.11 → 4.1.12 and its `@vitest/*` subtree with it (`@vitest/expect`, `@vitest/pretty-format`, `@vitest/runner`, `@vitest/snapshot`, `@vitest/spy`, `@vitest/utils`, plus `chai`, `tinyrainbow` and `@types/estree`). `hono` is a direct devDependency whose range `^4.11.9` already allowed 4.13.17. No `package.json` change was needed (no override). `vite` is unchanged at 8.3.7, already past the 8.3.3 fixed version for the alerts already trimmed from the ticket. > **Restart note:** this merge to `bb-plugins` `main` moves the pin, builds a new `bb-server` image and stages a restart on every developer's server (at *Restart now*, or in the 03:00–05:00 ET quiet window). ## Classification no-review: lockfile-only patch security bumps in `review-watch`, a plugin that is not deployed. No behaviour, default, contract or existing feature changes; no owner-reviewed trigger is touched. ## What changes - `plugins/review-watch/package-lock.json` only. `package.json` is unchanged. ## Testing - `npm install --include=dev --legacy-peer-deps` in `plugins/review-watch`: clean, lockfile unchanged. - `npm update vitest hono` in `plugins/review-watch`: lockfile only (12 packages moved, all within existing ranges). - `npm ls @vitest/mocker hono`: `@vitest/mocker@4.1.12` (via `vitest@4.1.12`) and `hono@4.13.17` only; `npm ls vite`: `vite@8.3.7` only. - `npm run typecheck` in `plugins/review-watch`: pass. - `npm test` in `plugins/review-watch`: pass (10 files, 118 tests). - `review-watch` is in the CI matrix (`.github/workflows/plugins.yaml`), so CI runs it too.
Fixes the two duplication bugs in BB-2: an escalation delivered to the project steward twice (HUB-195/196), and a retried
steward_update { guidance, resolve }that recorded its answer twice while the escalation kept "The binding ended." (HUB-183).Classification
owner-reviewed: changes a live plugin's runtime code (
plugins/stewards) and adds store migrations.What changes
Delivery once (
store.ts,server.tswakeProject/sendTo,wake.ts)delivered_atcolumn. The project steward's prompt lists undelivered escalations under New escalations routed to you and delivered ones under Escalations still open with you.sendTo's awaits, so an escalation resolved in the meantime is left out. The new ones are marked delivered in the same synchronous step, so a prompt sent right after lists them as still open. If the send fails, the mark is undone.delivered_at, so the new holder hears it as new.MIGRATIONS, after stewards: a page per project, and a record of questions put to the user (BB-1) #22'squestionstable. The first adds the column. The second backfillsdelivered_at = created_atfor escalations already open, so the first prompt after deploy doesn't list them as new again. No existing statement is edited.steward_updatesafe to retry (server.ts,store.ts)store.answerEscalationresolves it if it's open. If it's already resolved, it appends the answer after the earlier text (for example "The binding ended.\nYes, include SSO."). If the record already ends with that answer, it leaves it unchanged, so retries are no-ops. Only a resolve that closes an open approval request counts as declining the spec. Adding guidance to an approval thatapprove: truealready closed doesn't setdeclinedSpecHash.guidance already saved. A deduped guidance or an unchanged answer doesn't notify the steward again.finishEndingstill resolves open escalations with "The binding ended."; a later answer is accepted as above.BB-1's questions (#22, now on main)
store.resolve(id, text, by)still closes the question a forward made.answerEscalation(id, text, by)resolves through it, and when it appends to an already-resolved escalation it appends the same text to that escalation's question, so the two records never disagree.resolve: "qst_…") that is already closed is answered through its escalation, so a retry is a no-op and an answer after the ending is recorded. Repeating a plain question's close with the same answer is a no-op; a different answer is still "already closed".steward_update.Tests (
server.test.ts)sendTo's awaits makes it fail.resolve,forwardorapprovetarget writes no guidance, priority or approval.approve: truecloses the approval request, then{ guidance, resolve }on the same escalation succeeds and records the answer without declining.finishEnding,{ guidance, resolve }succeeds, keeps "The binding ended.", and records the answer once; a retry returns normally and changes nothing.npm run typecheckandnpm testpass inplugins/stewards(99 tests, on main with #22). The repo'spluginsCI matrix doesn't includestewards, so CI doesn't run these tests.Coordination with BB-1 (#22)
#22 merged first (559cc17); this branch is rebased onto it. Its migrations come after #22's
questionsstatement, and nothing existing is edited. #22 also definesstore.answerfor questions; this PR's escalation method isanswerEscalation.🤖 Generated with Claude Code
— from bb thread thr_5j2t3zpeb2