H-A-458 (1): compare a want's run with the have's only within its branch

A pipeline's key is <branch>.<source>, so every pipeline of a branch has its
own key, and comparing the whole key found no applied run for a stale want of
an older pipeline of the same branch (main.175 after main.180): it was
applied. settleOne now compares the branches, each key without its last
part; a want of another branch still replaces whatever stands. Rows with real
keys: feat.10 applied, feat.9 refused and said, main.5 applied, the have
naming run 5 of main.5.

Review round 2, finding: the whole pipeline key compared instead of its branch.

Builds: design 47 H2 §813 (1); H-A-429 (1), H-A-458 (1)
This commit is contained in:
2026-11-22 03:13:15 +01:00
parent a9d41d44ec
commit 876bf45223
3 changed files with 22 additions and 11 deletions
+6 -5
View File
@@ -394,12 +394,13 @@ func testAWantAndItsCompositionApplyTheModuleAndTheHaveNamesBoth(t *testing.T) {
if got := len(b.appliedList()) - before; got != 0 {
t.Errorf("a want of run 10 after a have of run 20: applied %d times, want none", got)
}
// H-A-429 (1), H-A-458 (1): a want's run is compared with the have's only within one pipeline: a lower run of another
// pipeline replaces what stands, and the have keeps that pipeline beside its run; a lower run of the same is refused.
// H-A-429 (1), H-A-458 (1): a want's run is compared with the have's only within one branch, a pipeline's key being
// <branch>.<source>: a lower run of another branch replaces what stands, and the have keeps its pipeline beside its
// run; a lower run of an older pipeline of the same branch is refused.
for _, row := range []struct {
fp, run, pipeline string
applied int
}{{"7", "10", "feat.mesh-host", 1}, {"8", "9", "feat.mesh-host", 0}} {
}{{"7", "10", "feat.10", 1}, {"8", "9", "feat.9", 0}, {"b", "5", "main.5", 1}} {
before := len(b.appliedList())
fpr := fpOf(row.fp)
ckr, crawr, digr := composition(t, "web", fpr, false, archive("a", d2))
@@ -412,8 +413,8 @@ func testAWantAndItsCompositionApplyTheModuleAndTheHaveNamesBoth(t *testing.T) {
t.Errorf("a want of run %s of pipeline %s: applied %d times, want %d", row.run, row.pipeline, got, row.applied)
}
}
if h := b.haves.last("web"); h.Run != "10" || h.Pipeline != "feat.mesh-host" {
t.Errorf("the have names run %q of pipeline %q, want run 10 of feat.mesh-host", h.Run, h.Pipeline)
if h := b.haves.last("web"); h.Run != "5" || h.Pipeline != "main.5" {
t.Errorf("the have names run %q of pipeline %q, want run 5 of main.5", h.Run, h.Pipeline)
}
b.mu.Lock()
said := strings.Join(b.said, "\n")