R1-3: the waiting read names a seat's stream by mesh-sdk's one derivation

seatStream derived the stream name itself and kept '.' where buscompose.SeatQueueStreamName
writes '_'; QueueWaitingOf now calls buscompose (review round 1, finding 3, queue.go:34).

Builds: design 47 H2 §777, H-A-410, P9
This commit is contained in:
2026-11-22 02:18:31 +01:00
parent e8579359b6
commit 026fb780d6
2 changed files with 12 additions and 8 deletions
+4 -6
View File
@@ -8,6 +8,8 @@ import (
"time"
"github.com/nats-io/nats.go/jetstream"
"git.novox.be/novox/mesh-sdk/go/buscompose"
)
// QueueWaitingMost is the most a waiting read holds, in its asks' ids and modules (design 47 H2 H-A-410).
@@ -30,11 +32,6 @@ type QueueWaiting struct {
Capped bool `json:"capped,omitempty"`
}
// seatStream is the work-queue stream a seat's asks are kept on.
func seatStream(seat string) string {
return "SEAT_" + strings.ToUpper(strings.ReplaceAll(seat, "-", "_"))
}
// QueueWaitingOf reads, without consuming, the asks that wait on the seat's work queue for module, the holder whose
// membership lists the queue's workers: its own store (ADR 0596). For each of its workers on the seat's stream, every message
// after the worker's acknowledgement floor is read by a direct get by subject, never by a consumer of its own; one at or
@@ -44,7 +41,8 @@ func (c *Conn) QueueWaitingOf(module, seat string) (QueueWaiting, error) {
if err != nil {
return QueueWaiting{}, err
}
stream := seatStream(seat)
// The work-queue stream a seat's asks are kept on, by the one derivation every part takes (H-A-410, P9).
stream := buscompose.SeatQueueStreamName(seat)
var workers []SeatWorker
for _, w := range t.Workers {
if w.Stream == stream {