Files
suaveplan/openspec/archive/2026-04-27-events-spec-tightening/tasks.md
2026-05-27 23:29:53 +01:00

1.5 KiB

Tasks: events-spec-tightening

1. Spec delta

  • 1.1 Author specs/events/spec.md delta with ## MODIFIED Requirements (Deterministic id and clock sources, Structured errors, Passive observability adapter) and ## ADDED Requirements (emitAsync timeout, emitAsync abort, Envelope traceId propagation).
  • 1.2 Add **Verified by:** line to every requirement (existing + new).

2. Conformance test

  • 2.1 Add packages/events/events/src/conformance.spec-conformance.test.ts pinning:
    • new EventBus({ clock, idGenerator }) accepts injections (replaces ghost createBus).
    • Async listener throw is captured into EmitResult.errors with EVENTS.LISTENER.THREW.
    • withObservability adapter onEmitError fires when dispatch rejects.
    • emitAsync with timeoutMs rejects with EVENTS.EMIT.TIMED_OUT past the deadline.
    • emitAsync with an aborted AbortSignal rejects with EVENTS.EMIT.ABORTED (cause === signal.reason).
    • traceId passed to emit / emitAsync surfaces on EventEnvelope.traceId.

3. Gate

  • 3.1 bunx turbo lint typecheck test --filter=@suaveplan/events green.
  • 3.2 bunx turbo test:coverage --filter=@suaveplan/events 100/100/100/100.
  • 3.3 bun scripts/openspec-conformance.ts @suaveplan/events exits 0.

4. Fold + archive

  • 4.1 Fold delta into openspec/specs/events/spec.md.
  • 4.2 Move openspec/changes/events-spec-tightening/ to openspec/archive/2026-04-27-events-spec-tightening/.