Skip to content

Populate usage.Events and return an empty StreamMetadata.Tags (#411, #412) - #413

Merged
jeremydmiller merged 1 commit into
mainfrom
fix/411-412-explorer-descriptors
Aug 4, 2026
Merged

Populate usage.Events and return an empty StreamMetadata.Tags (#411, #412)#413
jeremydmiller merged 1 commit into
mainfrom
fix/411-412-explorer-descriptors

Conversation

@jeremydmiller

@jeremydmiller jeremydmiller commented Aug 4, 2026

Copy link
Copy Markdown
Member

Two explorer-surface defects, both found by a new cross-store compliance suite (EventStoreExplorerCompliance, JasperFx/jasperfx#633) rather than by Polecat's own tests.

#411usage.Events was empty

EventStoreUsage carries the event registry twice: Events (List<EventDescriptor>) and RegisteredEventTypes (List<EventTypeDescriptor>). Marten fills both. Polecat filled only RegisteredEventTypes, so usage.Events came back empty.

That matters because this descriptor is read out of repo by CritterWatch, where an empty Events list reads as "this store has no event types configured" rather than "this store describes them under a different key" — the tooling degrades silently instead of failing.

Now populated from the same AllKnownEventTypes() loop that already fed RegisteredEventTypes.

#412StreamMetadata.Tags was null

GetStreamMetadataAsync returned Tags: null!, but the record declares it non-nullable:

public sealed record StreamMetadata(..., IReadOnlyDictionary<string, string> Tags);

"No tags" is spelled with an empty dictionary. A null forces every consumer that trusts the declaration into a NullReferenceException instead of an empty loop. The null! had silenced the compiler's warning rather than answering it.

Now a shared static readonly empty dictionary, so there is no per-stream allocation. Polecat does not persist DCB stream tags yet, so every row legitimately reports the same empty set.

Scope

Deliberately product-only. The compliance enrollment that proves both fixes needs a JasperFx release carrying the new suite, so it lands separately — at which point the two temporary capability gates come out and the suite runs ungated. Verified locally against that suite: explorer suite 6/6, compliance 124/124 with no gates, full Polecat.Tests 1722/0/3.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VpDCvJcBDZerieJB4JEHde

…412)

Both found by a new cross-store compliance suite (EventStoreExplorerCompliance,
JasperFx/jasperfx#633) rather than by Polecat's own tests -- which is the point
of the shared suite.

#411: EventStoreUsage carries the event registry twice, as Events
(List<EventDescriptor>) and RegisteredEventTypes (List<EventTypeDescriptor>).
Marten fills both; Polecat filled only RegisteredEventTypes, so usage.Events came
back empty. This descriptor is read out of repo by CritterWatch, where an empty
Events list reads as "this store has no event types configured" rather than "this
store describes them under a different key". Now populated from the same
AllKnownEventTypes() loop that already fed RegisteredEventTypes.

#412: GetStreamMetadataAsync returned Tags: null!, but StreamMetadata.Tags is
declared as a non-nullable IReadOnlyDictionary<string, string>. "No tags" is
spelled with an empty dictionary; null forces every consumer that trusts the
declaration into a NullReferenceException instead of an empty loop. The `null!`
silenced the compiler's warning rather than answering it. Now a shared static
empty dictionary, so there is no per-stream allocation.

Deliberately product-only: the compliance enrollment that proves these lands
separately, once the JasperFx release carrying the suite is out.

Closes #411
Closes #412

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpDCvJcBDZerieJB4JEHde
@jeremydmiller
jeremydmiller force-pushed the fix/411-412-explorer-descriptors branch from 750c733 to 44a45a3 Compare August 4, 2026 22:50
@jeremydmiller
jeremydmiller merged commit 7c19249 into main Aug 4, 2026
7 checks passed
@jeremydmiller
jeremydmiller deleted the fix/411-412-explorer-descriptors branch August 4, 2026 23:11
jeremydmiller added a commit that referenced this pull request Aug 4, 2026
Enrolls the three shared suites that shipped in 2.39.4 (JasperFx/jasperfx#633):
fetch_latest_compliance (7), stream_archiving_compliance (6) and
event_store_explorer_compliance (6). Polecat's compliance coverage goes from 105
to 124 tests with zero capability gates.

No gates are needed because #413 already fixed what they would have covered: the
explorer suite found an empty usage.Events collection (#411) and a null
StreamMetadata.Tags (#412) while it was being written, and those landed
separately so they did not have to wait on a JasperFx release. The two temporary
gates were removed from the compliance library before it shipped, so these
assertions run unmodified here.

The version jump also picks up 2.39.2 and 2.39.3, which had not been adopted yet.

Verified on net9.0 against the published packages: 124/124 compliance.


Claude-Session: https://claude.ai/code/session_01VpDCvJcBDZerieJB4JEHde

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant