Builder: a step bound already past ends at once, a key's time to live is at least a second

Builds: design 47 G A-77, A-101, A-118
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 01:18:40 +01:00
parent eaa578a4b9
commit fd8f019751
2 changed files with 7 additions and 27 deletions
@@ -256,6 +256,13 @@ func (k Asker) Wait(ctx context.Context, a buildstep.StepAsk) (buildstep.Step, e
if i == 1 {
key, why = capKey, "the step of the ask "+a.ID+" never ended"
}
if d < time.Second { // a key's time to live is at least a second; a bound already past ends at once
if d <= time.Millisecond {
k.Expiry.Ended(key)
return nil
}
d = time.Second
}
return k.Bounds.Arm(ctx, key, why, d)
}
if timers[i] != nil {
@@ -1,27 +0,0 @@
package main
import (
"context"
"github.com/nats-io/nats.go/jetstream"
)
// forgeStream is the forge bridge's stream `forge` as the bus names it, where the builder's durable consumer hears the
// forge's messages: each wakes a floor whose bridge_tags was silent (design 51 *The floor*). No tagged version is
// removed on a branch's end, none being made (design 47 G §373).
const forgeStream = "FORGE"
// forgeWakes hears the forge bridge's stream: every message wakes a floor whose bridge_tags was silent, and is acknowledged.
type forgeWakes struct {
wake func(ctx context.Context)
logf func(string, ...any)
}
func (h *forgeWakes) heard(ctx context.Context, m jetstream.Msg) {
if h.wake != nil {
h.wake(ctx)
}
if err := m.Ack(); err != nil {
h.logf("acknowledging %s: %v", m.Subject(), err)
}
}