The builder says wait-held for a key queued behind a package, the package as its part and on (package:<ref>), on its stream waits, and wait-ended published once the key is claimed; a toolchain wait never ends by that, and a package wait never by a toolchain's end. Files: internal/build/waits.go (Package, On, WaitPublished), internal/build/run.go (Hold at the queued result, End at the claim), cmd/mesh-delivery-builder/waits.go (Part in the body, the End rule). Builds: design 47 G A-192, §499 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
22 lines
844 B
Go
22 lines
844 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"mesh-delivery-builder/internal/build"
|
|
)
|
|
|
|
// Design 47 G A-192: a key queued behind a package says its wait in the one wait form, the package as its `part` and `on`; a toolchain
|
|
// wait names none.
|
|
func TestAWaitBodyNamesItsPart(t *testing.T) {
|
|
w := &waitsKept{bound: time.Hour, held: map[string]build.ToolchainWait{}}
|
|
pkg := w.body(build.ToolchainWait{Module: "m", Fingerprint: "src2:f", Package: "@novox/sdk@0.1.15"}, "")
|
|
if pkg.Part != "@novox/sdk@0.1.15" || pkg.On != "package:@novox/sdk@0.1.15" || pkg.Step != waitStepBuilding {
|
|
t.Errorf("a package wait says %+v", pkg)
|
|
}
|
|
if tc := w.body(build.ToolchainWait{Module: "m", Fingerprint: "src2:f", Language: "go", Version: "go1.26.0"}, ""); tc.Part != "" || tc.On != "toolchain:go@go1.26.0" {
|
|
t.Errorf("a toolchain wait says %+v", tc)
|
|
}
|
|
}
|