Enrolment: the hand acts through the seat's client, its findings through the conditions client's writer, the owners' states followed from the shared events stream, seat names from the contracts and its claim and end events name the seat mesh-node-enroller (D-23); contract import paths follow the domain folders (D-12..D-22 Enrolment part; issue 1966)

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 14:51:55 +01:00
parent 404083d25f
commit 5472e633dd
11 changed files with 30 additions and 27 deletions
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"errors"
oc "git.novox.be/novox/mesh-contracts/go/seats/operatorchannel"
oc "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel"
"git.novox.be/novox/mesh-sdk/go/delivery"
"reflect"
"slices"
@@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshnodeenroller"
"regexp"
"time"
@@ -18,8 +19,8 @@ import (
// Module and Seat are the module's name and the seat it holds.
const (
Module = catalogue.EnrolmentSeat
Seat = catalogue.EnrolmentSeat
Module = "mesh-enrolment"
Seat = meshnodeenroller.Seat
// State is the holder's bucket of open enrolments; its keys are node.<node> and address.<address> (ADR 0587 §2).
State = delivery.EnrolmentsState
)
@@ -11,8 +11,8 @@ import (
"sync"
"time"
mv "git.novox.be/novox/mesh-contracts/go/seats/meshvault"
oc "git.novox.be/novox/mesh-contracts/go/seats/operatorchannel"
mv "git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault"
oc "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel"
"git.novox.be/novox/mesh-sdk/go/delivery"
)
@@ -23,8 +23,8 @@ import (
"github.com/nats-io/nats.go"
"github.com/nats-io/nats.go/jetstream"
mv "git.novox.be/novox/mesh-contracts/go/seats/meshvault"
oc "git.novox.be/novox/mesh-contracts/go/seats/operatorchannel"
mv "git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault"
oc "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/delivery"
"git.novox.be/novox/mesh-sdk/go/testbus"
@@ -8,8 +8,8 @@ import (
"strings"
"time"
occ "git.novox.be/novox/mesh-contracts/go/clients/operatorchannelclient"
oc "git.novox.be/novox/mesh-contracts/go/seats/operatorchannel"
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"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/delivery"
)
@@ -7,8 +7,8 @@ import (
"testing"
"time"
occ "git.novox.be/novox/mesh-contracts/go/clients/operatorchannelclient"
oc "git.novox.be/novox/mesh-contracts/go/seats/operatorchannel"
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/delivery"
)
@@ -11,8 +11,8 @@ import (
"testing"
"time"
mv "git.novox.be/novox/mesh-contracts/go/seats/meshvault"
oc "git.novox.be/novox/mesh-contracts/go/seats/operatorchannel"
mv "git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault"
oc "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel"
"git.novox.be/novox/mesh-sdk/go/delivery"
)
@@ -12,10 +12,10 @@ import (
"os"
"time"
occ "git.novox.be/novox/mesh-contracts/go/clients/operatorchannelclient"
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient"
occ "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/delivery"
"git.novox.be/novox/mesh-sdk/go/handacts"
"git.novox.be/novox/mesh-sdk/go/views"
)
@@ -125,7 +125,7 @@ const (
// PlacementTool, then the assigner's views family; past its bound the finding in the enrolment's own findings.
func followed() *views.Reader {
v := &views.Reader{Module: Module, Logf: func(f string, a ...any) { logf("["+Module+"] "+f, a...) }, Findings: views.OwnFindings{},
Acts: handacts.Recorder{Ask: stdio.Ask}}
Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}}
v.Follow(delivery.AssignerModule, delivery.PlacementState, PlacementTool)
v.Start(context.Background())
return v
@@ -137,7 +137,7 @@ func SeatEventSubject(event string) string { return "mesh.seat." + Seat + ".even
// newHolder is the holder over the runtime.
func newHolder(v *views.Reader) *Holder {
call := Call(stdio.Ask)
rec := handacts.Recorder{Ask: stdio.Ask}
rec := meshhandactsclient.Recorder{Ask: stdio.Ask}
rd := followedReader{pics: v, rest: runtimeReader{}}
client := occ.New("asked")
return &Holder{
@@ -149,7 +149,7 @@ func newHolder(v *views.Reader) *Holder {
WarrantOf: warrantOf(client),
Warrant: func(ask string) error { _, err := rec.RecordWarrant(Module, ask); return err },
Act: func(what, why, cause string) error {
_, err := rec.Record(handacts.Request{What: what, Why: why, Cause: cause})
_, err := rec.Record(meshhandactsclient.Request{What: what, Why: why, Cause: cause})
return err
},
Loaded: loadedVia(rd),
@@ -7,7 +7,7 @@ import (
"fmt"
"time"
mv "git.novox.be/novox/mesh-contracts/go/seats/meshvault"
mv "git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault"
"git.novox.be/novox/mesh-sdk/go/delivery"
)
+5 -3
View File
@@ -3,6 +3,9 @@ module mesh-enrolment
go 1.26.0
require (
git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshnodeenroller 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/identity-and-access/go/seats/meshvault 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
)
@@ -10,9 +13,8 @@ require (
require git.novox.be/novox/mesh-contracts/go v0.0.0-20261104174344-ae5266e77639 // indirect
require (
git.novox.be/novox/mesh-contracts/go/clients/operatorchannelclient v0.0.0-20261104174344-ae5266e77639
git.novox.be/novox/mesh-contracts/go/seats/meshvault v0.0.0-20261104174344-ae5266e77639
git.novox.be/novox/mesh-contracts/go/seats/operatorchannel v0.0.0-20261104174344-ae5266e77639
git.novox.be/novox/mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient v0.0.0-20261104174344-ae5266e77639
git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel v0.0.0-20261104174344-ae5266e77639
github.com/antithesishq/antithesis-sdk-go v0.8.0-default-no-op // indirect
github.com/google/go-tpm v0.9.8 // indirect
github.com/klauspost/compress v1.20.1 // indirect
+5 -5
View File
@@ -4,7 +4,7 @@
"runs-as": "mesh-enrolment",
"claims": [
{
"name": "mesh-enrolment",
"name": "mesh-node-enroller",
"scope": "mesh",
"serves": [
"issue",
@@ -17,10 +17,10 @@
}
],
"consumes": [
"mesh-enrolment.node-enrolled",
"mesh-enrolment.enrolment-refused",
"mesh-enrolment.enrolment-revoked",
"mesh-enrolment.enrolment-expired",
"mesh-node-enroller.node-enrolled",
"mesh-node-enroller.enrolment-refused",
"mesh-node-enroller.enrolment-revoked",
"mesh-node-enroller.enrolment-expired",
"mesh-delivery-assigner.views.placement"
],
"uses": [