2.6 KiB
2.6 KiB
Capability Spec Delta: timing (spec-conformance)
Package: @suaveplan/timing
Status: PROPOSED
This delta annotates each existing requirement in openspec/specs/timing/spec.md with a **Verified by:** line, and records the inline drift fixes that wire scheduler queue-depth, stopwatch elapsed, and timer tick OTel emission so TM-11's "MUST emit" clause is satisfied at the module flow level (not just via standalone helpers). No requirement semantics change.
MODIFIED Requirements
(See openspec/specs/timing/spec.md for the full requirement bodies; this delta only records the verification mapping.)
| Requirement | Verified by |
|---|---|
| TM-01 — Injectable clock | src/stopwatch/stopwatch.test.ts AND src/throttle/throttle.test.ts AND src/timer/timer.test.ts AND src/timing.spec-conformance.test.ts AND tests/no-disallowed.test.ts |
| TM-02 — AbortSignal support | src/scheduler/scheduler.test.ts AND src/timing.spec-conformance.test.ts |
| TM-03 — Stopwatch | src/stopwatch/stopwatch.test.ts AND src/timing.spec-conformance.test.ts |
| TM-04 — Throttle / debounce | src/throttle/throttle.test.ts AND src/throttle/debounce.test.ts AND src/timing.spec-conformance.test.ts |
| TM-05 — Decay | src/decay/decay.test.ts |
| TM-06 — Scheduler | src/scheduler/scheduler.test.ts AND src/timing.spec-conformance.test.ts |
| TM-07 — Timer and countdown | src/timer/timer.test.ts AND src/timing.spec-conformance.test.ts |
| TM-08 — Vector clock | src/vector-clock/vector-clock.test.ts AND src/timing.spec-conformance.test.ts |
| TM-09 — Structured errors | src/errors/timing-error.test.ts |
| TM-10 — Zod schemas | src/*/*.schemas.ts AND tests/dep-graph.test.ts |
| TM-11 — OTel instrumentation | src/otel/timing-otel.test.ts AND src/timing.spec-conformance.test.ts |
| TM-12 — sideEffects: false + coverage 100% | tests/tree-shake.test.ts AND tests/no-disallowed.test.ts AND coverage gate |
Newly added tests in this change
src/timing.spec-conformance.test.ts— pins throttle window-count edge, debounce flush/cancel/maxWait, vector-clock relation matrix and JSON round-trip, scheduler drain order + pre-abort, countdown pause/resume invariant with injected clock, stopwatch monotonicity across laps, and OTel no-op smoke for the newrecordSchedulerQueueDepthgauge.
Inline drift fixes folded into this change
- TM-11: stopwatch
.stop(), scheduler enqueue/dequeue/dispose, and timer ticks now emit via@opentelemetry/api. NewrecordSchedulerQueueDepthhelper added (lazyObservableGauge, mutable observed value, no-op without exporter).