nats and mesh-config: their event streams keep their history, the bus's predefined form of an event family, not an age-limited stream of their own (V1; ADR 0592 §6; issue 1966)
Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -74,7 +74,7 @@ them, newest first; with `proposal`, one read whole, with whether the router's a
|
||||
said per node. State `retiring`; the tool `config_retiring` lists, asks again and cancels.
|
||||
- Findings (state `findings`, read by the condition keeper): `rename-refused`, `rename-window-held` and
|
||||
`retirement-held` (seven days, naming the node), `retiring-unanswered` (asked twice).
|
||||
- The events `renamed`, `retiring` and `retired` are carried by the stream `config-events`, kept seven days.
|
||||
- The events `renamed`, `retiring` and `retired` are carried by the stream `config-events`, which keeps its history (the bus refuses a new event when it is full).
|
||||
|
||||
## Files it does not know
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ func TestEveryStateAndActHasItsTool(t *testing.T) {
|
||||
if !slices.Equal(dm.Emits, []string{ConfigChanged}) {
|
||||
t.Errorf("emits %v, want only %s: the stream carries the others", dm.Emits, ConfigChanged)
|
||||
}
|
||||
if len(dm.Streams) != 1 || dm.Streams[0].Name != StreamName || dm.Streams[0].Days() != 7 || !dm.Streams[0].Carries(EventRenamed) ||
|
||||
if len(dm.Streams) != 1 || dm.Streams[0].Name != StreamName || !dm.Streams[0].KeepsHistory() || !dm.Streams[0].Carries(EventRenamed) ||
|
||||
!dm.Streams[0].Carries(EventRetiring) || !dm.Streams[0].Carries(EventRetired) || dm.Streams[0].Carries(ConfigChanged) {
|
||||
t.Errorf("streams %+v: want %s, seven days, carrying renamed, retiring and retired but not config-changed", dm.Streams, StreamName)
|
||||
t.Errorf("streams %+v: want %s, keeping its history, carrying renamed, retiring and retired but not config-changed", dm.Streams, StreamName)
|
||||
}
|
||||
}
|
||||
for _, verb := range SeatVerbs {
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
const (
|
||||
RenamesState = "renames"
|
||||
// EventRenamed is `renamed`, EventRetiring `retiring` and EventRetired `retired`, the family `config.events` of the
|
||||
// seat's definition (design 26), under the holder's subjects: each carried by the stream StreamName, kept seven days.
|
||||
// seat's definition (design 26), under the holder's subjects: each carried by the stream StreamName, which keeps its history.
|
||||
EventRenamed = "renamed"
|
||||
EventRetiring = "retiring"
|
||||
EventRetired = "retired"
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
"retiring",
|
||||
"retired"
|
||||
],
|
||||
"max-age-days": 7
|
||||
"retention": "history"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ func (s processStore) Create(state, key string, value []byte) (uint64, error) {
|
||||
// streamEmitter says an event of the seat mesh-broker, with the SDK's headers, under its one event id (the lead's ruling,
|
||||
// registry milestone, 13:0x; design 25 § 12.3): on the seat's own subject `mesh.seat.mesh-broker.event.<event>`, which the
|
||||
// shared events stream keeps 7 days and every consumer of `mesh-broker.<event>` hears, like any seat's event; then on the
|
||||
// bus module's own stream (its old `streams` section, 30 days, 256 MiB), which its tool `history` reads. The seat's subject
|
||||
// bus module's own stream (a stream that keeps its history, 256 MiB), which its tool `history` reads. The seat's subject
|
||||
// first: a reader hears it before the history holds it, never the other way round. It says it on s.Left (every subject
|
||||
// when nil) and leaves in s.Left what the bus did not take, so the keeper says that again with the same id and the bus
|
||||
// keeps it once (the two publishes are not one act: a failed second one is kept and said again, never silent).
|
||||
|
||||
@@ -169,7 +169,7 @@ func main() {
|
||||
var ReadingVerbs = []string{"list", "show", "check", "orphans"}
|
||||
|
||||
// Events are the seat mesh-broker's events (ADR 0595 §6, ADR 0620 §2): said on the seat's subjects on the shared events stream
|
||||
// and kept 30 days on the bus module's own stream broker-events (BROKER_EVENTS), which `history` reads (keep.go).
|
||||
// and kept in full on the bus module's own stream broker-events (BROKER_EVENTS), which `history` reads (keep.go).
|
||||
var Events = []string{"created", "refused", "drifted", "drift-cleared", "full", "full-cleared", "orphaned", "recreated", "dropped"}
|
||||
|
||||
// allTools is every tool and seat verb this bundle serves.
|
||||
|
||||
@@ -161,7 +161,8 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) {
|
||||
// The bus module provides bus state (design 25 § 12.2-12.3, ADR 0595 §4-§6; CAT-N1): its keeper is a process of
|
||||
// its own on its own account (own secret broker-keeper, ADR 0436 §1), creating only bus state; it hears the indexer's
|
||||
// manifest-accepted, keeps what it heard in its own old state `asked` (ADR 0595 §10) and the persons' requests in
|
||||
// `requests`; its nine events are its own (ADR 0620 §2), on its own stream kept 30 days at 256 MiB; the seat's four
|
||||
// `requests`; its nine events are its own (ADR 0620 §2), on its own stream that keeps its history (ADR 0592 §6, the manifest
|
||||
// validator's predefined form) at 256 MiB; the seat's four
|
||||
// reading verbs are served, its four acting verbs are the keeper's own work and no other account's; its health is
|
||||
// the keeper's own tool, beside the server's tcp check.
|
||||
var nm struct {
|
||||
@@ -177,6 +178,7 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) {
|
||||
Name string `json:"name"`
|
||||
Events []string `json:"events"`
|
||||
MaxAgeDays int `json:"max-age-days"`
|
||||
Retention string `json:"retention"`
|
||||
MaxMiB int `json:"max-mib"`
|
||||
} `json:"streams"`
|
||||
State []struct {
|
||||
@@ -205,8 +207,8 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) {
|
||||
t.Errorf("uses %v: the operator channel, for the warrant of recreate and drop", nm.Uses)
|
||||
}
|
||||
if len(nm.Streams) != 1 || nm.Streams[0].Name != "broker-events" || !slices.Equal(nm.Streams[0].Events, Events) ||
|
||||
nm.Streams[0].MaxAgeDays != 30 || nm.Streams[0].MaxMiB != 256 {
|
||||
t.Errorf("streams are %+v: broker-events carrying %v, 30 days, 256 MiB", nm.Streams, Events)
|
||||
nm.Streams[0].MaxAgeDays != 0 || nm.Streams[0].Retention != "history" || nm.Streams[0].MaxMiB != 256 {
|
||||
t.Errorf("streams are %+v: broker-events carrying %v, keeping its history, 256 MiB", nm.Streams, Events)
|
||||
}
|
||||
for _, e := range Events {
|
||||
if slices.Contains(m.Emits, e) {
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
"recreated",
|
||||
"dropped"
|
||||
],
|
||||
"max-age-days": 30,
|
||||
"retention": "history",
|
||||
"max-mib": 256
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user