Initial Commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<!-- markdownlint-disable MD024 -->
|
||||
|
||||
# Capability Spec Delta: audio-metadata (audio-shipped-file-size-cleanup)
|
||||
|
||||
**Package**: `@suaveplan/audio-metadata`
|
||||
**Status**: PROPOSED
|
||||
|
||||
> Every requirement below carries a `**Verified by:**` line at authoring time. No exceptions.
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: id3v2 parser source modules respect the 300-line cap
|
||||
|
||||
The ID3v2 parser implementation MUST be split such that no single `.ts` file under `src/parsers/id3v2/` exceeds the 300-line hard cap. The public function export `parseId3v2` SHALL remain available from `@suaveplan/audio-metadata` with its existing signature and observable behavior across every supported frame type (T... text frames, TXXX user-defined text, W... URL frames, APIC attached picture, UFID file identifier, COMM comments, USLT lyrics, GEOB general encapsulated object) and every supported text encoding (ISO-8859-1, UTF-16, UTF-16BE, UTF-8) with unsynchronisation reversal applied where the header flag is set.
|
||||
|
||||
#### Scenario: every id3v2 source file is at or under the 300-line cap
|
||||
|
||||
- **WHEN** `find packages/audio/audio-metadata/src/parsers/id3v2 -name "*.ts" ! -name "*.test.ts" | xargs awk 'END { if (NR > 300) print FILENAME, NR }'` is run
|
||||
- **THEN** the output is empty
|
||||
|
||||
#### Scenario: id3v2 fixture parses are unchanged
|
||||
|
||||
- **WHEN** `parseId3v2` is invoked on the existing fixture set used by `id3v2.test.ts`
|
||||
- **THEN** every parse result is deep-equal to the pre-split result
|
||||
|
||||
**Verified by:** `src/parsers/id3v2/id3v2.test.ts::"every supported v2.4 fixture parses to the documented shape"` AND `tests/file-size.test.ts::"every id3v2 src file is under 300 lines"`
|
||||
|
||||
---
|
||||
|
||||
### Requirement: id3v2 test modules respect the 500-line cap
|
||||
|
||||
The ID3v2 test suite MUST be split such that no single `*.test.ts` file under `src/parsers/id3v2/` exceeds the 500-line hard cap. The aggregate test count across the split files SHALL be greater than or equal to the pre-split count. The residual `id3v2.test.ts` SHALL hold end-to-end fixture-parse cases; per-frame-family and per-encoding cases SHALL move to sibling files named after the family they cover.
|
||||
|
||||
#### Scenario: every id3v2 test file is at or under the 500-line cap
|
||||
|
||||
- **WHEN** `find packages/audio/audio-metadata/src/parsers/id3v2 -name "*.test.ts" | xargs awk 'END { if (NR > 500) print FILENAME, NR }'` is run
|
||||
- **THEN** the output is empty
|
||||
|
||||
**Verified by:** `tests/file-size.test.ts::"every id3v2 test file is under 500 lines"` AND `tests/exports.test.ts::"aggregate id3v2 test count is greater than or equal to pre-split"`
|
||||
|
||||
---
|
||||
|
||||
### Requirement: mp4-atom parser modules respect the size caps
|
||||
|
||||
The MP4 atom parser implementation MUST be split such that no `.ts` source file under `src/parsers/mp4-atom/` exceeds the 300-line cap and no `.test.ts` file exceeds the 500-line cap. The public function export `parseMp4Atom` SHALL remain available from `@suaveplan/audio-metadata` with its existing signature and observable behavior across container atoms (`ftyp`, `moov`, `mvhd`, `mdat`, `ilst`) and iTunes metadata sub-atoms.
|
||||
|
||||
#### Scenario: every mp4-atom source file is at or under the 300-line cap
|
||||
|
||||
- **WHEN** `find packages/audio/audio-metadata/src/parsers/mp4-atom -name "*.ts" ! -name "*.test.ts" | xargs awk 'END { if (NR > 300) print FILENAME, NR }'` is run
|
||||
- **THEN** the output is empty
|
||||
|
||||
#### Scenario: every mp4-atom test file is at or under the 500-line cap
|
||||
|
||||
- **WHEN** `find packages/audio/audio-metadata/src/parsers/mp4-atom -name "*.test.ts" | xargs awk 'END { if (NR > 500) print FILENAME, NR }'` is run
|
||||
- **THEN** the output is empty
|
||||
|
||||
**Verified by:** `tests/file-size.test.ts::"every mp4-atom src file is under 300 lines"` AND `tests/file-size.test.ts::"every mp4-atom test file is under 500 lines"`
|
||||
|
||||
---
|
||||
|
||||
### Requirement: ogg-vorbis test modules respect the 500-line cap
|
||||
|
||||
The Ogg-Vorbis test suite MUST be split such that no `*.test.ts` file under `src/parsers/ogg-vorbis/` exceeds the 500-line hard cap. The aggregate test count across the split files SHALL be greater than or equal to the pre-split count. The source file is already within cap and is unchanged.
|
||||
|
||||
#### Scenario: every ogg-vorbis test file is at or under the 500-line cap
|
||||
|
||||
- **WHEN** `find packages/audio/audio-metadata/src/parsers/ogg-vorbis -name "*.test.ts" | xargs awk 'END { if (NR > 500) print FILENAME, NR }'` is run
|
||||
- **THEN** the output is empty
|
||||
|
||||
**Verified by:** `tests/file-size.test.ts::"every ogg-vorbis test file is under 500 lines"`
|
||||
@@ -0,0 +1,44 @@
|
||||
<!-- markdownlint-disable MD024 -->
|
||||
|
||||
# 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"`
|
||||
@@ -0,0 +1,26 @@
|
||||
<!-- markdownlint-disable MD024 -->
|
||||
|
||||
# Capability Spec Delta: audio-transport (audio-shipped-file-size-cleanup)
|
||||
|
||||
**Package**: `@suaveplan/audio-transport`
|
||||
**Status**: PROPOSED
|
||||
|
||||
> Every requirement below carries a `**Verified by:**` line at authoring time. No exceptions.
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Transport source modules respect the 300-line cap
|
||||
|
||||
The `Transport` implementation MUST be split such that no single `.ts` file under `src/transport/` exceeds the 300-line hard cap. The public class export from `@suaveplan/audio-transport` SHALL remain `Transport` with its existing constructor signature, public methods, and observable behavior (clock injection, BPM + time-signature + PPQ state, tick advance, lookahead scheduling, schedule/cancel, loop region, swing, tempo automation). Internal helper modules MAY be added under `src/transport/` but SHALL NOT appear in the `package.json` `exports` map.
|
||||
|
||||
#### Scenario: every transport source file is at or under the 300-line cap
|
||||
|
||||
- **WHEN** `find packages/audio/audio-transport/src/transport -name "*.ts" ! -name "*.test.ts" | xargs awk 'END { if (NR > 300) print FILENAME, NR }'` is run
|
||||
- **THEN** the output is empty
|
||||
|
||||
#### Scenario: public Transport surface is unchanged
|
||||
|
||||
- **WHEN** a consumer imports `Transport` from `@suaveplan/audio-transport` and exercises every public method documented in `src/transport/transport.md`
|
||||
- **THEN** every method exists with its existing signature and returns the existing shape
|
||||
|
||||
**Verified by:** `tests/exports.test.ts::"Transport surface is byte-identical to pre-split"` AND `tests/file-size.test.ts::"every transport src file is under 300 lines"`
|
||||
Reference in New Issue
Block a user