Design 47 H2's corrections: movers carried beside a failed one, validate, acted lifetimes, publish asked again (issue 1984) #365

Merged
mesh-tools merged 156 commits from feat/47-H2-corrections into main 2026-11-25 20:11:50 +00:00
Showing only changes of commit 34c5cc9079 - Show all commits
@@ -360,6 +360,34 @@ func TestWatchmanWhole(t *testing.T) { // 1135/AC8
sayStep("step-ended", time.Now().UTC())
until("the step's end clears it", func() bool { return !finding(stepFinding) })
// H-A-617: a record open for over a day raises `record-open` and its end clears it; a second end of it (`ends` 2) raises and
// clears nothing. A later record's finding, heard after the second end on the one stream, shows the second end was taken.
recordSay := func(event, record, call string, ends int) {
t.Helper()
body := fmt.Sprintf(`{"record":%q,"milestone":"main.42","branch":"main","source":42,"call":%q,"ends":%d,"at":%q}`, record, call, ends,
time.Now().UTC().Add(-25*time.Hour).Format(time.RFC3339))
subject := "mesh.seat.mesh-delivery.event." + event
if event == "record-opened" {
subject += "." + call
}
if _, err := js.Publish(ctx, subject, []byte(body)); err != nil {
t.Fatal(err)
}
}
recordFinding := func(record string) bool {
return finding(watch.FindingKey(watch.ScopeDelivery, record, watch.KindRecordOpen))
}
recordSay("record-opened", "r-first", "aaaaaaaaaaaaaaaa", 0)
until("the record open for over a day", func() bool { return recordFinding("r-first") })
recordSay("record-ended", "r-first", "aaaaaaaaaaaaaaaa", 1)
until("the record's end clears it", func() bool { return !recordFinding("r-first") })
recordSay("record-ended", "r-first", "aaaaaaaaaaaaaaaa", 2)
recordSay("record-opened", "r-second", "bbbbbbbbbbbbbbbb", 0)
until("the next record open for over a day", func() bool { return recordFinding("r-second") })
if recordFinding("r-first") {
t.Error("a second end of a cleared record raised its finding again")
}
// A step the runner's stands named at the start (seeded through the seat verb) and that no progress follows is
// `pipeline-stands`; the approval waiting on a person is owed none.
seeded := func(step string) string {