Skip to content

Glob Pattern Matching for Subscriptions #246

@jwilger

Description

@jwilger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions