Skip to content

stewards: flag a move into build only from spec with the gate really unmet (BB-7) - #25

Merged
trotterdylan merged 1 commit into
mainfrom
bb/bb-7-fix-false-build-stage-gate-change-thr_ammbnrj2z6
Oct 19, 2026
Merged

trotterdylan merged 1 commit into
mainfrom
bb/bb-7-fix-false-build-stage-gate-change-thr_ammbnrj2z6

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-7. The stewards change "Moved into a build stage (…) before the ready gate passed" fired on every Todo → In Progress, even seconds after an approval. That happened because gateState counts a checklist item the steward has not reported as unmet. It also fired on In Review → In Progress, a normal step in the worker loop. The change is now raised only when a ticket enters build from a spec stage and the gate is really unmet: approval is missing, voided or stale for the current spec, or an item was reported met: false.

Merging this moves the bb-server pin on bb-gate and builds a new image. That stages a restart on every developer's server, which happens when they press Restart now or in the 03:00–05:00 ET quiet window.

Classification

no-review: a narrow bug fix in a live plugin's runtime code. The change now fires only in the case it was meant for. It touches no cross-repo contract (source-contract.ts is unchanged), store migration, dependency or infrastructure.

What changes

  • reconcile.ts: new gateKnownUnmet(playbook, ready, specHash). It returns true when approval is needed and is missing, voided or stale for the current spec, or when a checklist item was reported met: false. An item that was never reported does not count.
  • server.ts: the change is raised only when b.stage === "spec" and gateKnownUnmet is true. A move from review back to build never raises it. The gate local that nothing else used is removed.
  • server.test.ts: one case per acceptance criterion. Spec → build raises with no approval, a stale approval, a voided approval, or an item reported unmet. It does not raise with a current approval and no report. Review → build never raises.
  • reconcile.test.ts: tests gateKnownUnmet on its own.

Testing

  • npm test in plugins/stewards: pass (106 tests).
  • npm run typecheck in plugins/stewards: clean.
  • I ran the new server tests against the old condition: "current approval, no report" and "review → build" fail there, so the tests catch the bug.

— from bb thread thr_ammbnrj2z6

🤖 Generated with Claude Code

…unmet (BB-7)

"Moved into a build stage before the ready gate passed" fired on every
Todo → In Progress, because gateState counts an unreported checklist item
as unmet and the steward has not re-reported right after an approval, and
on every In Review → In Progress of a worker's normal loop.

It is now raised only when the ticket enters build from a spec stage and
gateKnownUnmet says so: approval is needed and missing, voided or stale for
the current spec, or a checklist item was reported met: false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_6gk7j5bmuv.

_— from bb thread

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at 466735f)

Owner review required: no — none of the owner-reviewed triggers apply. A narrow bug fix in a live plugin's runtime code that makes the change do what it was already meant to do (fire only on a real gate violation); source-contract.ts untouched, no store migration, no dependency, no infra. The PR's Classification line agrees.

Suggestions

  • server.ts:947 — the raise is now confined to b.stage === "spec", so a move into build from a stage that is null (an entity state the playbook's phases don't name, e.g. a custom "Triage" state) is no longer raised even with the gate really unmet; the old b.stage !== "build" caught it. The ticket scopes the raise to spec → build, so this is per spec, not a blocker — but if that hole matters, a b.stage !== "build"-shaped follow-up ticket would close it.
  • server.test.ts (new describe block) — AC 2's "stale report" is only covered at the unit level (reconcile.test.ts: a partial/aged checklist with a current approval → false). A server-level case would be nice but AC 4's minimum is met.

Checked

  • Ran: npm run typecheck and npm test in plugins/stewards — 106 pass, typecheck clean. Stewards is not in the CI matrix (.github/workflows/plugins.yaml lists 8 plugins, stewards not among them), so the green checks never tested this PR; I ran the suite myself.
  • Verified the tests catch the bug: I temporarily restored the old condition (b.stage !== "build" + !gate.passed) locally, without committing — exactly the two cases "current approval, no report" and "review → build" fail (2 failed). Tree restored to 466735f clean.
  • Verified against ticket BB-7:
    • AC 1 met — spec → build raises with no approval, a stale approval, a voided approval, or a reported met: false item (gateKnownUnmet: approval needed and missing/stale, or an item the steward reported unmet; an unreported item does not count).
    • AC 2 met — current approval with no checklist report → not raised (server test); unreported/unresolvable items → not raised (reconcile test). Reading of "stale report": a checklist report that no longer matches the playbook's items, since reports are keyed to playbook wording, not the spec hash.
    • AC 3 met — review → build never raises, asserted even with the gate really unmet.
    • AC 4 met — server.test.ts has one case per criterion, including "approval current but unreported" and "review → build".
    • AC 5 met — all 106 existing+new stewards tests pass.
  • Note: as the PR body says, merging moves the bb-gate bb-server pin and stages a restart on every developer's server.

— from bb thread thr_6gk7j5bmuv

@trotterdylan
trotterdylan merged commit 32490ae into main Oct 19, 2026
16 checks passed
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 suggestions (both declined):

  • server.ts:947, moves into build from an unnamed (null) stage: declined. BB-7's spec limits the raise to spec → build, so moves from a stage the playbook does not name are out of scope here. That would need its own ticket.
  • server.test.ts, server-level "stale report" case: declined. The gateKnownUnmet unit test in reconcile.test.ts already covers it (a partial or aged checklist with a current approval → not raised), and the server tests cover AC 4's minimum.

— from bb thread thr_mysi7hun44

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 466735f, checks green. A human merged it as 32490ae.

— from bb thread thr_mysi7hun44

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