diff --git a/modules/gitea/cmd/package-registry/seats_test.go b/modules/gitea/cmd/package-registry/seats_test.go index 92ac71e40..6deb1ab47 100644 --- a/modules/gitea/cmd/package-registry/seats_test.go +++ b/modules/gitea/cmd/package-registry/seats_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - "git.novox.be/novox/mesh-sdk/go/health" + "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" "gitea/internal/forgehttp" "gitea/internal/packageseats" ) @@ -133,7 +133,7 @@ func TestThePackageSeatsStoreIntoTheForge(t *testing.T) { // and the next write the forge takes clears it (no timer looks at the token). var refused []bool forge.Refused = func(raised bool) { refused = append(refused, raised) } - if k := health.FindingKey(health.ScopeSeat, packageseats.Self, PackagesTokenRefused+".write"); k != PackagesTokenRefusedKey { + if k := meshconditionsclient.Key(meshconditionsclient.ScopeSeat, packageseats.Self, PackagesTokenRefused+".write"); k != PackagesTokenRefusedKey { t.Errorf("the refusal's key is %s, the watcher watches %s", k, PackagesTokenRefusedKey) } _ = os.WriteFile(writer.TokenFile, []byte("stale\n"), 0o600) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go b/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go index 09d5a441b..689ff100e 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go @@ -164,7 +164,11 @@ func TestAModuleOutsideTheTreeCountsByVersionAndChecksum(t *testing.T) { if err != nil { t.Fatal(err) } - ext := pkgs["git.novox.be/novox/mesh-sdk/go/buildstep"] + // The capture holds the one package go list was asked about, whichever package that was. + var ext *goPackage + for _, p := range pkgs { + ext = p + } if ext == nil || ext.Module == nil || ext.Module.Sum == "" || ext.Module.Version == "" || ext.Module.Main { t.Fatalf("the capture holds no external package with a version and a checksum: %+v", ext) } diff --git a/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts.go b/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts.go index 6d83505f0..063987624 100644 --- a/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts.go +++ b/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts.go @@ -24,35 +24,36 @@ import ( "sync/atomic" "time" + handactsclient "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient" + handacts "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhandacts" occ "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient" oc "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel" - "git.novox.be/novox/mesh-sdk/go/handacts" ) -// The seat, the log, the states and the event, as mesh-sdk's handacts names them. +// The seat, the log, the states and the event, as the seat mesh-hand-acts's contract names them. const ( - Module = handacts.Module + Module = "mesh-hand-acts" Seat = handacts.Seat - ActsLog = handacts.ActsLog - WarrantsState = handacts.WarrantsState + ActsLog = handacts.StateActs + WarrantsState = handacts.StateWarrants // RouterRecords is the router's record of every ask, `.` (ADR 0259): the warrant is read there. RouterRecords = "messenger.asks" - RecordedEvent = handacts.EventRecorded + RecordedEvent = handacts.EventActRecorded // RecordedSubject is where the seat says it: a seat's events are on mesh.seat..event., which its // consumers hear (catalogue.SeatSays). RecordedSubject = "mesh.seat." + Seat + ".event." + RecordedEvent - VerbRecord = handacts.VerbRecord - VerbDrill = handacts.VerbDrill - VerbWarrant = handacts.VerbWarrant - CauseDrill = handacts.CauseDrill - CauseOperatorAnswer = handacts.CauseOperatorAnswer + VerbRecord = handactsclient.VerbRecord + VerbDrill = handactsclient.VerbDrill + VerbWarrant = handactsclient.VerbWarrant + CauseDrill = handactsclient.CauseDrill + CauseOperatorAnswer = handactsclient.CauseOperatorAnswer ) // RepeatedWithin is how far back a cause counts as repeated (S15). const RepeatedWithin = 14 * 24 * time.Hour -// Act is one entry of the log: mesh-sdk's handacts.Act, the controller's HandAct unchanged. +// Act is one entry of the log: the seat's Act. type Act = handacts.Act // Store is the bus's buckets and this module's log as it reaches them, through its runtime. Create writes a key only @@ -130,7 +131,7 @@ func (l *Log) HandAct(by, verb, what, why, cause, condition string) (Recorded, e ", which no healer is wanted for. Nothing was recorded") } at := l.Now().UTC() - act := Act{ID: actKey(at), At: at, By: by, Verb: verb, Args: []string{what}, Why: why, Cause: cause, + act := Act{ID: actKey(at), At: at, By: by, Verb: verb, Arguments: []string{what}, Why: why, Cause: cause, Condition: strings.TrimSpace(condition)} if err := l.record(act); err != nil { return Recorded{}, err @@ -219,10 +220,10 @@ func (l *Log) Warranted(caller, asker, ask string) (Recorded, error) { } at := l.Now().UTC() act := Act{ID: "warrant-" + asker + "-" + ask, At: warranted.UTC(), Verb: VerbWarrant, - Args: []string{fmt.Sprintf("the operator chose %s on %s's ask %s", w.Label, asker, ask)}, - Why: fmt.Sprintf("%s (ask %s of %s)", occ.Says(*w), ask, asker), - By: fmt.Sprintf("the %s, as %s identity %s", w.By.Who, w.By.Kind, w.By.Identity), - Cause: CauseOperatorAnswer, Via: via(*w), Ask: ask, Proofs: w.Proofs, + Arguments: []string{fmt.Sprintf("the operator chose %s on %s's ask %s", w.Label, asker, ask)}, + Why: fmt.Sprintf("%s (ask %s of %s)", occ.Says(*w), ask, asker), + By: fmt.Sprintf("the %s, as %s identity %s", w.By.Who, w.By.Kind, w.By.Identity), + Cause: CauseOperatorAnswer, Via: via(*w), Ask: ask, Proofs: w.Proofs, RequestedBy: asker + ", recorded at the word of " + caller, Outcome: "chosen; what " + asker + " did with it is in its own record"} if claimed == nil { @@ -297,7 +298,7 @@ func (l *Log) HandActs(days int, cause, who string) Listing { out.Kept[ActsLog] = kept } for _, a := range all { - if now.Sub(a.At) <= RepeatedWithin && a.Repair() { + if now.Sub(a.At) <= RepeatedWithin && handactsclient.Repair(a) { out.Repeated[a.Cause]++ } if a.At.Before(since) || (cause != "" && a.Cause != cause) || (who != "" && !strings.Contains(a.By, who)) { @@ -329,7 +330,7 @@ func (l *Log) read(since time.Time) ([]Act, int, error) { if json.Unmarshal(raw, &a) != nil || a.At.Before(since) { continue } - a.Log = handacts.LogSeat + a.Log = handacts.Seat out = append(out, a) } return out, len(entries), nil diff --git a/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts_test.go b/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts_test.go index b95c2d568..9f5d2bb8c 100644 --- a/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts_test.go +++ b/modules/mesh-hand-acts/cmd/mesh-hand-acts/acts_test.go @@ -171,7 +171,7 @@ func TestHandActRecordsWhatTheProvenCallerDid(t *testing.T) { raw, _, _ := store.Last(ActsLog, keys[0]) _ = json.Unmarshal(raw, &kept) if kept.By != tc.by || kept.Verb != tc.wantVerb || kept.Cause != tc.wantCause || kept.Condition != "bus.x.missing" || - kept.Args[0] != tc.what || kept.Log != "" { + kept.Arguments[0] != tc.what || kept.Log != "" { t.Errorf("%s: kept %+v", tc.name, kept) } } diff --git a/modules/mesh-hand-acts/go.mod b/modules/mesh-hand-acts/go.mod index 360e7a04b..143b09769 100644 --- a/modules/mesh-hand-acts/go.mod +++ b/modules/mesh-hand-acts/go.mod @@ -3,6 +3,8 @@ module mesh-hand-acts go 1.26.0 require ( + git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhandacts v0.0.0-00010101000000-000000000000 + git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261104174359-05b3e2e1b94f diff --git a/modules/mesh-healers/cmd/mesh-healers/healers.go b/modules/mesh-healers/cmd/mesh-healers/healers.go index 4fc0c11e5..e7e335db1 100644 --- a/modules/mesh-healers/cmd/mesh-healers/healers.go +++ b/modules/mesh-healers/cmd/mesh-healers/healers.go @@ -26,9 +26,9 @@ import ( "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" meshconditions "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions" + handacts "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhandacts" meshhealers "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhealers" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/handacts" ) // Module and Seat are this module and the seat it holds once for the mesh. @@ -47,7 +47,7 @@ const ( // ActedSubject is where the seat says it, which its consumers hear (catalogue.SeatSays). ActedSubject = "mesh.seat." + Seat + ".event." + ActedEvent // RecordedEvent is the hand-act log's seat event, each act recorded there (ADR 0565 ยง11). - RecordedEvent = handacts.Seat + "." + handacts.EventRecorded + RecordedEvent = handacts.Seat + "." + handacts.EventActRecorded // The events it hears: the keeper's, on the seat mesh-conditions. RaisedEvent = "mesh-conditions.condition-raised" ChangedEvent = "mesh-conditions.condition-changed" diff --git a/modules/mesh-healers/cmd/mesh-healers/healers_test.go b/modules/mesh-healers/cmd/mesh-healers/healers_test.go index 2322abbf6..d7e5d68fd 100644 --- a/modules/mesh-healers/cmd/mesh-healers/healers_test.go +++ b/modules/mesh-healers/cmd/mesh-healers/healers_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "git.novox.be/novox/mesh-sdk/go/handacts" + handacts "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhandacts" ) type memStore struct { @@ -426,7 +426,7 @@ func TestTheVerbsAndReads(t *testing.T) { args map[string]any log, err string }{ - {"into the seat", false, map[string]any{"what": "stopped records", "why": "does it raise"}, handacts.LogSeat, ""}, + {"into the seat", false, map[string]any{"what": "stopped records", "why": "does it raise"}, handacts.Seat, ""}, {"no holder: refused, the controller's not asked", true, map[string]any{"what": "stopped records", "why": "x"}, "", "nothing was recorded"}, {"says nothing", false, map[string]any{}, "", "says what"}, } @@ -455,7 +455,7 @@ func TestTheVerbsAndReads(t *testing.T) { } case err != nil || got.(map[string]any)["log"] != d.log: t.Errorf("drill %s: %v, %v", d.name, got, err) - case d.log == handacts.LogSeat && !strings.Contains(asked[0], `"verb":"hand-act drill"`): + case d.log == handacts.Seat && !strings.Contains(asked[0], `"verb":"hand-act drill"`): t.Errorf("drill %s asked %v", d.name, asked) } for _, k := range asked { diff --git a/modules/mesh-healers/cmd/mesh-healers/tools.go b/modules/mesh-healers/cmd/mesh-healers/tools.go index e5f1dc25b..fc0d92273 100644 --- a/modules/mesh-healers/cmd/mesh-healers/tools.go +++ b/modules/mesh-healers/cmd/mesh-healers/tools.go @@ -12,8 +12,9 @@ import ( "strings" "time" + handactsclient "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient" + handacts "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhandacts" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/handacts" ) // Verbs are the seat's verbs, as the manifest claims them. @@ -92,7 +93,7 @@ func (h *Healers) Drill(what, why, condition string) (any, error) { if h.Ask == nil { return nil, errors.New("the hand-act log cannot be reached from here: nothing was recorded") } - body := map[string]any{"what": what, "why": why, "verb": handacts.VerbDrill} + body := map[string]any{"what": what, "why": why, "verb": handactsclient.VerbDrill} if condition != "" { body["condition"] = condition } @@ -100,7 +101,7 @@ func (h *Healers) Drill(what, why, condition string) (any, error) { if err != nil { return nil, fmt.Errorf("%s.hand-act refused the drill, so nothing was recorded: %w", handacts.Seat, err) } - return map[string]any{"log": handacts.LogSeat, "answer": answer}, nil + return map[string]any{"log": handacts.Seat, "answer": answer}, nil } // Heal is the verb heal: one condition judged now by its healer. diff --git a/modules/mesh-healers/cmd/mesh-healers/wanted.go b/modules/mesh-healers/cmd/mesh-healers/wanted.go index 2b83a20af..cbee1a0e3 100644 --- a/modules/mesh-healers/cmd/mesh-healers/wanted.go +++ b/modules/mesh-healers/cmd/mesh-healers/wanted.go @@ -16,13 +16,13 @@ import ( "strings" "time" - "git.novox.be/novox/mesh-sdk/go/handacts" + handacts "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhandacts" ) // Within is how far back a repeated cause counts. const Within = 14 * 24 * time.Hour -// HandAct is what S15 reads of one act of the hand-act log (mesh-sdk handacts.Act). +// HandAct is what S15 reads of one act of the hand-act log (the seat mesh-hand-acts's Act). type HandAct struct { ID string `json:"id"` At time.Time `json:"at"` @@ -85,7 +85,7 @@ func (h *Healers) ActRecorded(body []byte) { if h.acts == nil { h.acts = map[string]HandAct{} } - h.acts[handacts.LogSeat+":"+a.ID] = a + h.acts[handacts.Seat+":"+a.ID] = a h.mu.Unlock() h.Wanted() } diff --git a/modules/mesh-healers/go.mod b/modules/mesh-healers/go.mod index 0b3c16026..77d768cb1 100644 --- a/modules/mesh-healers/go.mod +++ b/modules/mesh-healers/go.mod @@ -3,6 +3,7 @@ module mesh-healers go 1.26.0 require ( + git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhandacts v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261104174359-05b3e2e1b94f github.com/nats-io/nats.go v1.54.0 ) @@ -24,3 +25,4 @@ require ( require git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient v0.0.0-00010101000000-000000000000 require git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions v0.0.0-00010101000000-000000000000 require git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshhealers v0.0.0-00010101000000-000000000000 +require git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient v0.0.0-00010101000000-000000000000 diff --git a/modules/mesh-provisioner/cmd/mesh-provisioner/provisioner_test.go b/modules/mesh-provisioner/cmd/mesh-provisioner/provisioner_test.go index 9fb54ccb2..4df58189f 100644 --- a/modules/mesh-provisioner/cmd/mesh-provisioner/provisioner_test.go +++ b/modules/mesh-provisioner/cmd/mesh-provisioner/provisioner_test.go @@ -9,7 +9,7 @@ import ( "sync" "testing" - "git.novox.be/novox/mesh-sdk/go/health" + "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" "git.novox.be/novox/mesh-sdk/go/views" ) @@ -313,7 +313,7 @@ func TestTheManifestDeclaresWhatTheCodeKeeps(t *testing.T) { t.Errorf("the claim: %+v", m.Claims) } // needs stays declared this release so its first start can empty it (ADR 0570 clause 1). - if want := []string{Registry, Needs, Applied, Collect, ProvisionsState, PlansState, RefusedState, health.FindingsState}; !slices.Equal(m.State, want) { + if want := []string{Registry, Needs, Applied, Collect, ProvisionsState, PlansState, RefusedState, meshconditionsclient.FindingsState}; !slices.Equal(m.State, want) { t.Errorf("the state is %v, want %v", m.State, want) } // Every state and act has its tool (ADR 0570 Consequences): the verb reads the clients' states, the holder's tools diff --git a/modules/mesh-vault/cmd/mesh-vault/signing.go b/modules/mesh-vault/cmd/mesh-vault/signing.go index 8ed4b0ff8..421c92eab 100644 --- a/modules/mesh-vault/cmd/mesh-vault/signing.go +++ b/modules/mesh-vault/cmd/mesh-vault/signing.go @@ -23,8 +23,8 @@ import ( "time" "git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault" + "git.novox.be/novox/mesh-networking/modules/mesh-wireguard/go/overlay" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/overlay" ) // The vault's own signing secrets: each an ed25519 seed in base64 (never PEM, which the vault takes as a private key diff --git a/modules/mesh-vault/cmd/mesh-vault/signing_test.go b/modules/mesh-vault/cmd/mesh-vault/signing_test.go index 8a3d27930..cdb0c10de 100644 --- a/modules/mesh-vault/cmd/mesh-vault/signing_test.go +++ b/modules/mesh-vault/cmd/mesh-vault/signing_test.go @@ -14,7 +14,7 @@ import ( "strings" "testing" - "git.novox.be/novox/mesh-sdk/go/overlay" + "git.novox.be/novox/mesh-networking/modules/mesh-wireguard/go/overlay" "git.novox.be/novox/mesh-sdk/go/seal" ) diff --git a/modules/mesh-vault/go.mod b/modules/mesh-vault/go.mod index 0e2eb7cae..f34057674 100644 --- a/modules/mesh-vault/go.mod +++ b/modules/mesh-vault/go.mod @@ -29,3 +29,4 @@ require ( golang.org/x/sys v0.48.0 // indirect golang.org/x/time v0.16.0 // indirect ) +require git.novox.be/novox/mesh-networking/modules/mesh-wireguard/go v0.0.0-20261105000000-000000000000