Problem
Journal.append(pid, events, expectedSeq, tags?) takes one tag list for the whole batch (src/persistence/Journal.ts:17-22), and PersistentActor.persistAll reads this.tagsFor(events[0]!) — the comment says "Collect tags from the first event" (src/persistence/PersistentActor.ts:271).
Persisting [OrderPlaced, PaymentCaptured] atomically stamps both events with OrderPlaced's tags, so eventsByTag('payment') never sees the second event. Every backend faithfully replicates this (RelationalJournal.ts:117 joins one tagString; CassandraJournal.ts:143 one tagList; MongoJournal.ts:122; DynamoDbJournal.ts:132). Tagged queries silently miss events for anyone who tags per event type and persists atomically — the natural event-sourcing shape.
Proposed behaviour
BREAKING (pre-1.0 hard cut): widen the contract to per-event tags — an { event, tags }[] shape or ReadonlyArray<ReadonlyArray<string>> — and have persistAll call tagsFor per event. Migrate all ten journal backends in the same change.
Acceptance criteria
- New persistence-contract scenario: "per-event tags round-trip in a multi-event append", passing on all ten journal harnesses.
- CHANGELOG entry flagged BREAKING with a one-line migration note.
Related: #532 (query-side backend parity), #493 (contract polish)
Problem
Journal.append(pid, events, expectedSeq, tags?)takes one tag list for the whole batch (src/persistence/Journal.ts:17-22), andPersistentActor.persistAllreadsthis.tagsFor(events[0]!)— the comment says "Collect tags from the first event" (src/persistence/PersistentActor.ts:271).Persisting
[OrderPlaced, PaymentCaptured]atomically stamps both events withOrderPlaced's tags, soeventsByTag('payment')never sees the second event. Every backend faithfully replicates this (RelationalJournal.ts:117joins onetagString;CassandraJournal.ts:143onetagList;MongoJournal.ts:122;DynamoDbJournal.ts:132). Tagged queries silently miss events for anyone who tags per event type and persists atomically — the natural event-sourcing shape.Proposed behaviour
BREAKING (pre-1.0 hard cut): widen the contract to per-event tags — an
{ event, tags }[]shape orReadonlyArray<ReadonlyArray<string>>— and havepersistAllcalltagsForper event. Migrate all ten journal backends in the same change.Acceptance criteria
Related: #532 (query-side backend parity), #493 (contract polish)