Relate a batch whose moves are not known to every change
mesh/merge-gate pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without …
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered

The review found that a merge kept without its moves, judged again at
the cut, gave its batch no modules, so it could read as unrelated to a
walk it will build beside. An unknown change is never unrelated.
This commit is contained in:
2026-10-12 02:06:54 +02:00
parent 96005a8bfd
commit 9460689fff
2 changed files with 33 additions and 2 deletions
+18
View File
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"strings"
"testing"
"github.com/novox/mesh-controller/internal/inventory"
@@ -90,3 +91,20 @@ func TestFootprintOfBatchWidensToDependents(t *testing.T) {
t.Errorf("footprint = %+v; want base-image and nzbget, no head", f)
}
}
// A batch holding a merge kept with no moves (one owed a later look, judged again at the cut) is related to
// every change, in both orders: what it will move is not known, and an unknown change is never unrelated
// (issue 525 review).
func TestABatchWhoseMovesAreNotKnownIsRelatedToEverything(t *testing.T) {
unknown := footprintOfBatch([]inventory.BatchedMerge{heardMerge("novox/one", "fix/a", "app"), heardMerge("novox/two", "fix/b")}, nil)
other := footprintOfWalk(walkOf("novox/three", "nzbget"), nil)
for _, pair := range [][2]footprint{{unknown, other}, {other, unknown}} {
if ok, why := related(pair[0], pair[1], nil); !ok || !strings.Contains(why, "not known") {
t.Fatalf("an unknown batch read as %v (%q)", ok, why)
}
}
known := footprintOfBatch([]inventory.BatchedMerge{heardMerge("novox/one", "fix/a", "app")}, nil)
if ok, why := related(known, other, nil); ok {
t.Fatalf("a known, unrelated batch read as related: %q", why)
}
}