Released: TBD Compare: v0.12.0-alpha.7…v0.12.0-alpha.8
Where alpha.7 turned community into a reusable upstream for the REST admin
surface, alpha.8 does the same for the event data plane. It carries the
community half of PRD Slice 4A (enterprise #86 — enterprise business-stream
data plane + server-side metering capture): the business-stream event router is
now reachable from an exported pkg/, and a subject-carrying metering
observation hook rides the live routing path. Together these let the enterprise
edition embed and meter the community router as a superset — without forking or
importing anything under internal/.
The change is deliberately narrow. The router implementation, its tests, and the
pkg/internal seam discipline established by PRD #50 / PR #54 all stay in
internal/eventRouter; community still has exactly one router. What crosses the
boundary is a thin facade — pkg/eventRouter — that re-exports the
construct-and-drive contract as type aliases plus one constructor, alongside an
OpenPersistence composition-root opener so an out-of-tree module can stand up
the services + cluster coordinator it needs to drive the router. The enterprise
product owner authorized this export direction on 2026-06-27.
Compatibility: the new surface is additive and off by default. The metering
observer is distinct from the existing Prometheus SetEventCounter hook — a
different field on a different path — and community itself registers no observer,
so /metrics behavior is byte-unchanged and the Prometheus counter/dedup
tests stay green. There are no new environment variables. The family continues
to ship byte-matched at the tag (v0.12.0-alpha.8); enterprise consumes
github.com/i2-open/i2goSignals/pkg/eventRouter and re-pins by tag on this
release-train.
pkg/ (PR #219). Added
pkg/eventRouter, a deliberately narrow facade an out-of-tree Go module
embeds with no internal/ import: NewBusinessRouter(deps Deps, nodeId
string) BusinessRouter, where BusinessRouter exposes only HandleEvent,
UpdateStreamState, RegisterMeteringObserver, and Shutdown.Deps is a type alias over the internal RouterDeps — the embedder populates
the exported pkg/services fields (StreamService / KeyService /
EventService) plus a Coordinator, and never has to name an internal/
type. The constructor returns the same deep internal router (NewRouter);
only the exposed surface is narrowed to what the enterprise superset needs.pkg/internal boundary to keep the router internal; this facade does not
move or fork it — the implementation and its tests remain in
internal/eventRouter, so #50’s seam discipline is preserved while the
superset gains a no-internal-import embedding point.internal/eventRouter/metering.go,
re-exported via pkg/eventRouter). A MeteringObserver.ObserveEvent(...)
receives one MeteringObservation per routed event, carrying {StreamURN,
Direction (ingress|egress), Subject}. The Subject is read from the SET
sub_id claim — the per-event identity that distinct-set metering (MAS)
requires and a Prometheus counter cannot express.HandleEvent, and
once per egress at each fan-out selection point — RFC 8935 push, RFC 8936
poll, and both SSTP-client and SSTP-server pairs.SetEventCounter(in, out *prometheus.CounterVec); the registration is
held in an atomic.Pointer so the hot path pays only a lock-free atomic load
per event, and an unregistered observer is a no-op. Community registers none,
so /metrics is unaffected. The new RegisterMeteringObserver method on the
internal EventRouter interface is also stubbed (typed-unsupported) on the
admin-surface adminRouterAdapter.eventRouter.OpenPersistence(storeURL, dbName) (PR #219, commit
6ad9903). The construct-and-drive surface above is unsatisfiable out-of-tree
on its own, because dbProviders is internal/ and a separate Go module
physically cannot import it. This re-export is a thin pass-through to the
persistence factory (detects memorydb: or a Mongo URL) that yields the
*dbProviders.Persistence bundle — StreamService / KeyService /
EventService and Coordinator for Deps, plus the Storage handle to
close on shutdown. It follows the existing posture of
pkg/goSsfServer.NewApplication, which already accepts the same type.pkg/internal boundary decision the
event-router export reconciles against.pkg → internal admin-route export;
this release applies the same additive, narrow-facade pattern to the event
data plane. Lineage: ADR 0021 (services-lift, the pkg/services types in
Deps) and ADR 0010 (provider decomposition, the OpenPersistence root).pkg/goSignalsServer admin surface — was closed not-planned: that surface
is admin-only (adminRouterAdapter panics on event methods) and has no live
router to observe. The router-level hook in #218 supersedes it.go test -race ./... is green module-wide. New coverage includes
internal/eventRouter/metering_test.go (observer fires once per routed event
with the correct {stream_urn, direction, subject} for both ingress and
egress, on the live path), the exported end-to-end seam tests
(pkg/eventRouter/event_router_test.go and
pkg/eventRouter/event_router_embed_test.go), and the Prometheus
distinctness/dedup tests confirming /metrics is unchanged. Per-PR gates
(gofmt -l, go vet, -race) pass with no new warnings; the OpenID SSF
conformance matrix in conformance/ is unaffected by the additive, default-off
changes.