Skip to content

stewards: read the typed wait's divergence state (BB-333) - #370

Merged
trotterdylan merged 1 commit into
mainfrom
bb/bb-333-read-command-for-wait-divergence-state-thr_8t8w8xg7y7
Nov 15, 2026
Merged

trotterdylan merged 1 commit into
mainfrom
bb/bb-333-read-command-for-wait-divergence-state-thr_8t8w8xg7y7

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

Implements BB-333. The wait_divergence_state table that #368 (1376a75, deployed) writes had no reader. This adds a read-only sibling to bb stewards divergences, bb stewards wait-divergences, so the shadow can be judged clean before PR 3 retires noWakeSource, unheardWait and namesUserAsBlocker.

Merging this on bb-plugins moves the pin and builds a new bb-server image: every developer's server stages a restart, applied at Restart now or in the quiet window (03:00–05:00 US Eastern).

Classification

no-review: additive; no entry in stewards/project.json bigDecisions matches a new read-only CLI command. No gate, wait, liveness or wake result changes.

What changes

  • store.waitDivergences({ bindingId? }): reads wait_divergence_state (one row per binding that has reported a typed wait) and joins the noWakeSource divergence row behind that state for the wait kind, first/last seen and count. Read-only: it only .all()s. It prefers the active direction's row when derived and reported disagree, and keeps the most recent row for a stopped divergence.
  • bb stewards wait-divergences: prints one line per binding (derived result, noWakeSource result, kind, count, first/last seen), with the same --binding, --project and --json options as divergences; --project resolves a binding key exactly as divergences does.
  • formatWaitDivergences for the human output.
  • Tests: the store join (active-direction preference, a stopped divergence, an agreeing binding with no log row) in assessment.test.ts, and the CLI (listing, --binding, --project, --json, and the help text) in server.test.ts.

Retires: nothing.

No behaviour change. Nothing reads the state on the reconcile, wake, gate or render path; the read-counts fixture is unchanged (1958 tests pass, including read-counts.test.ts and migrations.test.ts). No migration and no change to migrations.snapshot.json. This is an additive PR.

Out of scope: PR 3 (retiring noWakeSource, unheardWait, namesUserAsBlocker) and any change to the shadow derivation itself.

Testing

  • npm run typecheck: pass.
  • npm test: pass (1958 tests; the plugins CI matrix does not include every live plugin, so run here).
  • read-counts.test.ts + migrations.test.ts: pass, unchanged.
  • Not tested: no live reconcile drives a real wait_divergence_state row in these tests; the store-level test seeds the writer's own recordWaitDivergence, which is the code path the reconcile calls.

Add a read-only `bb stewards wait-divergences` sibling to the BB-293
divergence log. It lists the wait_divergence_state rows PR 2 (#368) writes:
per binding the derived stall, the report-time noWakeSource flag, and the
wait kind, first/last seen and count from the noWakeSource divergence row
behind that state, with the same --binding/--project/--json options.

No behaviour change: nothing reads the state on the reconcile, wake, gate
or render path, no migration, and no change to any gate, wait, liveness or
wake result.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_kzchenxz3e.

— from bb thread thr_8t8w8xg7y7

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (Claude Opus 5.5, at 4e852b3)

Owner review required: no — none of the owner-reviewed triggers apply. "A store migration" matches store.ts by path only; the diff adds two SELECTs and no migration or table, and nothing on the reconcile, wake or gate path calls waitDivergences.

Tested

  • Ran: npm run typecheck && npm test in plugins/stewards (pass, 1958 tests; CI's stewards job was still running).

Looks good.

— from bb thread thr_kzchenxz3e

@trotterdylan
trotterdylan merged commit a091192 into main Nov 15, 2026
24 checks passed
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 4e852b3, checks green.
merge commit a091192
Note: merging this moves the pin and stages a restart for every developer's server (Restart now, or in the 03:00–05:00 ET quiet window).
dispatched bb-server.yaml on bitcomplete/bb-gate@main

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