IX-numbered: the indexer consumes no version.numbered, so its series fill from the registry seats' published alone

Builds: design 47 G §413

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 20:41:59 +01:00
parent 69524c6489
commit 1aeccdfb01
4 changed files with 4 additions and 36 deletions
@@ -623,7 +623,7 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
checksCons = c
return nil
})
// The versions each package's series holds (DLV-I5): the registry seats' published and the builder's numbered, on the
// The versions each package's series holds (DLV-I5): the registry seats' published, on the
// indexer's durable consumer of the shared events stream. Where it is not there yet, no series moves until the indexer
// starts again, said.
if err := hub.Handle(meshdelivery.SubjectSourceMovedAll, func(m jetstream.Msg) { source.heard(ctx, m) }); err != nil {
@@ -639,9 +639,6 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
return err
}
}
if err := hub.Handle(numberedSubject, versions); err != nil {
return err
}
_ = notHeard.Bind(process.EventsStream, "no package's series moves, no node's manifest-reads-changed and no assignments view is heard until the indexer starts again", func() error {
if err := hub.Start(ctx, js, cred); err != nil {
stopped = cmp.Or(stopped, err)
@@ -8,34 +8,19 @@ import (
"git.novox.be/novox/mesh-delivery/contracts/go/seats/gopackageregistry"
"git.novox.be/novox/mesh-delivery/contracts/go/seats/npmpackageregistry"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
"mesh-delivery-indexer/internal/index"
)
// The versions the packages state keeps per series (index.HearVersion, DLV-I5), heard on the indexer's durable consumer of
// the shared events stream: the package registry seats' published (their contracts in mesh-contracts) and the builder's
// numbered (its own event, version.numbered).
// the shared events stream: the package registry seats' published (their contracts in mesh-contracts).
var (
publishedSeats = map[string]string{
gopackageregistry.SubjectPublished: gopackageregistry.Seat,
npmpackageregistry.SubjectPublished: npmpackageregistry.Seat,
}
numberedSubject = "mesh.mod." + builds.BuilderModule + ".event.version.numbered"
)
// numbered is the builder's version.numbered body as the indexer reads it.
type numbered struct {
Name string `json:"name"`
Kind string `json:"kind"`
Version string `json:"version"`
Tag string `json:"tag,omitempty"`
Fingerprint string `json:"fingerprint"`
Commit string `json:"commit,omitempty"`
Digest string `json:"digest,omitempty"`
Seat string `json:"seat,omitempty"`
}
// heardVersion reads one message of the consumer as a version, false for any other subject. A package's is kept in its
// series; one that does not decode is said and acknowledged; a write that fails is left unacknowledged, so the bus gives
// it again.
@@ -55,19 +40,6 @@ func heardVersion(ctx context.Context, ix *index.Indexer, m jetstream.Msg, logf
}
h = index.HeardVersion{Package: p.Name, Seat: seat, Version: p.Version, Tag: p.Tag, Commit: p.Commit, Digest: p.Digest,
Fingerprint: p.Fingerprint, GoModule: p.Module, Published: true}
case m.Subject() == numberedSubject:
var n numbered
if err := json.Unmarshal(m.Data(), &n); err != nil {
logf("%s holds what is no numbered, left: %v", m.Subject(), err)
_ = m.Ack()
return true
}
if n.Kind != "package" {
_ = m.Ack()
return true
}
h = index.HeardVersion{Package: n.Name, Seat: n.Seat, Version: n.Version, Tag: n.Tag, Commit: n.Commit, Digest: n.Digest,
Fingerprint: n.Fingerprint}
default:
return false
}
@@ -155,9 +155,9 @@ func TestManifestDeclarations(t *testing.T) { // 1238/AC1, 1444 (reads the build
}
// "Reads FORGE" is a consumes of the indexer's stream: the broker grants only buckets by reads (mesh-control
// internal/broker/state.go:62-93).
// The registry seats' published and the builder's numbered fill each package's series (DLV-I5, design 51 *The versions*).
// The registry seats' published fill each (§413: no consume of version.numbered) package's series (DLV-I5, design 51 *The versions*).
if want := []string{"go-package-registry.published", "mesh-build-go.toolchain.reported", "mesh-build-node.toolchain.reported", "mesh-delivery-assigner.views.assignments",
"mesh-delivery-builder.version.numbered", "mesh-delivery-checker.preview.written", "mesh-delivery-checker.try.ended", "mesh-delivery-checker.try.started", "mesh-delivery-checker.verdict", "mesh-delivery-forge-bridge.forge.**",
"mesh-delivery-checker.preview.written", "mesh-delivery-checker.try.ended", "mesh-delivery-checker.try.started", "mesh-delivery-checker.verdict", "mesh-delivery-forge-bridge.forge.**",
"mesh-delivery.source-moved", "npm-package-registry.published"}; !reflect.DeepEqual(sorted(m.Consumes), want) {
t.Errorf("consumes = %v, want %v", m.Consumes, want)
}
@@ -67,7 +67,6 @@
"mesh-build-go.toolchain.reported",
"mesh-build-node.toolchain.reported",
"mesh-delivery-assigner.views.assignments",
"mesh-delivery-builder.version.numbered",
"mesh-delivery-checker.preview.written",
"mesh-delivery-checker.try.ended",
"mesh-delivery-checker.try.started",