From 90f53608bc497e30711baf7966aff32be3ada235 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 04:43:10 +0100 Subject: [PATCH] B-src (in progress): the builder reads no source stamp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A module value carries no source stamp (C1d): ModuleOf takes none from the entry's inputs, a build's claim is numbered per fingerprint naming no source revision and no merge, and the log's started entry names none. The seat list's parts take no callers and resolve no caller's holder (mesh-sdk's NewPart without callers, SDK-C). internal/... is green; cmd/mesh-delivery-builder still hears manifest-accepted (names.go:21, versions.go:192, module.json:57), which the seat mesh-catalog no longer defines: its floor's wake is H-A-49's, asked of the lead. Builds: design 47 H §764 (the indexer: the field pull, the source numbering); lead answers H-A-48, H-A-66 (hq f599b761) Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy --- .../cmd/mesh-delivery-builder-tools/main.go | 5 ++--- .../cmd/mesh-delivery-builder/integration_test.go | 2 +- .../cmd/mesh-delivery-builder/main.go | 4 ++-- .../cmd/mesh-delivery-builder/seatlist.go | 9 +++------ .../internal/build/entry_test.go | 9 +++++++-- .../mesh-delivery-builder/internal/build/numbers.go | 10 +++------- modules/mesh-delivery-builder/internal/build/run.go | 11 +++++------ 7 files changed, 23 insertions(+), 27 deletions(-) diff --git a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder-tools/main.go b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder-tools/main.go index bfc658dc..37a94c66 100644 --- a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder-tools/main.go +++ b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder-tools/main.go @@ -408,9 +408,8 @@ func main() { pk.Start(context.Background()) // The build modules are no names (design 47 G A-82): the build seats on the seat list, each held by the module the catalog // half's manifests say; the seat list and its two tools wired once by mesh-sdk (§204). - // Its callers name seats, never a module, resolved from the seat-holders view the catalog half's claimant serves (A-295, A-298). - gate := seatlist.NewPart("builder", []string{stdio.AnyPerson, stdio.CallerSeatPrefix + "node-tool-runner", stdio.CallerSeatPrefix + "mesh-healers"}) - gate.Holders(branches.SeatHolders(context.Background())) + // Its tools are open to every caller, so the part resolves no caller's seat to its holder (design 47 H H-A-66). + gate := seatlist.NewPart("builder") go func() { <-stdio.Served() gate.Follow(seatlist.StdioBus(), nil, func(f string, a ...any) { fmt.Fprintf(os.Stderr, "[mesh-delivery-builder-tools] "+f+"\n", a...) }) diff --git a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/integration_test.go b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/integration_test.go index d7760233..58afc2be 100644 --- a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/integration_test.go +++ b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/integration_test.go @@ -414,7 +414,7 @@ func (b *bed) manifestOf(t *testing.T, fixture string) map[string]any { // entry is the catalog graph entry of a module as the holder answers it. func (b *bed) entry(name, path, at, fp2, digest string, manifest map[string]any, toolchains map[string]builds.ToolchainUsed, src uint64) meshcatalog.CatalogEntry { return meshcatalog.CatalogEntry{Module: name, Repository: "novox/mesh-catalog", Commit: at, Fp: fp2, Path: path, ManifestDigest: digest, Manifest: manifest, - Inputs: &meshcatalog.EntryInputs{Toolchains: build.CatalogToolchains(toolchains), Src: int64(src)}} + Inputs: &meshcatalog.EntryInputs{Toolchains: build.CatalogToolchains(toolchains)}} } // archive writes modules. as the real indexer does for a module of an archive only: its fingerprint names no diff --git a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/main.go b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/main.go index d813037b..3ec551b5 100644 --- a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/main.go +++ b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/main.go @@ -121,9 +121,9 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro // The part's own buckets are `_` of the credential's module (design 47 G A-296). own := ownBucketsOf(cred.Module) seatGate := newSeatGate() - // The part's one holder function (A-298): the seat list's callers and the views found by their seat (§717) read it. + // The part's one holder function (A-298): the views found by their seat (§717) read it; the seat list names no callers + // (design 47 H H-A-66). holders := branches.SeatHolders(ctx) - seatGate.Holders(holders) seats := buildrun.NewBuildSeats(seatGate.definitions, versions.HolderOf(branches)) bound := defaultStepBound if v := strings.TrimSpace(getenv("MESH_BUILDER_STEP_BOUND")); v != "" { diff --git a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/seatlist.go b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/seatlist.go index 73afe11a..8c4f963b 100644 --- a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/seatlist.go +++ b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/seatlist.go @@ -3,20 +3,17 @@ package main import ( "git.novox.be/novox/mesh-sdk/go/seatdef" "git.novox.be/novox/mesh-sdk/go/seatlist" - - stdio "git.novox.be/novox/mesh-sdk/go" ) // The builder reads the seat list as every part does, through mesh-sdk's one wiring (go/seatlist.Part; design 47 G §204): its // definitions name the build seats (the seats whose acting rule is the step build), its tools `builder_seat_list` and -// `builder_seat_list_again`. A call through the mesh MCP server is proved only as its machine's tool runner (issue 627). The -// list names seats, never a module, resolved by the holder function meshcatalogclient's SeatHolders answers (A-295, A-298). -var seatListAgainCallers = []string{stdio.AnyPerson, stdio.CallerSeatPrefix + "node-tool-runner", stdio.CallerSeatPrefix + "mesh-healers"} +// `builder_seat_list_again`, open to every caller (design 47 H H-A-66). The list names seats, never a module, resolved by the +// holder function meshcatalogclient's SeatHolders answers (A-295, A-298). // seatGate is the builder's wiring of the seat list. type seatGate struct{ *seatlist.Part } -func newSeatGate() *seatGate { return &seatGate{seatlist.NewPart("builder", seatListAgainCallers)} } +func newSeatGate() *seatGate { return &seatGate{seatlist.NewPart("builder")} } // definitions are the seat definitions the list holds, none before it is read. func (g *seatGate) definitions() map[string]seatdef.Definition { diff --git a/modules/mesh-delivery-builder/internal/build/entry_test.go b/modules/mesh-delivery-builder/internal/build/entry_test.go index dbf0432e..5ccbf04f 100644 --- a/modules/mesh-delivery-builder/internal/build/entry_test.go +++ b/modules/mesh-delivery-builder/internal/build/entry_test.go @@ -13,15 +13,20 @@ import ( func TestAnEntryOfTheCatalogHalfIsTheFormTheBuilderBuildsBy(t *testing.T) { e := meshcatalog.CatalogEntry{Module: "netcheck", Repository: "novox/mesh-catalog", Path: "modules/netcheck", Commit: "abc", Fp: "src2:f", ManifestDigest: "sha256:m", Bases: []string{"base"}, Packages: map[string]string{"p": "1"}, Needs: []string{"n"}, - Inputs: &meshcatalog.EntryInputs{Src: 7, Toolchains: map[string]meshcatalog.ToolchainUsed{"go": {Version: "go1", Recipe: "1"}}, + Inputs: &meshcatalog.EntryInputs{Toolchains: map[string]meshcatalog.ToolchainUsed{"go": {Version: "go1", Recipe: "1"}}, Paths: map[string][]string{"lib": {"a/b", "c"}}}} got := ModuleOf(e) - if got.Fp2 != "src2:f" || got.Manifest != "m" || got.Path != "modules/netcheck" || got.Commit != "abc" || got.Src != 7 || + if got.Fp2 != "src2:f" || got.Manifest != "m" || got.Path != "modules/netcheck" || got.Commit != "abc" || got.Toolchains["go"].Version != "go1" || got.Packages["p"] != "1" || !reflect.DeepEqual(got.Needs, []string{"n"}) || got.Inputs2 == nil || !reflect.DeepEqual(got.Inputs2.Bases, []string{"base"}) || !reflect.DeepEqual(got.Inputs2.Paths, map[string]string{"a/b": "lib", "c": "lib"}) { t.Errorf("ModuleOf = %+v", got) } + // A module value carries no source stamp (design 47 H H-A-48): its claim is numbered per fingerprint, naming no source + // revision and no merge. + if c := ClaimOf("netcheck", got, Plan{}); c.Revision != "" || c.Merge != 0 || c.Fingerprint != "src2:f" { + t.Errorf("ClaimOf = %+v", c) + } if bare := ModuleOf(meshcatalog.CatalogEntry{Module: "m"}); bare.Inputs2 != nil || bare.Fp2 != "" { t.Errorf("ModuleOf of an entry with none = %+v, want nothing set", bare) } diff --git a/modules/mesh-delivery-builder/internal/build/numbers.go b/modules/mesh-delivery-builder/internal/build/numbers.go index 9200129a..2aeefc0e 100644 --- a/modules/mesh-delivery-builder/internal/build/numbers.go +++ b/modules/mesh-delivery-builder/internal/build/numbers.go @@ -6,7 +6,6 @@ import ( "fmt" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshbuilds" "git.novox.be/novox/mesh-sdk/go/catalogue" - "strconv" "strings" "time" @@ -30,14 +29,11 @@ type VersionNumbers struct { N *versions.Numberer } -// ClaimOf is the claim a module value's trunk build is numbered by: a package per source revision (Src), the rest per -// fingerprint, in merge order (Src). +// ClaimOf is the claim a module value's trunk build is numbered by, per fingerprint: a module value carries no source stamp +// (design 47 H H-A-48), so the claim names no source revision and no merge. func ClaimOf(module string, m meshcatalog.ModulesByModuleValue, plan Plan) versions.BuildClaim { c := versions.BuildClaim{Module: module, Path: m.Path, Repository: trunk.RepositoryName(m.Repository), Fingerprint: m.Fp2, - Commit: m.Commit, Merge: uint64(m.Src)} - if uint64(m.Src) != 0 { - c.Revision = strconv.FormatUint(uint64(m.Src), 10) - } + Commit: m.Commit} for _, t := range plan.Tasks { c.Artifacts = append(c.Artifacts, versions.ClaimArtifact{Artifact: t.Artifact, Kind: t.Kind, Language: t.Language}) } diff --git a/modules/mesh-delivery-builder/internal/build/run.go b/modules/mesh-delivery-builder/internal/build/run.go index 9b923a6a..fcabe73a 100644 --- a/modules/mesh-delivery-builder/internal/build/run.go +++ b/modules/mesh-delivery-builder/internal/build/run.go @@ -9,7 +9,6 @@ import ( "maps" "slices" "sort" - "strconv" "strings" "sync" "time" @@ -266,7 +265,7 @@ func (b *Builder) take(ctx context.Context, o Origin, key string, m meshcatalog. } // ModuleOf is a catalog entry in the form the builder builds by: its fingerprint, manifest digest, source (repository, -// directory, commit, the source revision it was taken in at), the toolchains its fingerprint was computed with, the bases it is +// directory, commit; no source stamp, design 47 H H-A-48), the toolchains its fingerprint was computed with, the bases it is // built against, its packages and needs, and the named paths of its artifacts. func ModuleOf(e meshcatalog.CatalogEntry) meshcatalog.ModulesByModuleValue { m := meshcatalog.ModulesByModuleValue{Repository: e.Repository, Path: e.Path, Commit: e.Commit, Fp2: e.Fp, None2: e.None, @@ -275,7 +274,7 @@ func ModuleOf(e meshcatalog.CatalogEntry) meshcatalog.ModulesByModuleValue { m.Inputs2 = &meshcatalog.ModulesByModuleValueInputs2{Bases: e.Bases} } if in := e.Inputs; in != nil { - m.Src, m.Toolchains, m.Problems = in.Src, in.Toolchains, in.Problems + m.Toolchains, m.Problems = in.Toolchains, in.Problems if len(in.Paths) > 0 { if m.Inputs2 == nil { m.Inputs2 = &meshcatalog.ModulesByModuleValueInputs2{} @@ -1217,15 +1216,15 @@ func (b *Builder) logBuild(e builds.BuildLogEntry) { b.Log(e) } -// LogStarted is the log's entry of a build of module's fingerprint starting (ADR 0571 §1): the module, the fingerprint, the -// source revision, where it is built from (repository, directory, commit, the candidate's ref), the node of the builder +// LogStarted is the log's entry of a build of module's fingerprint starting (ADR 0571 §1): the module, the fingerprint (no +// source stamp, design 47 H H-A-48), where it is built from (repository, directory, commit, the candidate's ref), the node of the builder // that asked it and the time. func LogStarted(module string, m meshcatalog.ModulesByModuleValue, ref, by string, at time.Time) builds.BuildLogEntry { dir := m.Path if dir == "" { dir = meshcatalogclient.RootPath } - return builds.BuildLogEntry{Event: builds.BuildStartedEvent, Module: module, FP: m.Fp2, Source: strconv.FormatUint(uint64(m.Src), 10), + return builds.BuildLogEntry{Event: builds.BuildStartedEvent, Module: module, FP: m.Fp2, Repository: m.Repository, Directory: dir, Commit: m.Commit, Ref: ref, Node: by, At: at.UTC()} }