Keep a walk's withheld modules on its record, name every machine a stopped send reached, and list the stop's store tests (review of #232)
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 fail: its merge-check.sh failed: 3 store test(s) listed in testdata/store-tests did not run and pass against the store
mesh/delivery-group group feat/459-a-stop-re-walks-the-others rejected: a member's own check failed
mesh/delivery superseded: a newer head of the same pull request

This commit is contained in:
2026-10-11 20:25:20 +02:00
parent 5446be1abb
commit 201bd28278
5 changed files with 47 additions and 3 deletions
+3
View File
@@ -768,6 +768,7 @@ func planBatch(ctx context.Context, open *stores, batch *inventory.Plan, carry [
} }
sort.Strings(also) sort.Strings(also)
ordered := groupOrderEdges(members, entries, read, edges) ordered := groupOrderEdges(members, entries, read, edges)
var withheld []string
plan := planOfMoves(moved, append(append([]inventory.Edge{}, edges...), ordered...)) plan := planOfMoves(moved, append(append([]inventory.Edge{}, edges...), ordered...))
// **Withheld, a stopped merge's modules** (novox/hq ADR 0299): a module is built at its branch, which holds the // **Withheld, a stopped merge's modules** (novox/hq ADR 0299): a module is built at its branch, which holds the
// merge a stop left out of the walk these merges were walked again from — built here only as a dependent, it // merge a stop left out of the walk these merges were walked again from — built here only as a dependent, it
@@ -775,6 +776,7 @@ func planBatch(ctx context.Context, open *stores, batch *inventory.Plan, carry [
// and the stop named it. // and the stop named it.
if batch.Delivery != nil && batch.Delivery.Batch != nil { if batch.Delivery != nil && batch.Delivery.Batch != nil {
if out := withhold(&plan, batch.Delivery.Batch.Withheld, moved); len(out) > 0 { if out := withhold(&plan, batch.Delivery.Batch.Withheld, moved); len(out) > 0 {
withheld = out
fmt.Printf(" withheld, a stopped merge's modules built only as dependents: %s\n", strings.Join(out, ", ")) fmt.Printf(" withheld, a stopped merge's modules built only as dependents: %s\n", strings.Join(out, ", "))
} }
} }
@@ -788,6 +790,7 @@ func planBatch(ctx context.Context, open *stores, batch *inventory.Plan, carry [
} }
plan.Delivery.Merges = named plan.Delivery.Merges = named
plan.Delivery.Alone = batch.Delivery != nil && batch.Delivery.Alone plan.Delivery.Alone = batch.Delivery != nil && batch.Delivery.Alone
plan.Delivery.Withheld = withheld
// **Its moments and its class** (novox/hq ADR 0282 decision 6): measured, never acted on. // **Its moments and its class** (novox/hq ADR 0282 decision 6): measured, never acted on.
plan.Times = walkTimesAtCut(*batch, plan, entries, now) plan.Times = walkTimesAtCut(*batch, plan, entries, now)
if len(moved) == 0 { if len(moved) == 0 {
+16 -3
View File
@@ -191,7 +191,15 @@ func stopWalkWithout(ctx context.Context, inv *inventory.Inventory, id, by, why
if batch { if batch {
return p, said, stopInBatch(ctx, inv, &p, merges, again, &said, stopped, now) return p, said, stopInBatch(ctx, inv, &p, merges, again, &said, stopped, now)
} }
said.Kept = keptOf(p, movesOf(again)) entries, err := inv.Catalogued(ctx)
if err != nil {
return p, said, err
}
running := map[string][]string{}
for _, e := range entries {
running[e.Manifest.Module] = e.On
}
said.Kept = keptOf(p, movesOf(again), running)
stopped(&p) stopped(&p)
p.Delivery.Kept = said.Kept p.Delivery.Kept = said.Kept
if len(again) == 0 { if len(again) == 0 {
@@ -413,8 +421,10 @@ func movesOf(merges []inventory.BatchedMerge) []string {
} }
// keptOf are the modules a stopped walk sent that no merge walked again moves, and the machines each reached: // keptOf are the modules a stopped walk sent that no merge walked again moves, and the machines each reached:
// those keep running the stopped walk's build. // those keep running the stopped walk's build. A module sent to its first machines reached those, and the rest it
func keptOf(p inventory.Plan, walkedAgain []string) []inventory.PlanKept { // was sent to after them; one sent with no first machine (its policy sends it to all together, or a later tier is
// built by it) reached every machine running it.
func keptOf(p inventory.Plan, walkedAgain []string, running map[string][]string) []inventory.PlanKept {
var out []inventory.PlanKept var out []inventory.PlanKept
for name, m := range p.Modules { for name, m := range p.Modules {
if m == nil || slices.Contains(walkedAgain, name) { if m == nil || slices.Contains(walkedAgain, name) {
@@ -424,6 +434,9 @@ func keptOf(p inventory.Plan, walkedAgain []string) []inventory.PlanKept {
if m.FirstAt != nil || m.SentAt != nil { if m.FirstAt != nil || m.SentAt != nil {
machines = union(machines, m.First) machines = union(machines, m.First)
} }
if m.SentAt != nil && len(m.First) == 0 {
machines = union(machines, running[name])
}
if m.Gate != nil && m.Gate.Since != nil { if m.Gate != nil && m.Gate.Since != nil {
machines = union(machines, m.Gate.Machines) machines = union(machines, m.Gate.Machines)
} }
+19
View File
@@ -391,3 +391,22 @@ func TestSavingPlansAndMovingMergesIsOneAct(t *testing.T) {
t.Fatalf("the merge moved to %q though the act was refused", m.Plan) t.Fatalf("the merge moved to %q though the act was refused", m.Plan)
} }
} }
// What a stopped walk leaves on the machines names every machine its sends reached (review of #232): a module sent
// with no first machine reached every machine running it; one sent first reached those, and the rest it was sent
// to; a module a merge walked again moves is sent again, and is not named.
func TestKeptNamesEveryMachineASendReached(t *testing.T) {
at := t0
p := inventory.Plan{Modules: map[string]*inventory.PlanModule{
"together": {SentAt: &at},
"first": {First: []string{"anchor"}, FirstAt: &at, Rest: map[string]inventory.SentDeclaration{"laptop": {}}},
"again": {SentAt: &at},
"unsent": {},
}}
got := keptOf(p, []string{"again"}, map[string][]string{"together": {"laptop", "anchor"}, "again": {"anchor"}})
want := []inventory.PlanKept{{Module: "first", Machines: []string{"anchor", "laptop"}},
{Module: "together", Machines: []string{"anchor", "laptop"}}}
if !reflect.DeepEqual(got, want) {
t.Fatalf("kept %+v; want %+v", got, want)
}
}
+3
View File
@@ -201,6 +201,9 @@ type PlanDelivery struct {
// Kept are the modules the stopped walk already sent and nothing walks again: the machines named keep running // Kept are the modules the stopped walk already sent and nothing walks again: the machines named keep running
// the stopped walk's build (novox/hq ADR 0299). // the stopped walk's build (novox/hq ADR 0299).
Kept []PlanKept `json:"kept,omitempty"` Kept []PlanKept `json:"kept,omitempty"`
// Withheld are, on a walk cut from a batch a stop walked merges again in, the modules it did not build: a
// stopped merge moves them, and built only as dependents at the branch they would deliver it (ADR 0299).
Withheld []string `json:"withheld,omitempty"`
// Batch is the window of a batch; nil once it is cut into a walk. // Batch is the window of a batch; nil once it is cut into a walk.
Batch *PlanBatch `json:"batch,omitempty"` Batch *PlanBatch `json:"batch,omitempty"`
// Alone says the walk walks one merge on its own commit, after a failed walk carried it in a later one: // Alone says the walk walks one merge on its own commit, after a failed walk carried it in a later one:
+6
View File
@@ -1,3 +1,9 @@
# The tests that need the throwaway store and must have run against it (novox/hq issue 459): merge-check.sh runs # The tests that need the throwaway store and must have run against it (novox/hq issue 459): merge-check.sh runs
# each one named here, by package, and fails unless every one passed — a test that needs the store skips without # each one named here, by package, and fails unless every one passed — a test that needs the store skips without
# one, and a skip passes unseen. One per line: <package> <TestName>. Lines starting with # are said nothing of. # one, and a skip passes unseen. One per line: <package> <TestName>. Lines starting with # are said nothing of.
./cmd/mesh-controller TestAStopWithoutAMergeWalksTheOthersAgain
./cmd/mesh-controller TestAStopWithoutAMergeEndsTheMergesThatContainIt
./cmd/mesh-controller TestAStopWalksTheOthersAgainInTheOpenBatch
./cmd/mesh-controller TestAStopNamesWhatStaysOnTheMachinesAndWhatStillCarriesIt
./cmd/mesh-controller TestAStopWithoutAMergeLeavesItOutOfABatch
./cmd/mesh-controller TestSavingPlansAndMovingMergesIsOneAct