"Needs you" stays on after a gate is approved #247

Closed
opened 2026-10-27 15:30:58 -04:00 by cmoriarty · 1 comment
Owner

What happens
In run 117, the proposal-review step opened two gates a second apart. The second was approved and the run went on. The first stayed open, so "needs you" stayed lit and open_gates stayed at 1.

Fix

  • When a step starts a new attempt, close the old attempt's gates.
  • Count only the current attempt's gates.
  • Find out why the step started a second attempt after 1 second.

Done when
Approving a gate clears "needs you" everywhere.

From the Braid vs Claude Code pinball test, 2026-10-27 (runs 110–120).

**What happens** In run 117, the proposal-review step opened two gates a second apart. The second was approved and the run went on. The first stayed open, so "needs you" stayed lit and `open_gates` stayed at 1. **Fix** - When a step starts a new attempt, close the old attempt's gates. - Count only the current attempt's gates. - Find out why the step started a second attempt after 1 second. **Done when** Approving a gate clears "needs you" everywhere. _From the Braid vs Claude Code pinball test, 2026-10-27 (runs 110–120)._
Author
Owner

Cause
Run 117's events: attempt 1 opened, then attempt 2 opened 6 ms later with attempt 1 never closed. A second tick had read the step as ready during attempt 1's checkpoint write, and human steps take no lease.

What shipped

  • An attempt opens only if, in the same write, the step is still ready on the attempt before.
  • Every count of open gates (inbox, run counts, status, notifier) counts only gates on their step's current attempt.

Tests
tests/engine/test_scheduler.py and tests/api/test_gates.py.

Shipped in 5598ddf (OpenSpec change reliable-dispatch-merge-and-ci-evidence, archived).

**Cause** Run 117's events: attempt 1 opened, then attempt 2 opened 6 ms later with attempt 1 never closed. A second tick had read the step as ready during attempt 1's checkpoint write, and human steps take no lease. **What shipped** - An attempt opens only if, in the same write, the step is still ready on the attempt before. - Every count of open gates (inbox, run counts, status, notifier) counts only gates on their step's current attempt. **Tests** `tests/engine/test_scheduler.py` and `tests/api/test_gates.py`. _Shipped in 5598ddf (OpenSpec change `reliable-dispatch-merge-and-ci-evidence`, archived)._
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#247
No description provided.