Main reverted G's half merge (#189, reverted by8afc3ebin #191) and then took the reader release's S1-S5, which copied G's code. G's form holds where they differ (process_bus.go, seats.go, state.go and their tests); the release's kept names stay so main's callers keep building: SeatViewPrefix beside SeatReadPrefix, and QueueInvoke's empty strings on not-ok (with its test TestQueueInvoke). The tree differs from G's headf30dee54only by those and the release's two tests (objects cap option, seat states and stream kinds). Builds: design 47 G (the milestone's sdk part, as atf30dee54) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
67 lines
2.0 KiB
Go
67 lines
2.0 KiB
Go
package views_test
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/views"
|
|
)
|
|
|
|
// Plain structs shaped as the types the seat generator emits for the seat `mesh-conditions` (design 47 G A-3): the writer
|
|
// is generic over them and works on their wire form, so the test brings the same shape, field for field.
|
|
|
|
type testSubject struct {
|
|
Also []string `json:"also,omitempty"`
|
|
ID string `json:"id"`
|
|
Machine string `json:"machine,omitempty"`
|
|
Scope string `json:"scope"`
|
|
}
|
|
|
|
type testFinding struct {
|
|
At time.Time `json:"at"`
|
|
Explanation string `json:"explanation,omitempty"`
|
|
Headline string `json:"headline,omitempty"`
|
|
ID string `json:"id"`
|
|
Kind string `json:"kind"`
|
|
Observer string `json:"observer"`
|
|
Owner string `json:"owner,omitempty"`
|
|
Run string `json:"run,omitempty"`
|
|
Scope string `json:"scope"`
|
|
Severity string `json:"severity"`
|
|
Since time.Time `json:"since"`
|
|
Source string `json:"source"`
|
|
Subject testSubject `json:"subject"`
|
|
Summary string `json:"summary"`
|
|
WaitingOn string `json:"waiting-on,omitempty"`
|
|
}
|
|
|
|
type testCleared struct {
|
|
At time.Time `json:"at"`
|
|
ID string `json:"id"`
|
|
Kind string `json:"kind"`
|
|
Scope string `json:"scope"`
|
|
Why string `json:"why"`
|
|
}
|
|
|
|
type testPending struct {
|
|
Bound string `json:"bound"`
|
|
Key string `json:"key"`
|
|
Since time.Time `json:"since"`
|
|
}
|
|
|
|
type testStated struct {
|
|
Asked string `json:"asked,omitempty"`
|
|
At time.Time `json:"at"`
|
|
Findings []testFinding `json:"findings"`
|
|
Kinds []string `json:"kinds,omitempty"`
|
|
Pending []testPending `json:"pending"`
|
|
}
|
|
|
|
type testAsked struct {
|
|
Ask string `json:"ask"`
|
|
Module string `json:"module,omitempty"`
|
|
}
|
|
|
|
type testWriter = views.Writer[testFinding, testCleared, testStated, testAsked]
|
|
type testConfig = views.WriterConfig[testFinding, testCleared, testStated, testAsked]
|
|
type testObserved = views.Observed[testFinding]
|