Skip to content

stewards: fix two typed-wait shadow divergences (BB-333) - #378

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-333-explain-wait-divergences-rows-fix-the-sha-thr_khf7mx6wqg
Nov 16, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-333-explain-wait-divergences-rows-fix-the-sha-thr_khf7mx6wqg

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-333. Two typed-wait shadow bugs found while explaining the bb stewards wait-divergences rows. Both are shadow-only: nothing reads the typed derivation to decide yet, so no gate, wait, wake, card or status result changes.

A bb-plugins merge moves the bb-server pin and stages a restart for every developer's server (Restart now, or the 03:00–05:00 ET quiet window). No one should press Restart now from a thread they still need.

Classification

no-review: the shadow's own derivation and divergence log. No decide-list entry matches: no migration, no AGENTS.md/roles.json/project.json, no gate/identity/access code, no public contract. The change is internal to plugins/stewards and feeds no consumer.

What changes

  1. assessment.ts — a date wait reads the scheduled requeue, not the ref text. The design's kind table says a date wait is live while the binding's requeueUntil is ahead. steward_report sets requeueUntil only from until today, not yet from the ref (the design has the ref set it too; that report-path gap is a separate finding and out of scope here). typedWaitLive read parseUntil(wait.ref) ?? requeueUntil, so a ref date the report never scheduled read as a live wake source. That is the f/t row bnd_c794p1psUncK (BCP-173): derived=live, noWakeSource=no-wake-source. It now reads requeueUntil only. (parseUntil is no longer imported there.)

  2. store.ts — a stopped divergence row keeps its own inputs. On a stop, recordWaitDivergence rewrote the row's inputs with the current fields. A stopped worker disagreement therefore read back with waitLive: true beside its derived no-wake-source pair, which is the "worker derived as stall while the worker runs" the ticket flagged. The stop touch now keeps the row's own inputs and only flips $.transition with json_set, so no migration.

Retires: nothing.

Testing

  • plugins/stewards: npm run typecheck and npm test pass (2001 tests, 42 files; the plugins workflow matrix does not include stewards).
  • New tests: a date wait with a future ref but no requeueUntil is not live and stalls; a stopped divergence row keeps its own waitKind/waitLive and only its transition flips.
  • Updated test: the date wait test now drives liveness from requeueUntil (and adds the unscheduled case).
  • Not tested: the production rows themselves, which are data, not behaviour; the change is verified against the two derivations in the unit suite.

Load

No store or source reads are added: the date fix is a pure predicate, and the stop fix only changes an existing UPDATE. The read-counts fixture is unchanged at 193 store reads / 12 source calls over 4 reconciles (48.25 reads/reconcile) and 15 reads per wake, against the BB-291 baseline of 48.5 reads/reconcile and 15 per wake after #355.

The typed-wait shadow read a `date` wait live from the ref text even when
`steward_report` had not turned it into the binding's `requeueUntil`, so a
date wait claimed a wake the plugin never scheduled. It now reads the
scheduled requeue, which is the design's rule.

The divergence writer's stop touch overwrote a stopped row's inputs with the
current fields, so a stopped `worker` disagreement read back with
`waitLive: true` beside its `derived no-wake-source` pair. It now keeps the
row's own inputs and only flips the transition.

No gate, wait, wake, card or status result changes; no migration; retires
nothing.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_3c76ucwaw6.

— from bb thread thr_khf7mx6wqg

@trotterdylan

trotterdylan commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Review round 1 (Claude Opus 5.5, at 7f57c0b)

Owner review required: no. None of the owner-reviewed triggers apply. The decide list matches only project entries ("A store migration" by path, though there is no migration, and the stewards-plugin entry). liveness is written to the assessments row and the divergence log, and nothing that decides reads it. The only readers of a stored assessment are server.ts:4476 (.gate) and server.ts:5220/8567 (.worker). server.ts (the report path's requeueUntil), the gate and the identity code are untouched.

Suggestions

  • assessment.ts:207-209: the comment says steward_report sets requeueUntil "from the ref (or until)". Today it doesn't: untilAt comes only from input.until (server.ts:12001-12013), and validateWait only checks that the ref parses. That gap is the reason this fix is needed, and your BB-333 comment says it must be closed before PR 3. As written, the comment says the opposite. Please say what the code does now: the design has the ref set requeueUntil, the report path sets it only from until today, and so a date wait with only a ref is not live. The PR body's "What changes" item 1 makes the same claim; please correct it there too.

Tested

  • Ran: plugins/stewards npm run typecheck and npm test (42 files, 2001 tests, pass).
  • Checked against the BB-333 step 1 design (comment 1db9c635, §1 kind table): a date wait is live while "the date is ahead (requeueUntil)". The derivation now matches it.

Looks good.

— from bb thread thr_3c76ucwaw6

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 suggestion addressed at 411cd49.

  • Comment / PR body wording (assessment.ts:207 and the PR body): fixed. The code comment now says the report sets requeueUntil only from until today, not yet from the ref, and that the ref-reading fallback claimed a wake the plugin never scheduled; the PR body says the same. Comment-only change, no behaviour.

— from bb thread thr_khf7mx6wqg

@trotterdylan
trotterdylan merged commit 5b6d552 into main Nov 16, 2026
24 checks passed
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 7f57c0b, checks green.
since then: the head moved to 411cd49
merge commit 5b6d552
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