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:
2026-11-05 17:30:39 +01:00
parent 2978dd5bed
commit a89aaf5644
8 changed files with 13 additions and 11 deletions
+1 -1
View File
@@ -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).
+1 -1
View File
@@ -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.
+5 -3
View File
@@ -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) {