Files
2026-05-27 23:29:53 +01:00

2.9 KiB

Capability Spec Delta: audio-timeline (audio-shipped-file-size-cleanup)

Package: @suaveplan/audio-timeline Status: PROPOSED

Every requirement below carries a **Verified by:** line at authoring time. No exceptions.

MODIFIED Requirements

Requirement: TimelineEngine source modules respect the 300-line cap

The TimelineEngine implementation MUST be split across source modules such that no single .ts file under src/engine/ exceeds the 300-line hard cap defined in CLAUDE.md Rule §3 / openspec/AGENTS.md §3. The public class export from @suaveplan/audio-timeline SHALL remain TimelineEngine with its existing constructor signature, public methods, and observable behavior (track CRUD, clip CRUD, mixer mutations, transport controls, snapshot/restore, undo/redo, event emission). Internal helper modules MAY be added under src/engine/ but SHALL NOT appear in the package.json exports map; they are implementation detail.

Scenario: every engine source file is at or under the 300-line cap

  • WHEN find packages/audio/audio-timeline/src/engine -name "*.ts" ! -name "*.test.ts" | xargs awk 'END { if (NR > 300) print FILENAME, NR }' is run
  • THEN the output is empty

Scenario: public TimelineEngine surface is unchanged

  • WHEN a consumer imports TimelineEngine from @suaveplan/audio-timeline and exercises every public method documented in src/engine/engine.md
  • THEN every method exists with its existing signature and returns the existing shape

Verified by: tests/exports.test.ts::"TimelineEngine surface is byte-identical to pre-split" AND tests/file-size.test.ts::"every engine src file is under 300 lines"


Requirement: TimelineEngine test modules respect the 500-line cap

The TimelineEngine test suite MUST be split such that no single *.test.ts file under src/engine/ exceeds the 500-line hard cap. The aggregate test count across all split files SHALL be greater than or equal to the pre-split count — no test SHALL be deleted or weakened as part of the split. Test names SHALL describe behavior, not implementation (per openspec/AGENTS.md §7 "Test structure").

Scenario: every engine test file is at or under the 500-line cap

  • WHEN find packages/audio/audio-timeline/src/engine packages/audio/audio-timeline/tests -name "*.test.ts" | xargs awk 'END { if (NR > 500) print FILENAME, NR }' is run
  • THEN the output is empty

Scenario: aggregate test count is preserved

  • WHEN bunx turbo test --filter=@suaveplan/audio-timeline is run after the split
  • THEN the reported total test count is greater than or equal to the pre-split count captured in task 1.1

Verified by: tests/file-size.test.ts::"every engine test file is under 500 lines" AND tests/exports.test.ts::"aggregate engine test count is greater than or equal to pre-split"