From d4e29a07b23d555985c4d9d7517114a9973d7af9 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 22:46:08 +0100 Subject: [PATCH] LOCKS (A-56): the locks check counts the mesh's own @novox/mesh-* packages as it counts the SDK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A module naming only the mesh's packages beyond typescript and the types needs no lock (gitea names the contracts' git and mesh-catalog packages); a row in the first test fails without the change, as does the catalogue's own run. Builds: design 47 G A-56, ADR 0469 ยง5 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- checks/locks/main.go | 9 +++++++-- checks/locks/main_test.go | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/checks/locks/main.go b/checks/locks/main.go index e0b5c5829..fb9c6b651 100644 --- a/checks/locks/main.go +++ b/checks/locks/main.go @@ -5,7 +5,8 @@ // go run . // // Exits 1 on a finding. The packages that count are those the build module counts (mesh-build-node fetch.go -// ownDependencies): the `dependencies` beyond the SDK, typescript and the @types packages. +// ownDependencies): the `dependencies` beyond the mesh's own packages (@novox/mesh-*, the SDK among them), typescript and the +// @types packages. package main import ( @@ -17,6 +18,10 @@ import ( "strings" ) +// meshPackages is the prefix of every package the mesh itself publishes: the build module's toolchain and the mesh's registry +// give them, as they give the SDK, so a module naming only them needs no lock (design 47 G A-56). +const meshPackages = "@novox/mesh-" + // Finding is one module refused: it names Packages beyond the SDK and has no lock file. type Finding struct { Module string @@ -70,7 +75,7 @@ func Check(root string) ([]Finding, error) { } var names []string for n := range pkg.Dependencies { - if n != "@novox/mesh-sdk" && n != "typescript" && !strings.HasPrefix(n, "@types/") { + if !strings.HasPrefix(n, meshPackages) && n != "typescript" && !strings.HasPrefix(n, "@types/") { names = append(names, n) } } diff --git a/checks/locks/main_test.go b/checks/locks/main_test.go index 11aab626d..6ab888974 100644 --- a/checks/locks/main_test.go +++ b/checks/locks/main_test.go @@ -35,6 +35,8 @@ func TestAModuleNamingOnlyTheSDKNeedsNoLock(t *testing.T) { root := t.TempDir() module(t, root, "plain", "typescript", sdkOnly, false) module(t, root, "none", "typescript", "", false) + // The mesh's own packages count as the SDK does (design 47 G A-56): a contracts package needs no lock. + module(t, root, "contracts", "typescript", `{"dependencies":{"@novox/mesh-sdk":"^0.1.1","@novox/mesh-delivery-contracts-git":"^0.1.0"}}`, false) got, err := Check(root) if err != nil || len(got) != 0 { t.Fatalf("%v %v", got, err)