feat(eventcore-types): glob pattern matching for subscriptions (#246) #410
No reviewers
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/eventcore!410
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/246-glob-pattern-matching"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements POSIX glob pattern matching for event subscription filtering (issue #246) — the distinct pattern type ADR-017 reserved metacharacters for.
StreamPatterndomain type (nutype) validated to compile as aglob::Patternat construction (parse-don't-validate), with amatches()method and proptest-covered validation. Theglobcrate's defaultPattern::matchestreats/as an ordinary character, so*crosses/.EventFiltergains a mutually-exclusivestream_patternfield with apattern()constructor andstream_pattern()accessor;StreamPatternis re-exported fromeventcore-types.LIMIT(same correctness reasoning as theevent_typefilter, #372): Postgres usesstream_id ~ $nwith an anchored, injection-safe glob→POSIX-regex translation; SQLite uses the nativeGLOBoperator; memory and fs filter in-process. Postgres and SQLiteread_eventsqueries are refactored into dynamic builders so prefix XOR pattern + cursor + event_type compose without combinatorial query strings.StreamPrefixnow rejects glob metacharacters via theno_glob_metacharacterspredicate (blast radius minimal — existing prefixes are all literal).Tests
New cross-backend contract tests wired into
backend_contract_tests!(run by all four backends):*wildcard (crossing the page-limit boundary to prove pre-LIMITfiltering),?single-char,[0-9]character class. Plus unit tests for the glob→regex translation including injection cases. Full workspace suite: 269 tests pass, clippy clean.Decision record
ADR-0047 records the matching approach (glob crate,
/semantics, per-backend pushdown, validation).projection-systemandstore-backendsblueprints document pattern filtering.Acceptance criteria
Closes #246
This PR introduces POSIX glob pattern matching for event subscription filtering, enhancing the flexibility of event stream selection. The changes appear well-implemented with comprehensive testing across backends, ensuring correctness and performance. The PR is ready to merge.
LLM usage and cost
Estimated total USD: $0.496512 via https://api.openai.com and https://api.openai.com