Namespace DotBoxD.Plugins.Indexing
Classes
Section titled “Classes”Marks an event property the host keeps a dispatch index for. DotBoxD owns predicate lowering and
exposes index metadata on the plugin manifest (DotBoxD.Plugins.HookSubscriptionManifest.IndexedPredicates);
this attribute is how a host declares which of those property paths it can actually serve from an
equality/range bucket. DotBoxD.Plugins.Indexing.EventIndexMatcher reads it (once, with a compiled getter)
and ignores manifest predicates whose path is not an index key, leaving them to the verified IR.
Promoted to the framework as the first-class declaration surface (issue #50) so any host can opt into index-based prefiltering without reimplementing the matcher. It stays purely declarative: a property the host does not mark is simply never served from the index.
A host’s compiled view of a subscription’s DotBoxD.Plugins.IndexedPredicate metadata — the
“compile the metadata into whatever dispatch/index structure is natural for the runtime” half of
issue #47, promoted to the framework by issue #50. It keeps only the predicates whose
DotBoxD.Plugins.IndexedPredicate.Path is an DotBoxD.Plugins.Indexing.EventIndexKeyAttribute property of
TEvent (the fields the host indexes) and evaluates them cheaply against an event
through precompiled property getters — no per-event reflection, so the index never costs more
than it saves.
Because every kept predicate is a necessary AND condition of the real predicate,
`DotBoxD.Plugins.Indexing.EventIndexMatcher.CouldMatch()` returning false is always a safe reject; returning true means
the event passed the cheap index and the host should still run the verified IR unless the manifest
reported full coverage. Conversely, the matcher never rejects on a comparison it cannot soundly decide
(a value whose type cannot be reconciled to the property, a null reference, or an ordering it cannot
evaluate): such a leaf is dropped or passed through so the verified IR stays the authority. This keeps
the invariant "index-reject ⇒ verified-IR-reject" intact even for hand-built or imported manifests
whose `DotBoxD.Plugins.IndexedPredicate.ValueType` disagrees with the property's CLR type.
A first-class, reusable host dispatch index (issue #50). A host registers a subscription kernel together
with its generated DotBoxD.Plugins.IndexedPredicates; the registry recomputes them from verified IR and
compiles them into an
DotBoxD.Plugins.Indexing.EventIndexMatcher (precompiled getters, no per-event reflection) and, when the host
publishes an event, runs the cheap index check before entering the sandbox. Events the index
rejects never reach the verified IR; survivors are dispatched to DotBoxD.Plugins.Kernel.InstalledKernel as the
correctness authority — the verified ShouldHandle still runs after a matching index check because
package-supplied coverage metadata is not trusted across the manifest boundary.
This is the "register a subscription and get index-based prefiltering without writing your own matcher"
surface. Subscriptions whose predicates touch no indexed field are rejected by `DotBoxD.Plugins.Indexing.EventIndexRegistry.Register(DotBoxD.Abstractions.IPluginEventAdapter{},DotBoxD.Plugins.Kernel.InstalledKernel,System.Collections.Generic.IReadOnlyList{DotBoxD.Plugins.IndexedPredicate},System.Boolean)`
(returns false) so the host can leave them on its broad pipeline.
Structs
Section titled “Structs”Prefilter diagnostics for an DotBoxD.Plugins.Indexing.EventIndexRegistry: how many indexed checks ran
(DotBoxD.Plugins.Indexing.EventIndexStats.Considered), how many events the index rejected before any sandbox entry
(DotBoxD.Plugins.Indexing.EventIndexStats.Prefiltered), and how many survived to the verified IR (DotBoxD.Plugins.Indexing.EventIndexStats.Dispatched).
Considered == Prefiltered + Dispatched holds once publishing is quiescent; a snapshot taken
while DotBoxD.Plugins.Indexing.EventIndexRegistry.Publish(,System.Threading.CancellationToken) is running concurrently may observe an in-flight
increment between the three reads.