Glob Pattern Matching for Subscriptions #246

Open
opened 2025-12-28 20:00:16 -08:00 by jwilger · 0 comments
jwilger commented 2025-12-28 20:00:16 -08:00 (Migrated from github.com)

Overview

Implements POSIX glob pattern matching for SubscriptionQuery per ADR-017 and ARCHITECTURE.md v1.6. Enables filtering subscriptions using wildcard patterns like account-* or order-[0-9]*.

Core Components

  • StreamPattern type that permits glob metacharacters (*, ?, [, ])
  • SubscriptionQuery::filter_stream_pattern(StreamPattern) method
  • POSIX glob matching via glob crate (or similar)

Design Decisions (from ARCHITECTURE.md)

  • Distinct type: StreamPattern vs StreamPrefix (literals) - type system makes intent explicit
  • Reserved characters in StreamId/StreamPrefix enable unambiguous pattern matching
  • POSIX glob over regex: simpler, sufficient, safer (no catastrophic backtracking)

Acceptance Criteria

  • StreamPattern type created with wildcard support
  • Single-character wildcard (?) works correctly
  • Character class ([0-9]) works correctly
  • StreamPattern distinct from StreamPrefix (glob chars forbidden in prefix)
  • Subscription filtering with patterns works for InMemoryEventStore
  • Subscription filtering with patterns works for PostgresEventStore

Migrated from beads issue: eventcore-ihm

## Overview Implements POSIX glob pattern matching for SubscriptionQuery per ADR-017 and ARCHITECTURE.md v1.6. Enables filtering subscriptions using wildcard patterns like `account-*` or `order-[0-9]*`. ## Core Components - `StreamPattern` type that permits glob metacharacters (*, ?, [, ]) - `SubscriptionQuery::filter_stream_pattern(StreamPattern)` method - POSIX glob matching via `glob` crate (or similar) ## Design Decisions (from ARCHITECTURE.md) - **Distinct type**: StreamPattern vs StreamPrefix (literals) - type system makes intent explicit - **Reserved characters** in StreamId/StreamPrefix enable unambiguous pattern matching - **POSIX glob over regex**: simpler, sufficient, safer (no catastrophic backtracking) ## Acceptance Criteria - [ ] StreamPattern type created with wildcard support - [ ] Single-character wildcard (?) works correctly - [ ] Character class ([0-9]) works correctly - [ ] StreamPattern distinct from StreamPrefix (glob chars forbidden in prefix) - [ ] Subscription filtering with patterns works for InMemoryEventStore - [ ] Subscription filtering with patterns works for PostgresEventStore --- *Migrated from beads issue: eventcore-ihm*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jwilger/eventcore#246
No description provided.