3.2 KiB
3.2 KiB
audio-timeline Spec Checklist
Requirements
- Universal purity
- Scenario: Built dist references no platform globals
- Scenario: Tests pass under both runtimes
- TimelineEngine construction and state snapshot
- Scenario: getState returns an immutable snapshot
- Scenario: tracksVersion increments on track mutation
- Track model and CRUD operations
- Scenario: addTrack then removeTrack round-trips the track array
- Scenario: Unknown track id throws AUDIO_TIMELINE_TRACK_NOT_FOUND
- Clip model and clip lifecycle
- Scenario: addClip places a clip on the named track
- Scenario: Unknown clip id throws AUDIO_TIMELINE_CLIP_NOT_FOUND
- Clip drag with overlap constraint
- Scenario: Drag is clamped to avoid sibling overlap
- Scenario: Zero constrained delta is a no-op
- Clip trim with minimum-duration guard
- Scenario: Right trim shortens duration within the floor
- Scenario: Over-trim throws AUDIO_TIMELINE_INVALID_TRIM
- Clip split at a sample boundary
- Scenario: Split produces two contiguous clips
- Scenario: Split outside the clip throws AUDIO_TIMELINE_INVALID_SPLIT
- Per-track mixer state
- Scenario: Volume is clamped and forwarded to the adapter
- Scenario: Solo mutes non-soloed tracks
- Zoom levels and selection
- Scenario: zoomOut at the coarsest level is a no-op
- Scenario: setSelection normalises a reversed range
- Loop region and transport playback
- Scenario: Playback follows the FSM transitions
- Scenario: Invalid transport transition is rejected by the FSM
- Tempo and musical time
- Scenario: setTempo updates state and forwards to the adapter
- TimelineAdapter interface — plugin slot 5
- Scenario: NullTimelineAdapter satisfies the full interface
- Scenario: Transport without an adapter throws AUDIO_TIMELINE_ADAPTER_NOT_SET
- Undo/redo via @suaveplan/undo
- Scenario: Mutation then undo restores prior state
- Scenario: redo reapplies the undone command
- Transaction batching of undo commands
- Scenario: Committed transaction undoes as one step
- Scenario: commitTransaction without an active transaction throws
- Incremental adapter updates on undo/redo
- Scenario: Same-count undo issues per-track updates
- Scenario: Count-changing undo issues a full setTracks
- Typed timeline event surface
- Scenario: clipChange fires once per clip mutation
- Session save/load via @suaveplan/serialize
- Scenario: Session round-trips through serialize
- Zod boundary validation
- Scenario: Invalid clip is rejected at the boundary
- Structured error codes
- Scenario: Every registered code is thrown by a call site
- OpenTelemetry instrumentation
- Scenario: Instrumentation is inert without an exporter
- AbortSignal propagation
- Scenario: Pre-aborted signal short-circuits init
- Subpath exports per feature module
- Scenario: Each feature module is independently importable