I2 hub-start-alone: the indexer starts its event hub with Start alone

Start binds the indexer's durable on EVENTS and on each kept seat event's stream it handles, so
startHearing no longer calls StartKept, which mesh-sdk's hub no longer has.

Builds: design 47 H2b §836 1.
This commit is contained in:
2026-11-27 03:01:31 +01:00
parent 499bb15eae
commit b44a9ee1dc
2 changed files with 5 additions and 16 deletions
@@ -107,19 +107,14 @@ func ptr[T any](v T) *T { return &v }
// noWire is a finding writer that is none: a non-nil WireWriter for the test of which emitter is made.
type noWire struct{ views.WireWriter }
// startedHub records which of an event hub's starts were asked.
// startedHub is an event hub whose Start answers startErr.
type startedHub struct {
startErr error
kept bool
}
func (h *startedHub) Start(context.Context, jetstream.JetStream, process.Account) error {
return h.startErr
}
func (h *startedHub) StartKept(context.Context, jetstream.JetStream, process.Account) int {
h.kept = true
return 1
}
// H-A-578 (2): an event of a subject the indexer no longer consumes is acknowledged with no work, and the journal says
// the subject once, at the first.
@@ -46,19 +46,13 @@ func sayVersionReleased(conn *nats.Conn, cred process.Account) func(context.Cont
// hubStarter is the event hub as startHearing starts it.
type hubStarter interface {
Start(ctx context.Context, js jetstream.JetStream, cred process.Account) error
StartKept(ctx context.Context, js jetstream.JetStream, cred process.Account) int
}
// startHearing binds the indexer's durable on the shared events stream and then, beside it, its durable on each kept seat
// event's own stream (SEAT_<seat>_<event>) whose event it handles: package-published and the build seats'
// step-ended are never on EVENTS, and its tool runner reads only its own twin there, so the program hears them only so
// (design 47 G A-397; mesh-sdk process.EventHub.StartKept).
// startHearing starts the event hub once: its Start binds the indexer's durable on the shared events stream and, beside it, its
// durable on each kept seat event's own stream (SEAT_<seat>_<event>) whose event it handles, package-published and the build
// seats' step-ended being never on EVENTS (design 47 H2b §836 1.; mesh-sdk process.EventHub.Start).
func startHearing(ctx context.Context, hub hubStarter, js jetstream.JetStream, cred process.Account) error {
if err := hub.Start(ctx, js, cred); err != nil {
return err
}
hub.StartKept(ctx, js, cred)
return nil
return hub.Start(ctx, js, cred)
}
// EventDeliveries is how many times the bus gives a message of the indexer's events consumer: the MaxDeliver the grants part