19 tasks covering core testing, Redis hardening, WebSocket client/server adapters, Worker adapter, and final review gates. Iroh adapters are tracked as a deferred placeholder blocked on the @alkdev/iroh fork. Phases: core validation → Redis hardening → review gate → WebSocket adapters → review gate → Worker adapter → review gate → final validation.
2.0 KiB
2.0 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level |
|---|---|---|---|---|---|---|---|
| core-pubsub-tests | Write tests for createPubSub, EventEnvelope, and in-process event target | pending | moderate | low | component | implementation |
Description
The core createPubSub factory, EventEnvelope type, and the in-process (default EventTarget) path have no tests. These are the foundation of the entire package — every adapter builds on createPubSub. Write comprehensive tests that verify the core contract.
The architecture specifies these behaviors:
createPubSub()with no config usesnew EventTarget()(in-process)createPubSub({ eventTarget })uses a custom event targetpublish(type, id, payload)dispatches aCustomEventwith type"type:id"anddetailasEventEnvelopesubscribe(type, id)returns aRepeater<EventEnvelope>(async iterable)publishthrows on event types starting with__(reserved for adapter control)- Topic scoping uses the
type:idconvention subscribecleanup: breaking out of thefor awaitloop removes the listener
Acceptance Criteria
test/create_pubsub.test.tsexists and passes- Test:
publishdispatches event with correcttype:idtopic - Test:
publishthrows on__-prefixed event types - Test:
subscribereturns async iterable that yieldsEventEnvelopeobjects - Test:
subscribeenvelope has correcttype,id,payloadfields - Test: subscriber receives events only for the subscribed topic (type:id matching)
- Test: multiple subscribers on the same topic all receive events
- Test: subscriber cleanup — breaking out of
for awaitloop removes the listener - Test:
createPubSubwith customeventTargetdispatches to that target - Test:
createPubSubwithouteventTargetusesnew EventTarget()(in-process)
References
- docs/architecture/api-surface.md
- src/create_pubsub.ts
- src/types.ts
Notes
To be filled by implementation agent
Summary
To be filled on completion