Merge branch 'feat/47-H2-corrections-a' into feat/47-H2-corrections-b

This commit is contained in:
2026-11-25 18:31:16 +01:00
147 changed files with 3903 additions and 475 deletions
@@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa
if err := json.Unmarshal(raw, &a); err != nil {
return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err)
}
return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil
opened := parts.Opened{Held: a.Held, Lacks: a.Lacks}
if a.OtherBytes != nil {
opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint}
}
return opened, nil
}
chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error {
raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part,
@@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa
if err := json.Unmarshal(raw, &a); err != nil {
return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err)
}
return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil
opened := parts.Opened{Held: a.Held, Lacks: a.Lacks}
if a.OtherBytes != nil {
opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint}
}
return opened, nil
}
chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error {
raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part,
@@ -14,6 +14,7 @@ import (
seat "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/sourcebranches"
"git.novox.be/novox/mesh-sdk/go/busretry"
"git.novox.be/novox/mesh-sdk/go/seatlist"
"git.novox.be/novox/mesh-sdk/go/views"
)
@@ -403,6 +404,7 @@ func TestSeatHoldersFollowsTheClaimantOfTheAssignerSeat(t *testing.T) {
t.Fatalf("holders = %v, want %s", got, want)
}
}
nodes := b.SeatHolderNodes(ctx) // the same followed view, each holder with its node (design 47 H2 H-A-742)
main, _ := w.get("mesh-catalog.catalog-revisions.main")
seats.mu.Lock()
seats.trunk = claims(1, "asg-a")
@@ -411,6 +413,9 @@ func TestSeatHoldersFollowsTheClaimantOfTheAssignerSeat(t *testing.T) {
t.Fatal(err)
}
answered("asg-a", "node-tools")
if got := nodes("node-tool-runner"); !slices.Equal(got, []seatlist.HolderNode{{Module: "node-tools", Node: "anchor"}}) {
t.Fatalf("holder nodes = %v, want node-tools on anchor", got)
}
seats.mu.Lock()
seats.trunk = claims(2, "asg-b")
seats.mu.Unlock()
@@ -99,25 +99,43 @@ type seatHolders struct {
// follows the new one's (§532); with no claimant it keeps what it has. Nothing is asked on a timer. The part's manifest consumes
// `seat:mesh-module-assigner.views.seat-holders`. A Wiring that follows no plain view answers no holders, said in the log.
func (b *Branches) SeatHolders(ctx context.Context) func(seat string) []string {
sh := &seatHolders{kick: make(chan struct{}, 1)}
b.holders.Store(sh)
fw, ok := b.w.(viewFollowing)
if !ok {
b.logf("meshcatalogclient: this part's reader follows no plain view, so no seat's holders are known")
} else {
go func() {
for {
select {
case <-ctx.Done():
return
case <-sh.kick:
}
b.refollow(sh, fw)
return seatlist.HoldersIn(b.followHolders(ctx))
}
// SeatHolderNodes is SeatHolders answering each holder of a seat with its module and its node, over the same followed view's values
// through seatlist.HolderNodesIn, so no module reads the view's keys itself (design 47 H2 H-A-742). It follows the view as
// SeatHolders does: a part calls one of them, or both, and the view is followed once.
func (b *Branches) SeatHolderNodes(ctx context.Context) func(seat string) []seatlist.HolderNode {
return seatlist.HolderNodesIn(b.followHolders(ctx))
}
// followHolders starts the follow of the claimant's seat-holders view, once, and is the view's values as it holds them now.
func (b *Branches) followHolders(ctx context.Context) func() (map[string]json.RawMessage, error) {
sh := b.holders.Load()
if sh == nil {
sh = &seatHolders{kick: make(chan struct{}, 1)}
if !b.holders.CompareAndSwap(nil, sh) {
sh = b.holders.Load()
} else {
fw, ok := b.w.(viewFollowing)
if !ok {
b.logf("meshcatalogclient: this part's reader follows no plain view, so no seat's holders are known")
} else {
go func() {
for {
select {
case <-ctx.Done():
return
case <-sh.kick:
}
b.refollow(sh, fw)
}
}()
sh.changed()
}
}()
sh.changed()
}
}
return seatlist.HoldersIn(func() (map[string]json.RawMessage, error) {
return func() (map[string]json.RawMessage, error) {
sh.mu.Lock()
values := sh.values
sh.mu.Unlock()
@@ -125,7 +143,7 @@ func (b *Branches) SeatHolders(ctx context.Context) func(seat string) []string {
return nil, nil
}
return values(), nil
})
}
}
// changed asks the follow to read the claimant again, without blocking the caller (a view's change is told under its lock).
@@ -56,6 +56,20 @@ const RevertLive = seat.WantsByWantNodeModuleValueRevertLive
// want:version: it awaits its hand placement (design 47 H §772, H-A-73). Beside a put it is the one held want.
const HoldAwaitsHandPlacement = "awaits-hand-placement"
// HoldAwaitsReadsPrefix begins the words of a want the assigner holds for a reader capability the node's node-engine does
// not state, followed by the missing capabilities (design 47 H2 H-A-682 (2), H-A-706 (DMC-14)).
const HoldAwaitsReadsPrefix = "awaits-reads:"
// HoldAwaitsEntryPrefix begins the words of a want the assigner holds until the catalog entry of its fingerprint is read,
// followed by the fingerprint (design 47 H2 H-A-698 (2), H-A-706 (DMC-14)).
const HoldAwaitsEntryPrefix = "awaits-entry:"
// holdWords says whether words are a held want's other than a put's: awaiting its hand placement, or beginning with one of
// the two prefixes.
func holdWords(words string) bool {
return words == HoldAwaitsHandPlacement || strings.HasPrefix(words, HoldAwaitsReadsPrefix) || strings.HasPrefix(words, HoldAwaitsEntryPrefix)
}
// NodeWord is the last part of a node's own key.
const NodeWord = "node"
@@ -182,8 +196,8 @@ func checkWant(w Want) error {
}
return nil
}
if w.Hold && !w.Put && w.Words != HoldAwaitsHandPlacement {
return fmt.Errorf("wants: only a put, or a want awaiting its hand placement (%s), holds a want", HoldAwaitsHandPlacement)
if w.Hold && !w.Put && !holdWords(w.Words) {
return fmt.Errorf("wants: only a put, or a want awaiting its hand placement (%s), its reads (%s) or its entry (%s), holds a want", HoldAwaitsHandPlacement, HoldAwaitsReadsPrefix, HoldAwaitsEntryPrefix)
}
if err := checkFingerprint(w.Fp, "a want's fingerprint"); err != nil {
return err
@@ -45,6 +45,9 @@ func TestWantsAreWhatTheEarlierCodecWrote(t *testing.T) {
"a placement's build": {Want{Fp: a, Version: "0.1.14"}, `{"v":1,"fp":"` + a + `","version":"0.1.14"}`},
// design 47 H §772, H-A-73: a node whose node-engine reads no want by version is held, awaiting its hand placement.
"awaits its hand placement": {Want{Fp: a, Version: "0.1.15", Pipeline: "main.3589", Rank: 1, Hold: true, Words: HoldAwaitsHandPlacement}, `{"v":1,"fp":"` + a + `","version":"0.1.15","pipeline":"main.3589","rank":1,"hold":true,"words":"awaits-hand-placement"}`},
// design 47 H2 H-A-682 (2), H-A-698 (2), H-A-706 (DMC-14): held for a reader capability the engine does not state, or for an entry not read yet.
"awaits its reads": {Want{Fp: a, Version: "0.1.15", Hold: true, Words: HoldAwaitsReadsPrefix + "directory-contents-owner"}, `{"v":1,"fp":"` + a + `","version":"0.1.15","hold":true,"words":"awaits-reads:directory-contents-owner"}`},
"awaits its entry": {Want{Fp: a, Version: "0.1.15", Hold: true, Words: HoldAwaitsEntryPrefix + a}, `{"v":1,"fp":"` + a + `","version":"0.1.15","hold":true,"words":"awaits-entry:` + a + `"}`},
} {
t.Run(name, func(t *testing.T) {
raw, err := EncodeWant(row.w)
@@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa
if err := json.Unmarshal(raw, &a); err != nil {
return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err)
}
return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil
opened := parts.Opened{Held: a.Held, Lacks: a.Lacks}
if a.OtherBytes != nil {
opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint}
}
return opened, nil
}
chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error {
raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part,
@@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa
if err := json.Unmarshal(raw, &a); err != nil {
return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err)
}
return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil
opened := parts.Opened{Held: a.Held, Lacks: a.Lacks}
if a.OtherBytes != nil {
opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint}
}
return opened, nil
}
chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error {
raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part,
@@ -13,7 +13,7 @@ const Seat = "container-image-registry"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 1
const Form = 2
// FormRegistry is the form of what the part registry adds.
const FormRegistry = 1
@@ -21,8 +21,8 @@ const FormRegistry = 1
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "1 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825"
generatedForms = "2 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825"
)
const (
@@ -329,6 +329,14 @@ const (
PublishInputKindUpstream = "upstream"
)
// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729).
type PublishAnswerOtherBytes struct {
// the digest the holder holds for that name and version
Digest string `json:"digest"`
// the fingerprint the holder keeps for it, absent where it keeps none
Fingerprint string `json:"fingerprint,omitempty"`
}
// PublishAnswer is what publish answers.
type PublishAnswer struct {
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
@@ -337,8 +345,10 @@ type PublishAnswer struct {
Held bool `json:"held,omitempty"`
// the digests of the parts the holder lacks, to send by publish-part
Lacks []string `json:"lacks,omitempty"`
// the transfer
Transfer string `json:"transfer"`
// the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729)
OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"`
// the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732)
Transfer string `json:"transfer,omitempty"`
}
// PublishPartInput is what publish-part takes.
@@ -57,6 +57,10 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v NameOfInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "name-of answers the copy's reference", subject: "", given: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", wire: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}",
decode: func(b []byte) (any, error) { var v NameOfAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
v, err := c.decode([]byte(c.given))
@@ -86,7 +86,7 @@ func VerbDescription(verb string) string {
case VerbNote:
return "Append one line to a commit's note under refs/notes/mesh-plan. The line carries the act's id, and an id the note already holds is skipped (held)."
case VerbMergePull:
return "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, its base a watched branch, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose repository has no watched branch is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery (H-A-471). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit."
return "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose base is no watched branch, whatever its repository, is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery, and merge-called leaves it out (H-A-471, H-A-704). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit."
case VerbTag:
return "Write the git tag of a released version, <directory>/vMAJOR.MINOR.PATCH for a Go package (design 47 H2 §796), at the commit its build was made from; the builder writes it only on the catalog's version-released (design 47 G section 370). A tag already at that commit is answered performed. An error answer carries error and error-kind."
}
@@ -229,12 +229,12 @@ type Call struct {
// CallMember is one member of a kept call.
type CallMember struct {
// the pull request's base, read at judging: a watched branch, but for a member noted as of a repository with no watched branch
// the pull request's base, read at judging: a watched branch, but for a member noted as one whose base is no watched branch
Branch string `json:"branch"`
// for merged, the merge commit
Commit string `json:"commit,omitempty"`
Head string `json:"head"`
// for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471)
// for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704)
Note string `json:"note,omitempty"`
Number int64 `json:"number"`
Repository string `json:"repository"`
@@ -298,7 +298,7 @@ type FailedStep struct {
type MemberOutcome struct {
// for merged, the merge commit; for a member refused already-merged, its commit
Commit string `json:"commit,omitempty"`
// for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471)
// for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704)
Note string `json:"note,omitempty"`
Number int64 `json:"number"`
Repository string `json:"repository"`
@@ -43,7 +43,7 @@ func TestFixtures(t *testing.T) {
}, subjectIs: nil},
{name: "a merge call kept", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}",
decode: func(b []byte) (any, error) { var v CallsByCallCallValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "a merge call kept with a member merged plainly, its repository having no watched branch", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}",
{name: "a merge call kept with a member merged plainly, its base being no watched branch", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}",
decode: func(b []byte) (any, error) { var v CallsByCallCallValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "pull asks", subject: "", given: "{\"merge-commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"repository\":\"novox/mesh-sdk\"}", wire: "{\"merge-commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"repository\":\"novox/mesh-sdk\"}",
decode: func(b []byte) (any, error) { var v PullInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
@@ -135,7 +135,7 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v MergePullInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "merge-pull answers the call and each member merged", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"merged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"merged\"}]}",
decode: func(b []byte) (any, error) { var v MergePullAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "merge-pull merges a member of a repository with no watched branch plainly, noted no delivery", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}",
{name: "merge-pull merges a member whose base is no watched branch plainly, noted no delivery", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}",
decode: func(b []byte) (any, error) { var v MergePullAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "merge-pull refuses every member when one is refused, naming why", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"refused\",\"why\":\"the head moved: cccccccccccccccccccccccccccccccccccccccc, not the named aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},{\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"refused\",\"why\":\"the head moved: cccccccccccccccccccccccccccccccccccccccc, not the named aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},{\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}]}",
decode: func(b []byte) (any, error) { var v MergePullAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
@@ -12,7 +12,7 @@ const Seat = "go-package-registry"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 1
const Form = 2
// FormRegistry is the form of what the part registry adds.
const FormRegistry = 1
@@ -20,8 +20,8 @@ const FormRegistry = 1
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "1 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9"
generatedForms = "2 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9"
)
const (
@@ -189,6 +189,14 @@ const (
PublishInputKindUpstream = "upstream"
)
// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729).
type PublishAnswerOtherBytes struct {
// the digest the holder holds for that name and version
Digest string `json:"digest"`
// the fingerprint the holder keeps for it, absent where it keeps none
Fingerprint string `json:"fingerprint,omitempty"`
}
// PublishAnswer is what publish answers.
type PublishAnswer struct {
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
@@ -197,8 +205,10 @@ type PublishAnswer struct {
Held bool `json:"held,omitempty"`
// the digests of the parts the holder lacks, to send by publish-part
Lacks []string `json:"lacks,omitempty"`
// the transfer
Transfer string `json:"transfer"`
// the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729)
OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"`
// the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732)
Transfer string `json:"transfer,omitempty"`
}
// PublishPartInput is what publish-part takes.
@@ -37,6 +37,10 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}",
decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
v, err := c.decode([]byte(c.given))
@@ -13,13 +13,13 @@ const Seat = "mesh-builds"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 3
const Form = 4
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "3"
generatedFieldsDigest = "AskTakenEvent=6d5d3da7ac39 BuildEntry=3c829a0a3d58 Dependency=90a32b07c563 DropAnswer=7538f2f5e68e PackagePublished=34dd069a6aab PackagePublishedEvent=8e12888c1559 PublishQueueAnswer=0f1326e35e17 PublishQueueAnswerCountsItem=b770db2f0920 PublishQueueAnswerQueueItem=b1eebc09f41e PublishedAnswer=69a801982819 ReservedAnswer=2272a4d6f0f4 ReservedAnswerArtifactsItem=d74eb6e00abb Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=be571d4ff16f StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=dc5893aef7e5 ToolchainAgreed=f3d9ce993734 ToolchainAgreedDigestsItem=1d42893a96b9 ToolchainAgreedEvent=e3502d6f194d VersionReservedEvent=984547d6ad07"
generatedForms = "4"
generatedFieldsDigest = "AskTakenEvent=6d5d3da7ac39 BuildEntry=3c829a0a3d58 Dependency=90a32b07c563 DropAnswer=7538f2f5e68e PackagePublished=7e20050c6260 PackagePublishedEvent=8e12888c1559 PublishQueueAnswer=0f1326e35e17 PublishQueueAnswerCountsItem=b770db2f0920 PublishQueueAnswerQueueItem=b1eebc09f41e PublishedAnswer=69a801982819 ReservedAnswer=2272a4d6f0f4 ReservedAnswerArtifactsItem=d74eb6e00abb Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=be571d4ff16f StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=dc5893aef7e5 ToolchainAgreed=f3d9ce993734 ToolchainAgreedDigestsItem=1d42893a96b9 ToolchainAgreedEvent=e3502d6f194d VersionReservedEvent=984547d6ad07"
)
const (
@@ -146,6 +146,8 @@ type PackagePublished struct {
Dependencies []Dependency `json:"dependencies,omitempty"`
// the published artifact's digest
Digest string `json:"digest"`
// the fingerprint of the build the reservation holds, so the runner marks every running pipeline of the branch that moves the module at it; absent from a publish whose reservation names none; the builder, the assigner and the indexer read it not and decode it tolerantly (design 47 H2 H-A-707 (6))
Fingerprint string `json:"fingerprint,omitempty"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
// the module
@@ -198,7 +200,7 @@ type StepEnded struct {
Packages map[string]string `json:"packages,omitempty"`
Pipeline string `json:"pipeline"`
Rerun bool `json:"rerun,omitempty"`
// for a step ended superseded, the module graph revision of the entry that superseded it, 0 when the builder knows none; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-561)
// the module graph revision of the entry that superseded the step, present exactly when outcome is superseded and absent otherwise; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-574, H-A-650)
Revision int64 `json:"revision,omitempty"`
// why it failed, could not run or was superseded: the entry not built, the part not heard, the superseding fingerprint
Said string `json:"said,omitempty"`
@@ -35,6 +35,10 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v VersionReservedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.version-reserved$")},
{name: "a build step's progress while its build waits for a package", subject: "mesh.seat.mesh-builds.event.step-progress.anchor", given: "{\"ask\":\"a1b2\",\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-23T02:40:00Z\",\"phase\":\"build\"}", wire: "{\"ask\":\"a1b2\",\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-23T02:40:00Z\",\"phase\":\"build\"}",
decode: func(b []byte) (any, error) { var v StepProgressEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.step-progress\\.[^.*> ]+$")},
{name: "the step ended superseded in form 4: revision present exactly when superseded (H-A-574, H-A-650)", subject: "mesh.seat.mesh-builds.event.step-ended.laptop", given: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"form\":4,\"id\":\"m2kx9a1b3c4d6f\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"revision\":14,\"said\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\",\"step\":\"build\",\"v\":1}", wire: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"form\":4,\"id\":\"m2kx9a1b3c4d6f\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"revision\":14,\"said\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\",\"step\":\"build\",\"v\":1}",
decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.step-ended\\.[^.*> ]+$")},
{name: "a package published, naming the build's fingerprint (H-A-707 (6))", subject: "mesh.seat.mesh-builds.event.package-published", given: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"part\":\"mesh-contracts:go-nodeengine\",\"version\":\"0.1.4\"},{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"part\":\"mesh-build-go:toolchain\",\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}", wire: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"part\":\"mesh-contracts:go-nodeengine\",\"version\":\"0.1.4\"},{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"part\":\"mesh-build-go:toolchain\",\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}",
decode: func(b []byte) (any, error) { var v PackagePublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.package-published$")},
{name: "reserved asks a module", subject: "", given: "{\"module\":\"mesh-sdk\"}", wire: "{\"module\":\"mesh-sdk\"}",
decode: func(b []byte) (any, error) { var v ReservedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "reserved asks a package by its name", subject: "", given: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.15\"}", wire: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.15\"}",
@@ -14,13 +14,13 @@ const Seat = "mesh-catalog"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 6
const Form = 7
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "6"
generatedFieldsDigest = "ActingRule=8a83ce7e0457 Artifact=78b05c1a9ec3 ArtifactPackage=2a3a660a934d ArtifactRef=a2f06147f4b6 BuildEdge=76f0684e254a CandidatesByGroupValue=9ea8c6c580d2 CandidatesByGroupValuePullsItem=90fb03643258 CandidatesByGroupValuePullsItemFpsValue=4c6783201aa3 CatalogEntry=c0a4ea25d523 CatalogRevision=d1ecaaa484af CatalogRevisionDefinitionsItem=77fcff620d48 CatalogRevisionEvent=710cbc5bfff1 CatalogRevisionsByBranchRevisionValue=17e54f635d35 CatalogRevisionsByCandidateGroupHeadsValue=17e54f635d35 CatalogRevisionsByEntryDigestValue=8755036a3051 DependentsAnswer=7538f2f5e68e Edge=7242732afaef EntryAnswer=805c2ff28e1c EntryInputs=76a7f8690dd2 EntryRef=ff109e5089e1 Fill=80f442916429 FillingEvent=5bd4df78ed84 FingerprintInputs=99a6df7f991f FullEvent=5bd4df78ed84 Head=774b4bf88ba4 InputAnswer=cd41ee65565d InputsByTimeDigestValue=a2f06147f4b6 ManifestsByDigestValue=51b3822b29c6 ModuleAnswer=499a03ce9b27 ModuleAnswerModule=c0f679e09f08 ModulesAnswer=6d119571c69e ModulesAnswerModulesItem=a70f39c60b67 ModulesByModuleValue=fc7530ba893a ModulesByModuleValueInputs2=99a6df7f991f PackagesByModuleValue=2b62574b709f PackagesByModuleValuePackagesItem=a7d30558470d PackagesByPackageSeriesValue=07421d8d3411 PackagesByPackageSeriesValueNewest=aba144994370 PackagesByPackageSeriesValueNewestContents=eca2ccf56913 PackagesByPackageSeriesValueNewestContentsPackagesItem=a7d30558470d PackagesByPackageSeriesValueNumbered=c8ffc628599c PackagesByPackageSeriesValueNumberedContents=0def6c0794ee PackagesByPackageSeriesValueNumberedContentsPackagesItem=a7d30558470d Policy=719e2f460c6f PolicyAnswer=46cdf8430557 PredefinedByListValue=ec8e3febe8ac ProvidesAnswer=7538f2f5e68e RegisterAnswer=46cdf8430557 Registration=ef03d1b2e73f RegistrationAsked=b529a0e1c5ca RegistrationChangedEvent=99a3268edf41 RegistrationHistoryByModuleVersionValue=0999b5bb7dc7 RegistrationHistoryBySourceOwnerNameVersionValue=0999b5bb7dc7 RegistrationsAnswer=8849ef618cf3 RegistrationsByModuleValue=0999b5bb7dc7 RegistrationsBySourceOwnerNameValue=0999b5bb7dc7 RevisionAnswer=258ea5124931 RoomEvent=5bd4df78ed84 SeatDefinitionChangedEvent=e271d24d58f7 SeatDefinitionRemovedEvent=f7d6171111e6 SeatDefinitionsAnswer=0fd6a59fec59 SeatDefinitionsAnswerEntry=d006f68d2be5 SeatDefinitionsAnswerSeatsItem=e271d24d58f7 SeatListAnswer=04477a8044b1 SourceCheck=d1ed7cbbd579 StepStatuses=4f50aa633e61 TakeInEntry=545ec1528499 ToolchainUsed=43b6d42376fb UnwatchAnswer=46cdf8430557 VersionArtifact=438c49a392b0 VersionEdge=b0f80e83f4dc VersionEntry=33f5b00dbda9 VersionReleasedEvent=4ccf1ea90e7f VersionsAnswer=b59e6e057e7b VersionsByModuleVersionValue=e546dfadb913 WatchAnswer=46cdf8430557"
generatedForms = "7"
generatedFieldsDigest = "ActingRule=8a83ce7e0457 Artifact=0223a648b4e5 ArtifactDigestsItem=a7d30558470d ArtifactPackage=2a3a660a934d ArtifactRef=a2f06147f4b6 BuildEdge=76f0684e254a CandidatesByGroupValue=9ea8c6c580d2 CandidatesByGroupValuePullsItem=90fb03643258 CandidatesByGroupValuePullsItemFpsValue=4c6783201aa3 CatalogEntry=4c82dcc1e492 CatalogRevision=178230def2a0 CatalogRevisionDefinitionsItem=77fcff620d48 CatalogRevisionEvent=710cbc5bfff1 CatalogRevisionsByBranchRevisionValue=17e54f635d35 CatalogRevisionsByCandidateGroupHeadsValue=17e54f635d35 CatalogRevisionsByEntryDigestValue=8755036a3051 DependentsAnswer=7538f2f5e68e Edge=7242732afaef EntryAnswer=805c2ff28e1c EntryInputs=76a7f8690dd2 EntryRef=ff109e5089e1 Fill=80f442916429 FillingEvent=5bd4df78ed84 FingerprintInputs=99a6df7f991f FullEvent=5bd4df78ed84 Head=774b4bf88ba4 InputAnswer=cd41ee65565d InputsByTimeDigestValue=a2f06147f4b6 ManifestsByDigestValue=51b3822b29c6 ModuleAnswer=499a03ce9b27 ModuleAnswerModule=c0f679e09f08 ModulesAnswer=6d119571c69e ModulesAnswerModulesItem=a70f39c60b67 ModulesByModuleValue=fc7530ba893a ModulesByModuleValueInputs2=99a6df7f991f PackagesByModuleValue=2b62574b709f PackagesByModuleValuePackagesItem=a7d30558470d PackagesByPackageSeriesValue=07421d8d3411 PackagesByPackageSeriesValueNewest=aba144994370 PackagesByPackageSeriesValueNewestContents=eca2ccf56913 PackagesByPackageSeriesValueNewestContentsPackagesItem=a7d30558470d PackagesByPackageSeriesValueNumbered=c8ffc628599c PackagesByPackageSeriesValueNumberedContents=0def6c0794ee PackagesByPackageSeriesValueNumberedContentsPackagesItem=a7d30558470d Policy=719e2f460c6f PolicyAnswer=46cdf8430557 PredefinedByListValue=ec8e3febe8ac ProvidesAnswer=7538f2f5e68e RegisterAnswer=46cdf8430557 Registration=ef03d1b2e73f RegistrationAsked=b529a0e1c5ca RegistrationChangedEvent=99a3268edf41 RegistrationHistoryByModuleVersionValue=0999b5bb7dc7 RegistrationHistoryBySourceOwnerNameVersionValue=0999b5bb7dc7 RegistrationsAnswer=8849ef618cf3 RegistrationsByModuleValue=0999b5bb7dc7 RegistrationsBySourceOwnerNameValue=0999b5bb7dc7 RevisionAnswer=258ea5124931 RoomEvent=5bd4df78ed84 SeatDefinitionChangedEvent=e271d24d58f7 SeatDefinitionRemovedEvent=f7d6171111e6 SeatDefinitionsAnswer=0fd6a59fec59 SeatDefinitionsAnswerEntry=d006f68d2be5 SeatDefinitionsAnswerSeatsItem=e271d24d58f7 SeatListAnswer=04477a8044b1 SourceCheck=d1ed7cbbd579 StepStatuses=4f50aa633e61 TakeInEntry=545ec1528499 ToolchainUsed=43b6d42376fb UnwatchAnswer=46cdf8430557 VersionArtifact=438c49a392b0 VersionEdge=b0f80e83f4dc VersionEntry=33f5b00dbda9 VersionReleasedEvent=4ccf1ea90e7f VersionsAnswer=b59e6e057e7b VersionsByModuleVersionValue=e546dfadb913 WatchAnswer=46cdf8430557"
)
const (
@@ -625,6 +625,14 @@ type ActingRule struct {
Step string `json:"step"`
}
// ArtifactDigestsItem is a type of the contract.
type ArtifactDigestsItem struct {
// the package's digest, by its files (design 47 H2 H-A-580)
Digest string `json:"digest"`
// the package's Go import path or npm name
Package string `json:"package"`
}
// ArtifactPackage is the package's name read from the revision's own files at the artifact's path (the module of its go.mod, the name of its package.json, the manifest's image name), written at take-in (design 47 G section 676).
type ArtifactPackage struct {
// go, npm or image
@@ -634,6 +642,8 @@ type ArtifactPackage struct {
// Artifact is one artifact of a module in the catalog graph entry.
type Artifact struct {
// the digest of each package of the artifact, kept by the indexer when it computes the entry, so an importer reads the digest of each package it imports from the entry that publishes it (design 47 H2 H-A-580)
Digests []ArtifactDigestsItem `json:"digests,omitempty"`
// the artifact's kind
Kind string `json:"kind,omitempty"`
// the artifact's language as its manifest says it (go, typescript, ...); a step's build seat is read from it (design 47 G section 323)
@@ -670,6 +680,8 @@ type CatalogEntry struct {
Class string `json:"class,omitempty"`
// the merge commit it was last changed at
Commit string `json:"commit"`
// the subjects its accepted manifest consumes, filled by the indexer beside invokes (design 47 H2 H-A-621)
Consumes []string `json:"consumes,omitempty"`
// the requirements the manifest's contributes object names as keys, sorted, its local names not carried; each is also in requires (design 47 G section 709)
Contributes []string `json:"contributes,omitempty"`
// the edges into this module's artifacts, each from the artifact that comes first; the build and the delivery order by these alone
@@ -690,7 +702,7 @@ type CatalogEntry struct {
// the sha256: digest of the manifest's bytes as the forge answered them, set by the indexer at take-in and never computed again from the manifest whole; the module's value and the manifests key are this digest (design 47 G section 506)
ManifestDigest string `json:"manifest-digest,omitempty"`
Module string `json:"module"`
// the manifest reads a node-engine must state to compose it, its templates' forms included, as the forge bridge read them at the merge (ADR 0614 §4, ADR 0632 §2)
// the manifest reads a node-engine must state to compose it, its templates' forms included, as the indexer derives them at the take-in (ADR 0614 §4, ADR 0632 §2)
Needs []string `json:"needs,omitempty"`
// why it has none
None string `json:"none,omitempty"`
@@ -747,6 +759,8 @@ type CatalogRevision struct {
Module string `json:"module,omitempty"`
// the movers of the take-in that wrote it, so a redelivered source-moved whose revision is kept says take-in.taken again from them, recomputing nothing (design 47 H §743, H-A-92); absent for one with no mover
Movers []TakeInEntry `json:"movers,omitempty"`
// the version of the manifest validator's need rules this revision's entries were derived with, absent read as 0; a take-in derives the rule needs of unmoved entries again only when its own is higher than its base revision's (design 47 H2 H-A-569 (2), H-A-605 (4))
NeedsRules int64 `json:"needs-rules,omitempty"`
// for call-kind take-in-again, the repository taken in again (H-A-215)
Repository string `json:"repository,omitempty"`
// the catalog graph revision's number, counted by its holder
@@ -57,7 +57,7 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v ModulesAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "the module verb (captured: xclip)", subject: "", given: "{\"module\":{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"manifest\":{\"build\":{\"artifacts\":[{\"binary\":\"xclip-tools\",\"from\":\"cmd/xclip-tools\",\"kind\":\"bundle\",\"language\":\"go\",\"loads\":[\"xclip-tools\"],\"name\":\"tools\",\"system\":\"arch\"}]},\"capabilities\":[\"package-manager\"],\"module\":\"xclip\",\"resources\":[{\"id\":\"package\",\"package\":\"xclip\",\"type\":\"package\"}],\"tools\":[\"xclip_copy\",\"xclip_paste\",\"xclip_targets\",\"xclip_session\"],\"version\":\"1\"},\"module\":\"xclip\",\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\"}}", wire: "{\"module\":{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"manifest\":{\"build\":{\"artifacts\":[{\"binary\":\"xclip-tools\",\"from\":\"cmd/xclip-tools\",\"kind\":\"bundle\",\"language\":\"go\",\"loads\":[\"xclip-tools\"],\"name\":\"tools\",\"system\":\"arch\"}]},\"capabilities\":[\"package-manager\"],\"module\":\"xclip\",\"resources\":[{\"id\":\"package\",\"package\":\"xclip\",\"type\":\"package\"}],\"tools\":[\"xclip_copy\",\"xclip_paste\",\"xclip_targets\",\"xclip_session\"],\"version\":\"1\"},\"module\":\"xclip\",\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\"}}",
decode: func(b []byte) (any, error) { var v ModuleAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "a watched branch's catalog graph revision", subject: "", given: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}", wire: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}",
{name: "a watched branch's catalog graph revision", subject: "", given: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"needs-rules\":2,\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}", wire: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"needs-rules\":2,\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}",
decode: func(b []byte) (any, error) {
var v CatalogRevisionsByBranchRevisionValue
err := json.Unmarshal(b, &v)
@@ -69,7 +69,7 @@ func TestFixtures(t *testing.T) {
err := json.Unmarshal(b, &v)
return v, err
}, subjectIs: nil},
{name: "a catalog graph entry (xclip)", subject: "", given: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}",
{name: "a catalog graph entry (xclip)", subject: "", given: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"consumes\":[\"node-engine.running.*.*\"],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"consumes\":[\"node-engine.running.*.*\"],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}",
decode: func(b []byte) (any, error) {
var v CatalogRevisionsByEntryDigestValue
err := json.Unmarshal(b, &v)
@@ -99,7 +99,7 @@ func TestFixtures(t *testing.T) {
err := json.Unmarshal(b, &v)
return v, err
}, subjectIs: nil},
{name: "an entry with its artifacts and the edges into them, per artifact", subject: "", given: "{\"artifacts\":[{\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"artifacts\":[{\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}",
{name: "an entry with its artifacts and the edges into them, per artifact", subject: "", given: "{\"artifacts\":[{\"digests\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"package\":\"git.novox.be/novox/mesh-sdk/go/keys\"}],\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"artifacts\":[{\"digests\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"package\":\"git.novox.be/novox/mesh-sdk/go/keys\"}],\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}",
decode: func(b []byte) (any, error) {
var v CatalogRevisionsByEntryDigestValue
err := json.Unmarshal(b, &v)
@@ -14,13 +14,13 @@ const Seat = "mesh-delivery"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 2
const Form = 3
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "2"
generatedFieldsDigest = "DeliveriesAnswer=d6ae3ca4e5da Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 HeadsByRepositoryBranchValue=b32fd594ee25 Owed=a30ee01924cc OwedByRepositoryNumberHeadActValue=f16ff5733d62 OwedEvent=86af3b56de28 RecordEndedEvent=566edb8684e5 RecordEndedEventAwayItem=44ad7d26bd16 RecordOpenedEvent=9cf9afaa25b4 RecoveryAnswer=8c705e17cdf8 RecoveryMergedEvent=014d4d00d2e5 RoomEvent=5bd4df78ed84 ShowAnswer=7538f2f5e68e SourceAnswer=6ae84f05f10d SourceByBranchValue=31aa822718c0 SourceHead=e722e2d9492f SourceMovedEvent=5231909928e9 SourceMovedEventHeadsItem=774b4bf88ba4 StalledAnswer=7538f2f5e68e"
generatedForms = "3"
generatedFieldsDigest = "DeliveriesAnswer=d6ae3ca4e5da Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 HeadsByRepositoryBranchValue=b32fd594ee25 Owed=a30ee01924cc OwedByRepositoryNumberHeadActValue=f16ff5733d62 OwedEvent=86af3b56de28 RecordEndedEvent=c693c67bd78c RecordEndedEventAwayItem=44ad7d26bd16 RecordOpenedEvent=9cf9afaa25b4 RecoveryAnswer=8c705e17cdf8 RecoveryMergedEvent=014d4d00d2e5 RoomEvent=5bd4df78ed84 ShowAnswer=7538f2f5e68e SourceAnswer=6ae84f05f10d SourceByBranchValue=31aa822718c0 SourceHead=e722e2d9492f SourceMovedEvent=5231909928e9 SourceMovedEventHeadsItem=774b4bf88ba4 StalledAnswer=7538f2f5e68e"
)
const (
@@ -436,6 +436,8 @@ type RecordEndedEvent struct {
Branch string `json:"branch"`
// the merge call
Call string `json:"call"`
// the record's end count, one higher at each end after the first, as pipeline-ended's end count is (design 47 H2 H-A-597, H-A-617)
Ends int64 `json:"ends,omitempty"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
// its milestone, <branch>.<source>
@@ -21,7 +21,7 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v OwedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.owed\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "record-opened is said", subject: "mesh.seat.mesh-delivery.event.record-opened.0123456789abcdef", given: "{\"at\":\"2026-11-20T02:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", wire: "{\"at\":\"2026-11-20T02:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}",
decode: func(b []byte) (any, error) { var v RecordOpenedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.record-opened\\.[^.*> ]+$")},
{name: "record-ended is said", subject: "mesh.seat.mesh-delivery.event.record-ended", given: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", wire: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}",
{name: "record-ended is said", subject: "mesh.seat.mesh-delivery.event.record-ended", given: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"ends\":2,\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", wire: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"ends\":2,\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}",
decode: func(b []byte) (any, error) { var v RecordEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.record-ended$")},
{name: "filling is said", subject: "mesh.seat.mesh-delivery.event.filling", given: "{\"bytes\":650000000,\"cap\":805306368,\"store\":\"records\"}", wire: "{\"bytes\":650000000,\"cap\":805306368,\"store\":\"records\"}",
decode: func(b []byte) (any, error) { var v FillingEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.filling$")},
@@ -14,13 +14,13 @@ const Seat = "mesh-pipeline-runner"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 12
const Form = 13
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "12"
generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverEnded=4b35095f6829 MoverRow=b61f41d131a3 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=582f8ff3b28d PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=ed94ced4513a Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=48b8cecc529a StandsAnswer=0afa3693bf3b StartAnswer=ed94ced4513a StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466"
generatedForms = "13"
generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=e2c9486343d2 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=6de094f5329f Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=9db5cfcb26bb StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=90066504aaa7 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466"
)
const (
@@ -45,6 +45,7 @@ const (
const (
EventPipelineStarted = "pipeline-started"
EventMoverAdded = "mover-added"
EventPipelineEnded = "pipeline-ended"
EventRunStarted = "run-started"
EventStepStarted = "step-started"
@@ -71,11 +72,11 @@ func VerbDescription(verb string) string {
case VerbStart:
return "A delivering pipeline for a watched branch's head, by hand; written in the hand-act log. With modules, a pipeline at the head keyed <branch>.<revision>.again.<n> carrying the named modules whose newest entry has no passed pipeline, at the take-in's tiers; a module whose newest entry passed is refused by name. Exactly one of module or modules (design 47 H2 H-A-479)."
case VerbShow:
return "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). Reads only."
return "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). The answer names only the movers its page holds, with each row's fingerprint and version, mover-count and step-count and no unlogged; it answers within bound, capped, total and next, and moved true when the record was written between two pages (design 47 H2 H-A-709 (1), (2)). Reads only."
case VerbList:
return "The pipelines and runs of a module, a branch or a commit, newest first, of every branch when none is named (design 47 H2 H-A-533): by default one short row per pipeline, the newest 20 (its key, branch, call, source, revision, start, end, outcome, movers' count, its steps counted per outcome and first failed or could-not-run step with its module and why); the whole pipelines, each record with its movers and steps counted, never its steps (show gives those), only with full and a limit (design 47 H2 H-A-376, H-A-467). Reads only."
case VerbStands:
return "What stands still, and since when: each step not ended and each wait held. Reads only."
return "What stands still, and since when: each step not ended and each wait held, in the order of their since, then their pipeline, module, step and artifact, within bound; reads only (design 47 H2 H-A-709 (2))."
case VerbWhyCarried:
return "Where a step's result was carried from, with the kept results it rests on. Reads only."
case VerbKept:
@@ -93,7 +94,7 @@ func VerbDescription(verb string) string {
case VerbPlace:
return "A waiting pipeline placed ahead of its turn, its steps asked now; written in the hand-act log (design 47 H §748, H-A-53)."
case VerbPlaceUnfinished:
return "A mover kept in the state unfinished put in a pipeline of its own at once, keyed <branch>.<revision>.unfinished.<module>; written in the hand-act log (design 47 H2 §786, H-A-398)."
return "A mover kept in the state unfinished put in a pipeline of its own at once, keyed <branch>.<revision>.unfinished.<module>; written in the hand-act log (design 47 H2 §786, H-A-398). With all, each key of unfinished is put in a pipeline of its own; the answer names every pipeline put and every key that could not be (design 47 H2 H-A-725)."
case VerbAskAgain:
return "A declined approval step asked again (ADR 0666 section 10). Written in the hand-act log."
case VerbTestRuns:
@@ -106,7 +107,7 @@ func VerbDescription(verb string) string {
// Events is every event published on the seat's subject: a new copy each call.
func Events() []string {
return []string{EventPipelineStarted, EventPipelineEnded, EventRunStarted, EventStepStarted, EventStepEnded, EventWaitHeld, EventWaitEnded, EventRePinned, EventFilling, EventFull, EventRoom}
return []string{EventPipelineStarted, EventMoverAdded, EventPipelineEnded, EventRunStarted, EventStepStarted, EventStepEnded, EventWaitHeld, EventWaitEnded, EventRePinned, EventFilling, EventFull, EventRoom}
}
// Family is where the seat's events are kept: the shared events stream, filtered to the seat's subjects.
@@ -126,6 +127,17 @@ func SubjectPipelineStarted(branch, revision string) string {
// SubjectPipelineStartedAll hears every pipeline-started.
const SubjectPipelineStartedAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*"
// StreamMoverAdded is the stream mover-added is kept in.
const StreamMoverAdded = "SEAT_mesh-pipeline-runner_mover-added"
// SubjectMoverAdded is where mover-added is published, on mesh.seat.mesh-pipeline-runner.event.mover-added.<branch>.<revision>.
func SubjectMoverAdded(branch, revision string) string {
return "mesh.seat.mesh-pipeline-runner.event.mover-added." + branch + "." + revision
}
// SubjectMoverAddedAll hears every mover-added.
const SubjectMoverAddedAll = "mesh.seat.mesh-pipeline-runner.event.mover-added.*.*"
// StreamPipelineEnded is the stream pipeline-ended is kept in.
const StreamPipelineEnded = "SEAT_mesh-pipeline-runner_pipeline-ended"
@@ -638,9 +650,13 @@ type LogEntry struct {
// the keys of the kept results the step wrote or carried, <level>.<digest>, which the runner ages by their last-read (design 47 G sections 330, 470)
Kept []string `json:"kept,omitempty"`
// the module of the mover whose step the entry is of (H-A-190)
Module string `json:"module,omitempty"`
Outcome string `json:"outcome,omitempty"`
Pipeline string `json:"pipeline"`
Module string `json:"module,omitempty"`
Outcome string `json:"outcome,omitempty"`
// the revision the passed-over end named, present with revision (design 47 H2 H-A-743)
PassedOver int64 `json:"passed-over,omitempty"`
Pipeline string `json:"pipeline"`
// the pipeline's own revision, present on the entry of a step asked again after an end the runner passed over (design 47 H2 H-A-743)
Revision int64 `json:"revision,omitempty"`
Step string `json:"step"`
What string `json:"what"`
}
@@ -717,6 +733,25 @@ const (
MoverUnplacedKeptRevisionUnread = "kept-revision-unread"
)
// MoverAdded is a mover added to a pipeline that waits or runs, or put in a reopened one: said on the pipeline's subject as pipeline-started is, with exactly one of from, caller or take-in; a reader refuses one naming none or two (design 47 H2 H-A-594 (4), H-A-609 (3), H-A-645).
type MoverAdded struct {
// the caller of start, as the runtime proved it
Caller string `json:"caller,omitempty"`
// the mover's fingerprint
Fingerprint string `json:"fingerprint"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
// the key of the pipeline the mover came from
From string `json:"from,omitempty"`
Module string `json:"module"`
// the key of the pipeline that carries the mover
Pipeline string `json:"pipeline"`
// the catalog graph revision of the pipeline
Revision int64 `json:"revision"`
// the source revision of the take-in whose entries were added to a pipeline already held
TakeIn int64 `json:"take-in,omitempty"`
}
// MoverEnded is one mover at its pipeline's end (design 47 H §746).
type MoverEnded struct {
// the commit the mover's entry was last changed at, from the pipeline's value (design 47 H-A-119)
@@ -737,9 +772,15 @@ type MoverEnded struct {
// MoverRow is one mover of a pipeline in show's short form (design 47 H2 H-A-376).
type MoverRow struct {
Failed *FailedStep `json:"failed,omitempty"`
Module string `json:"module"`
// the mover's build-input fingerprint, which the delivery view's pipeline page reads from the row (design 47 H2 H-A-709 (1))
Fingerprint string `json:"fingerprint,omitempty"`
Module string `json:"module"`
// waiting for a mover with no step placed; running while a required step is open; failed once a required step did not pass; superseded for one a newer pipeline took out
Outcome string `json:"outcome"`
// the mover's tier in the pipeline's delivery order, from 1, which the delivery view's tiered page groups the movers by (design 47 H2 H-A-730)
Tier int64 `json:"tier,omitempty"`
// the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1))
Version string `json:"version,omitempty"`
}
// The values of MoverRow's outcome.
@@ -762,7 +803,7 @@ type Pipeline struct {
Ended *time.Time `json:"ended,omitempty"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
// how many movers the pipeline has, set by list alone (H-A-191)
// how many movers the pipeline has, set by list and by show (H-A-191, design 47 H2 H-A-709 (1))
MoverCount int64 `json:"mover-count,omitempty"`
// the modules the pipeline moves, its take-in's entries (design 47 H §746)
Movers []Mover `json:"movers"`
@@ -780,13 +821,13 @@ type Pipeline struct {
// the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9)
Source int64 `json:"source"`
Started *time.Time `json:"started,omitempty"`
// how many steps the pipeline's movers have, set by list alone, which answers the record with its steps empty (H-A-191)
// how many steps the pipeline's movers have, set by list, which answers the record with its steps empty, and by show (H-A-191, design 47 H2 H-A-709 (1))
StepCount int64 `json:"step-count,omitempty"`
// every mover's steps, each naming its mover, approval last; in the state pipelines a record's own are empty, each mover's kept under its own key (H-A-187)
Steps []StepResult `json:"steps"`
// the modules a newer waiting take-in of the same branch took out of the pipeline, written with the movers by compare-and-set; at its placing the runner writes a mover's build-step why from it (design 47 H §748, H-A-107)
Superseded []string `json:"superseded,omitempty"`
// the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189)
// the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189); show's answer carries none (design 47 H2 H-A-709 (1))
Unlogged []LogEntry `json:"unlogged,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
@@ -963,8 +1004,8 @@ type PipelineStarted struct {
Form int64 `json:"form,omitempty"`
// every catalog revision the pipeline's movers are kept at, said again in full at each re-pin, so the indexer pins each while the pipeline runs (design 47 H2 H-A-496 and its addendum)
Kept []int64 `json:"kept,omitempty"`
// the pipeline's movers
Movers []Mover `json:"movers"`
// the pipeline's movers, each with what its readers read (design 47 H2 H-A-709 (3))
Movers []StartedMover `json:"movers"`
// the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
Pipeline string `json:"pipeline"`
// for a pipeline a package's publish started, that publish (A-202)
@@ -1018,6 +1059,20 @@ type Shared struct {
Run string `json:"run"`
}
// StartedMover is one mover of a pipeline-started: what its readers read, the gate's module, fingerprint and version; published, widens, tests, unplaced, revision and over-budget stay in the pipeline's record, read by show (design 47 H2 H-A-709 (3)).
type StartedMover struct {
// the commit the module's entry was last changed at
Commit string `json:"commit"`
// the module's build-input fingerprint at the commit
Fingerprint string `json:"fingerprint"`
Module string `json:"module"`
Repository string `json:"repository"`
// the mover's tier in the pipeline's delivery order, from 1 (ADR 0666 section 14; design 47 H section 746)
Tier int64 `json:"tier,omitempty"`
// the version released for the mover in this pipeline, absent until one is (design 47 H-A-52)
Version string `json:"version,omitempty"`
}
// StepEvent is a step's start or end: the step, its status, its outcome, its fingerprint, its test counts, what a carried result was carried from, and for a rerun that it is one and its proved caller; a bypassed step too.
type StepEvent struct {
At *time.Time `json:"at,omitempty"`
@@ -1058,6 +1113,8 @@ type StepResult struct {
Ended *time.Time `json:"ended,omitempty"`
// the artifact's build-input fingerprint the step ran at
Fingerprint string `json:"fingerprint,omitempty"`
// when the step was held, written at the hold and cleared at its end; absent when it holds no wait, so the ended wait, stands and the watchman's seed read the same time (design 47 H2 H-A-738 (2))
HeldAt *time.Time `json:"held-at,omitempty"`
// the mover the step is of (design 47 H-A-35)
Module string `json:"module,omitempty"`
// the node whose holder ended it
@@ -1193,8 +1250,12 @@ type Wait struct {
Artifact string `json:"artifact,omitempty"`
// the step's own ask, where it has one (design 47 G §731)
Ask string `json:"ask,omitempty"`
// a duration such as 30m: the runner's stalled-bound, which the watchman times the wait by (design 47 H2 H-A-599, H-A-611, H-A-736)
Bound string `json:"bound,omitempty"`
// the watched branch, or the branch of a run on request
Branch string `json:"branch"`
// the time the bound counts from: when the wait was held (design 47 H2 H-A-599, H-A-736)
ClockFrom *time.Time `json:"clock-from,omitempty"`
// the commit the module's entry was last changed at
Commit string `json:"commit,omitempty"`
// the module's build-input fingerprint at the commit
@@ -1307,9 +1368,11 @@ type StartAnswer struct {
// ShowInput is what show takes.
type ShowInput struct {
// the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2))
Bound int64 `json:"bound,omitempty"`
// a mover's module: the answer's pipeline then holds that mover's steps alone (H-A-187); with neither mover, step nor state the answer holds each mover's row (design 47 H2 H-A-376)
Mover string `json:"mover,omitempty"`
// the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789)
// the cursor the previous page answered, opaque: the place of the next row or step among those the filters hold and the record's revision; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57))
Next string `json:"next,omitempty"`
// the pipeline's key
Pipeline string `json:"pipeline"`
@@ -1333,12 +1396,14 @@ const (
// ShowAnswer is what show answers.
type ShowAnswer struct {
// yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789)
// yes when the answer stopped at bound; the rest is read from next (design 47 H2 H-A-709 (2))
Capped bool `json:"capped,omitempty"`
Fill []Fill `json:"fill,omitempty"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
Log []LogEntry `json:"log,omitempty"`
// yes when a page was asked with a next of another revision of the record: it answers from that place, though rows and steps may have changed between the pages; a reader that needs one whole picture reads again with no next (design 47 H2 H-A-709 (2))
Moved bool `json:"moved,omitempty"`
// each mover's row, when show names no mover, step or state (design 47 H2 H-A-376)
Movers []MoverRow `json:"movers,omitempty"`
// the cursor of the next page, opaque; empty at the end (design 47 H2 §779)
@@ -1373,13 +1438,27 @@ type ListAnswer struct {
// StandsInput is what stands takes.
type StandsInput struct {
// the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2))
Bound int64 `json:"bound,omitempty"`
// only this module's waits, applied while reading
Module string `json:"module,omitempty"`
// the cursor the previous page answered, opaque: the place of the last wait answered, so the next page answers the waits after it; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57))
Next string `json:"next,omitempty"`
// only this pipeline's waits, applied while reading
Pipeline string `json:"pipeline,omitempty"`
}
// StandsAnswer is what stands answers.
type StandsAnswer struct {
// yes when the answer stopped at bound; the rest is read from next
Capped bool `json:"capped,omitempty"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
Form int64 `json:"form,omitempty"`
// the cursor of the next page, opaque; empty at the end
Next string `json:"next,omitempty"`
Stands []Wait `json:"stands"`
// how many waits the filters hold in all
Total int64 `json:"total,omitempty"`
}
// WhyCarriedInput is what why-carried takes.
@@ -1559,20 +1638,44 @@ type PlaceAnswer struct {
// PlaceUnfinishedInput is what place-unfinished takes.
type PlaceUnfinishedInput struct {
// the unfinished entry's key, <branch>.<module>
Key string `json:"key"`
// true to put every key of unfinished at once, one hand act; exactly one of key or all (design 47 H2 H-A-644)
All bool `json:"all,omitempty"`
// the unfinished entry's key, <branch>.<module>; exactly one of key or all
Key string `json:"key,omitempty"`
// why, written with the caller the runtime proves in the hand-act log
Why string `json:"why"`
}
// PlaceUnfinishedAnswer is what place-unfinished answers.
type PlaceUnfinishedAnswer struct {
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
// PlaceUnfinishedAnswerFailedItem is a type of the contract.
type PlaceUnfinishedAnswerFailedItem struct {
// the unfinished entry's key
Key string `json:"key"`
// why it could not be put
Words string `json:"words"`
}
// PlaceUnfinishedAnswerPlacedItem is a type of the contract.
type PlaceUnfinishedAnswerPlacedItem struct {
// the unfinished entry's key
Key string `json:"key"`
// the key of the pipeline the mover is put in
Pipeline string `json:"pipeline"`
}
// PlaceUnfinishedAnswer is what place-unfinished answers.
type PlaceUnfinishedAnswer struct {
// one item per key that could not be put with all, empty with key; always present (design 47 H2 H-A-725)
Failed []PlaceUnfinishedAnswerFailedItem `json:"failed"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
// with key, the key of the pipeline the mover is put in; absent with all
Pipeline string `json:"pipeline,omitempty"`
// one item per key put with all, empty with key; always present (design 47 H2 H-A-725)
Placed []PlaceUnfinishedAnswerPlacedItem `json:"placed"`
// with all and no key in unfinished, that two empty lists are the answer (design 47 H2 H-A-725)
Said string `json:"said,omitempty"`
}
// AskAgainInput is what ask-again takes.
type AskAgainInput struct {
// the mover's module, so a pipeline of several movers is never ambiguous; a call naming none on a pipeline of one mover is taken as that mover (design 47 H-A-101)
@@ -1635,6 +1738,9 @@ type TestRunsDropAnswer struct {
// PipelineStartedEvent is the body of the event pipeline-started.
type PipelineStartedEvent = PipelineStarted
// MoverAddedEvent is the body of the event mover-added.
type MoverAddedEvent = MoverAdded
// PipelineEndedEvent is the body of the event pipeline-ended.
type PipelineEndedEvent = PipelineEnded
@@ -1881,6 +1987,15 @@ func DecodePipelineStartedEvent(raw []byte) (PipelineStartedEvent, int, error) {
return v, formRead(raw), nil
}
// DecodeMoverAddedEvent reads a MoverAddedEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
func DecodeMoverAddedEvent(raw []byte) (MoverAddedEvent, int, error) {
var v MoverAddedEvent
if err := json.Unmarshal(raw, &v); err != nil {
return v, 0, err
}
return v, formRead(raw), nil
}
// DecodePipelineEndedEvent reads a PipelineEndedEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
func DecodePipelineEndedEvent(raw []byte) (PipelineEndedEvent, int, error) {
var v PipelineEndedEvent
@@ -17,7 +17,7 @@ func TestFixtures(t *testing.T) {
decode func([]byte) (any, error)
subjectIs *regexp.Regexp
}{
{name: "a take-in's pipeline started with its two movers", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.3589", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}",
{name: "a take-in's pipeline started with its two movers", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.3589", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1,\"version\":\"0.1.15\"},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1,\"version\":\"0.1.15\"},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}",
decode: func(b []byte) (any, error) { var v PipelineStartedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-started\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a pipeline started again at a re-pin, with the three revisions its movers are kept at (H-A-496)", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.291", given: "{\"at\":\"2026-11-22T20:00:00Z\",\"branch\":\"main\",\"kept\":[292,295,298],\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"pipeline\":\"main.291\",\"revision\":291,\"source\":114,\"v\":1}", wire: "{\"at\":\"2026-11-22T20:00:00Z\",\"branch\":\"main\",\"kept\":[292,295,298],\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"pipeline\":\"main.291\",\"revision\":291,\"source\":114,\"v\":1}",
decode: func(b []byte) (any, error) { var v PipelineStartedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-started\\.[^.*> ]+\\.[^.*> ]+$")},
@@ -29,7 +29,7 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v PipelineEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-ended\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a pipeline ended failed, naming the step that held it, no version released", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.main.3589", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"steps\":[{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"failed\",\"status\":\"required\",\"step\":\"unit\"},{\"module\":\"nats\",\"outcome\":\"not asked\",\"status\":\"required\",\"step\":\"approval\",\"why\":\"unit of nats:program failed\"}],\"tier\":1}],\"outcome\":\"failed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1,\"why\":\"unit of nats:program failed\"}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"steps\":[{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"failed\",\"status\":\"required\",\"step\":\"unit\"},{\"module\":\"nats\",\"outcome\":\"not asked\",\"status\":\"required\",\"step\":\"approval\",\"why\":\"unit of nats:program failed\"}],\"tier\":1}],\"outcome\":\"failed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1,\"why\":\"unit of nats:program failed\"}",
decode: func(b []byte) (any, error) { var v PipelineEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-ended\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a pipeline over pipelines-at-once waits its turn", subject: "mesh.seat.mesh-pipeline-runner.event.wait-held.main.3590", given: "{\"branch\":\"main\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}", wire: "{\"branch\":\"main\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}",
{name: "a pipeline over pipelines-at-once waits its turn", subject: "mesh.seat.mesh-pipeline-runner.event.wait-held.main.3590", given: "{\"bound\":\"30m\",\"branch\":\"main\",\"clock-from\":\"2026-11-10T10:01:00Z\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}", wire: "{\"bound\":\"30m\",\"branch\":\"main\",\"clock-from\":\"2026-11-10T10:01:00Z\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}",
decode: func(b []byte) (any, error) { var v WaitHeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.wait-held\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a run on request started", subject: "mesh.seat.mesh-pipeline-runner.event.run-started.nats.main.0123456789abcdef0123456789abcdef01234567", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"by\":\"fix-1965@workstation\",\"members\":[{\"branch\":\"feature/1966-x\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"module\":\"nats\"}],\"run\":\"run-m2kx9a\",\"v\":1}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"by\":\"fix-1965@workstation\",\"members\":[{\"branch\":\"feature/1966-x\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"module\":\"nats\"}],\"run\":\"run-m2kx9a\",\"v\":1}",
decode: func(b []byte) (any, error) { var v RunStartedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.run-started\\.[^.*> ]+\\.[^.*> ]+\\.[^.*> ]+$")},
@@ -51,13 +51,17 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.step-ended\\.[^.*> ]+\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a kept mover re-pinned", subject: "mesh.seat.mesh-pipeline-runner.event.re-pinned", given: "{\"mover\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":412}", wire: "{\"mover\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":412}",
decode: func(b []byte) (any, error) { var v RePinnedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.re-pinned$")},
{name: "a mover added from the pipeline it came from (H-A-594 (4))", subject: "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589", given: "{\"fingerprint\":\"fp-sdk\",\"from\":\"main.3580\",\"module\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":12}", wire: "{\"fingerprint\":\"fp-sdk\",\"from\":\"main.3580\",\"module\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":12}",
decode: func(b []byte) (any, error) { var v MoverAddedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.mover-added\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a mover added by a take-in whose pipeline key is held (H-A-609 (3))", subject: "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589", given: "{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"pipeline\":\"main.3589\",\"revision\":12,\"take-in\":3590}", wire: "{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"pipeline\":\"main.3589\",\"revision\":12,\"take-in\":3590}",
decode: func(b []byte) (any, error) { var v MoverAddedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.mover-added\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a take-in's pipeline kept, its steps naming their mover", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}",
decode: func(b []byte) (any, error) {
var v PipelinesByBranchRevisionValue
err := json.Unmarshal(b, &v)
return v, err
}, subjectIs: nil},
{name: "a running pipeline whose build waits on the revision view for the revision that superseded it (H-A-561, H-A-562)", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}",
{name: "a running pipeline whose build waits on the revision view for the revision that superseded it (H-A-561, H-A-562)", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"held-at\":\"2026-11-10T10:00:30Z\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"held-at\":\"2026-11-10T10:00:30Z\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}",
decode: func(b []byte) (any, error) {
var v PipelinesByBranchRevisionValue
err := json.Unmarshal(b, &v)
@@ -111,7 +115,7 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v ReviewInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "review answers its step", subject: "", given: "{\"pipeline\":\"main.3589\",\"result\":{\"outcome\":\"passed\",\"status\":\"optional\",\"step\":\"review\"}}", wire: "{\"pipeline\":\"main.3589\",\"result\":{\"outcome\":\"passed\",\"status\":\"optional\",\"step\":\"review\"}}",
decode: func(b []byte) (any, error) { var v ReviewAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "show answers a pipeline with its log and fill", subject: "", given: "{\"fill\":[{\"bytes\":4096,\"cap\":268435456,\"store\":\"pipelines\"}],\"log\":[{\"artifact\":\"nats:program\",\"at\":\"2026-11-10T10:00:00Z\",\"pipeline\":\"main.3589\",\"step\":\"lint\",\"what\":\"started\"}],\"pipeline\":{\"branch\":\"main\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"}],\"v\":1}}", wire: "{\"fill\":[{\"bytes\":4096,\"cap\":268435456,\"store\":\"pipelines\"}],\"log\":[{\"artifact\":\"nats:program\",\"at\":\"2026-11-10T10:00:00Z\",\"pipeline\":\"main.3589\",\"step\":\"lint\",\"what\":\"started\"}],\"pipeline\":{\"branch\":\"main\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"}],\"v\":1}}",
{name: "show answers a pipeline with its log and fill", subject: "", given: "{\"fill\":[{\"bytes\":4096,\"cap\":268435456,\"store\":\"pipelines\"}],\"log\":[{\"artifact\":\"nats:program\",\"at\":\"2026-11-10T10:00:00Z\",\"pipeline\":\"main.3589\",\"step\":\"lint\",\"what\":\"started\"},{\"artifact\":\"nats:program\",\"at\":\"2026-11-10T10:05:00Z\",\"module\":\"nats\",\"passed-over\":13,\"pipeline\":\"main.3589\",\"revision\":14,\"step\":\"build\",\"what\":\"started\"}],\"pipeline\":{\"branch\":\"main\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"}],\"v\":1}}", wire: "{\"fill\":[{\"bytes\":4096,\"cap\":268435456,\"store\":\"pipelines\"}],\"log\":[{\"artifact\":\"nats:program\",\"at\":\"2026-11-10T10:00:00Z\",\"pipeline\":\"main.3589\",\"step\":\"lint\",\"what\":\"started\"},{\"artifact\":\"nats:program\",\"at\":\"2026-11-10T10:05:00Z\",\"module\":\"nats\",\"passed-over\":13,\"pipeline\":\"main.3589\",\"revision\":14,\"step\":\"build\",\"what\":\"started\"}],\"pipeline\":{\"branch\":\"main\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"}],\"v\":1}}",
decode: func(b []byte) (any, error) { var v ShowAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "rerun names the mover's module", subject: "", given: "{\"module\":\"nats\",\"pipeline\":\"main.3589\",\"step\":\"unit\",\"why\":\"a flaky test, issue 1966\"}", wire: "{\"module\":\"nats\",\"pipeline\":\"main.3589\",\"step\":\"unit\",\"why\":\"a flaky test, issue 1966\"}",
decode: func(b []byte) (any, error) { var v RerunInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
@@ -135,6 +139,24 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v PlaceInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "end-again asks a running pipeline's end judged once more, with why", subject: "", given: "{\"pipeline\":\"main.20\",\"why\":\"a mover waits on its registration and another failed\"}", wire: "{\"pipeline\":\"main.20\",\"why\":\"a mover waits on its registration and another failed\"}",
decode: func(b []byte) (any, error) { var v EndAgainInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "place-unfinished with all, one hand act", subject: "", given: "{\"all\":true,\"why\":\"the unfinished movers of the old pipelines (design 47 H2 H-A-644)\"}", wire: "{\"all\":true,\"why\":\"the unfinished movers of the old pipelines (design 47 H2 H-A-644)\"}",
decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "place-unfinished with one key", subject: "", given: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}", wire: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}",
decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "show answers a page of movers' rows with their fingerprint and version, moved and capped (H-A-709)", subject: "", given: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"tier\":2,\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"tier\":1}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}", wire: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"tier\":2,\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"tier\":1}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}",
decode: func(b []byte) (any, error) { var v ShowAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "stands answers a page, capped, with the total and the cursor of the next (H-A-709)", subject: "", given: "{\"capped\":true,\"next\":\"cursor-2\",\"stands\":[{\"artifact\":\"nats:program\",\"branch\":\"main\",\"module\":\"nats\",\"on\":\"build node\",\"pipeline\":\"main.3589\",\"revision\":12,\"since\":\"2026-11-10T10:00:00Z\",\"source\":3589,\"step\":\"unit\",\"v\":1}],\"total\":300}", wire: "{\"capped\":true,\"next\":\"cursor-2\",\"stands\":[{\"artifact\":\"nats:program\",\"branch\":\"main\",\"module\":\"nats\",\"on\":\"build node\",\"pipeline\":\"main.3589\",\"revision\":12,\"since\":\"2026-11-10T10:00:00Z\",\"source\":3589,\"step\":\"unit\",\"v\":1}],\"total\":300}",
decode: func(b []byte) (any, error) { var v StandsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "stands asked for one pipeline and module, within a bound (H-A-709)", subject: "", given: "{\"bound\":32768,\"module\":\"nats\",\"next\":\"cursor-2\",\"pipeline\":\"main.3589\"}", wire: "{\"bound\":32768,\"module\":\"nats\",\"next\":\"cursor-2\",\"pipeline\":\"main.3589\"}",
decode: func(b []byte) (any, error) { var v StandsInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "show asked within a bound (H-A-709)", subject: "", given: "{\"bound\":65536,\"next\":\"cursor-1\",\"pipeline\":\"main.3589\"}", wire: "{\"bound\":65536,\"next\":\"cursor-1\",\"pipeline\":\"main.3589\"}",
decode: func(b []byte) (any, error) { var v ShowInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "place-unfinished with all answers each key put and each that could not be (H-A-725)", subject: "", given: "{\"failed\":[{\"key\":\"main.gitea\",\"words\":\"its entry is not read\"}],\"placed\":[{\"key\":\"main.nats\",\"pipeline\":\"main.3589.unfinished.nats\"}]}", wire: "{\"failed\":[{\"key\":\"main.gitea\",\"words\":\"its entry is not read\"}],\"placed\":[{\"key\":\"main.nats\",\"pipeline\":\"main.3589.unfinished.nats\"}]}",
decode: func(b []byte) (any, error) { var v PlaceUnfinishedAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "place-unfinished with all over no key answers two empty lists and says so (H-A-725)", subject: "", given: "{\"failed\":[],\"placed\":[],\"said\":\"no key in unfinished\"}", wire: "{\"failed\":[],\"placed\":[],\"said\":\"no key in unfinished\"}",
decode: func(b []byte) (any, error) { var v PlaceUnfinishedAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "place-unfinished with one key answers its pipeline", subject: "", given: "{\"failed\":[],\"pipeline\":\"main.3589.unfinished.nats\",\"placed\":[]}", wire: "{\"failed\":[],\"pipeline\":\"main.3589.unfinished.nats\",\"placed\":[]}",
decode: func(b []byte) (any, error) { var v PlaceUnfinishedAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
v, err := c.decode([]byte(c.given))
@@ -14,13 +14,13 @@ const Seat = "mesh-wants"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 3
const Form = 4
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "3"
generatedFieldsDigest = "Ask=6cb8b82e2fbe AskTakenEvent=6d5d3da7ac39 AsksByAssignmentsProposalValue=0bb5682c7b3b AsksByBackupNodeModuleFingerprintValue=0bb5682c7b3b AsksByHoldModuleFingerprintValue=0bb5682c7b3b AsksByOutsideNodeModuleFingerprintValue=0bb5682c7b3b AsksByRecordNodeModuleDigestValue=0bb5682c7b3b AsksByRestoreNodeModuleFingerprintValue=0bb5682c7b3b AsksByRevertNodeModuleFingerprintValue=0bb5682c7b3b AssignmentEntry=7d2549782eb2 AssignmentRevision=72c8701f7314 AssignmentRevisionCapabilitiesItem=0c89b0717762 AssignmentRevisionEvent=7faff968ce44 AssignmentRevisionsByCandidateGroupHeadsValue=8553b390118d AssignmentRevisionsByEntryDigestValue=4e5ee7a23e5b AssignmentRevisionsByTrunkRevisionValue=8553b390118d BusAnswer=7538f2f5e68e CatalogOf=7a4646fdbea7 Change=28d1f3c5cd32 ChangeAfterItem=30d718c21581 CompositionReader=5a943c1f8ef1 CompositionRun=2a08fc65e2d0 CompositionRunProgram=5a1202df3497 CompositionRunWaits=9cd147ddfc06 CompositionsAnswer=f8bca93c7f9c CompositionsByGroupHeadsValue=9428965fab8f CompositionsDropAnswer=52803700282a Difference=4011cff516b1 DifferenceAnswer=629237aa39f0 DifferenceEvent=49066d0dff6d DifferenceRefusedItem=0e9caa83ace7 DifferencesByNodeModuleValue=a22487ffadfd DropAnswer=7538f2f5e68e Edge=a71709025a08 EntryAnswer=05adebad70d6 Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 Held=15abbd6a1a33 HeldCandidate=04872f6afbfa InputAnswer=cd41ee65565d KeepNowAnswer=9962ab9fc051 NodeEntryRef=3888ae847653 NotRunning=279b628db0ec PipelineWanted=e1e379c21e59 PipelineWantedEvent=59946b31ab7d PolicyChangedEvent=7538f2f5e68e RevisionAnswer=39002c770cbd RoomEvent=5bd4df78ed84 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=edd08ab1a18b StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=b975f402601a UpgradeAnswer=7538f2f5e68e Wait=951500be820c WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 WantedEvent=58cf7a9f646b WantsByHeldModuleFingerprintValue=ff14aa998a5d WantsByWantNodeModuleValue=ab7c6799fd5d WantsByWantNodeNodeValue=a737a2108d53"
generatedForms = "4"
generatedFieldsDigest = "Ask=6cb8b82e2fbe AskTakenEvent=6d5d3da7ac39 AsksByAssignmentsProposalValue=0bb5682c7b3b AsksByBackupNodeModuleFingerprintValue=0bb5682c7b3b AsksByHoldModuleFingerprintValue=0bb5682c7b3b AsksByOutsideNodeModuleFingerprintValue=0bb5682c7b3b AsksByRecordNodeModuleDigestValue=0bb5682c7b3b AsksByRestoreNodeModuleFingerprintValue=0bb5682c7b3b AsksByRevertNodeModuleFingerprintValue=0bb5682c7b3b AssignmentEntry=7d2549782eb2 AssignmentRevision=72c8701f7314 AssignmentRevisionCapabilitiesItem=0c89b0717762 AssignmentRevisionEvent=7faff968ce44 AssignmentRevisionsByCandidateGroupHeadsValue=8553b390118d AssignmentRevisionsByEntryDigestValue=4e5ee7a23e5b AssignmentRevisionsByTrunkRevisionValue=8553b390118d BusAnswer=7538f2f5e68e CatalogOf=7a4646fdbea7 Change=28d1f3c5cd32 ChangeAfterItem=30d718c21581 CompositionReader=5a943c1f8ef1 CompositionRun=2a08fc65e2d0 CompositionRunProgram=5a1202df3497 CompositionRunWaits=9cd147ddfc06 CompositionsAnswer=f8bca93c7f9c CompositionsByGroupHeadsValue=9428965fab8f CompositionsDropAnswer=52803700282a Difference=4011cff516b1 DifferenceAnswer=629237aa39f0 DifferenceEvent=49066d0dff6d DifferenceRefusedItem=0e9caa83ace7 DifferencesByNodeModuleValue=a22487ffadfd DropAnswer=7538f2f5e68e Edge=a71709025a08 EntryAnswer=05adebad70d6 Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 Held=15abbd6a1a33 HeldCandidate=04872f6afbfa InputAnswer=cd41ee65565d KeepNowAnswer=9962ab9fc051 NodeEntryRef=3888ae847653 NotRunning=279b628db0ec PipelineWanted=e1e379c21e59 PipelineWantedEvent=59946b31ab7d PolicyChangedEvent=7538f2f5e68e RevisionAnswer=39002c770cbd RoomEvent=5bd4df78ed84 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=edd08ab1a18b StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=b975f402601a UpgradeAnswer=7538f2f5e68e ValidateAnswer=484ec1cfda14 ValidateAnswerProblemsItem=728518b4dc83 Wait=951500be820c WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 WantedEvent=58cf7a9f646b WantsByHeldModuleFingerprintValue=ff14aa998a5d WantsByWantNodeModuleValue=ab7c6799fd5d WantsByWantNodeNodeValue=a737a2108d53"
)
const (
@@ -32,6 +32,7 @@ const (
VerbInput = "input"
VerbCompositions = "compositions"
VerbCompositionsDrop = "compositions-drop"
VerbValidate = "validate"
VerbKeepNow = "keep-now"
VerbDrop = "drop"
)
@@ -58,7 +59,7 @@ const (
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbUpgrade, VerbBus, VerbRevision, VerbEntry, VerbDifference, VerbInput, VerbCompositions, VerbCompositionsDrop, VerbKeepNow, VerbDrop}
return []string{VerbUpgrade, VerbBus, VerbRevision, VerbEntry, VerbDifference, VerbInput, VerbCompositions, VerbCompositionsDrop, VerbValidate, VerbKeepNow, VerbDrop}
}
// VerbDescription is a verb's description as the seat's definition says it, "" for a verb the seat does not serve or
@@ -81,6 +82,8 @@ func VerbDescription(verb string) string {
return "Each composition run the assigner keeps (design 47 G §728): its program, input digest, ask, readers, outcome and verdict, and the state's fill against its cap; with candidate or machine, only those."
case VerbCompositionsDrop:
return "Drop one composition run by hand (design 47 G §728): the act and why are written in the hand-act log first, then the run's ask is dropped, each reader ended could not run naming the drop, and the key deleted."
case VerbValidate:
return "Judge a pipeline's candidate on request, the manifest validator's verdict of its manifests: the act and why are written in the hand-act log first, then the candidate's validate run, keyed <pipeline>.validate, is joined or started with the step's own code, so a validate step asked later joins it and builds no second manifest validator. It answers the run as it stands: running with its start, or its end: passed; failed cycle naming the cycle; failed manifest-refused with every problem per manifest, those counted and those the case before holds too; could-not-run with why. It writes no want and ends no step (design 47 H2 H-A-684 (1), H-A-702, H-A-727)."
case VerbKeepNow:
return "Keep the assignment graph's revisions now, by hand (design 47 H2 §813 (2); H-A-417): written in the hand-act log first by the module's tool assigner_keep_now, then the keeping runs at once on the pass's newest computed revision; answers the revision kept, or the fault the keeping met."
case VerbDrop:
@@ -1287,6 +1290,60 @@ type CompositionsDropAnswer struct {
Run CompositionRun `json:"run"`
}
// ValidateInput is what validate takes.
type ValidateInput struct {
// the candidate's key as mesh-pipeline-runner.show names it: <branch>.<revision>, or run-<id> for a run on request
Candidate string `json:"candidate,omitempty"`
// narrows the answer to this module's manifest
Module string `json:"module,omitempty"`
// a pipeline's key as the runner names it, a delivering pipeline's or a run on request's
Pipeline string `json:"pipeline"`
// why, written with the caller the runtime proves in the hand-act log
Why string `json:"why"`
}
// ValidateAnswerProblemsItem is a type of the contract.
type ValidateAnswerProblemsItem struct {
// the case before holds it too, so the candidate does not cause it
Before bool `json:"before"`
Module string `json:"module"`
Problem string `json:"problem"`
}
// ValidateAnswer is what validate answers.
type ValidateAnswer struct {
// for failed cycle, the artifacts the cycle passes through
Cycle []string `json:"cycle,omitempty"`
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
Form int64 `json:"form,omitempty"`
// the run's state: running, or its end
Outcome string `json:"outcome"`
// for failed manifest-refused, every problem per manifest, those counted and those the case before holds too
Problems []ValidateAnswerProblemsItem `json:"problems,omitempty"`
// for failed, which
Reason string `json:"reason,omitempty"`
// the validate run as it stands
Run *CompositionRun `json:"run,omitempty"`
// when the run started, while it runs
Started *time.Time `json:"started,omitempty"`
// for could-not-run, why
Why string `json:"why,omitempty"`
}
// The values of ValidateAnswer's outcome.
const (
ValidateAnswerOutcomeRunning = "running"
ValidateAnswerOutcomePassed = "passed"
ValidateAnswerOutcomeFailed = "failed"
ValidateAnswerOutcomeCouldNotRun = "could-not-run"
)
// The values of ValidateAnswer's reason.
const (
ValidateAnswerReasonCycle = "cycle"
ValidateAnswerReasonManifestRefused = "manifest-refused"
)
// KeepNowInput is what keep-now takes.
type KeepNowInput struct {
// why the keeping runs now
@@ -1614,6 +1671,15 @@ func DecodeCompositionsDropAnswer(raw []byte) (CompositionsDropAnswer, int, erro
return v, formRead(raw), nil
}
// DecodeValidateAnswer reads a ValidateAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
func DecodeValidateAnswer(raw []byte) (ValidateAnswer, int, error) {
var v ValidateAnswer
if err := json.Unmarshal(raw, &v); err != nil {
return v, 0, err
}
return v, formRead(raw), nil
}
// DecodeKeepNowAnswer reads a KeepNowAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
func DecodeKeepNowAnswer(raw []byte) (KeepNowAnswer, int, error) {
var v KeepNowAnswer
@@ -163,6 +163,12 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v CompositionsDropInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "C1 compositions-drop answers the run it deleted and the readers it ended", subject: "", given: "{\"ended\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"run\":{\"ask\":\"r1a2b3\",\"candidate\":\"main.12\",\"ended\":\"2026-11-17T10:03:00Z\",\"input\":\"sha256:0123\",\"key\":\"main.12.anchor\",\"machine\":\"anchor\",\"outcome\":\"passed\",\"program\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"directory\":\"cmd/mesh-compose\",\"fingerprint\":\"src2:aaaa\",\"repository\":\"novox/mesh-host\"},\"readers\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"started\":\"2026-11-17T10:00:00Z\",\"verdict\":{\"blamed\":[],\"composes\":true}}}", wire: "{\"ended\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"run\":{\"ask\":\"r1a2b3\",\"candidate\":\"main.12\",\"ended\":\"2026-11-17T10:03:00Z\",\"input\":\"sha256:0123\",\"key\":\"main.12.anchor\",\"machine\":\"anchor\",\"outcome\":\"passed\",\"program\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"directory\":\"cmd/mesh-compose\",\"fingerprint\":\"src2:aaaa\",\"repository\":\"novox/mesh-host\"},\"readers\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"started\":\"2026-11-17T10:00:00Z\",\"verdict\":{\"blamed\":[],\"composes\":true}}}",
decode: func(b []byte) (any, error) { var v CompositionsDropAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "validate asked for a pipeline's candidate", subject: "", given: "{\"candidate\":\"main.12\",\"pipeline\":\"main.3589\",\"why\":\"a manifest changed by a fix has no verdict before its merge\"}", wire: "{\"candidate\":\"main.12\",\"pipeline\":\"main.3589\",\"why\":\"a manifest changed by a fix has no verdict before its merge\"}",
decode: func(b []byte) (any, error) { var v ValidateInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "validate answers a failed run naming a problem the case before holds too", subject: "", given: "{\"outcome\":\"failed\",\"problems\":[{\"before\":true,\"module\":\"nats\",\"problem\":\"a state asks more than 64 MiB\"}],\"reason\":\"manifest-refused\"}", wire: "{\"outcome\":\"failed\",\"problems\":[{\"before\":true,\"module\":\"nats\",\"problem\":\"a state asks more than 64 MiB\"}],\"reason\":\"manifest-refused\"}",
decode: func(b []byte) (any, error) { var v ValidateAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "validate answers a run still running", subject: "", given: "{\"outcome\":\"running\",\"started\":\"2026-11-25T17:00:00Z\"}", wire: "{\"outcome\":\"running\",\"started\":\"2026-11-25T17:00:00Z\"}",
decode: func(b []byte) (any, error) { var v ValidateAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
v, err := c.decode([]byte(c.given))
@@ -12,7 +12,7 @@ const Seat = "npm-package-registry"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 1
const Form = 2
// FormRegistry is the form of what the part registry adds.
const FormRegistry = 1
@@ -20,8 +20,8 @@ const FormRegistry = 1
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "1 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9"
generatedForms = "2 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9"
)
const (
@@ -189,6 +189,14 @@ const (
PublishInputKindUpstream = "upstream"
)
// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729).
type PublishAnswerOtherBytes struct {
// the digest the holder holds for that name and version
Digest string `json:"digest"`
// the fingerprint the holder keeps for it, absent where it keeps none
Fingerprint string `json:"fingerprint,omitempty"`
}
// PublishAnswer is what publish answers.
type PublishAnswer struct {
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
@@ -197,8 +205,10 @@ type PublishAnswer struct {
Held bool `json:"held,omitempty"`
// the digests of the parts the holder lacks, to send by publish-part
Lacks []string `json:"lacks,omitempty"`
// the transfer
Transfer string `json:"transfer"`
// the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729)
OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"`
// the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732)
Transfer string `json:"transfer,omitempty"`
}
// PublishPartInput is what publish-part takes.
@@ -37,6 +37,10 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}",
decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
v, err := c.decode([]byte(c.given))
@@ -13,7 +13,7 @@ const Seat = "oci-artifact-registry"
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
// a reader of a value of another form says "form N, this reader knows M".
const Form = 2
const Form = 3
// FormRegistry is the form of what the part registry adds.
const FormRegistry = 1
@@ -21,8 +21,8 @@ const FormRegistry = 1
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "2 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825"
generatedForms = "3 registry:1"
generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825"
)
const (
@@ -320,6 +320,14 @@ const (
PublishInputKindUpstream = "upstream"
)
// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729).
type PublishAnswerOtherBytes struct {
// the digest the holder holds for that name and version
Digest string `json:"digest"`
// the fingerprint the holder keeps for it, absent where it keeps none
Fingerprint string `json:"fingerprint,omitempty"`
}
// PublishAnswer is what publish answers.
type PublishAnswer struct {
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
@@ -328,8 +336,10 @@ type PublishAnswer struct {
Held bool `json:"held,omitempty"`
// the digests of the parts the holder lacks, to send by publish-part
Lacks []string `json:"lacks,omitempty"`
// the transfer
Transfer string `json:"transfer"`
// the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729)
OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"`
// the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732)
Transfer string `json:"transfer,omitempty"`
}
// PublishPartInput is what publish-part takes.
@@ -57,6 +57,10 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v ListInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "list answers a capped page with the cursor of the next", subject: "", given: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}", wire: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}",
decode: func(b []byte) (any, error) { var v ListAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}",
decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
v, err := c.decode([]byte(c.given))
@@ -68,7 +68,7 @@
"properties": {
"transfer": {
"type": "string",
"description": "the transfer"
"description": "the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732)"
},
"lacks": {
"type": "array",
@@ -80,11 +80,26 @@
"held": {
"type": "boolean",
"description": "the digest is held already: nothing to send; the outcome follows as an event"
},
"other-bytes": {
"type": "object",
"description": "the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729)",
"properties": {
"digest": {
"type": "string",
"description": "the digest the holder holds for that name and version"
},
"fingerprint": {
"type": "string",
"description": "the fingerprint the holder keeps for it, absent where it keeps none"
}
},
"required": [
"digest"
]
}
},
"required": [
"transfer"
]
"required": []
},
"optional": true
},
@@ -160,5 +160,24 @@
"given": {
"reference": "container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
}
},
{
"name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
"fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
}
}
},
{
"name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
}
}
}
]
@@ -136,7 +136,7 @@
},
{
"name": "hold",
"description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 \u00a72); never an image of the holder's own. Emits held.",
"description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 §2); never an image of the holder's own. Emits held.",
"input": {
"type": "object",
"properties": {
@@ -218,7 +218,7 @@
},
{
"name": "list",
"description": "What the store holds of one repository, or of every repository the seat holds when none is named: every image manifest and index, each with its digest, whether it is an index (and the manifests an index names), the tags naming it, its size and whether it is held. Read from the store itself, so a manifest no tag names is listed too; it reads only (ADR 0632 \u00a73).",
"description": "What the store holds of one repository, or of every repository the seat holds when none is named: every image manifest and index, each with its digest, whether it is an index (and the manifests an index names), the tags naming it, its size and whether it is held. Read from the store itself, so a manifest no tag names is listed too; it reads only (ADR 0632 §3).",
"input": {
"type": "object",
"properties": {
@@ -500,5 +500,6 @@
}
]
}
]
],
"form": 2
}
@@ -44,7 +44,7 @@
}
},
{
"name": "a merge call kept with a member merged plainly, its repository having no watched branch",
"name": "a merge call kept with a member merged plainly, its base being no watched branch",
"of": "state:calls/call.<call>",
"given": {
"account": "tools-shanks",
@@ -66,7 +66,7 @@
"repository": "novox/hq",
"state": "merged",
"branch": "main",
"note": "no delivery: the repository has no watched branch"
"note": "no delivery: its base is no watched branch"
}
],
"said": true
@@ -515,7 +515,7 @@
}
},
{
"name": "merge-pull merges a member of a repository with no watched branch plainly, noted no delivery",
"name": "merge-pull merges a member whose base is no watched branch plainly, noted no delivery",
"of": "verb:merge-pull.answer",
"why": "a repository of no module is the forge's business alone (design 47 H2 H-A-471)",
"given": {
@@ -532,7 +532,7 @@
"number": 799,
"state": "merged",
"commit": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"note": "no delivery: the repository has no watched branch"
"note": "no delivery: its base is no watched branch"
}
]
}
@@ -834,7 +834,7 @@
},
{
"name": "merge-pull",
"description": "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, its base a watched branch, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose repository has no watched branch is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery (H-A-471). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit.",
"description": "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose base is no watched branch, whatever its repository, is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery, and merge-called leaves it out (H-A-471, H-A-704). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit.",
"input": {
"type": "object",
"properties": {
@@ -1670,7 +1670,7 @@
},
"note": {
"type": "string",
"description": "for a member merged plainly, its repository having no watched branch: \"no delivery: the repository has no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471)"
"description": "for a member merged plainly, its base being no watched branch, whatever its repository: \"no delivery: its base is no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704)"
}
},
"required": [
@@ -1726,7 +1726,7 @@
},
"branch": {
"type": "string",
"description": "the pull request's base, read at judging: a watched branch, but for a member noted as of a repository with no watched branch"
"description": "the pull request's base, read at judging: a watched branch, but for a member noted as one whose base is no watched branch"
},
"head": {
"type": "string",
@@ -1751,7 +1751,7 @@
},
"note": {
"type": "string",
"description": "for a member merged plainly, its repository having no watched branch: \"no delivery: the repository has no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471)"
"description": "for a member merged plainly, its base being no watched branch, whatever its repository: \"no delivery: its base is no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704)"
}
},
"required": [
@@ -106,5 +106,24 @@
"0.1.19"
]
}
},
{
"name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
"fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
}
}
},
{
"name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
}
}
}
]
@@ -31,5 +31,6 @@
"description": "form none: the Go module proxy's read side, answered anonymously, with no credential (design 51)"
}
}
]
],
"form": 2
}
@@ -173,5 +173,57 @@
"phase": "build",
"at": "2026-11-23T02:40:00Z"
}
},
{
"name": "the step ended superseded in form 4: revision present exactly when superseded (H-A-574, H-A-650)",
"of": "event:step-ended",
"subject": "mesh.seat.mesh-builds.event.step-ended.laptop",
"given": {
"v": 1,
"form": 4,
"id": "m2kx9a1b3c4d6f",
"pipeline": "main.12.nats",
"step": "build",
"node": "laptop",
"outcome": "superseded",
"entries": [
{
"module": "nats",
"fingerprint": "fp-0123"
}
],
"said": "nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch",
"revision": 14
}
},
{
"name": "a package published, naming the build's fingerprint (H-A-707 (6))",
"of": "event:package-published",
"subject": "mesh.seat.mesh-builds.event.package-published",
"given": {
"v": 1,
"artifact": "mesh-sdk:go",
"module": "mesh-sdk",
"version": "0.1.15",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"branch": "main",
"source": 3589,
"dependencies": [
{
"kind": 1,
"version": "0.1.4",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"part": "mesh-contracts:go-nodeengine"
},
{
"kind": 3,
"version": "1.26.0",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"part": "mesh-build-go:toolchain"
}
],
"at": "2026-11-10T10:00:00Z",
"fingerprint": "fp-sdk"
}
}
]
@@ -524,6 +524,10 @@
"type": "integer",
"description": "the catalog revision number of that branch the build was made from, the indexer's count (design 47 H-A-218, H-A-220); absent from a reservation made before the field"
},
"fingerprint": {
"type": "string",
"description": "the fingerprint of the build the reservation holds, so the runner marks every running pipeline of the branch that moves the module at it; absent from a publish whose reservation names none; the builder, the assigner and the indexer read it not and decode it tolerantly (design 47 H2 H-A-707 (6))"
},
"dependencies": {
"type": "array",
"items": {
@@ -689,7 +693,7 @@
},
"revision": {
"type": "integer",
"description": "for a step ended superseded, the module graph revision of the entry that superseded it, 0 when the builder knows none; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-561)"
"description": "the module graph revision of the entry that superseded the step, present exactly when outcome is superseded and absent otherwise; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-574, H-A-650)"
},
"rerun": {
"type": "boolean"
@@ -791,5 +795,5 @@
]
}
},
"form": 3
"form": 4
}
@@ -213,7 +213,8 @@
"call": "release of mesh-sdk 0.1.27",
"call-kind": "release",
"module": "mesh-sdk",
"version": "0.1.27"
"version": "0.1.27",
"needs-rules": 2
}
},
{
@@ -303,6 +304,9 @@
},
"invokes": [
"node-files.read"
],
"consumes": [
"node-engine.running.*.*"
]
}
},
@@ -504,7 +508,13 @@
"artifacts": [
{
"ref": "mesh-grants:program",
"language": "go"
"language": "go",
"digests": [
{
"package": "git.novox.be/novox/mesh-sdk/go/keys",
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"ref": "mesh-grants:tools",
@@ -1691,6 +1691,13 @@
},
"description": "each a seat verb or a module tool it calls"
},
"consumes": {
"type": "array",
"items": {
"type": "string"
},
"description": "the subjects its accepted manifest consumes, filled by the indexer beside invokes (design 47 H2 H-A-621)"
},
"serves": {
"type": "array",
"items": {
@@ -1710,7 +1717,7 @@
"items": {
"type": "string"
},
"description": "the manifest reads a node-engine must state to compose it, its templates' forms included, as the forge bridge read them at the merge (ADR 0614 §4, ADR 0632 §2)"
"description": "the manifest reads a node-engine must state to compose it, its templates' forms included, as the indexer derives them at the take-in (ADR 0614 §4, ADR 0632 §2)"
},
"main": {
"type": "string",
@@ -1989,6 +1996,10 @@
"base": {
"type": "integer",
"description": "the newest kept revision of its branch below it, which the take-in that wrote it pinned for its pipeline: the base of the validate step's case before (design 47 H-A-147, H-A-151, H-A-154); absent on the branch's first take-in"
},
"needs-rules": {
"type": "integer",
"description": "the version of the manifest validator's need rules this revision's entries were derived with, absent read as 0; a take-in derives the rule needs of unmoved entries again only when its own is higher than its base revision's (design 47 H2 H-A-569 (2), H-A-605 (4))"
}
},
"required": [
@@ -2433,6 +2444,27 @@
"ecosystem",
"name"
]
},
"digests": {
"type": "array",
"items": {
"type": "object",
"properties": {
"package": {
"type": "string",
"description": "the package's Go import path or npm name"
},
"digest": {
"type": "string",
"description": "the package's digest, by its files (design 47 H2 H-A-580)"
}
},
"required": [
"package",
"digest"
]
},
"description": "the digest of each package of the artifact, kept by the indexer when it computes the entry, so an importer reads the digest of each package it imports from the entry that publishes it (design 47 H2 H-A-580)"
}
},
"required": [
@@ -2566,5 +2598,5 @@
]
}
},
"form": 6
"form": 7
}
@@ -44,7 +44,8 @@
"at": "2026-11-09T21:00:00Z",
"branch": "main",
"source": 1044,
"call": "0123456789abcdef"
"call": "0123456789abcdef",
"ends": 2
}
},
{
@@ -327,6 +327,10 @@
"type": "string",
"format": "date-time",
"description": "when"
},
"ends": {
"type": "integer",
"description": "the record's end count, one higher at each end after the first, as pipeline-ended's end count is (design 47 H2 H-A-597, H-A-617)"
}
},
"required": [
@@ -719,5 +723,5 @@
]
}
},
"form": 2
"form": 3
}
@@ -16,7 +16,8 @@
"commit": "0123456789abcdef0123456789abcdef01234567",
"fingerprint": "fp-sdk",
"repository": "mesh-sdk",
"tier": 1
"tier": 1,
"version": "0.1.15"
},
{
"module": "nats",
@@ -48,7 +49,11 @@
"tier": 1
}
],
"kept": [292, 295, 298],
"kept": [
292,
295,
298
],
"at": "2026-11-22T20:00:00Z"
}
},
@@ -359,7 +364,9 @@
"v": 1,
"step": "pipeline",
"on": "pipelines-at-once",
"since": "2026-11-10T10:01:00Z"
"since": "2026-11-10T10:01:00Z",
"bound": "30m",
"clock-from": "2026-11-10T10:01:00Z"
}
},
{
@@ -601,5 +608,29 @@
"mover": "mesh-sdk",
"revision": 412
}
},
{
"name": "a mover added from the pipeline it came from (H-A-594 (4))",
"of": "event:mover-added",
"subject": "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589",
"given": {
"pipeline": "main.3589",
"revision": 12,
"module": "mesh-sdk",
"fingerprint": "fp-sdk",
"from": "main.3580"
}
},
{
"name": "a mover added by a take-in whose pipeline key is held (H-A-609 (3))",
"of": "event:mover-added",
"subject": "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589",
"given": {
"pipeline": "main.3589",
"revision": 12,
"module": "nats",
"fingerprint": "fp-0123",
"take-in": 3590
}
}
]
@@ -103,7 +103,8 @@
"why": "nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch",
"fingerprint": "fp-0123",
"seat": "mesh-builds",
"module": "nats"
"module": "nats",
"held-at": "2026-11-10T10:00:30Z"
}
],
"started": "2026-11-10T10:00:00Z",
@@ -86,6 +86,16 @@
"artifact": "nats:program",
"what": "started",
"at": "2026-11-10T10:00:00Z"
},
{
"pipeline": "main.3589",
"module": "nats",
"step": "build",
"artifact": "nats:program",
"what": "started",
"at": "2026-11-10T10:05:00Z",
"revision": 14,
"passed-over": 13
}
],
"fill": [
@@ -341,5 +351,136 @@
"pipeline": "main.20",
"why": "a mover waits on its registration and another failed"
}
},
{
"name": "place-unfinished with all, one hand act",
"of": "verb:place-unfinished.input",
"given": {
"all": true,
"why": "the unfinished movers of the old pipelines (design 47 H2 H-A-644)"
}
},
{
"name": "place-unfinished with one key",
"of": "verb:place-unfinished.input",
"given": {
"key": "main.mesh-sdk",
"why": "the mover passed on its own"
}
},
{
"name": "show answers a page of movers' rows with their fingerprint and version, moved and capped (H-A-709)",
"of": "verb:show.answer",
"given": {
"pipeline": {
"pipeline": "main.3589",
"branch": "main",
"revision": 12,
"source": 3589,
"v": 1,
"outcome": "running",
"mover-count": 129,
"step-count": 516,
"movers": [],
"steps": []
},
"movers": [
{
"module": "nats",
"outcome": "running",
"fingerprint": "fp-0123",
"version": "0.1.9",
"tier": 2
},
{
"module": "mesh-sdk",
"outcome": "passed",
"fingerprint": "fp-sdk",
"tier": 1
}
],
"capped": true,
"total": 129,
"next": "cursor-1",
"moved": true
}
},
{
"name": "stands answers a page, capped, with the total and the cursor of the next (H-A-709)",
"of": "verb:stands.answer",
"given": {
"stands": [
{
"pipeline": "main.3589",
"module": "nats",
"branch": "main",
"revision": 12,
"source": 3589,
"v": 1,
"step": "unit",
"artifact": "nats:program",
"on": "build node",
"since": "2026-11-10T10:00:00Z"
}
],
"capped": true,
"total": 300,
"next": "cursor-2"
}
},
{
"name": "stands asked for one pipeline and module, within a bound (H-A-709)",
"of": "verb:stands.input",
"given": {
"pipeline": "main.3589",
"module": "nats",
"bound": 32768,
"next": "cursor-2"
}
},
{
"name": "show asked within a bound (H-A-709)",
"of": "verb:show.input",
"given": {
"pipeline": "main.3589",
"bound": 65536,
"next": "cursor-1"
}
},
{
"name": "place-unfinished with all answers each key put and each that could not be (H-A-725)",
"of": "verb:place-unfinished.answer",
"given": {
"placed": [
{
"key": "main.nats",
"pipeline": "main.3589.unfinished.nats"
}
],
"failed": [
{
"key": "main.gitea",
"words": "its entry is not read"
}
]
}
},
{
"name": "place-unfinished with all over no key answers two empty lists and says so (H-A-725)",
"of": "verb:place-unfinished.answer",
"given": {
"placed": [],
"failed": [],
"said": "no key in unfinished"
}
},
{
"name": "place-unfinished with one key answers its pipeline",
"of": "verb:place-unfinished.answer",
"given": {
"pipeline": "main.3589.unfinished.nats",
"placed": [],
"failed": []
}
}
]
@@ -93,7 +93,7 @@
},
{
"name": "show",
"description": "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). Reads only.",
"description": "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). The answer names only the movers its page holds, with each row's fingerprint and version, mover-count and step-count and no unlogged; it answers within bound, capped, total and next, and moved true when the record was written between two pages (design 47 H2 H-A-709 (1), (2)). Reads only.",
"input": {
"type": "object",
"properties": {
@@ -125,7 +125,13 @@
},
"next": {
"type": "string",
"description": "the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789)"
"description": "the cursor the previous page answered, opaque: the place of the next row or step among those the filters hold and the record's revision; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57))"
},
"bound": {
"type": "integer",
"minimum": 4096,
"maximum": 786432,
"description": "the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2))"
}
},
"required": [
@@ -152,7 +158,7 @@
},
"capped": {
"type": "boolean",
"description": "yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789)"
"description": "yes when the answer stopped at bound; the rest is read from next (design 47 H2 H-A-709 (2))"
},
"total": {
"type": "integer",
@@ -168,6 +174,10 @@
"$ref": "#/defs/MoverRow"
},
"description": "each mover's row, when show names no mover, step or state (design 47 H2 H-A-376)"
},
"moved": {
"type": "boolean",
"description": "yes when a page was asked with a next of another revision of the record: it answers from that place, though rows and steps may have changed between the pages; a reader that needs one whole picture reads again with no next (design 47 H2 H-A-709 (2))"
}
},
"required": [
@@ -231,10 +241,29 @@
},
{
"name": "stands",
"description": "What stands still, and since when: each step not ended and each wait held. Reads only.",
"description": "What stands still, and since when: each step not ended and each wait held, in the order of their since, then their pipeline, module, step and artifact, within bound; reads only (design 47 H2 H-A-709 (2)).",
"input": {
"type": "object",
"properties": {}
"properties": {
"pipeline": {
"type": "string",
"description": "only this pipeline's waits, applied while reading"
},
"module": {
"type": "string",
"description": "only this module's waits, applied while reading"
},
"bound": {
"type": "integer",
"minimum": 4096,
"maximum": 786432,
"description": "the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2))"
},
"next": {
"type": "string",
"description": "the cursor the previous page answered, opaque: the place of the last wait answered, so the next page answers the waits after it; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57))"
}
}
},
"answer": {
"type": "object",
@@ -244,6 +273,18 @@
"items": {
"$ref": "#/defs/Wait"
}
},
"capped": {
"type": "boolean",
"description": "yes when the answer stopped at bound; the rest is read from next"
},
"total": {
"type": "integer",
"description": "how many waits the filters hold in all"
},
"next": {
"type": "string",
"description": "the cursor of the next page, opaque; empty at the end"
}
},
"required": [
@@ -598,21 +639,24 @@
},
{
"name": "place-unfinished",
"description": "A mover kept in the state unfinished put in a pipeline of its own at once, keyed <branch>.<revision>.unfinished.<module>; written in the hand-act log (design 47 H2 §786, H-A-398).",
"description": "A mover kept in the state unfinished put in a pipeline of its own at once, keyed <branch>.<revision>.unfinished.<module>; written in the hand-act log (design 47 H2 §786, H-A-398). With all, each key of unfinished is put in a pipeline of its own; the answer names every pipeline put and every key that could not be (design 47 H2 H-A-725).",
"input": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "the unfinished entry's key, <branch>.<module>"
"description": "the unfinished entry's key, <branch>.<module>; exactly one of key or all"
},
"why": {
"type": "string",
"description": "why, written with the caller the runtime proves in the hand-act log"
},
"all": {
"type": "boolean",
"description": "true to put every key of unfinished at once, one hand act; exactly one of key or all (design 47 H2 H-A-644)"
}
},
"required": [
"key",
"why"
]
},
@@ -621,11 +665,58 @@
"properties": {
"pipeline": {
"type": "string",
"description": "the key of the pipeline the mover is put in"
"description": "with key, the key of the pipeline the mover is put in; absent with all"
},
"placed": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "the unfinished entry's key"
},
"pipeline": {
"type": "string",
"description": "the key of the pipeline the mover is put in"
}
},
"required": [
"key",
"pipeline"
]
},
"description": "one item per key put with all, empty with key; always present (design 47 H2 H-A-725)"
},
"failed": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "the unfinished entry's key"
},
"words": {
"type": "string",
"description": "why it could not be put"
}
},
"required": [
"key",
"words"
]
},
"description": "one item per key that could not be put with all, empty with key; always present (design 47 H2 H-A-725)"
},
"said": {
"type": "string",
"description": "with all and no key in unfinished, that two empty lists are the answer (design 47 H2 H-A-725)"
}
},
"required": [
"pipeline"
"placed",
"failed"
]
},
"class": "act"
@@ -767,6 +858,17 @@
"max-mib": 32
}
},
{
"name": "mover-added",
"subject": "mover-added.<branch>.<revision>",
"body": {
"$ref": "#/defs/MoverAdded"
},
"keep": {
"max-age-days": 90,
"max-mib": 32
}
},
{
"name": "pipeline-ended",
"subject": "pipeline-ended.<branch>.<revision>",
@@ -1225,6 +1327,11 @@
"type": "string",
"description": "for a carried result, the pipeline it was carried from"
},
"held-at": {
"type": "string",
"format": "date-time",
"description": "when the step was held, written at the hold and cleared at its end; absent when it holds no wait, so the ended wait, stands and the watchman's seed read the same time (design 47 H2 H-A-738 (2))"
},
"rerun": {
"type": "boolean",
"description": "the step was asked again by the runner's rerun"
@@ -1411,15 +1518,15 @@
"items": {
"$ref": "#/defs/LogEntry"
},
"description": "the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189)"
"description": "the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189); show's answer carries none (design 47 H2 H-A-709 (1))"
},
"mover-count": {
"type": "integer",
"description": "how many movers the pipeline has, set by list alone (H-A-191)"
"description": "how many movers the pipeline has, set by list and by show (H-A-191, design 47 H2 H-A-709 (1))"
},
"step-count": {
"type": "integer",
"description": "how many steps the pipeline's movers have, set by list alone, which answers the record with its steps empty (H-A-191)"
"description": "how many steps the pipeline's movers have, set by list, which answers the record with its steps empty, and by show (H-A-191, design 47 H2 H-A-709 (1))"
},
"published": {
"$ref": "#/defs/Published",
@@ -1665,9 +1772,9 @@
"movers": {
"type": "array",
"items": {
"$ref": "#/defs/Mover"
"$ref": "#/defs/StartedMover"
},
"description": "the pipeline's movers"
"description": "the pipeline's movers, each with what its readers read (design 47 H2 H-A-709 (3))"
},
"run": {
"type": "string",
@@ -1890,6 +1997,15 @@
"type": "string",
"description": "the step's own ask, where it has one (design 47 G §731)"
},
"bound": {
"type": "string",
"description": "a duration such as 30m: the runner's stalled-bound, which the watchman times the wait by (design 47 H2 H-A-599, H-A-611, H-A-736)"
},
"clock-from": {
"type": "string",
"format": "date-time",
"description": "the time the bound counts from: when the wait was held (design 47 H2 H-A-599, H-A-736)"
},
"shared": {
"type": "array",
"items": {
@@ -1969,6 +2085,14 @@
"type": "string"
},
"description": "the keys of the kept results the step wrote or carried, <level>.<digest>, which the runner ages by their last-read (design 47 G sections 330, 470)"
},
"revision": {
"type": "integer",
"description": "the pipeline's own revision, present on the entry of a step asked again after an end the runner passed over (design 47 H2 H-A-743)"
},
"passed-over": {
"type": "integer",
"description": "the revision the passed-over end named, present with revision (design 47 H2 H-A-743)"
}
},
"description": "one entry of the step log",
@@ -2364,6 +2488,18 @@
"module": {
"type": "string"
},
"fingerprint": {
"type": "string",
"description": "the mover's build-input fingerprint, which the delivery view's pipeline page reads from the row (design 47 H2 H-A-709 (1))"
},
"version": {
"type": "string",
"description": "the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1))"
},
"tier": {
"type": "integer",
"description": "the mover's tier in the pipeline's delivery order, from 1, which the delivery view's tiered page groups the movers by (design 47 H2 H-A-730)"
},
"outcome": {
"type": "string",
"enum": [
@@ -2384,7 +2520,80 @@
"module",
"outcome"
]
},
"MoverAdded": {
"type": "object",
"description": "a mover added to a pipeline that waits or runs, or put in a reopened one: said on the pipeline's subject as pipeline-started is, with exactly one of from, caller or take-in; a reader refuses one naming none or two (design 47 H2 H-A-594 (4), H-A-609 (3), H-A-645)",
"properties": {
"pipeline": {
"type": "string",
"description": "the key of the pipeline that carries the mover"
},
"revision": {
"type": "integer",
"description": "the catalog graph revision of the pipeline"
},
"module": {
"type": "string"
},
"fingerprint": {
"type": "string",
"description": "the mover's fingerprint"
},
"from": {
"type": "string",
"description": "the key of the pipeline the mover came from"
},
"caller": {
"type": "string",
"description": "the caller of start, as the runtime proved it"
},
"take-in": {
"type": "integer",
"description": "the source revision of the take-in whose entries were added to a pipeline already held"
}
},
"required": [
"pipeline",
"revision",
"module",
"fingerprint"
]
},
"StartedMover": {
"type": "object",
"description": "one mover of a pipeline-started: what its readers read, the gate's module, fingerprint and version; published, widens, tests, unplaced, revision and over-budget stay in the pipeline's record, read by show (design 47 H2 H-A-709 (3))",
"properties": {
"module": {
"type": "string"
},
"commit": {
"type": "string",
"description": "the commit the module's entry was last changed at"
},
"fingerprint": {
"type": "string",
"description": "the module's build-input fingerprint at the commit"
},
"repository": {
"type": "string"
},
"tier": {
"type": "integer",
"description": "the mover's tier in the pipeline's delivery order, from 1 (ADR 0666 section 14; design 47 H section 746)"
},
"version": {
"type": "string",
"description": "the version released for the mover in this pipeline, absent until one is (design 47 H-A-52)"
}
},
"required": [
"module",
"commit",
"fingerprint",
"repository"
]
}
},
"form": 12
"form": 13
}
@@ -296,5 +296,37 @@
}
]
}
},
{
"name": "validate asked for a pipeline's candidate",
"of": "verb:validate.input",
"given": {
"pipeline": "main.3589",
"candidate": "main.12",
"why": "a manifest changed by a fix has no verdict before its merge"
}
},
{
"name": "validate answers a failed run naming a problem the case before holds too",
"of": "verb:validate.answer",
"given": {
"outcome": "failed",
"reason": "manifest-refused",
"problems": [
{
"module": "nats",
"problem": "a state asks more than 64 MiB",
"before": true
}
]
}
},
{
"name": "validate answers a run still running",
"of": "verb:validate.answer",
"given": {
"outcome": "running",
"started": "2026-11-25T17:00:00Z"
}
}
]
@@ -278,6 +278,106 @@
]
}
},
{
"name": "validate",
"class": "act",
"description": "Judge a pipeline's candidate on request, the manifest validator's verdict of its manifests: the act and why are written in the hand-act log first, then the candidate's validate run, keyed <pipeline>.validate, is joined or started with the step's own code, so a validate step asked later joins it and builds no second manifest validator. It answers the run as it stands: running with its start, or its end: passed; failed cycle naming the cycle; failed manifest-refused with every problem per manifest, those counted and those the case before holds too; could-not-run with why. It writes no want and ends no step (design 47 H2 H-A-684 (1), H-A-702, H-A-727).",
"input": {
"type": "object",
"properties": {
"pipeline": {
"type": "string",
"description": "a pipeline's key as the runner names it, a delivering pipeline's or a run on request's"
},
"module": {
"type": "string",
"description": "narrows the answer to this module's manifest"
},
"candidate": {
"type": "string",
"description": "the candidate's key as mesh-pipeline-runner.show names it: <branch>.<revision>, or run-<id> for a run on request"
},
"why": {
"type": "string",
"description": "why, written with the caller the runtime proves in the hand-act log"
}
},
"required": [
"pipeline",
"why"
]
},
"answer": {
"type": "object",
"properties": {
"run": {
"$ref": "#/defs/CompositionRun",
"description": "the validate run as it stands"
},
"outcome": {
"type": "string",
"enum": [
"running",
"passed",
"failed",
"could-not-run"
],
"description": "the run's state: running, or its end"
},
"started": {
"type": "string",
"format": "date-time",
"description": "when the run started, while it runs"
},
"reason": {
"type": "string",
"enum": [
"cycle",
"manifest-refused"
],
"description": "for failed, which"
},
"cycle": {
"type": "array",
"items": {
"type": "string"
},
"description": "for failed cycle, the artifacts the cycle passes through"
},
"problems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"module": {
"type": "string"
},
"problem": {
"type": "string"
},
"before": {
"type": "boolean",
"description": "the case before holds it too, so the candidate does not cause it"
}
},
"required": [
"module",
"problem",
"before"
]
},
"description": "for failed manifest-refused, every problem per manifest, those counted and those the case before holds too"
},
"why": {
"type": "string",
"description": "for could-not-run, why"
}
},
"required": [
"outcome"
]
}
},
{
"name": "keep-now",
"description": "Keep the assignment graph's revisions now, by hand (design 47 H2 §813 (2); H-A-417): written in the hand-act log first by the module's tool assigner_keep_now, then the keeping runs at once on the pass's newest computed revision; answers the revision kept, or the fault the keeping met.",
@@ -1910,5 +2010,5 @@
"on": "every"
}
],
"form": 3
"form": 4
}
@@ -106,5 +106,24 @@
"0.1.19"
]
}
},
{
"name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
"fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
}
}
},
{
"name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
}
}
}
]
@@ -31,5 +31,6 @@
"description": "form none: the npm registry's read side, answered anonymously, with no credential (design 51)"
}
}
]
],
"form": 2
}
@@ -164,5 +164,24 @@
"total": 3,
"next": "c-4183"
}
},
{
"name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
"fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
}
}
},
{
"name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)",
"of": "verb:publish.answer",
"given": {
"other-bytes": {
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
}
}
}
]
@@ -397,5 +397,5 @@
]
}
],
"form": 2
"form": 3
}
@@ -64,6 +64,7 @@ export type KeptEvent = registry.KeptEvent;
export type Outcome = registry.Outcome;
export type Part = registry.Part;
export type PublishAnswer = registry.PublishAnswer;
export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes;
export type PublishInput = registry.PublishInput;
export type PublishPartAnswer = registry.PublishPartAnswer;
export type PublishPartInput = registry.PublishPartInput;
@@ -96,6 +96,14 @@ export interface PublishInput {
"version"?: string;
}
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
export interface PublishAnswerOtherBytes {
/** the digest the holder holds for that name and version */
"digest": string;
/** the fingerprint the holder keeps for it, absent where it keeps none */
"fingerprint"?: string;
}
/** is what publish answers. */
export interface PublishAnswer {
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
@@ -104,8 +112,10 @@ export interface PublishAnswer {
"held"?: boolean;
/** the digests of the parts the holder lacks, to send by publish-part */
"lacks"?: string[];
/** the transfer */
"transfer": string;
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
"other-bytes"?: PublishAnswerOtherBytes;
/** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */
"transfer"?: string;
}
/** is what publish-part takes. */
+3 -3
View File
@@ -92,12 +92,12 @@ export interface Call {
/** one member of a kept call */
export interface CallMember {
/** the pull request's base, read at judging: a watched branch, but for a member noted as of a repository with no watched branch */
/** the pull request's base, read at judging: a watched branch, but for a member noted as one whose base is no watched branch */
"branch": string;
/** for merged, the merge commit */
"commit"?: string;
"head": string;
/** for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471) */
/** for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704) */
"note"?: string;
"number": number;
"repository": string;
@@ -146,7 +146,7 @@ export interface FailedStep {
export interface MemberOutcome {
/** for merged, the merge commit; for a member refused already-merged, its commit */
"commit"?: string;
/** for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471) */
/** for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704) */
"note"?: string;
"number": number;
"repository": string;
@@ -35,6 +35,7 @@ export type KeptEvent = registry.KeptEvent;
export type Outcome = registry.Outcome;
export type Part = registry.Part;
export type PublishAnswer = registry.PublishAnswer;
export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes;
export type PublishInput = registry.PublishInput;
export type PublishPartAnswer = registry.PublishPartAnswer;
export type PublishPartInput = registry.PublishPartInput;
@@ -96,6 +96,14 @@ export interface PublishInput {
"version"?: string;
}
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
export interface PublishAnswerOtherBytes {
/** the digest the holder holds for that name and version */
"digest": string;
/** the fingerprint the holder keeps for it, absent where it keeps none */
"fingerprint"?: string;
}
/** is what publish answers. */
export interface PublishAnswer {
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
@@ -104,8 +112,10 @@ export interface PublishAnswer {
"held"?: boolean;
/** the digests of the parts the holder lacks, to send by publish-part */
"lacks"?: string[];
/** the transfer */
"transfer": string;
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
"other-bytes"?: PublishAnswerOtherBytes;
/** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */
"transfer"?: string;
}
/** is what publish-part takes. */
@@ -83,6 +83,8 @@ export interface PackagePublished {
"dependencies"?: Dependency[];
/** the published artifact's digest */
"digest": string;
/** the fingerprint of the build the reservation holds, so the runner marks every running pipeline of the branch that moves the module at it; absent from a publish whose reservation names none; the builder, the assigner and the indexer read it not and decode it tolerantly (design 47 H2 H-A-707 (6)) */
"fingerprint"?: string;
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
/** the module */
@@ -135,7 +137,7 @@ export interface StepEnded {
"packages"?: Record<string, string>;
"pipeline": string;
"rerun"?: boolean;
/** for a step ended superseded, the module graph revision of the entry that superseded it, 0 when the builder knows none; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-561) */
/** the module graph revision of the entry that superseded the step, present exactly when outcome is superseded and absent otherwise; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-574, H-A-650) */
"revision"?: number;
/** why it failed, could not run or was superseded: the entry not built, the part not heard, the superseding fingerprint */
"said"?: string;
@@ -171,6 +171,13 @@ export interface ActingRule {
"step": string;
}
export interface ArtifactDigestsItem {
/** the package's digest, by its files (design 47 H2 H-A-580) */
"digest": string;
/** the package's Go import path or npm name */
"package": string;
}
/** the package's name read from the revision's own files at the artifact's path (the module of its go.mod, the name of its package.json, the manifest's image name), written at take-in (design 47 G section 676) */
export interface ArtifactPackage {
/** go, npm or image */
@@ -180,6 +187,8 @@ export interface ArtifactPackage {
/** one artifact of a module in the catalog graph entry */
export interface Artifact {
/** the digest of each package of the artifact, kept by the indexer when it computes the entry, so an importer reads the digest of each package it imports from the entry that publishes it (design 47 H2 H-A-580) */
"digests"?: ArtifactDigestsItem[];
/** the artifact's kind */
"kind"?: string;
/** the artifact's language as its manifest says it (go, typescript, ...); a step's build seat is read from it (design 47 G section 323) */
@@ -216,6 +225,8 @@ export interface CatalogEntry {
"class"?: string;
/** the merge commit it was last changed at */
"commit": string;
/** the subjects its accepted manifest consumes, filled by the indexer beside invokes (design 47 H2 H-A-621) */
"consumes"?: string[];
/** the requirements the manifest's contributes object names as keys, sorted, its local names not carried; each is also in requires (design 47 G section 709) */
"contributes"?: string[];
/** the edges into this module's artifacts, each from the artifact that comes first; the build and the delivery order by these alone */
@@ -236,7 +247,7 @@ export interface CatalogEntry {
/** the sha256: digest of the manifest's bytes as the forge answered them, set by the indexer at take-in and never computed again from the manifest whole; the module's value and the manifests key are this digest (design 47 G section 506) */
"manifest-digest"?: string;
"module": string;
/** the manifest reads a node-engine must state to compose it, its templates' forms included, as the forge bridge read them at the merge (ADR 0614 §4, ADR 0632 §2) */
/** the manifest reads a node-engine must state to compose it, its templates' forms included, as the indexer derives them at the take-in (ADR 0614 §4, ADR 0632 §2) */
"needs"?: string[];
/** why it has none */
"none"?: string;
@@ -292,6 +303,8 @@ export interface CatalogRevision {
"module"?: string;
/** the movers of the take-in that wrote it, so a redelivered source-moved whose revision is kept says take-in.taken again from them, recomputing nothing (design 47 H §743, H-A-92); absent for one with no mover */
"movers"?: TakeInEntry[];
/** the version of the manifest validator's need rules this revision's entries were derived with, absent read as 0; a take-in derives the rule needs of unmoved entries again only when its own is higher than its base revision's (design 47 H2 H-A-569 (2), H-A-605 (4)) */
"needs-rules"?: number;
/** for call-kind take-in-again, the repository taken in again (H-A-215) */
"repository"?: string;
/** the catalog graph revision's number, counted by its holder */
@@ -269,6 +269,8 @@ export interface RecordEndedEvent {
"branch": string;
/** the merge call */
"call": string;
/** the record's end count, one higher at each end after the first, as pipeline-ended's end count is (design 47 H2 H-A-597, H-A-617) */
"ends"?: number;
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
/** its milestone, <branch>.<source> */
@@ -26,6 +26,7 @@ export declare const verbs: {
export declare const events: {
readonly pipelineStarted: "pipeline-started";
readonly moverAdded: "mover-added";
readonly pipelineEnded: "pipeline-ended";
readonly runStarted: "run-started";
readonly stepStarted: "step-started";
@@ -46,6 +47,12 @@ export declare function pipelineStartedSubject(branch: string, revision: string)
export declare const pipelineStartedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*";
export declare const moverAddedStream: "SEAT_mesh-pipeline-runner_mover-added";
export declare function moverAddedSubject(branch: string, revision: string): string;
export declare const moverAddedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.mover-added.*.*";
export declare const pipelineEndedStream: "SEAT_mesh-pipeline-runner_pipeline-ended";
export declare function pipelineEndedSubject(branch: string, revision: string): string;
@@ -220,7 +227,11 @@ export interface LogEntry {
/** the module of the mover whose step the entry is of (H-A-190) */
"module"?: string;
"outcome"?: "running" | "waiting" | "passed" | "failed" | "nothing to run" | "bypassed" | "carried" | "could not run" | "waiting for a build node" | "did not build" | "accepted" | "declined" | "superseded" | "cancelled";
/** the revision the passed-over end named, present with revision (design 47 H2 H-A-743) */
"passed-over"?: number;
"pipeline": string;
/** the pipeline's own revision, present on the entry of a step asked again after an end the runner passed over (design 47 H2 H-A-743) */
"revision"?: number;
"step": "build" | "lint" | "unit" | "integration" | "composition" | "review" | "approval";
"what": "started" | "ended";
}
@@ -257,6 +268,25 @@ export interface Mover {
"widens"?: Widening[];
}
/** a mover added to a pipeline that waits or runs, or put in a reopened one: said on the pipeline's subject as pipeline-started is, with exactly one of from, caller or take-in; a reader refuses one naming none or two (design 47 H2 H-A-594 (4), H-A-609 (3), H-A-645) */
export interface MoverAdded {
/** the caller of start, as the runtime proved it */
"caller"?: string;
/** the mover's fingerprint */
"fingerprint": string;
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
/** the key of the pipeline the mover came from */
"from"?: string;
"module": string;
/** the key of the pipeline that carries the mover */
"pipeline": string;
/** the catalog graph revision of the pipeline */
"revision": number;
/** the source revision of the take-in whose entries were added to a pipeline already held */
"take-in"?: number;
}
/** one mover at its pipeline's end (design 47 H §746) */
export interface MoverEnded {
/** the commit the mover's entry was last changed at, from the pipeline's value (design 47 H-A-119) */
@@ -277,9 +307,15 @@ export interface MoverEnded {
/** one mover of a pipeline in show's short form (design 47 H2 H-A-376) */
export interface MoverRow {
"failed"?: FailedStep;
/** the mover's build-input fingerprint, which the delivery view's pipeline page reads from the row (design 47 H2 H-A-709 (1)) */
"fingerprint"?: string;
"module": string;
/** waiting for a mover with no step placed; running while a required step is open; failed once a required step did not pass; superseded for one a newer pipeline took out */
"outcome": "waiting" | "running" | "passed" | "failed" | "superseded";
/** the mover's tier in the pipeline's delivery order, from 1, which the delivery view's tiered page groups the movers by (design 47 H2 H-A-730) */
"tier"?: number;
/** the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1)) */
"version"?: string;
}
/** one pipeline of one take-in, its movers the take-in's entries, as the runner keeps it in its state pipelines by compare-and-set (design 47 H §746) */
@@ -293,7 +329,7 @@ export interface Pipeline {
"ended"?: string;
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
/** how many movers the pipeline has, set by list alone (H-A-191) */
/** how many movers the pipeline has, set by list and by show (H-A-191, design 47 H2 H-A-709 (1)) */
"mover-count"?: number;
/** the modules the pipeline moves, its take-in's entries (design 47 H §746) */
"movers": Mover[];
@@ -311,13 +347,13 @@ export interface Pipeline {
/** the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9) */
"source": number;
"started"?: string;
/** how many steps the pipeline's movers have, set by list alone, which answers the record with its steps empty (H-A-191) */
/** how many steps the pipeline's movers have, set by list, which answers the record with its steps empty, and by show (H-A-191, design 47 H2 H-A-709 (1)) */
"step-count"?: number;
/** every mover's steps, each naming its mover, approval last; in the state pipelines a record's own are empty, each mover's kept under its own key (H-A-187) */
"steps": StepResult[];
/** the modules a newer waiting take-in of the same branch took out of the pipeline, written with the movers by compare-and-set; at its placing the runner writes a mover's build-step why from it (design 47 H §748, H-A-107) */
"superseded"?: string[];
/** the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189) */
/** the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189); show's answer carries none (design 47 H2 H-A-709 (1)) */
"unlogged"?: LogEntry[];
/** the layout version */
"v"?: number;
@@ -461,8 +497,8 @@ export interface PipelineStarted {
"form"?: number;
/** every catalog revision the pipeline's movers are kept at, said again in full at each re-pin, so the indexer pins each while the pipeline runs (design 47 H2 H-A-496 and its addendum) */
"kept"?: number[];
/** the pipeline's movers */
"movers": Mover[];
/** the pipeline's movers, each with what its readers read (design 47 H2 H-A-709 (3)) */
"movers": StartedMover[];
/** the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
"pipeline": string;
/** for a pipeline a package's publish started, that publish (A-202) */
@@ -516,6 +552,20 @@ export interface Shared {
"run": string;
}
/** one mover of a pipeline-started: what its readers read, the gate's module, fingerprint and version; published, widens, tests, unplaced, revision and over-budget stay in the pipeline's record, read by show (design 47 H2 H-A-709 (3)) */
export interface StartedMover {
/** the commit the module's entry was last changed at */
"commit": string;
/** the module's build-input fingerprint at the commit */
"fingerprint": string;
"module": string;
"repository": string;
/** the mover's tier in the pipeline's delivery order, from 1 (ADR 0666 section 14; design 47 H section 746) */
"tier"?: number;
/** the version released for the mover in this pipeline, absent until one is (design 47 H-A-52) */
"version"?: string;
}
/** a step's start or end: the step, its status, its outcome, its fingerprint, its test counts, what a carried result was carried from, and for a rerun that it is one and its proved caller; a bypassed step too */
export interface StepEvent {
"at"?: string;
@@ -556,6 +606,8 @@ export interface StepResult {
"ended"?: string;
/** the artifact's build-input fingerprint the step ran at */
"fingerprint"?: string;
/** when the step was held, written at the hold and cleared at its end; absent when it holds no wait, so the ended wait, stands and the watchman's seed read the same time (design 47 H2 H-A-738 (2)) */
"held-at"?: string;
/** the mover the step is of (design 47 H-A-35) */
"module"?: string;
/** the node whose holder ended it */
@@ -646,8 +698,12 @@ export interface Wait {
"artifact"?: string;
/** the step's own ask, where it has one (design 47 G §731) */
"ask"?: string;
/** a duration such as 30m: the runner's stalled-bound, which the watchman times the wait by (design 47 H2 H-A-599, H-A-611, H-A-736) */
"bound"?: string;
/** the watched branch, or the branch of a run on request */
"branch": string;
/** the time the bound counts from: when the wait was held (design 47 H2 H-A-599, H-A-736) */
"clock-from"?: string;
/** the commit the module's entry was last changed at */
"commit"?: string;
/** the module's build-input fingerprint at the commit */
@@ -730,9 +786,11 @@ export interface StartAnswer {
/** is what show takes. */
export interface ShowInput {
/** the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2)) */
"bound"?: number;
/** a mover's module: the answer's pipeline then holds that mover's steps alone (H-A-187); with neither mover, step nor state the answer holds each mover's row (design 47 H2 H-A-376) */
"mover"?: string;
/** the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789) */
/** the cursor the previous page answered, opaque: the place of the next row or step among those the filters hold and the record's revision; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57)) */
"next"?: string;
/** the pipeline's key */
"pipeline": string;
@@ -744,12 +802,14 @@ export interface ShowInput {
/** is what show answers. */
export interface ShowAnswer {
/** yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789) */
/** yes when the answer stopped at bound; the rest is read from next (design 47 H2 H-A-709 (2)) */
"capped"?: boolean;
"fill"?: Fill[];
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
"log"?: LogEntry[];
/** yes when a page was asked with a next of another revision of the record: it answers from that place, though rows and steps may have changed between the pages; a reader that needs one whole picture reads again with no next (design 47 H2 H-A-709 (2)) */
"moved"?: boolean;
/** each mover's row, when show names no mover, step or state (design 47 H2 H-A-376) */
"movers"?: MoverRow[];
/** the cursor of the next page, opaque; empty at the end (design 47 H2 §779) */
@@ -784,13 +844,27 @@ export interface ListAnswer {
/** is what stands takes. */
export interface StandsInput {
/** the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2)) */
"bound"?: number;
/** only this module's waits, applied while reading */
"module"?: string;
/** the cursor the previous page answered, opaque: the place of the last wait answered, so the next page answers the waits after it; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57)) */
"next"?: string;
/** only this pipeline's waits, applied while reading */
"pipeline"?: string;
}
/** is what stands answers. */
export interface StandsAnswer {
/** yes when the answer stopped at bound; the rest is read from next */
"capped"?: boolean;
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
/** the cursor of the next page, opaque; empty at the end */
"next"?: string;
"stands": Wait[];
/** how many waits the filters hold in all */
"total"?: number;
}
/** is what why-carried takes. */
@@ -928,20 +1002,42 @@ export interface PlaceAnswer {
/** is what place-unfinished takes. */
export interface PlaceUnfinishedInput {
/** the unfinished entry's key, <branch>.<module> */
"key": string;
/** true to put every key of unfinished at once, one hand act; exactly one of key or all (design 47 H2 H-A-644) */
"all"?: boolean;
/** the unfinished entry's key, <branch>.<module>; exactly one of key or all */
"key"?: string;
/** why, written with the caller the runtime proves in the hand-act log */
"why": string;
}
/** is what place-unfinished answers. */
export interface PlaceUnfinishedAnswer {
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
export interface PlaceUnfinishedAnswerFailedItem {
/** the unfinished entry's key */
"key": string;
/** why it could not be put */
"words": string;
}
export interface PlaceUnfinishedAnswerPlacedItem {
/** the unfinished entry's key */
"key": string;
/** the key of the pipeline the mover is put in */
"pipeline": string;
}
/** is what place-unfinished answers. */
export interface PlaceUnfinishedAnswer {
/** one item per key that could not be put with all, empty with key; always present (design 47 H2 H-A-725) */
"failed": PlaceUnfinishedAnswerFailedItem[];
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
/** with key, the key of the pipeline the mover is put in; absent with all */
"pipeline"?: string;
/** one item per key put with all, empty with key; always present (design 47 H2 H-A-725) */
"placed": PlaceUnfinishedAnswerPlacedItem[];
/** with all and no key in unfinished, that two empty lists are the answer (design 47 H2 H-A-725) */
"said"?: string;
}
/** is what ask-again takes. */
export interface AskAgainInput {
/** the mover's module, so a pipeline of several movers is never ambiguous; a call naming none on a pipeline of one mover is taken as that mover (design 47 H-A-101) */
@@ -997,6 +1093,9 @@ export interface TestRunsDropAnswer {
/** is the body of the event pipeline-started. */
export type PipelineStartedEvent = PipelineStarted;
/** is the body of the event mover-added. */
export type MoverAddedEvent = MoverAdded;
/** is the body of the event pipeline-ended. */
export type PipelineEndedEvent = PipelineEnded;
@@ -26,6 +26,7 @@ export const verbs = {
export const events = {
pipelineStarted: "pipeline-started",
moverAdded: "mover-added",
pipelineEnded: "pipeline-ended",
runStarted: "run-started",
stepStarted: "step-started",
@@ -48,6 +49,14 @@ export function pipelineStartedSubject(branch, revision) {
export const pipelineStartedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*";
export const moverAddedStream = "SEAT_mesh-pipeline-runner_mover-added";
export function moverAddedSubject(branch, revision) {
return "mesh.seat.mesh-pipeline-runner.event.mover-added." + branch + "." + revision;
}
export const moverAddedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.mover-added.*.*";
export const pipelineEndedStream = "SEAT_mesh-pipeline-runner_pipeline-ended";
export function pipelineEndedSubject(branch, revision) {
@@ -13,6 +13,7 @@ export declare const verbs: {
readonly input: "input";
readonly compositions: "compositions";
readonly compositionsDrop: "compositions-drop";
readonly validate: "validate";
readonly keepNow: "keep-now";
readonly drop: "drop";
};
@@ -685,6 +686,45 @@ export interface CompositionsDropAnswer {
"run": CompositionRun;
}
/** is what validate takes. */
export interface ValidateInput {
/** the candidate's key as mesh-pipeline-runner.show names it: <branch>.<revision>, or run-<id> for a run on request */
"candidate"?: string;
/** narrows the answer to this module's manifest */
"module"?: string;
/** a pipeline's key as the runner names it, a delivering pipeline's or a run on request's */
"pipeline": string;
/** why, written with the caller the runtime proves in the hand-act log */
"why": string;
}
export interface ValidateAnswerProblemsItem {
/** the case before holds it too, so the candidate does not cause it */
"before": boolean;
"module": string;
"problem": string;
}
/** is what validate answers. */
export interface ValidateAnswer {
/** for failed cycle, the artifacts the cycle passes through */
"cycle"?: string[];
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
"form"?: number;
/** the run's state: running, or its end */
"outcome": "running" | "passed" | "failed" | "could-not-run";
/** for failed manifest-refused, every problem per manifest, those counted and those the case before holds too */
"problems"?: ValidateAnswerProblemsItem[];
/** for failed, which */
"reason"?: "cycle" | "manifest-refused";
/** the validate run as it stands */
"run"?: CompositionRun;
/** when the run started, while it runs */
"started"?: string;
/** for could-not-run, why */
"why"?: string;
}
/** is what keep-now takes. */
export interface KeepNowInput {
/** why the keeping runs now */
@@ -13,6 +13,7 @@ export const verbs = {
input: "input",
compositions: "compositions",
compositionsDrop: "compositions-drop",
validate: "validate",
keepNow: "keep-now",
drop: "drop",
};
@@ -35,6 +35,7 @@ export type KeptEvent = registry.KeptEvent;
export type Outcome = registry.Outcome;
export type Part = registry.Part;
export type PublishAnswer = registry.PublishAnswer;
export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes;
export type PublishInput = registry.PublishInput;
export type PublishPartAnswer = registry.PublishPartAnswer;
export type PublishPartInput = registry.PublishPartInput;
@@ -96,6 +96,14 @@ export interface PublishInput {
"version"?: string;
}
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
export interface PublishAnswerOtherBytes {
/** the digest the holder holds for that name and version */
"digest": string;
/** the fingerprint the holder keeps for it, absent where it keeps none */
"fingerprint"?: string;
}
/** is what publish answers. */
export interface PublishAnswer {
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
@@ -104,8 +112,10 @@ export interface PublishAnswer {
"held"?: boolean;
/** the digests of the parts the holder lacks, to send by publish-part */
"lacks"?: string[];
/** the transfer */
"transfer": string;
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
"other-bytes"?: PublishAnswerOtherBytes;
/** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */
"transfer"?: string;
}
/** is what publish-part takes. */
@@ -61,6 +61,7 @@ export type KeptEvent = registry.KeptEvent;
export type Outcome = registry.Outcome;
export type Part = registry.Part;
export type PublishAnswer = registry.PublishAnswer;
export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes;
export type PublishInput = registry.PublishInput;
export type PublishPartAnswer = registry.PublishPartAnswer;
export type PublishPartInput = registry.PublishPartInput;
@@ -96,6 +96,14 @@ export interface PublishInput {
"version"?: string;
}
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
export interface PublishAnswerOtherBytes {
/** the digest the holder holds for that name and version */
"digest": string;
/** the fingerprint the holder keeps for it, absent where it keeps none */
"fingerprint"?: string;
}
/** is what publish answers. */
export interface PublishAnswer {
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
@@ -104,8 +112,10 @@ export interface PublishAnswer {
"held"?: boolean;
/** the digests of the parts the holder lacks, to send by publish-part */
"lacks"?: string[];
/** the transfer */
"transfer": string;
/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */
"other-bytes"?: PublishAnswerOtherBytes;
/** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */
"transfer"?: string;
}
/** is what publish-part takes. */
@@ -72,9 +72,19 @@ type watchedSource struct {
state string
}
func (s watchedSource) Keys() ([]string, error) { return s.w.Keys(s.state) }
// Each read asks Unread first, so a call made before the copy has its state answers the fault away at once (design 47 H2
// H-A-708 (2)); the bundle's own start keeps the waiting read (main).
func (s watchedSource) Keys() ([]string, error) {
if err := s.w.Unread(s.state); err != nil {
return nil, err
}
return s.w.Keys(s.state)
}
func (s watchedSource) Get(key string) (*views.Entry, bool, error) {
if err := s.w.Unread(s.state); err != nil {
return nil, false, err
}
v, ok, err := s.w.Get(s.state, key)
if err != nil || !ok {
return nil, false, err
@@ -82,4 +92,9 @@ func (s watchedSource) Get(key string) (*views.Entry, bool, error) {
return &views.Entry{Value: v}, true, nil
}
func (s watchedSource) Values() (map[string][]byte, error) { return s.w.Values(s.state) }
func (s watchedSource) Values() (map[string][]byte, error) {
if err := s.w.Unread(s.state); err != nil {
return nil, err
}
return s.w.Values(s.state)
}
@@ -1,7 +1,6 @@
// Command mesh-delivery-indexer-tools serves the indexer's tools (novox/hq issue 1945): the runtime launches it for a
// call. A hand act writes one value of the indexer's takeins state and waits for the indexer's answer there. The
// indexer is the other program: it serves no request subject (ADR 0437 §4); indexer_judge asks the same way, and
// indexer_verdicts reads the indexer's verdicts state. The read tools of the indexer's states are
// indexer is the other program: it serves no request subject (ADR 0437 §4). The read tools of the indexer's states are
// mesh-delivery-view's (indexer_module, indexer_modules, indexer_candidate, indexer_candidates).
package main
@@ -28,7 +27,7 @@ import (
// asker writes a takeins value and waits for the indexer's answer to it.
type asker func(key string, value []byte) (index.TakeInAsk, error)
// Tools are the indexer's tools. read is the indexer's state of verdicts, which indexer_verdicts reads; counts the old sections' count.
// Tools are the indexer's tools. counts is the old sections' count.
func Tools(ask asker, now func() time.Time, counts func() (index.OldSectionsCount, error), acts meshhandactsclient.Recorder) []stdio.Tool {
str := func(args map[string]any, k string) string { s, _ := args[k].(string); return strings.TrimSpace(s) }
return []stdio.Tool{
@@ -195,6 +194,11 @@ func main() {
}
follow.Start(context.Background())
watched := stdio.NewWatchedStates()
// The copies the handlers read are watched from the start, beside the answers: a handler asks Unread first and is answered
// the fault away until its state is in (design 47 H2 H-A-708 (2)).
for _, state := range []string{index.SeatDefinitionsState, "manifests"} {
go watched.Follow(state, nil)
}
tools = append(tools, catalogTools(trunk.State, kept, watched)...)
// The seat mesh-catalog's verb revision, a first view of the catalog half answered in this runtime of its own to exactly
// the parts whose entry declares it (novox/hq ADR 0663).
@@ -62,6 +62,9 @@ func configReadersTool(watched *stdio.WatchedStates, modules views.Source) stdio
}
}
kept := map[string]meshcatalog.ManifestsByDigestValue{}
if err := watched.Unread("manifests"); err != nil {
return nil, err
}
raws, err := watched.Values("manifests")
if err != nil {
return nil, fmt.Errorf("the manifests state cannot be read: %w", err)
@@ -0,0 +1,54 @@
package main
import (
"errors"
"runtime"
"testing"
"time"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/busretry"
"mesh-delivery-indexer/internal/index"
)
// Design 47 H2 H-A-708 (2): a handler on a watched copy asks Unread first, so the verb seat-definitions, asked before the copy
// has its state (the watch not handing its values yet), answers the fault away at once and answers its values after.
func TestASeatDefinitionsReadIsAnsweredAwayUntilItsStateIsWatched(t *testing.T) {
release := make(chan struct{})
w := stdio.WatchedStatesOver(func(state string, handle func(stdio.StateChange) error) error {
<-release
return handle(stdio.StateChange{State: state, Key: "git.trunk", Op: stdio.OpPut, Value: []byte(`{"digest":"d"}`), Revision: 1, Current: true})
}, nil)
src := watchedSource{w, index.SeatDefinitionsState}
var away *busretry.Away
if _, err := src.Keys(); !errors.As(err, &away) {
t.Fatalf("Keys before the copy is asked for = %v, want away", err)
}
go w.Follow(index.SeatDefinitionsState, nil) // the bundle's start asks for the copy
deadline := time.Now().Add(5 * time.Second)
for {
_, err := src.Values()
if errors.As(err, &away) && away.Part == "the state "+index.SeatDefinitionsState {
break // asked for and not handed yet
}
if time.Now().After(deadline) {
t.Fatalf("Values while the watch is held = %v, want away naming the state", err)
}
runtime.Gosched()
}
close(release)
for {
keys, err := src.Keys()
if err == nil {
if len(keys) != 1 || keys[0] != "git.trunk" {
t.Fatalf("Keys after the copy has its state = %v, want its one key", keys)
}
return
}
if time.Now().After(deadline) {
t.Fatalf("Keys still %v after the watch handed its values", err)
}
runtime.Gosched()
}
}
@@ -0,0 +1,27 @@
package main
import (
"sync"
"github.com/nats-io/nats.go/jetstream"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshbuilds"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
)
// droppedSubjects are the subjects the indexer's manifest no longer consumes while its durable consumer's filter still
// holds them, since the grants part never narrows a filter for a dropped entry (design 47 H2 H-A-578 (2), H-A-651): the
// toolchain agreement of the builder and the end of a want's wait. Listed once, here, beside the hub's handlers.
var droppedSubjects = []string{meshbuilds.SubjectToolchainAgreed, meshwants.SubjectWaitEnded}
// ackDropped is the hub's handler of a subject no longer consumed: it acknowledges each message at once, with no work, so
// the finding event-unhandled stays clear, and says one journal line for the subject at the first one after the start.
func ackDropped(subject string, logf func(string, ...any)) func(jetstream.Msg) {
var once sync.Once
return func(m jetstream.Msg) {
once.Do(func() {
logf("%s is no longer consumed: its events are acknowledged with no work (design 47 H2 H-A-578 (2))", subject)
})
_ = m.Ack()
}
}
@@ -396,7 +396,8 @@ func startIndexerRun(t *testing.T, put func(context.Context, buildLog), before .
"mesh.seat.mesh-catalog.event.full", "mesh.seat.mesh-catalog.event.room", "mesh.seat.mesh-catalog.event.seat-definition-changed",
"mesh.seat.mesh-catalog.event.seat-definition-removed", "mesh.seat.mesh-catalog.event.manifest-accepted", "mesh.seat.mesh-catalog.event.version-released",
"mesh.seat.mesh-conditions.event.>", "mesh.seat.operator-channel.event.>", "mesh.seat.go-package-registry.event.>", "mesh.seat.npm-package-registry.event.>",
"mesh.seat.mesh-module-assigner.event.>", "mesh.seat.node-build-go.event.>", meshbuilds.SubjectVersionReserved}}); err != nil { // not the seats kept in streams of their own (wanted and running, above)
"mesh.seat.mesh-module-assigner.event.>", "mesh.seat.node-build-go.event.>", meshbuilds.SubjectVersionReserved,
droppedSubjects[0], droppedSubjects[1]}}); err != nil { // not the seats kept in streams of their own (wanted and running, above)
t.Fatal(err)
}
// The indexer's durable on the shared events stream (process.EventHub), which carries its own room (design 47 H §744, H-A-50).
@@ -803,7 +804,7 @@ func serveAssignerAssignments(t *testing.T, ctx context.Context, js jetstream.Je
// builder's version-reserved, which no stream of its own keeps (design 47 H2 §805), and the Go package registry seat's
// published, a series' newest a pin names (H-A-495 addendum), and the Go build seat's imports-reported (design 47 H2 H-A-517).
FilterSubjects: []string{"mesh.mod." + assignerHolderModule + ".event.views.>", meshcatalog.SubjectRoom, nodebuildgo.SubjectStepEndedAll, meshbuilds.SubjectVersionReserved,
gopackageregistry.SubjectPublished, nodebuildgo.SubjectImportsReportedAll}}); err != nil {
gopackageregistry.SubjectPublished, nodebuildgo.SubjectImportsReportedAll, droppedSubjects[0], droppedSubjects[1]}}); err != nil {
t.Fatal(err)
}
em := views.Emitter{Owner: assignerHolderModule, Subject: process.Account{Node: "n1", Module: assignerHolderModule}.EventSubject,
@@ -18,6 +18,7 @@ import (
"os"
"os/signal"
"strings"
"sync"
"sync/atomic"
"syscall"
"time"
@@ -358,6 +359,7 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
Packages: awaitedStore{b: packages, js: js, name: index.Bucket(cred.Module, index.PackagesState)}, Files: filesVia(calls.Call), GoMod: goModVia(calls.Call),
Heard: heardStore, Runs: awaitedStore{b: runs}, Graph: graph,
// How long a reservation is kept and how long its gathering waits at most (design 47 H2 §805, H-A-424).
NpmTestFiles: listSetting("npm-test-files", logger.Printf),
ReservedKeep: durationSetting("reserved-keep", index.DefaultReservedKeep, logger.Printf),
ReservedSettle: durationSetting("reserved-settle", index.DefaultReservedSettle, logger.Printf),
// How long a take-in waits on another part before it says so, and before it raises take-in-waiting (H2 §803, H-A-461 (2)).
@@ -396,12 +398,34 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
}
return ix.SeedModulesFrom(ctx, r.Definitions(), stepsVia(calls.CallKeptWhileOpen, ix.SeedEntryHeld, logger.Printf))
}
// The indexer's one pull of its durable on the shared events stream (process.EventHub): every handler is registered
// before it starts.
hub := process.NewEventHub(logger.Printf)
reader := &views.ProcessReader{Module: cred.Module, Call: calls.Call, Logf: logger.Printf, Hub: hub,
Findings: func() views.WireWriter { return writer }}
// Each step of the start says when it begins and how long it took, so a start that does not end is read in the journal
// and not guessed (lead-47 2026-11-16: two starts on novox ran 25 minutes at one CPU with no line).
// Each is also the phase the start is in, said in the reader's journal and kept for the first-view tool (design 47 H2
// H-A-708 (1), H-A-717 DQ-54), and ended only by its own end, so a pass that runs beside the start's (the publish at
// start) never ends another's.
var phaseMu sync.Mutex
phase := ""
step := func(name string) func() {
began := time.Now()
logger.Printf("start: %s", name)
return func() { logger.Printf("start: %s done in %s", name, time.Since(began).Round(time.Millisecond)) }
phaseMu.Lock()
phase = name
phaseMu.Unlock()
reader.BeginPhase(name)
return func() {
logger.Printf("start: %s done in %s", name, time.Since(began).Round(time.Millisecond))
phaseMu.Lock()
defer phaseMu.Unlock()
if phase == name {
phase = ""
reader.EndPhase()
}
}
}
// A module of the current trunk graph with no registration is registered once at the start, as a kept trunk revision
// registers one entering the graph (design 47 H H-A-262, H-A-264 (1)); said loudly, whatever it answers.
@@ -451,11 +475,6 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
buildModules.refresh()
// The assignments is the seat mesh-module-assigner's: read through its holder's first view and views family, never its bucket (DLV-F1r).
assignmentsErrs := make(chan error)
// The indexer's one pull of its durable on the shared events stream (process.EventHub): every handler is registered
// before it starts.
hub := process.NewEventHub(logger.Printf)
reader := &views.ProcessReader{Module: cred.Module, Call: calls.Call, Logf: logger.Printf, Hub: hub,
Findings: func() views.WireWriter { return writer }}
// The holder function (A-302): the seat-holders view of the claimant of mesh-module-assigner in the indexer's own catalog,
// followed again at each refresh of the build modules (a seat list change, a catalog revision).
seatHolders := &seatHoldersFollow{ctx: ctx, ix: ix, reader: reader, logf: logger.Printf}
@@ -615,6 +634,11 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
if err := hub.Handle(decidedSubject(cred.Module), func(m jetstream.Msg) { heardDecided(ctx, registry, m, logger.Printf) }); err != nil {
return err
}
for _, subject := range droppedSubjects {
if err := hub.Handle(subject, ackDropped(subject, logger.Printf)); err != nil {
return err
}
}
// The indexer's own room wakes every take-in held on a full catalog store (design 47 H §744, H-A-50).
if err := hub.Handle(meshcatalog.SubjectRoom, func(m jetstream.Msg) { _ = m.Ack(); go sources.takeAgain() }); err != nil {
return err
@@ -643,6 +667,12 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
hear(meshcatalog.StreamRegistrationChanged, "a newly watched branch's source revisions are not taken in until the indexer starts again", func(m jetstream.Msg) {
_ = m.Ack()
sources.refresh()
// A module that left the registrations, or a branch that left its registration, frees its failed record (H-A-572 (2)).
if registered, err := registry.RegisteredFailedRecords(ctx); err != nil {
logger.Printf("the failed records are not freed after a registration changed: %v", err)
} else if err := ix.FreeFailedRecords(ctx, registered); err != nil {
logger.Printf("the failed records are not freed after a registration changed: %v", err)
}
})
// The held take-ins are taken in again from the state held at the start, before a branch's consumer gives a later one
// (design 47 H, H-A-114, H-A-118); a chain's key a stop left is deleted first (H2 H-A-497 addendum).
@@ -684,3 +714,19 @@ func durationSetting(key string, def time.Duration, logf func(string, ...any)) t
}
return d
}
// listSetting is the setting key read as a list of comma-separated words; one that is not given is said and is no words.
func listSetting(key string, logf func(string, ...any)) []string {
v, ok := stdio.Setting(key)
if !ok {
logf("the setting %s is not given: no file of an npm package is left out of its digest but node_modules", key)
return nil
}
var out []string
for _, w := range strings.Split(v, ",") {
if w = strings.TrimSpace(w); w != "" {
out = append(out, w)
}
}
return out
}
@@ -3,6 +3,8 @@ package main
import (
"context"
"encoding/json"
"fmt"
"strings"
"testing"
"time"
@@ -113,3 +115,19 @@ func (h *startedHub) StartKept(context.Context, jetstream.JetStream, process.Acc
h.kept = true
return 1
}
// H-A-578 (2): an event of a subject the indexer no longer consumes is acknowledged with no work, and the journal says
// the subject once, at the first.
func TestASubjectNoLongerConsumedIsAcknowledgedAndSaidOnce(t *testing.T) {
if len(droppedSubjects) != 2 {
t.Fatalf("the dropped subjects are %v, want the toolchain agreement and the wait's end", droppedSubjects)
}
var said []string
handle := ackDropped(droppedSubjects[0], func(format string, a ...any) { said = append(said, fmt.Sprintf(format, a...)) })
first, second := &ackedMsg{}, &ackedMsg{}
handle(first)
handle(second)
if first.acked != 1 || second.acked != 1 || len(said) != 1 || !strings.Contains(said[0], droppedSubjects[0]) {
t.Errorf("acked %d and %d, said %q; want both acknowledged and the subject said once", first.acked, second.acked, said)
}
}
@@ -412,11 +412,13 @@ func TestASourceRevisionMovingMeshSDKNamesItAndItsImporters(t *testing.T) {
if err != nil {
t.Fatal(err)
}
importerWants := "v0.1.29"
if slices.ContainsFunc(taken.Entries, func(m meshcatalog.TakeInEntry) bool { return m.Module == "importer" }) {
importerWants = ""
// The importer is a mover of this take-in (AC-I5b, design 47 H2 H-A-672, H-A-521, H-A-530): its fingerprint reads the digests
// of the package it imports from mesh-sdk's entry of the revision computed, which moved, so its build waits for this
// pipeline's publish and its entry names mesh-sdk with no version.
if !slices.ContainsFunc(taken.Entries, func(m meshcatalog.TakeInEntry) bool { return m.Module == "importer" }) {
t.Errorf("the take-in of mesh-sdk at %s names the movers %v, want importer among them", m3, taken.Entries)
}
for module, want := range map[string]string{"importer": importerWants, "legacy": "v0.1.29"} {
for module, want := range map[string]string{"importer": "", "legacy": "v0.1.29"} {
i := slices.IndexFunc(entries, func(e meshcatalog.CatalogEntry) bool { return e.Module == module })
if i < 0 {
t.Fatalf("main.%d holds no entry of %s", taken.Revision, module)
@@ -20,6 +20,7 @@ type takerIn interface {
DropCandidateGraph(ctx context.Context, group, heads, by, why string) index.TakenIn
NamedDrop(ctx context.Context, fingerprint, member, by, why string) index.TakenIn
PinDrop(ctx context.Context, key, by, why string) index.TakenIn
PinDropRecord(ctx context.Context, record, by, why string) index.TakenIn
DropRunByHand(ctx context.Context, run, by, why string) index.TakenIn
RegistryAct(ctx context.Context, a index.TakeInAsk) index.TakenIn
// HeldAgain and HeldSkip act on a watched branch's held source-moved (design 47 H §744).
@@ -70,6 +71,9 @@ func takenIn(ctx context.Context, ix takerIn, kv jetstream.KeyValue, e jetstream
} else if a.NamedFingerprint != "" && a.Drop {
asked, r = "drop of a member of a fingerprint's names", ix.NamedDrop(ctx, a.NamedFingerprint, a.NamedMember, a.By, a.Why)
a.Module = r.Module
} else if a.PinDropRecord != "" {
asked, r = "drop of a record from the pins of the catalog graph revisions", ix.PinDropRecord(ctx, a.PinDropRecord, a.By, a.Why)
a.Module = r.Module
} else if a.PinDrop != "" {
asked, r = "drop of a pin of the catalog graph revisions", ix.PinDrop(ctx, a.PinDrop, a.By, a.Why)
a.Module = r.Module
@@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"os"
"runtime"
"slices"
"strconv"
"strings"
@@ -26,9 +27,12 @@ import (
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildgo"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/busretry"
"git.novox.be/novox/mesh-sdk/go/keys"
"git.novox.be/novox/mesh-sdk/go/views"
"mesh-delivery-indexer/internal/index"
"mesh-delivery-indexer/judge"
)
// waitBound is how long a bed waits for what the indexer says or writes; a wait is on the bus (an event, a watch), never a sleep.
@@ -357,7 +361,7 @@ func sayPipeline(t *testing.T, ctx context.Context, js jetstream.JetStream, ende
pipeline := b + "." + s
if !ended {
raw, _ := json.Marshal(meshpipelinerunner.PipelineStarted{V: 1, Pipeline: pipeline, Branch: branch, Source: source, Revision: source,
Movers: []meshpipelinerunner.Mover{{Module: "avahi", Tier: 1}}})
Movers: []meshpipelinerunner.StartedMover{{Module: "avahi", Tier: 1}}})
if _, err := js.Publish(ctx, meshpipelinerunner.SubjectPipelineStarted(b, s), raw); err != nil {
t.Fatal(err)
}
@@ -412,7 +416,7 @@ func TestIndexerWhole(t *testing.T) {
)
var forge *forgeCommits
var heard *takeIns
var pins, held, takeinsKV, regs, runs jetstream.KeyValue
var pins, held, takeinsKV, regs, runs, status jetstream.KeyValue
js, ctx, candidates, _, restart := startIndexerRun(t, func(context.Context, buildLog) {}, func(ctx context.Context, js jetstream.JetStream) {
heard = hearTakeIns(t, js.Conn())
forge = serveCommits(t, js.Conn())
@@ -423,8 +427,8 @@ func TestIndexerWhole(t *testing.T) {
for _, b := range []struct {
state string
kv *jetstream.KeyValue
}{{index.HeldState, &held}, {index.TakeInsState, &takeinsKV}, {index.RunsState, &runs}} {
if *b.kv, err = js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: index.Bucket(testIndexer, b.state), History: 1}); err != nil {
}{{index.HeldState, &held}, {index.TakeInsState, &takeinsKV}, {index.RunsState, &runs}, {views.StatusState, &status}} {
if *b.kv, err = js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: index.Bucket(testIndexer, b.state), History: 64}); err != nil {
t.Fatal(err)
}
}
@@ -446,6 +450,32 @@ func TestIndexerWhole(t *testing.T) {
}
objects := newBusObjects(js, testAccount, index.CatalogRevisionsObjects)
// Design 47 H2 H-A-578 (2), H-A-651 (AC-I9): an event of a subject the manifest no longer consumes, which the durable's
// filter still holds, is acknowledged with no work (the unit test of ackDropped holds that it says the subject once).
var last uint64
for _, subject := range droppedSubjects {
ack, err := js.Publish(ctx, subject, []byte(`{}`))
if err != nil {
t.Fatal(err)
}
last = ack.Sequence
}
cons, err := testAccount.EventConsumer(ctx, js, views0Stream)
if err != nil {
t.Fatal(err)
}
for deadline := time.Now().Add(waitBound); ; runtime.Gosched() {
info, err := cons.Info(ctx)
if err != nil {
t.Fatal(err)
}
if info.AckFloor.Stream >= last {
break
}
if time.Now().After(deadline) {
t.Fatalf("the dropped subjects events are not acknowledged: ack floor %d, want %d", info.AckFloor.Stream, last)
}
}
// The first revision: no mover, no pin; its entries are the base.
sayMoved(t, ctx, js, "main", 10, c10, true)
// A revision's number is the indexer's own count, the branch's newest + 1 (design 47 H-A-213 (1)): the later take-ins of
@@ -471,6 +501,45 @@ func TestIndexerWhole(t *testing.T) {
}
untilKey(t, ctx, pins, index.PinKey("main", r(11)), pinned("pipeline."+rn(11)))
untilKey(t, ctx, pins, index.PinKey("main", r(10)), pinned("pipeline."+rn(11))) // validate's base, H-A-147
// Design 47 H2 H-A-569 (2), H-A-605 (4) (AC-I3): every revision carries the validator's need rules. The bed's seed, main.1,
// was kept with none, so main.2 derived each unmoved entry's needs from its manifest again; main.3, at the same rules as
// its base, derives none.
firstRev, firstEntries, err := index.ReadRevision(ctx, objects, rn(10))
if err != nil {
t.Fatal(err)
}
nextRev, nextEntries, err := index.ReadRevision(ctx, objects, rn(11))
if err != nil {
t.Fatal(err)
}
if firstRev.NeedsRules != judge.NeedsRules || nextRev.NeedsRules != judge.NeedsRules {
t.Errorf("the revisions carry the need rules %d and %d, want %d", firstRev.NeedsRules, nextRev.NeedsRules, judge.NeedsRules)
}
derivedFor, derivedNeeds := 0, 0
for _, e := range firstEntries {
raw, _ := json.Marshal(e.Manifest)
derived, err := judge.ManifestNeeds(raw)
if len(e.Manifest) == 0 || err != nil {
continue
}
derivedFor++
derivedNeeds += len(derived)
for _, need := range derived {
if !slices.Contains(e.Needs, need) {
t.Errorf("%s of main.2 carries needs %v, want %q its manifest names under the rules now", e.Module, e.Needs, need)
}
}
}
if derivedFor == 0 || derivedNeeds == 0 {
t.Errorf("%d unmoved entries of main.2 carry a manifest, deriving %d needs: no derivation was held", derivedFor, derivedNeeds)
}
// The bed's seeded entries were written to no state, so a take-in at unchanged rules, which derives nothing, carries the needs
// the state holds for them: none.
for _, e := range nextEntries {
if e.Module != "avahi" && len(e.Needs) != 0 {
t.Errorf("%s of main.3 carries needs %v, want none derived in a take-in at the rules of its base", e.Module, e.Needs)
}
}
info, err := objects.open(ctx)
if err != nil {
t.Fatal(err)
@@ -649,6 +718,66 @@ func TestIndexerWhole(t *testing.T) {
if hq := heard.next(t, "delta", 2); len(hq.Entries) != 0 || hq.Revision != 2 {
t.Errorf("the move of novox/hq on delta said %+v, want revision 2 with no movers", hq)
}
// Design 47 H2 H-A-708 (1), H-A-717 DQ-54: the start's phases are kept at start-phase of the state first-views, and the
// start's last phase ended is null.
untilKey(t, ctx, status, views.StartPhaseKey, func(v []byte) bool { return string(v) == "null" })
phases, err := status.History(ctx, views.StartPhaseKey)
if err != nil {
t.Fatal(err)
}
var said []string
for _, e := range phases {
var p *views.StartPhase
if json.Unmarshal(e.Value(), &p) == nil && p != nil {
said = append(said, p.Name)
}
}
for _, want := range []string{"following the assignments", "computing the fingerprints"} {
if !slices.Contains(said, want) {
t.Errorf("the start's phases kept %q, want %q among them", said, want)
}
}
// Design 47 H2 H-A-708 (2) (AC-I15): while the start's read of the trunk is held, the verb revision, asked of the tools'
// view of the trunk, answers the fault away naming the trunk's revision within seconds, never waiting behind the read.
hold := &holdEntries{Objects: objects, reading: make(chan struct{}), release: make(chan struct{})}
kept := &index.KeptTrunk{}
readEnded := make(chan error, 1)
go func() { readEnded <- kept.Reread(ctx, hold) }()
<-hold.reading
answered := make(chan error, 1)
go func() {
_, err := toolNamed(t, []stdio.Tool{index.RevisionTool(hold, kept)}, meshcatalog.Seat+"."+meshcatalog.VerbRevision).Run(map[string]any{})
answered <- err
}()
select {
case err := <-answered:
var away *busretry.Away
if !errors.As(err, &away) || !strings.HasPrefix(away.Part, "the trunk's revision ") {
t.Errorf("revision while the start's read is held answered %v, want away naming the trunk's revision", err)
}
case <-time.After(waitBound):
t.Error("revision waited behind the start's read of the trunk")
}
close(hold.release)
if err := <-readEnded; err != nil {
t.Errorf("the held read of the trunk ended with %v", err)
}
}
// holdEntries is the indexer's objects whose first read of an entry waits until release is closed: a read of the trunk held.
type holdEntries struct {
index.Objects
reading, release chan struct{}
once sync.Once
}
func (h *holdEntries) Get(ctx context.Context, name string) ([]byte, error) {
if strings.HasPrefix(name, "entry.") {
h.once.Do(func() { close(h.reading); <-h.release })
}
return h.Objects.Get(ctx, name)
}
// toolNamed is the tool of that name.
@@ -39,6 +39,9 @@ func (s *askedBy) NamedDrop(context.Context, string, string, string, string) ind
func (s *askedBy) PinDrop(context.Context, string, string, string) index.TakenIn {
return s.did("pin-drop")
}
func (s *askedBy) PinDropRecord(context.Context, string, string, string) index.TakenIn {
return s.did("pin-drop-record")
}
func (s *askedBy) DropRunByHand(context.Context, string, string, string) index.TakenIn {
return s.did("run-drop")
}
+1
View File
@@ -49,6 +49,7 @@ require (
)
require git.novox.be/novox/mesh-contracts/go/seats/meshbroker v0.0.0-00010101000000-000000000000
require git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault v0.0.0-00010101000000-000000000000
replace git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk => ../mesh-delivery-sdk
@@ -386,11 +386,11 @@ func Packages(module string, files map[string]string) (requires string, packages
// (design 47 H2 H-A-546 (1)). It refuses a listing with no package.json at that directory.
//
// Its one package is the npm name, its digest the hex sha256 of the sorted lines "<path relative to it> <object>" of every
// file under it but node_modules and the test files of `node --test`'s default patterns, which the Node build module's unit
// step runs (H-A-547): a file named `*.test.*`, `*-test.*`, `*_test.*` or `test.*`, and everything under a directory named
// test. The requirements' digest is the hex sha256 of the lines "package.json <object>" and "package-lock.json <object>"
// (the second absent with no lock file), as H-A-525 has it for go.mod and go.sum.
func NpmPackage(name string, files map[string]string) (requires string, packages []meshcatalog.PackagesByModuleValuePackagesItem, err error) {
// file under it but node_modules and the test files the indexer's setting npm-test-files names (H-A-598), the patterns of
// `node --test`'s defaults which the Node build module's unit step runs (H-A-547) as the setting's default has them. The
// requirements' digest is the hex sha256 of the lines "package.json <object>" and "package-lock.json <object>" (the second
// absent with no lock file), as H-A-525 has it for go.mod and go.sum.
func NpmPackage(name string, files map[string]string, testFiles []string) (requires string, packages []meshcatalog.PackagesByModuleValuePackagesItem, err error) {
pj, ok := files["package.json"]
if !ok {
return "", nil, fmt.Errorf("the npm package %s has no package.json at its directory", name)
@@ -402,7 +402,7 @@ func NpmPackage(name string, files map[string]string) (requires string, packages
sum := sha256.Sum256([]byte(req))
var lines []string
for p, object := range files {
if npmLeftOut(p) {
if npmLeftOut(p, testFiles) {
continue
}
lines = append(lines, p+" "+object)
@@ -413,15 +413,43 @@ func NpmPackage(name string, files map[string]string) (requires string, packages
}
// npmLeftOut is whether a file of an npm package, by its path relative to the package, leaves its digest: under
// node_modules or a directory named test, or a test file by `node --test`'s default patterns (H-A-547).
func npmLeftOut(p string) bool {
dir, file := path.Split(p)
// node_modules, or matching one of the setting npm-test-files' patterns (H-A-547, H-A-598).
func npmLeftOut(p string, testFiles []string) bool {
dir, _ := path.Split(p)
for _, e := range strings.Split(strings.TrimSuffix(dir, "/"), "/") {
if e == "node_modules" || e == "test" {
if e == "node_modules" {
return true
}
}
return strings.HasPrefix(file, "test.") || strings.Contains(file, ".test.") || strings.Contains(file, "-test.") || strings.Contains(file, "_test.")
for _, pattern := range testFiles {
if globMatch(strings.Split(pattern, "/"), strings.Split(p, "/")) {
return true
}
}
return false
}
// globMatch is whether the path's segments match the pattern's: a segment by path.Match, `**` any number of segments
// (none included).
func globMatch(pattern, segments []string) bool {
if len(pattern) == 0 {
return len(segments) == 0
}
if pattern[0] == "**" {
for i := 0; i <= len(segments); i++ {
if globMatch(pattern[1:], segments[i:]) {
return true
}
}
return false
}
if len(segments) == 0 {
return false
}
if ok, err := path.Match(pattern[0], segments[0]); err != nil || !ok {
return false
}
return globMatch(pattern[1:], segments[1:])
}
// ignoredDir is whether the go tool takes no package from dir: an element named testdata, or starting with _ or .
@@ -13,6 +13,9 @@ const sdk = "git.novox.be/novox/mesh-sdk/go"
// The indexer's one computation (ADR 0593 §2): what moved out of mesh-sdk computes what it computed, the import form
// moves only with what a module imports, and a package's digest is its own files.
// npmTestFiles are the setting npm-test-files' default, as the indexer's manifest gives it (H-A-573, H-A-598).
var npmTestFiles = []string{"**/*.test.*", "**/*-test.*", "**/*_test.*", "**/test.*", "**/test/**"}
func TestTheFingerprintComputation(t *testing.T) {
t.Run("the moved computation gives the values it gave in mesh-sdk", movedComputationGivesTheValuesItGaveInMeshSDK)
t.Run("the import form moves only with what the module imports", importFormMovesOnlyWithWhatTheModuleImports)
@@ -222,7 +225,7 @@ func packageDigestIsItsOwnFiles(t *testing.T) {
npm := map[string]string{"package.json": "p1", "package-lock.json": "l1", "src/stdio.ts": "a", "dist/stdio.js": "b",
"src/stdio.test.ts": "t1", "src/a-test.ts": "t2", "src/a_test.mjs": "t3", "test.js": "t4", "test/x.ts": "t5",
"node_modules/x/index.js": "n"}
npmReq, npmPkgs, err := NpmPackage("@novox/mesh-sdk", npm)
npmReq, npmPkgs, err := NpmPackage("@novox/mesh-sdk", npm, npmTestFiles)
if err != nil || len(npmPkgs) != 1 || npmPkgs[0].Package != "@novox/mesh-sdk" || npmPkgs[0].Digest == "" || npmReq == "" {
t.Fatalf("NpmPackage = %q, %+v, %v; want one package by its npm name", npmReq, npmPkgs, err)
}
@@ -231,7 +234,7 @@ func packageDigestIsItsOwnFiles(t *testing.T) {
moves bool
}{{"src/stdio.ts", true}, {"dist/stdio.js", true}, {"package.json", true}, {"src/stdio.test.ts", false}, {"src/a-test.ts", false},
{"src/a_test.mjs", false}, {"test.js", false}, {"test/x.ts", false}, {"node_modules/x/index.js", false}} {
r, ps, _ := NpmPackage("@novox/mesh-sdk", with(npm, c.file, "zz"))
r, ps, _ := NpmPackage("@novox/mesh-sdk", with(npm, c.file, "zz"), npmTestFiles)
if moved := ps[0].Digest != npmPkgs[0].Digest; moved != c.moves {
t.Errorf("changing %s of the npm package moved its digest %v, want %v", c.file, moved, c.moves)
}
@@ -239,10 +242,18 @@ func packageDigestIsItsOwnFiles(t *testing.T) {
t.Error("a changed package.json left the npm package's requirements' digest")
}
}
if r2, _, _ := NpmPackage("@novox/mesh-sdk", with(npm, "package-lock.json", "l2")); r2 == npmReq {
// H-A-598: the patterns are the setting's; given one, a file it matches leaves the digest and another file moves it.
one := []string{"**/*.spec.*"}
_, base, _ := NpmPackage("@novox/mesh-sdk", with(npm, "src/a.spec.ts", "s"), one)
_, specMoved, _ := NpmPackage("@novox/mesh-sdk", with(npm, "src/a.spec.ts", "s2"), one)
_, otherMoved, _ := NpmPackage("@novox/mesh-sdk", with(npm, "src/stdio.test.ts", "t9"), one)
if specMoved[0].Digest != base[0].Digest || otherMoved[0].Digest == base[0].Digest {
t.Error("with the setting npm-test-files given one pattern, a file it matches moved the digest or another did not")
}
if r2, _, _ := NpmPackage("@novox/mesh-sdk", with(npm, "package-lock.json", "l2"), npmTestFiles); r2 == npmReq {
t.Error("a changed lock file left the npm package's requirements' digest")
}
if _, _, err := NpmPackage("@novox/mesh-sdk", map[string]string{"index.js": "x"}); err == nil {
if _, _, err := NpmPackage("@novox/mesh-sdk", map[string]string{"index.js": "x"}, npmTestFiles); err == nil {
t.Error("a listing with no package.json was taken as an npm package")
}
}
@@ -37,6 +37,7 @@ func (ix *Indexer) withArtifacts(ctx context.Context, e meshcatalog.CatalogEntry
art := meshcatalog.Artifact{Ref: ArtifactRefOf(e.Module, a.Name), Language: a.Language, Kind: a.Kind}
if pkg := ix.packageOf(ctx, e, a); pkg != nil {
art.Package = pkg
art.Digests = ix.digestsOf(ctx, pkg)
}
e.Artifacts = append(e.Artifacts, art)
}
@@ -82,3 +83,31 @@ func (ix *Indexer) packageOf(ctx context.Context, e meshcatalog.CatalogEntry, a
}
return &meshcatalog.ArtifactPackage{Ecosystem: ecosystem, Name: name}
}
// digestsOf are the digests of the packages of a package artifact's module, one item per package, kept on the artifact of
// the entry so an importer reads each imported package's digest from the entry that publishes it (design 47 H2 H-A-580):
// those of the packages state's value of a Go module the artifact names, sorted by package; nil for an artifact of
// another ecosystem, or while the state holds none of its module.
func (ix *Indexer) digestsOf(ctx context.Context, pkg *meshcatalog.ArtifactPackage) []meshcatalog.ArtifactDigestsItem {
if pkg.Ecosystem != EcosystemGo || ix.Packages == nil {
return nil
}
key, err := PackagesKey(pkg.Name)
if err != nil {
return nil
}
value, _, found, err := ix.Packages.Get(ctx, key)
if err != nil || !found {
return nil
}
p, err := DecodePublishedPackages(value)
if err != nil {
return nil
}
var out []meshcatalog.ArtifactDigestsItem
for _, d := range p.Packages {
out = append(out, meshcatalog.ArtifactDigestsItem{Package: d.Package, Digest: d.Digest})
}
slices.SortFunc(out, func(a, b meshcatalog.ArtifactDigestsItem) int { return strings.Compare(a.Package, b.Package) })
return out
}
@@ -186,6 +186,9 @@ type Indexer struct {
// first reservation its gathering settles at the latest: the settings reserved-keep and reserved-settle (design 47 H2
// §805, H-A-424); zero takes the default.
ReservedKeep, ReservedSettle time.Duration
// NpmTestFiles are the patterns of the files that leave an npm package's digest, the setting npm-test-files (design 47 H2
// H-A-598); none leaves only node_modules.
NpmTestFiles []string
// WaitingLine is how long a take-in waits on another part before it says so and keeps its waiting-on, and WaitingBound
// how long before it raises take-in-waiting: the settings take-in-waiting-line and take-in-waiting-bound (design 47 H2
// §803, H-A-461 (2)); zero takes the default.
@@ -2,10 +2,12 @@ package index
import (
"context"
"slices"
"testing"
"time"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
"mesh-delivery-indexer/judge"
)
// Design 47 G A-85, §291, H §743, H-A-32: the indexer keeps a catalog revision per watched branch, <branch>.<source> (the
@@ -117,3 +119,37 @@ func TestTheRevisionAnswersEveryCaller(t *testing.T) {
t.Errorf("an unproven caller answered %+v, %v; want the revision", a, err)
}
}
// H-A-569 (2), H-A-605 (4): a take-in whose needs-rules equals its base revision's derives nothing for unmoved entries, and
// one with a higher number derives each from the manifest the entry carries, keeping its fingerprint.
func TestAHigherNeedsRulesDerivesTheUnmovedEntriesNeedsAgain(t *testing.T) {
ctx := context.Background()
ix := &Indexer{Module: testSelf, Revisions: newMemObjects(1 << 20)}
entry := meshcatalog.CatalogEntry{Module: "web", Repository: "novox/w", Commit: "c1", Fp: "src2:aa",
Manifest: map[string]any{"module": "web", "version": "1", "runs-as": "web"}}
if err := ix.KeepBranchEntries(ctx, "main", 1, map[string]meshcatalog.CatalogEntry{"web": entry}, nil); err != nil {
t.Fatal(err)
}
needsOf := func(source int64) ([]string, int64) {
a, err := Revision(ctx, ix.Revisions, nil, meshcatalog.RevisionInput{Branch: "main", Source: source})
if err != nil || len(a.Entries) != 1 {
t.Fatalf("source %d answered %+v (%v)", source, a, err)
}
if a.Entries[0].Fp != "src2:aa" {
t.Errorf("the entry's fingerprint moved to %q", a.Entries[0].Fp)
}
return a.Entries[0].Needs, a.Revision.NeedsRules
}
if needs, rules := needsOf(1); rules != judge.NeedsRules || !slices.Contains(needs, "directory-contents-owner") {
t.Errorf("the first revision holds needs %v at rules %d, want the runs-as need at rules %d", needs, rules, judge.NeedsRules)
}
// The base was written at the same rules: the needs an entry carries are kept as they are.
kept := entry
kept.Needs = []string{"word:module"}
if err := ix.KeepBranchEntries(ctx, "main", 2, map[string]meshcatalog.CatalogEntry{"web": kept}, nil); err != nil {
t.Fatal(err)
}
if needs, _ := needsOf(2); !slices.Equal(needs, []string{"word:module"}) {
t.Errorf("a take-in at unchanged rules derived needs again: %v", needs)
}
}
@@ -33,8 +33,13 @@ const CatalogEntryLayout = 1
func CatalogEntryOf(module string, cur meshcatalog.ModulesByModuleValue, m catalogue.Manifest, raw string, n graph.Node) meshcatalog.CatalogEntry {
e := meshcatalog.CatalogEntry{V: CatalogEntryLayout, Module: module, Repository: cur.Repository, Path: cur.Path,
Commit: cur.Commit, Manifest: manifestWhole(raw), ManifestDigest: meshcatalogclient.EntryManifestDigest(cur.Manifest), Verdict: cur.Verdict, Fp: n.FP, None: n.None, Bases: n.Bases,
Packages: maps.Clone(cur.Packages), Provides: n.Provides, Requires: n.Requires, Awaits: n.Awaits, Invokes: n.Invokes,
Packages: maps.Clone(cur.Packages), Provides: n.Provides, Requires: n.Requires, Awaits: n.Awaits, Invokes: n.Invokes, Consumes: slices.Clone(m.Consumes),
Serves: n.Serves, LeftOut: n.LeftOut, Main: MainOf(m), Contributes: contributesOf(m), Class: m.Class}
// needs are the reader capabilities the module's value names (design 47 H2, H-A-682 (1)): its manifest's words, forms
// and seat names and its templates' forms, sorted, absent when empty.
if len(cur.Needs) > 0 {
e.Needs = slices.Compact(slices.Sorted(slices.Values(cur.Needs)))
}
// requires names every requirement as catalogue.Manifest.Wants lists them, optional ones and those only contributes names
// included, since contributing to a requirement is requiring it (design 47 G §709, A-229).
for _, r := range m.Wants() {
@@ -66,11 +71,11 @@ func CatalogEntryOf(module string, cur meshcatalog.ModulesByModuleValue, m catal
// ModuleValueOf is the module's value as the indexer computes with it, read back from its catalog graph entry: the
// inverse of CatalogEntryOf, by which the indexer's view of the trunk is the newest trunk revision's entries (the lead's
// ruling on milestone 47/G finding 1; ADR 0656 §6: one form of the fact). The old line's fields (the old-form
// fingerprint, the reader needs) are not kept.
// ruling on milestone 47/G finding 1; ADR 0656 §6: one form of the fact), the reader needs included (H-A-682 (1)). The old
// line's old-form fingerprint is not kept.
func ModuleValueOf(e meshcatalog.CatalogEntry) meshcatalog.ModulesByModuleValue {
v := meshcatalog.ModulesByModuleValue{V: keys.Version, Repository: e.Repository, Path: e.Path, Commit: e.Commit, Manifest: meshcatalogclient.BareManifestDigest(e.ManifestDigest),
Verdict: e.Verdict, Fp2: e.Fp, None2: e.None, Packages: maps.Clone(e.Packages)}
Verdict: e.Verdict, Fp2: e.Fp, None2: e.None, Packages: maps.Clone(e.Packages), Needs: slices.Clone(e.Needs)}
if in := e.Inputs; in != nil {
v.Toolchains, v.Paths, v.Problems, v.Warnings, v.Unknown = maps.Clone(in.Toolchains), maps.Clone(in.Paths), in.Problems, in.Warnings, in.Unknown
if in.From != nil {
@@ -109,6 +109,27 @@ func TestAnEntryNamesWhatItContributesToAndEveryRequirement(t *testing.T) {
if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{}, "", graph.Node{}); e.Contributes != nil || e.Class != "" {
t.Errorf("an entry of a manifest contributing nothing and naming no class carries contributes %v, class %q", e.Contributes, e.Class)
}
// Design 47 H2 H-A-621: an entry's consumes equals its manifest's, beside its invokes.
cm := catalogue.Manifest{Consumes: []string{"mesh-delivery.merge-called", "mesh-builds.step-ended"}}
if e := CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{}, cm, "", graph.Node{}); !reflect.DeepEqual(e.Consumes, cm.Consumes) {
t.Errorf("consumes = %v, want %v", e.Consumes, cm.Consumes)
}
if e := CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{}, m, raw, graph.Node{}); e.Consumes != nil {
t.Errorf("a manifest consuming nothing gives the entry consumes %v", e.Consumes)
}
// Design 47 H2 H-A-682 (1): a module whose value names needs carries them sorted on its entry, and the value read back
// from the entry names them; a value with none leaves the entry's needs absent.
needs := []string{"seat:node-engine", "form:dir", "word:runs-as"}
e = CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{Needs: needs}, m, raw, graph.Node{})
if want := []string{"form:dir", "seat:node-engine", "word:runs-as"}; !reflect.DeepEqual(e.Needs, want) {
t.Errorf("needs = %v, want %v", e.Needs, want)
}
if back := ModuleValueOf(e); !reflect.DeepEqual(back.Needs, e.Needs) {
t.Errorf("the value read back names needs %v, want %v", back.Needs, e.Needs)
}
if e := CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{}, m, raw, graph.Node{}); e.Needs != nil {
t.Errorf("a value with no needs gives the entry needs %v", e.Needs)
}
// Design 47 H2 §810, H-A-394 (1): the entry carries its manifest's class, which the gate reads.
if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{Class: catalogue.ClassCore}, "", graph.Node{}); e.Class != catalogue.ClassCore {
t.Errorf("the entry of a core manifest carries the class %q, want core", e.Class)
@@ -15,11 +15,14 @@ import (
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
runner "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner"
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/graph"
"git.novox.be/novox/mesh-sdk/go/busretry"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/keys"
"git.novox.be/novox/mesh-sdk/go/process"
"git.novox.be/novox/mesh-sdk/go/views"
"mesh-delivery-indexer/judge"
)
// The indexer's object bucket catalog-revisions (design 47, Two graphs; novox/hq ADR 0619 §2: declared in the old
@@ -222,9 +225,17 @@ func newestOf(ctx context.Context, o Objects, branch string) (meshcatalog.Catalo
// while the newest is newer than the one that failed; the same revision failing twice is the read's failure. Progress bounds
// the loop. No revision kept is false.
func readNewestOf(ctx context.Context, o Objects, branch string) (meshcatalog.CatalogRevision, []meshcatalog.CatalogEntry, bool, error) {
return readNewestOfSaying(ctx, o, branch, nil)
}
// readNewestOfSaying is readNewestOf telling said the revision each pass found as the newest, before it reads its entries.
func readNewestOfSaying(ctx context.Context, o Objects, branch string, said func(revision int64)) (meshcatalog.CatalogRevision, []meshcatalog.CatalogEntry, bool, error) {
var failed int64
for {
newest, any, err := newestOf(ctx, o, branch)
if err == nil && any && said != nil {
said(newest.Revision)
}
if err == nil && !any {
return newest, nil, false, nil
}
@@ -332,6 +343,7 @@ func (ix *Indexer) viewEntries(ctx context.Context) (map[string]meshcatalog.Cata
}
}
entries := make(map[string]meshcatalog.CatalogEntry, len(held))
series := ix.pinnedSeries(ctx)
for name, cur := range held {
var m catalogue.Manifest
var raw string
@@ -340,11 +352,37 @@ func (ix *Indexer) viewEntries(ctx context.Context) (map[string]meshcatalog.Cata
m, raw = read, bytes
}
}
entries[name] = ix.withArtifacts(ctx, CatalogEntryOf(name, cur, m, raw, nodes[name]), m)
entries[name] = ix.withArtifacts(ctx, filledFromPins(CatalogEntryOf(name, cur, m, raw, nodes[name]), series, m), m)
}
return entries, nil
}
// filledFromPins is e with each package of it that has no version given the series' pin (design 47 H2 H-A-659): a view read
// back from a revision holds the blank a take-in left in the entry of a mover, and an entry that is no mover at a later
// take-in must not carry it. A package with no pin stays blank, its build waiting for the publish.
func filledFromPins(e meshcatalog.CatalogEntry, series map[string]SeriesPackage, m catalogue.Manifest) meshcatalog.CatalogEntry {
var blank sdkstep.PackageVersions
for p, v := range e.Packages {
if v == "" {
if blank == nil {
blank = sdkstep.PackageVersions{}
}
blank[p] = ""
}
}
if blank == nil {
return e
}
pkgs := maps.Clone(e.Packages)
for p, v := range releasedPins(blank, series, m, e.Repository, nil) {
if v != "" {
pkgs[p] = v
}
}
e.Packages = pkgs
return e
}
// KeepBranchEntries keeps entries as the catalog revision of a watched branch taken in from its source revision src (design
// 47 H §743, H-A-32), as keepBranchEntries does with no call.
func (ix *Indexer) KeepBranchEntries(ctx context.Context, branch string, src int64, entries map[string]meshcatalog.CatalogEntry, movers []meshcatalog.TakeInEntry) error {
@@ -379,9 +417,12 @@ func (ix *Indexer) keepBranchEntries(ctx context.Context, branch string, src int
}
number := newest.Revision + 1
entries = WithEdges(ix.withActs(ctx, entries)) // the acting rules and the edges between artifact references are written here, once, for every reader (A-208)
if judge.NeedsRules > newest.NeedsRules {
entries = withRuleNeeds(entries, movers) // H-A-605 (4): the rules moved since the base, so each unmoved entry is read again
}
at := ix.now().UTC()
rev, objects, err := CatalogRevisionOf(meshcatalog.CatalogRevision{Revision: number, Kind: "trunk", Branch: branch, Source: src, Call: call.Call,
CallKind: call.Kind, Module: call.Module, Version: call.Version, Repository: call.Repository, At: &at}, entries)
NeedsRules: judge.NeedsRules, CallKind: call.Kind, Module: call.Module, Version: call.Version, Repository: call.Repository, At: &at}, entries)
if err != nil {
return 0, err
}
@@ -461,6 +502,26 @@ func (ix *Indexer) keepBranchEntries(ctx context.Context, branch string, src int
return number, nil
}
// withRuleNeeds is entries with each unmoved entry's needs derived again from the manifest the entry carries whole, the
// manifest validator's rules as they stand (design 47 H2, H-A-569 (2), H-A-605 (4)): an entry gains the need a rule names
// now, keeps the ones it had and keeps its fingerprint, which no need moves. A mover's needs were derived at its take-in.
func withRuleNeeds(entries map[string]meshcatalog.CatalogEntry, movers []meshcatalog.TakeInEntry) map[string]meshcatalog.CatalogEntry {
moved := map[string]bool{}
for _, m := range movers {
moved[m.Module] = true
}
out := make(map[string]meshcatalog.CatalogEntry, len(entries))
for name, e := range entries {
if raw, err := json.Marshal(e.Manifest); !moved[name] && len(e.Manifest) > 0 && err == nil {
if derived, err := judge.ManifestNeeds(raw); err == nil {
e.Needs = slices.Compact(slices.Sorted(slices.Values(append(slices.Clone(e.Needs), derived...))))
}
}
out[name] = e
}
return out
}
// revisionCall is what made a catalog revision (design 47 H-A-213 (3), H-A-215): call, the words for a person; Kind, one of the
// seat mesh-catalog's three call kinds, which a reader reads instead of the words; Module and Version for a release, Repository
// for a take-in again. The zero value names no call (a revision kept by hand or a test).
@@ -625,11 +686,16 @@ type KeptTrunk struct {
read sync.Mutex // one re-read at a time; a read of the view never holds it
mu sync.Mutex
started bool
at int64
mods Store
held Store
rev meshcatalog.CatalogRevision
entries []meshcatalog.CatalogEntry
// reading is whether a read of the trunk runs now, readingRev the revision it reads (0 while the newest is not known
// yet) and readingSince when it began: a call that meets the start's read says them as the fault away (Unread).
reading bool
readingRev int64
readingSince time.Time
at int64
mods Store
held Store
rev meshcatalog.CatalogRevision
entries []meshcatalog.CatalogEntry
// manifests are the manifests the revision's entries carry whole, as JSON, by their digest as a module's value names it
// (A-487c: the verbs module and provides answer them from here, never from the manifests state).
manifests map[string]string
@@ -644,13 +710,25 @@ func (k *KeptTrunk) Reread(ctx context.Context, o Objects) error {
func (k *KeptTrunk) reread(ctx context.Context, o Objects) error {
began := time.Now()
k.mu.Lock()
k.reading, k.readingRev, k.readingSince = true, 0, began
k.mu.Unlock()
defer func() {
k.mu.Lock()
k.reading = false
k.mu.Unlock()
}()
fail := func(err error) error {
if k.Say != nil {
k.Say("the view of the trunk is BEHIND, its re-read failed after %s (the view held stays, the next heard catalog-revision reads again): %v", time.Since(began).Round(time.Millisecond), err)
}
return err
}
newest, entries, any, err := readNewestOf(ctx, o, TrunkBranch)
newest, entries, any, err := readNewestOfSaying(ctx, o, TrunkBranch, func(revision int64) {
k.mu.Lock()
k.readingRev = revision
k.mu.Unlock()
})
if err != nil {
return fail(err)
}
@@ -738,13 +816,40 @@ func (t TrunkStates) view() (modules, nodes Store, at int64, err error) {
return t.Kept.current(context.Background(), t.Objects)
}
// current is the view held; before the start's read it reads the newest revision once.
// Unread is the fault away (busretry.Away, design 47 H2 H-A-708 (2)) naming "the trunk's revision <n>" with "not read yet
// since <time>" while the start's read of the trunk holds the view, nil when the view is held or no read runs (a call then
// reads it once, as current does). A handler asks it before it reads, so a call made while the indexer starts is answered
// at once.
func (k *KeptTrunk) Unread() error {
k.mu.Lock()
defer k.mu.Unlock()
if k.started || !k.reading {
return nil
}
return k.away()
}
// away is the fault of a read of the trunk that runs now; the caller holds mu.
func (k *KeptTrunk) away() error {
part := "the trunk's newest revision"
if k.readingRev != 0 {
part = fmt.Sprintf("the trunk's revision %d", k.readingRev)
}
return &busretry.Away{Part: part, Words: "not read yet since " + k.readingSince.UTC().Format("15:04:05")}
}
// current is the view held; before the start's read it reads the newest revision once, and while a read runs it answers
// the fault away (Unread) and never waits behind it.
func (k *KeptTrunk) current(ctx context.Context, o Objects) (Store, Store, int64, error) {
k.mu.Lock()
started := k.started
k.mu.Unlock()
if !started {
k.read.Lock()
if !k.read.TryLock() {
k.mu.Lock()
defer k.mu.Unlock()
return nil, nil, 0, k.away()
}
k.mu.Lock()
started = k.started
k.mu.Unlock()
@@ -60,8 +60,9 @@ func (ix *Indexer) dry(branch, call string) *dryRun {
// weighed (Holds and Counted nil hold nothing); ReadFile only reads.
Findings: nil, SeatDefinitions: nil, ReadFile: ix.ReadFile, SaySeatDefinition: nil,
Heard: nil, underSeats: true, isDry: true,
// A dry run keeps no catalog graph revision (catalog_revisions.go): its revision is the take-in's to keep.
Revisions: nil, SayCatalogRevision: nil, SayFill: nil, EntryIndex: nil, NamedSets: nil, Versions: nil, SayVersionReleased: nil, Inputs: nil, InputObjects: nil, Pins: nil, PinsPending: nil,
// A dry run keeps no catalog graph revision (catalog_revisions.go): its revision is the take-in's to keep. It reads the
// versions state, which a series' pin is read from (H-A-744), and writes none: only the hearing of a release does.
Revisions: nil, SayCatalogRevision: nil, SayFill: nil, EntryIndex: nil, NamedSets: nil, Versions: ix.Versions, SayVersionReleased: nil, Inputs: nil, InputObjects: nil, Pins: nil, PinsPending: nil,
// A dry run writes no registration and asks no one.
Registry: nil, SeedModules: nil}
x.Logf = func(format string, args ...any) { ix.logf("take-in, computed and not written: "+format, args...) }
@@ -7,6 +7,8 @@ import (
"slices"
"sync"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
mcseat "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions"
"git.novox.be/novox/mesh-sdk/go/views"
)
@@ -148,3 +150,35 @@ func applyS(ix *Indexer, _ context.Context, rev uint64, s srcT) error {
}
return nil
}
// hearReleased hears a published version as HearVersion does and also releases it as the indexer's own: the series names
// its module and artifact (its field package, which a trunk merge writes) and the versions state holds the version with
// that artifact, which a series' pin is read from (design 47 H2 H-A-660, H-A-744).
func hearReleased(ctx context.Context, ix *Indexer, h HeardVersion, module, artifact string) (bool, error) {
kept, err := ix.HearVersion(ctx, h)
if err != nil {
return kept, err
}
series, _ := SeriesOf(h.Version)
if err := write(ctx, ix.Packages, SeriesKey(h.Package, series), func(value []byte, found bool) ([]byte, bool, error) {
var s SeriesPackage
if err := json.Unmarshal(value, &s); err != nil {
return nil, false, err
}
s.Package = module + "/" + artifact
next, err := json.Marshal(s)
return next, false, err
}); err != nil {
return kept, err
}
if ix.Versions == nil {
ix.Versions = newMem()
}
entry, err := json.Marshal(meshcatalog.VersionEntry{Module: module, Version: h.Version,
Artifacts: []meshcatalog.VersionArtifact{{Artifact: ArtifactRefOf(module, artifact), Digest: "sha256:" + h.Version}}})
if err != nil {
return kept, err
}
key := meshcatalog.VersionsByModuleVersionKey(module, h.Version)
return kept, write(ctx, ix.Versions, key, func([]byte, bool) ([]byte, bool, error) { return entry, false, nil })
}
@@ -3,6 +3,7 @@ package index
import (
"context"
"errors"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/graph"
"strings"
"testing"
@@ -177,7 +178,7 @@ func TestImportsReportedMoveTheFingerprintOnlyWithAnImportedPackage(t *testing.T
// The registry publishes its Go package at 0.1.20, another version than the module's release, from c3, whose content
// avahi's fingerprint already takes: its build is pinned to v0.1.20, and the import form takes no pin, so the
// fingerprint stands (I4/AC1; design 47 H2 H-A-530, H-A-183).
if _, err := ix.HearVersion(ctx, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: "0.1.20", Commit: c3, GoModule: meshSDK, Published: true}); err != nil {
if _, err := hearReleased(ctx, ix, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: "0.1.20", Commit: c3, GoModule: meshSDK, Published: true}, "mesh-sdk", "go"); err != nil {
t.Fatal(err)
}
for range 2 {
@@ -214,7 +215,7 @@ func onlyTheVersionLineTakesAPin(t *testing.T) {
}
release := func(ix *Indexer) {
t.Helper()
if _, err := ix.HearVersion(ctx, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: "0.1.20", Commit: c1, GoModule: meshSDK, Published: true}); err != nil {
if _, err := hearReleased(ctx, ix, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: "0.1.20", Commit: c1, GoModule: meshSDK, Published: true}, "mesh-sdk", "go"); err != nil {
t.Fatal(err)
}
if err := ix.Recompute(ctx); err != nil {
@@ -304,7 +305,7 @@ func aReportedSetIsAKeyOrAHeldSet(t *testing.T) {
t.Fatalf("%s: after the report fp2 %q (was %q), import form %q; want the fingerprint as it was, on the import form", c.name, m.Fp2, before.Fp2, m.Inputs2.ImportForm)
}
// mesh-sdk 0.1.20 is published from c3, which changes announce alone: avahi imports none of it.
if _, err := ix.HearVersion(ctx, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: "0.1.20", Commit: c3, GoModule: meshSDK, Published: true}); err != nil {
if _, err := hearReleased(ctx, ix, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: "0.1.20", Commit: c3, GoModule: meshSDK, Published: true}, "mesh-sdk", "go"); err != nil {
t.Fatal(err)
}
if err := ix.Recompute(ctx); err != nil {
@@ -478,8 +479,8 @@ func anAcceptedSeriesPinsItsNewest(t *testing.T) {
}
hear := func(version, commit string) func() error {
return func() error {
_, err := ix.HearVersion(ctx, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: version,
Commit: commit, GoModule: meshSDK, Published: true})
_, err := hearReleased(ctx, ix, HeardVersion{Package: "mesh-sdk/go", Seat: "go-package-registry", Version: version,
Commit: commit, GoModule: meshSDK, Published: true}, "mesh-sdk", "go")
return err
}
}
@@ -491,8 +492,10 @@ func anAcceptedSeriesPinsItsNewest(t *testing.T) {
return ix.HearImportsReported(ctx, buildEnd(t, "avahi", before.Fp2, meshSDK, meshSDK+"/announce"))
})
pinned := step("0.1.15 published from c3", hear("0.1.15", c3))
if pinned.Fp2 == before.Fp2 || pinned.Packages[meshSDK] != "v0.1.15" {
t.Fatalf("after 0.1.15: fp2 %q (was %q), versions %v; want moved by c3's announce, pinned to v0.1.15", pinned.Fp2, before.Fp2, pinned.Packages)
// The import form takes no accepted-series override (design 47 H2 H-A-672): the series' contents (c3) move nothing, the
// digests are the trunk entry's (c1) and the version is pinned.
if pinned.Fp2 != before.Fp2 || pinned.Packages[meshSDK] != "v0.1.15" {
t.Fatalf("after 0.1.15: fp2 %q (was %q), versions %v; want unmoved by the series' contents, pinned to v0.1.15", pinned.Fp2, before.Fp2, pinned.Packages)
}
// A publish in a series avahi does not accept pins nothing and moves nothing (H-A-184).
if m := step("0.2.0 published from c1", hear("0.2.0", c1)); m.Fp2 != pinned.Fp2 || m.Packages[meshSDK] != "v0.1.15" {
@@ -501,8 +504,28 @@ func anAcceptedSeriesPinsItsNewest(t *testing.T) {
if m := step("trunk at c2", trunk(c2)); m.Fp2 != pinned.Fp2 || m.Packages[meshSDK] != "v0.1.15" {
t.Errorf("a trunk merge moved avahi off its accepted series' newest: %q %v", m.Fp2, m.Packages)
}
// A trunk merge that changes announce, a package it imports, moves it: its digest is read from the publisher's entry
// of the revision, whatever series it accepts (design 47 H2 H-A-580, H-A-672).
if m := step("trunk at c3", trunk(c3)); m.Fp2 == pinned.Fp2 || m.Packages[meshSDK] != "v0.1.15" {
t.Errorf("a change of an imported package at the trunk did not move avahi: %q (was %q) %v", m.Fp2, pinned.Fp2, m.Packages)
}
// The publisher's entry keeps the digest of each package of its package artifact (design 47 H2 H-A-580).
held, _ := ix.heldModules(ctx)
raw, man, err := ix.manifestRaw(ctx, held["mesh-sdk"].Manifest)
if err != nil {
t.Fatal(err)
}
digests := 0
for _, a := range ix.withArtifacts(ctx, CatalogEntryOf("mesh-sdk", held["mesh-sdk"], man, raw, graph.Node{}), man).Artifacts {
digests += len(a.Digests)
}
if digests == 0 {
t.Errorf("the entry of mesh-sdk keeps no digest of its packages")
}
// mesh-sdk's module releases 0.3.0: a module's release number is never a package's pin (H-A-183).
ix.Versions = newMem()
if ix.Versions == nil {
ix.Versions = newMem()
}
ix.Versions.(*memStore).put(meshcatalog.VersionsByModuleVersionKey("mesh-sdk", "0.3.0"), []byte(`{}`))
if m := step("0.3.0 released", func() error { return nil }); m.Packages[meshSDK] != "v0.1.15" {
t.Errorf("a module's release pinned its package: %v", m.Packages)
@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"maps"
"slices"
"strings"
@@ -216,13 +217,21 @@ func (ix *Indexer) meshPackages(ctx context.Context, held map[string]meshcatalog
// packagesPublishedBy are the packages meshPackages names, each with the repository of the module that publishes it, so a
// take-in tells the packages its repository publishes (design 47 H2 H-A-520, H-A-539).
func (ix *Indexer) packagesPublishedBy(ctx context.Context, held map[string]meshcatalog.ModulesByModuleValue) (map[string]string, error) {
names, _, err := ix.publishedByEntries(ctx, held)
return names, err
}
// publishedByEntries are packagesPublishedBy's names, and with them the digests each Go package artifact of those entries
// keeps, by the package's name (an artifact's `digests`, design 47 H2 H-A-580): what an importer's fingerprint reads.
func (ix *Indexer) publishedByEntries(ctx context.Context, held map[string]meshcatalog.ModulesByModuleValue) (map[string]string, map[string][]meshcatalog.ArtifactDigestsItem, error) {
if held == nil {
var err error
if held, err = ix.heldModules(ctx); err != nil {
return nil, err
return nil, nil, err
}
}
names := map[string]string{}
digests := map[string][]meshcatalog.ArtifactDigestsItem{}
for name, cur := range held {
if cur.Manifest == "" {
continue
@@ -234,10 +243,36 @@ func (ix *Indexer) packagesPublishedBy(ctx context.Context, held map[string]mesh
for _, a := range ix.withArtifacts(ctx, CatalogEntryOf(name, cur, m, raw, graph.Node{}), m).Artifacts {
if p := a.Package; p != nil && p.Name != "" && (p.Ecosystem == EcosystemGo || p.Ecosystem == EcosystemNpm) {
names[p.Name] = cur.Repository
if len(a.Digests) > 0 {
digests[p.Name] = a.Digests
}
}
}
}
return names, nil
return names, digests, nil
}
// fromEntries is published with the packages of each module an entry of the revision computed publishes taken at the
// digests that entry keeps (design 47 H2 H-A-580): an importer's fingerprint reads a package's digest from the entry that
// publishes it, so a publisher that moves in the same take-in is read at its new digests; a module no entry keeps digests
// of stays as the state holds it. Nothing of published is changed in place.
func fromEntries(published map[string]meshcatalog.PackagesByModuleValue, digests map[string][]meshcatalog.ArtifactDigestsItem) map[string]meshcatalog.PackagesByModuleValue {
if len(digests) == 0 {
return published
}
out := maps.Clone(published)
for module, items := range digests {
p, ok := out[module]
if !ok {
continue
}
p.Packages = make([]meshcatalog.PackagesByModuleValuePackagesItem, len(items))
for i, d := range items {
p.Packages[i] = meshcatalog.PackagesByModuleValuePackagesItem{Package: d.Package, Digest: d.Digest}
}
out[module] = p
}
return out
}
// inTheMesh are the imports a package of names holds, the package itself or a path under it (I9's reading); any other
@@ -12,6 +12,7 @@ import (
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
"git.novox.be/novox/mesh-sdk/go/busretry"
"git.novox.be/novox/mesh-sdk/go/views"
)
@@ -315,3 +316,67 @@ func TestTheNewestRevisionReadersReadAgainWhenTheRevisionIsRemovedUnderThem(t *t
})
}
}
// heldRead is a bucket whose read of an entry waits until release is closed: the start's read of the trunk held.
type heldRead struct {
*memObjects
reading chan struct{}
release chan struct{}
once atomic.Bool
}
func (h *heldRead) Get(ctx context.Context, name string) ([]byte, error) {
if strings.HasPrefix(name, "entry.") && h.once.CompareAndSwap(false, true) {
close(h.reading)
<-h.release
}
return h.memObjects.Get(ctx, name)
}
// Design 47 H2 H-A-708 (2) (AC-I15): while the start's read of the trunk is held, the view and the verb revision answer the fault
// away naming the trunk's revision at once, never wait behind the read; once it ends they answer, and with no read running a
// call reads the view once, as before.
func TestAViewOfTheTrunkAnswersAwayWhileTheStartsReadIsHeld(t *testing.T) {
mem := newMemObjects(0)
data, _ := json.Marshal(meshcatalog.CatalogEntry{Module: "avahi", Repository: catalogueRepo, None: "not built"})
rev := meshcatalog.CatalogRevision{Revision: 7, Kind: "trunk", Entries: []meshcatalog.EntryRef{{Module: "avahi", Digest: "d7"}}}
if err := KeepRevision(context.Background(), mem, rev, map[string][]byte{"d7": data}); err != nil {
t.Fatal(err)
}
objects := &heldRead{memObjects: mem, reading: make(chan struct{}), release: make(chan struct{})}
kept := &KeptTrunk{}
if err := kept.Unread(); err != nil {
t.Fatalf("Unread before any read = %v, want none: a call reads once with no read running", err)
}
started := make(chan error, 1)
go func() { started <- kept.Reread(context.Background(), objects) }()
<-objects.reading
answered := make(chan error, 3)
go func() { _, _, _, err := kept.current(context.Background(), objects); answered <- err }()
go func() {
_, err := Revision(context.Background(), objects, kept, meshcatalog.RevisionInput{})
answered <- err
}()
go func() { _, _, _, err := kept.Newest(context.Background(), objects); answered <- err }()
for range 3 {
select {
case err := <-answered:
var away *busretry.Away
if !errors.As(err, &away) || away.Part != "the trunk's revision 7" || !strings.HasPrefix(away.Words, "not read yet since ") {
t.Errorf("a call met by the start's read answered %v, want away naming the trunk's revision 7", err)
}
case <-time.After(5 * time.Second):
t.Fatal("a call waited behind the start's read of the trunk")
}
}
close(objects.release)
if err := <-started; err != nil {
t.Fatal(err)
}
if err := kept.Unread(); err != nil {
t.Errorf("Unread after the read = %v, want nothing", err)
}
if a, err := Revision(context.Background(), objects, kept, meshcatalog.RevisionInput{}); err != nil || a.Revision == nil || a.Revision.Revision != 7 {
t.Errorf("revision after the read answered %+v (%v), want revision 7", a, err)
}
}
@@ -10,7 +10,6 @@ import (
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/trunk"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/keys"
"mesh-delivery-indexer/internal/fingerprint"
@@ -102,7 +101,7 @@ func (ix *Indexer) applyMoving(ctx context.Context, f whole, drop bool, moves ma
next := meshcatalog.ModulesByModuleValue{Repository: f.Repository, Commit: f.Merge, Manifest: digests[dir], Path: pathOf(dir)}
// The reader capabilities a changed manifest needs are written with it, before the judge's pass names them with its
// verdict, so no reader takes a new manifest as needing nothing (ADR 0614 §4).
next.Needs, _ = catalogue.ManifestNeeds([]byte(raw))
next.Needs, _ = judge.ManifestNeeds([]byte(raw))
if whole, ok := f.Needs[dir]; ok {
next.Needs = whole // its templates' text too, read by the forge bridge at the merge (ADR 0632 §2)
}
@@ -16,8 +16,8 @@ import (
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/trunk"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/process"
"mesh-delivery-indexer/judge"
)
const merge = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -441,7 +441,7 @@ func TestAMergeAddingAModuleDirectoryWritesItsValueWithNoBuildRecordAnywhere(t *
}
// ADR 0614 §4: the merge writes the reader capabilities its manifest needs, so no reader takes it as needing nothing
// before the judge's pass.
if want, _ := catalogue.ManifestNeeds([]byte(avahi)); len(m.Needs) == 0 || !slices.Equal(m.Needs, want) {
if want, _ := judge.ManifestNeeds([]byte(avahi)); len(m.Needs) == 0 || !slices.Equal(m.Needs, want) {
t.Errorf("module needs %v, want %v", m.Needs, want)
}
}
@@ -459,7 +459,7 @@ func (ix *Indexer) npmPackagesIn(ctx context.Context, repository, commit string,
if _, ok := files["package.json"]; !ok {
continue
}
requires, pkgs, err := fingerprint.NpmPackage(name, files)
requires, pkgs, err := fingerprint.NpmPackage(name, files, ix.NpmTestFiles)
if err != nil {
ix.logf("%s at %s: %v; it is not published", repository, commit, err)
break
@@ -226,7 +226,7 @@ func TestARepositorysPackagesAreThoseInTheMergesTree(t *testing.T) {
if err := ix.publish(ctx, "novox/mesh-sdk", merge, held, false, TrunkBranch); err != nil {
t.Fatal(err)
}
_, want, _ := fingerprint.NpmPackage(npmName, listing)
_, want, _ := fingerprint.NpmPackage(npmName, listing, nil)
got, ok := ix.publishedAll(ctx)[npmName]
if !ok || got.Repository != "novox/mesh-sdk" || got.Dir != "ts" || got.Commit != merge || !reflect.DeepEqual(got.Packages, want) {
t.Fatalf("packages of %s = %+v (%v), want its digest %+v from novox/mesh-sdk at ts; asked %v", npmName, got, ok, want, asked)
@@ -22,7 +22,8 @@ import (
// The indexer keeps the records pinning each catalog graph revision and removes a revision only on an event (design 47 G §153,
// §178, §189, §215, §216, §579, A-169, A-171): its state pins holds one key per revision, `<branch>.<revision>` (the watched branch
// and the revision's number, the branch escaped as a name is), whose value lists the records that pin it: a take-in's, each
// running pipeline's (design 47 H §743, §749) and each passed pipeline's release until a newer one is the want (H-A-168, H-A-170).
// running pipeline's (design 47 H §743, §749), each passed pipeline's release until a newer one is the want (H-A-168, H-A-170),
// and each failed pipeline's mover that did not pass until it passes or a newer revision moves it (H2 H-A-565, H-A-566).
const (
// PinsState is the state's name; PinsCapMiB is its cap in the manifest (about 1,800 keys of about 0.2 KiB).
PinsState = "pins"
@@ -74,7 +75,9 @@ func pinObject(key string) (string, bool) {
// HeardPins applies one event of the seat mesh-pipeline-runner the indexer's durable consumers gave it (design 47 H §749): a
// pipeline-started pins the revision it names, and each revision its movers are kept at (design 47 H2 H-A-496), under the
// record `pipeline.<pipeline>`, its pipeline-ended frees it and every other revision the record pins (H-A-147). A body
// record `pipeline.<pipeline>`, its pipeline-ended frees it and every other revision the record pins (H-A-147); a failed
// one first pins them under `failed.<branch>.<module>` for each mover that did not pass, freed when the mover passes in a
// later pipeline or a pipeline of a newer revision moves it (H-A-565 (1), H-A-566). A body
// that is no such event, or names no revision, changes nothing; an error leaves the event unacknowledged, so the bus gives it
// again; one applied twice changes nothing.
func (ix *Indexer) HeardPins(ctx context.Context, started *runner.PipelineStarted, ended *runner.PipelineEnded) error {
@@ -94,6 +97,16 @@ func (ix *Indexer) HeardPins(ctx context.Context, started *runner.PipelineStarte
if err := ix.pinKept(ctx, started.Branch, started.Revision, started.Kept, record); err != nil {
return err
}
// A delivering pipeline of a newer revision that moves a mover a failed pipeline left, carried or at a newer
// fingerprint, frees that mover's failed record from every older revision of the branch: its own pin covers it now
// (design 47 H2 H-A-565 (1), H-A-566).
if started.Run == "" {
for _, m := range started.Movers {
if err := ix.unpinOlder(ctx, started.Branch, started.Revision, FailedRecord(started.Branch, m.Module)); err != nil {
return err
}
}
}
// The reservations of the pipeline's revision settle at its start, if they gather (design 47 H2 §805, H-A-424 (1)).
if err := ix.Settle(ctx, BranchObject(started.Branch, started.Revision)); err != nil {
ix.logf("versions: the reservations of %s are not re-pinned at its pipeline-started: %v", BranchObject(started.Branch, started.Revision), err)
@@ -125,6 +138,24 @@ func (ix *Indexer) HeardPins(ctx context.Context, started *runner.PipelineStarte
}
}
record := PipelineRecord(ended.Pipeline)
if ended.Run == "" {
// A mover that passed frees its failed record from every older revision of the branch; a delivering pipeline that
// ended failed keeps its own revision and each kept revision its record pins under failed.<branch>.<module> for
// each mover that did not pass, before its own record is freed, so a rerun or a carry still reads them (design 47
// H2 H-A-565 (1), H-A-566).
for _, m := range ended.Movers {
if ended.Outcome == runner.PipelineEndedOutcomePassed || moverPassed(m) {
if err := ix.unpinOlder(ctx, ended.Branch, ended.Revision, FailedRecord(ended.Branch, m.Module)); err != nil {
return err
}
}
}
if ended.Outcome == runner.PipelineEndedOutcomeFailed || ended.Outcome == runner.PipelineEndedOutcomeCancelled {
if err := ix.pinFailed(ctx, ended, record); err != nil {
return err
}
}
}
if err := ix.unpin(ctx, PinKey(ended.Branch, ended.Revision), record); err != nil {
return err
}
@@ -139,6 +170,212 @@ func ReleaseRecord(branch, module string) string {
return "release." + keys.EscapeName(branch) + "." + keys.EscapeName(module)
}
// FailedRecord is the record a failed pipeline pins its own and its kept revisions under, one per mover that did not pass:
// `failed.<branch>.<module>`, each name escaped as a key's name is (design 47 H2 H-A-565 (1), H-A-566).
func FailedRecord(branch, module string) string {
return "failed." + keys.EscapeName(branch) + "." + keys.EscapeName(module)
}
// moverPassed says whether a mover of a pipeline-ended passed: it holds steps and each required one passed, was carried or
// had nothing to run, as the runner counts a step passed.
func moverPassed(m runner.MoverEnded) bool {
if len(m.Steps) == 0 {
return false
}
for _, s := range m.Steps {
if s.Status != runner.StepResultStatusRequired {
continue
}
switch s.Outcome {
case runner.StepResultOutcomePassed, runner.StepResultOutcomeCarried, runner.StepResultOutcomeNothingToRun:
default:
return false
}
}
return true
}
// movedOut says whether a mover of a pipeline-ended left it for a newer revision: a required step of it is superseded.
func movedOut(m runner.MoverEnded) bool {
return slices.ContainsFunc(m.Steps, func(s runner.StepResult) bool {
return s.Status == runner.StepResultStatusRequired && s.Outcome == runner.StepResultOutcomeSuperseded
})
}
// pinFailed pins, for each mover a pipeline-ended that failed or was cancelled did not deliver (a mover with a required
// step that did not pass, and each module its `unfinished` names, not one moved out of it for a newer revision), the revision
// the mover's entry comes from and that revision's `base`, under the mover's failed record: the kept revision the mover's
// entry is at, else the pipeline's own (design 47 H2 H-A-566, H-A-572 (1), H-A-595, H-A-608). At most two revisions per record.
func (ix *Indexer) pinFailed(ctx context.Context, ended *runner.PipelineEnded, record string) error {
var failed []string
fingerprint := map[string]string{}
for _, m := range ended.Movers {
fingerprint[m.Module] = m.Fingerprint
if !moverPassed(m) && !movedOut(m) {
failed = append(failed, m.Module)
}
}
for _, module := range ended.Unfinished {
if !slices.Contains(failed, module) {
failed = append(failed, module)
}
}
if len(failed) == 0 {
return nil
}
slices.Sort(failed)
pinKeys, err := ix.Pins.Keys(ctx)
if err != nil {
return err
}
slices.Sort(pinKeys)
var kept []int64 // the revisions the pipeline's record pins above its own: where its movers are kept
for _, k := range pinKeys {
b, r, ok := ParsePinKey(k)
if !ok || b != ended.Branch || r <= ended.Revision {
continue
}
v, _, found, err := ix.Pins.Get(ctx, k)
if err != nil {
return err
}
var pv PinValue
if found && json.Unmarshal(v, &pv) == nil && slices.Contains(pv.Records, record) {
kept = append(kept, r)
}
}
slices.Reverse(kept) // the newest first
for _, module := range failed {
at := ended.Revision
for _, r := range kept {
if ix.entryAt(ctx, ended.Branch, r, module) == fingerprint[module] && fingerprint[module] != "" {
at = r
break
}
}
revisions := []string{PinKey(ended.Branch, at)}
if base := ix.baseOf(ctx, ended.Branch, at); base > 0 && base != at {
revisions = append(revisions, PinKey(ended.Branch, base))
}
for _, k := range revisions {
if err := ix.pin(ctx, k, FailedRecord(ended.Branch, module)); err != nil {
// A write the full state refuses is said, and the event is left unacknowledged so the bus gives it again at its
// kept-call pace (H-A-572 (1)).
ix.logf("pins: %s is not written to %s, so %s is heard again: %v", FailedRecord(ended.Branch, module), k, ended.Pipeline, err)
return err
}
}
ix.logf("pins: %s ended %s: %s keeps %s until it passes in a later pipeline or a newer revision moves it (H-A-566, H-A-608)",
ended.Pipeline, ended.Outcome, FailedRecord(ended.Branch, module), strings.Join(revisions, ", "))
}
return nil
}
// entryAt is the fingerprint of module's entry in revision r of branch, empty when the revision or the entry is not read.
func (ix *Indexer) entryAt(ctx context.Context, branch string, r int64, module string) string {
_, entries, err := ReadRevision(ctx, ix.Revisions, RevisionObject(meshcatalog.CatalogRevision{Branch: branch, Revision: r}))
if err != nil {
return ""
}
for _, e := range entries {
if e.Module == module {
return e.Fp
}
}
return ""
}
// baseOf is the revision revision r of branch names as its base (H-A-151), zero when it names none or is not read.
func (ix *Indexer) baseOf(ctx context.Context, branch string, r int64) int64 {
rev, _, err := ReadRevision(ctx, ix.Revisions, RevisionObject(meshcatalog.CatalogRevision{Branch: branch, Revision: r}))
if err != nil {
return 0
}
return rev.Base
}
// FreeFailedRecords frees every failed record (`failed.<branch>.<module>`) from every pin that holds it when no registration
// of its module names its branch any more: the module left the registrations, or, until a change of a module's branch is a
// take-in of that branch's head for that module alone, its branch left the module's registration. registered says the
// registrations as a set of records (design 47 H2 H-A-572 (2), heard on registration-changed, ADR 0666 section 2).
func (ix *Indexer) FreeFailedRecords(ctx context.Context, registered map[string]bool) error {
pinKeys, err := ix.Pins.Keys(ctx)
if err != nil {
return err
}
for _, k := range pinKeys {
v, _, found, err := ix.Pins.Get(ctx, k)
if err != nil {
return err
}
var pv PinValue
if !found || json.Unmarshal(v, &pv) != nil {
continue
}
for _, record := range pv.Records {
if strings.HasPrefix(record, "failed.") && !registered[record] {
if err := ix.unpin(ctx, k, record); err != nil {
return err
}
ix.logf("pins: %s is freed from %s: its module is no longer registered on that branch (H-A-572 (2))", record, k)
}
}
}
return nil
}
// RegisteredFailedRecords are the failed records every registration of the registry names, one per module and branch.
func (r *Registry) RegisteredFailedRecords(ctx context.Context) (map[string]bool, error) {
all, err := r.Registrations.Keys(ctx)
if err != nil {
return nil, err
}
out := map[string]bool{}
for _, k := range all {
v, _, found, err := r.Registrations.Get(ctx, k)
if err != nil {
return nil, err
}
var reg meshcatalog.Registration
if !found || json.Unmarshal(v, &reg) != nil {
continue
}
if reg.Module == "" {
return nil, fmt.Errorf("the registration %s names no module, so no failed record is freed by this read", k)
}
for _, b := range reg.Branches {
out[FailedRecord(b, reg.Module)] = true
}
}
return out, nil
}
// unpinOlder frees record from every revision of branch older than revision (H-A-566).
func (ix *Indexer) unpinOlder(ctx context.Context, branch string, revision int64, record string) error {
pinKeys, err := ix.Pins.Keys(ctx)
if err != nil {
return err
}
for _, k := range pinKeys {
b, r, ok := ParsePinKey(k)
if !ok || b != branch || r >= revision {
continue
}
v, _, found, err := ix.Pins.Get(ctx, k)
if err != nil {
return err
}
var pv PinValue
if !found || json.Unmarshal(v, &pv) != nil || !slices.Contains(pv.Records, record) {
continue
}
if err := ix.unpin(ctx, k, record); err != nil {
return err
}
}
return nil
}
// HeardPipelineWanted applies one pipeline-wanted of the seat mesh-wants, said when a pipeline's wants are written to the end
// (design 47 H §751, H-A-168, H-A-170, H-A-173, H-A-174). Outcome running: a module whose release record the pipeline's own
// kept revision holds released its newer version there, and that is the want everywhere, so the module's record is freed from
@@ -562,6 +799,48 @@ func (ix *Indexer) PinDrop(ctx context.Context, key, by, why string) TakenIn {
return r
}
// PinDropRecord drops one record, by its name, from every pin of the state pins that holds it, leaving each pin's other records
// (indexer_pin_drop with record, design 47 H2 H-A-572 (3)); the removal rule then applies.
func (ix *Indexer) PinDropRecord(ctx context.Context, record, by, why string) TakenIn {
r := TakenIn{Module: "pins record " + record}
if ix.Pins == nil {
r.Answer = "the indexer keeps no state " + PinsState + ": nothing dropped"
return r
}
pinKeys, err := ix.Pins.Keys(ctx)
if err != nil {
r.Answer = "the state " + PinsState + " cannot be read: " + err.Error()
return r
}
slices.Sort(pinKeys)
dropped := 0
for _, k := range pinKeys {
if _, _, ok := ParsePinKey(k); !ok {
continue
}
v, _, found, err := ix.Pins.Get(ctx, k)
if err != nil {
r.Answer = "the pin " + k + " cannot be read, so the drop stops there: " + err.Error()
return r
}
var pv PinValue
if !found || json.Unmarshal(v, &pv) != nil || !slices.Contains(pv.Records, record) {
continue
}
if err := ix.unpin(ctx, k, record); err != nil {
r.Answer = "the record " + record + " could not be dropped from " + k + ": " + err.Error()
ix.logf("%s", r.Answer)
return r
}
dropped++
}
r.Stored = dropped > 0
r.Answer = fmt.Sprintf("the record %s is dropped from %d pins by %s (%s)", record, dropped, by, why)
ix.logf("%s", r.Answer)
ix.JudgePins(ctx)
return r
}
// PinnedRevision is one revision of the state pins as indexer_pins lists it.
type PinnedRevision struct {
Revision string `json:"revision"`
@@ -644,14 +923,34 @@ func PinsTools(pins Store, o Objects, ask func(key string, value []byte) (TakeIn
"running pipeline (design 47 H §765); the removal rule then applies (a revision no record pins and not current goes). A hand " +
"act, recorded through mesh-hand-acts before it is asked. Clears the finding pin-missing of the key. indexer_pins names the keys. " +
"With all true and no key, every pin of the state goes, each recorded and asked as one: the clean state's tool, run while no " +
"pipeline runs (design 47 H-A-121, H-A-124); it answers the count dropped and the pipelines they named.",
"pipeline runs (design 47 H-A-121, H-A-124); it answers the count dropped and the pipelines they named. With record " +
"and no key, that one record (`failed.<branch>.<module>`, as indexer_pins names it) is dropped from every pin that holds it " +
"and the pins' other records stay (design 47 H2 H-A-572 (3)).",
Input: map[string]any{"type": "object", "required": []string{"why"}, "properties": map[string]any{
"key": map[string]any{"type": "string", "description": "the pin's key `<branch>.<revision>`, as indexer_pins names it"},
"all": map[string]any{"type": "boolean", "description": "true drops every pin of the state pins, naming no key"},
"why": map[string]any{"type": "string", "description": "why it is dropped, in plain words"}}},
"key": map[string]any{"type": "string", "description": "the pin's key `<branch>.<revision>`, as indexer_pins names it"},
"all": map[string]any{"type": "boolean", "description": "true drops every pin of the state pins, naming no key"},
"record": map[string]any{"type": "string", "description": "one record, as indexer_pins names it, dropped from every pin that holds it; the pins' other records stay"},
"why": map[string]any{"type": "string", "description": "why it is dropped, in plain words"}}},
Run: func(args map[string]any) (any, error) {
str := func(k string) string { s, _ := args[k].(string); return strings.TrimSpace(s) }
key, why := str("key"), str("why")
if rec := str("record"); rec != "" {
if key != "" || str("all") == "true" || why == "" {
return nil, errors.New("name a record (record) with no key and no all, and say why (why): a drop is a hand act, recorded through mesh-hand-acts")
}
data, err := json.Marshal(TakeInAsk{V: 1, PinDropRecord: rec, Why: why, By: stdio.CallerOf(args), At: now().UTC()})
if err != nil {
return nil, err
}
if err := record("dropped the record "+rec+" from the pins of the catalog graph revisions by hand", why); err != nil {
return nil, fmt.Errorf("the hand act was not recorded through mesh-hand-acts, so nothing was dropped: %w", err)
}
a, err := ask("pin-drop-record."+keys.EscapeName(rec), data)
if err != nil {
return nil, err
}
return a.Result, nil
}
if all, _ := args["all"].(bool); all || str("all") == "true" {
if key != "" {
return nil, errors.New("the all form drops every pin: name no key with it")
@@ -52,6 +52,58 @@ func TestAPipelinesKeptRevisionsArePinnedUntilItEnds(t *testing.T) {
heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.1", Revision: 1, Kept: []int64{3, 4}}, nil,
"main.1", "main.3", "main.4", "main.6")
heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.1", Revision: 1, Outcome: runner.PipelineEndedOutcomeFailed}, "main.6")
// H-A-565 (1), H-A-566: a failed delivering pipeline keeps its own and its kept revisions under failed.main.<module> for
// each mover that did not pass (app failed, lib never ran; ok passed, gone was superseded); a pipeline of a newer
// revision moving lib frees lib's, app passing in a later pipeline frees app's, and only then the revisions go.
pending = 1
for source := int64(7); source <= 10; source++ {
e := reader
e.Commit = fmt.Sprintf("c%d", source)
if err := ix.KeepBranchEntries(ctx, "main", source, map[string]meshcatalog.CatalogEntry{"reader": e}, nil); err != nil {
t.Fatal(err)
}
}
pending = 0
step := func(outcome string) []runner.StepResult {
return []runner.StepResult{{Step: runner.StepResultStepUnit, Status: runner.StepResultStatusRequired, Outcome: outcome}}
}
heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.7", Revision: 7, Kept: []int64{8}}, nil, "main.10", "main.7", "main.8")
heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.7", Revision: 7, Outcome: runner.PipelineEndedOutcomeFailed,
Movers: []runner.MoverEnded{{Module: "app", Steps: step(runner.StepResultOutcomeFailed)}, {Module: "lib", Steps: step(runner.StepResultOutcomeNotAsked)},
{Module: "ok", Steps: step(runner.StepResultOutcomePassed)}, {Module: "gone", Steps: step(runner.StepResultOutcomeSuperseded)}}},
"main.10", "main.7")
for _, k := range []string{"main.7"} {
if v, _, _, _ := ix.Pins.Get(ctx, k); !slices.Equal(mustRecords(t, v), []string{"failed.main.app", "failed.main.lib"}) {
t.Errorf("the pin of %s holds %s, want app's and lib's failed records", k, v)
}
}
heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.10", Revision: 10, Movers: []runner.StartedMover{{Module: "lib"}}}, nil,
"main.10", "main.7")
if v, _, _, _ := ix.Pins.Get(ctx, "main.7"); !slices.Equal(mustRecords(t, v), []string{"failed.main.app"}) {
t.Errorf("the pin of main.7 holds %s after main.10 moved lib, want app's failed record alone", v)
}
heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.10", Revision: 10, Outcome: runner.PipelineEndedOutcomeFailed,
Movers: []runner.MoverEnded{{Module: "app", Steps: step(runner.StepResultOutcomePassed)}, {Module: "lib", Steps: step(runner.StepResultOutcomePassed)}}},
"main.10")
// H-A-595, H-A-608: a cancelled end pins as a failed one does, for a mover its `unfinished` names as for one whose step
// failed, so the revision its entry comes from stays after the pipeline's end.
pending = 1
for source := int64(11); source <= 12; source++ {
e := reader
e.Commit = fmt.Sprintf("c%d", source)
if err := ix.KeepBranchEntries(ctx, "main", source, map[string]meshcatalog.CatalogEntry{"reader": e}, nil); err != nil {
t.Fatal(err)
}
}
pending = 0
heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.11", Revision: 11}, nil, "main.11", "main.12")
heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.11", Revision: 11, Outcome: runner.PipelineEndedOutcomeCancelled,
Unfinished: []string{"carried"}}, "main.11", "main.12")
if v, _, _, _ := ix.Pins.Get(ctx, "main.11"); !slices.Equal(mustRecords(t, v), []string{"failed.main.carried"}) {
t.Errorf("the pin of main.11 holds %s after a cancelled end naming carried unfinished, want its failed record", v)
}
}
// Design 47 H §749 (G §579, A-169, A-171): the indexer pins a revision on a pipeline-started that names it and frees it on its
@@ -125,6 +177,17 @@ func TestTheIndexerRemovesARevisionOnlyWhenNoRecordPinsItAndItIsNotCurrent(t *te
if f := ix.Findings.Held(); len(f) != 1 || f[0].Kind != PinMissingKind {
t.Fatalf("findings %v, want one %s", f, PinMissingKind)
}
// H-A-572 (3): a record dropped by name leaves its pin's other records.
if err := ix.pin(ctx, "main.3", FailedRecord("main", "x")); err != nil {
t.Fatal(err)
}
before, _, _, _ := ix.Pins.Get(ctx, "main.3")
if r := ix.PinDropRecord(ctx, FailedRecord("main", "x"), "operator", "a hand act"); !r.Stored {
t.Fatalf("the record drop answered %q", r.Answer)
}
if v, _, _, _ := ix.Pins.Get(ctx, "main.3"); len(mustRecords(t, v)) != len(mustRecords(t, before))-1 || slices.Contains(mustRecords(t, v), FailedRecord("main", "x")) {
t.Errorf("the pin holds %s after the record drop, was %s: want the one record gone and the others staying", v, before)
}
if r := ix.PinDrop(ctx, "main.1", "operator", "names no running pipeline"); !r.Stored {
t.Fatalf("the pin drop answered %q", r.Answer)
}
@@ -227,6 +290,7 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) {
unreleased bool // its mover released no version there, so nothing pins main.5 (H-A-173)
then []int64 // sources taken in with no mover after the end
released []string
failed []string // main.5's mover did not pass in the failed pipeline: its failed record keeps these (H-A-565 (1), H-A-566)
}{
{name: "the previous revision kept and pinned", before: []int64{3, 4}, at: 3, whileRuns: []string{"main.2", "main.3"}, afterTheEnd: []string{"main.3"}, base: 2},
{name: "the newest kept before, whatever its source", before: []int64{2}, at: 2, whileRuns: []string{"main.1", "main.2"}, afterTheEnd: []string{"main.2"}, base: 1},
@@ -237,6 +301,8 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) {
base: 1, passed: true, unreleased: true, then: []int64{6}, afterTheEnd: []string{"main.3"}},
{name: "a failed pipeline's revision goes once no longer current", before: []int64{4}, at: 2, whileRuns: []string{"main.1", "main.2"},
base: 1, then: []int64{6}, afterTheEnd: []string{"main.3"}},
{name: "a failed pipeline's mover that did not pass keeps its revisions", before: []int64{4}, at: 2, whileRuns: []string{"main.1", "main.2"},
base: 1, then: []int64{6}, afterTheEnd: []string{"main.1", "main.2", "main.3"}, failed: []string{"main.1", "main.2"}},
} {
t.Run(tc.name, func(t *testing.T) {
ix := &Indexer{Module: testSelf, Revisions: newMemObjects(1 << 20), Pins: newMem(), Findings: newFindings(),
@@ -273,7 +339,11 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) {
}
}
end := runner.PipelineEnded{Branch: "main", Pipeline: at, Revision: tc.at, Outcome: runner.PipelineEndedOutcomeFailed,
Movers: []runner.MoverEnded{{Module: "reader", Fingerprint: "f", Version: "0.1.5"}}}
Movers: []runner.MoverEnded{{Module: "reader", Fingerprint: "f", Version: "0.1.5",
Steps: []runner.StepResult{{Step: runner.StepResultStepUnit, Status: runner.StepResultStatusRequired, Outcome: runner.StepResultOutcomePassed}}}}}
if tc.failed != nil {
end.Movers[0].Steps[0].Outcome = runner.StepResultOutcomeFailed
}
if tc.unreleased {
end.Movers[0].Version = ""
}
@@ -296,6 +366,9 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) {
if slices.Contains(tc.released, k) {
want = []string{ReleaseRecord("main", "reader")}
}
if slices.Contains(tc.failed, k) {
want = []string{FailedRecord("main", "reader")}
}
if v, _, _, _ := ix.Pins.Get(ctx, k); !slices.Equal(append([]string{}, mustRecords(t, v)...), want) {
t.Errorf("after the pipeline's end the pin of %s holds %s, want %v", k, v, want)
}
@@ -304,3 +377,20 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) {
})
}
}
// Design 47 H2 H-A-572 (2): a failed record is freed from every pin when no registration of its module names its branch.
func TestAFailedRecordIsFreedWhenItsModuleLeavesTheRegistrations(t *testing.T) {
ctx := context.Background()
ix := &Indexer{Module: testSelf, Revisions: newMemObjects(1 << 20), Pins: newMem(), Findings: newFindings()}
for _, r := range []string{FailedRecord("main", "gone"), FailedRecord("main", "stays"), PipelineRecord("main.1")} {
if err := ix.pin(ctx, "main.3", r); err != nil {
t.Fatal(err)
}
}
if err := ix.FreeFailedRecords(ctx, map[string]bool{FailedRecord("main", "stays"): true}); err != nil {
t.Fatal(err)
}
if v, _, _, _ := ix.Pins.Get(ctx, "main.3"); !slices.Equal(mustRecords(t, v), []string{FailedRecord("main", "stays"), PipelineRecord("main.1")}) {
t.Errorf("the pin holds %s, want the registered module's failed record and the pipeline's alone", v)
}
}

Some files were not shown because too many files have changed in this diff Show More