6.0 KiB
6.0 KiB
Tasks — audio-shipped-file-size-cleanup
Every checkbox MUST reflect work actually done in this change. No behavior change is permitted.
0. Pre-flight (non-negotiable)
- 0.1 Confirm clean working tree (
git statusreports nothing) and no in-flight worktrees with uncommitted work (git worktree listthengit statusin each) - 0.2 If any worktrees exist under
.claude/worktrees/, account for each one: still-active agent, work-pending-merge, or stale-and-prune. Stale worktrees MUST be removed (git worktree remove) before opening a new one — code that has been lost twice on main is the failure mode this guards against. - 0.3 Confirm the package set in
MANIFEST.mdmatchesfind packages -maxdepth 3 -name package.jsoncount. Drift here means a prior change archived without regenerating the manifest.
1. Pre-flight
- 1.1 Capture baseline:
bunx turbo lint typecheck test:coverage build --filter=@suaveplan/audio-timeline --filter=@suaveplan/audio-transport --filter=@suaveplan/audio-metadata— record green output. - 1.2 Snapshot
dist/**/*.d.tsfor the three packages to a temp dir for post-split comparison. - 1.3 Capture each package's
package.jsonexportsmap for post-split comparison.
2. @suaveplan/audio-timeline — engine.ts split
- 2.1 Extract
src/engine/engine-tracks.ts+.md+.test.tsfromengine.ts(track CRUD helpers). - 2.2 Extract
src/engine/engine-clips.ts+.md+.test.ts(clip CRUD helpers). - 2.3 Extract
src/engine/engine-mixer.ts+.md+.test.ts(mixer mutation helpers). - 2.4 Extract
src/engine/engine-transport.ts+.md+.test.ts(transport helpers). - 2.5 Shrink
engine.tsto delegating shell (≤300 lines); keep public class export atsrc/engine/index.tsunchanged. - 2.6 Shrink
engine.test.tsto construction / adapter wiring / snapshot / undo-redo / event cases only (≤500 lines). - 2.7 Verify:
bunx turbo lint typecheck test:coverage build --filter=@suaveplan/audio-timelinegreen; test count ≥ pre-split count. - 2.8 Diff
dist/**/*.d.tsvs baseline — only path / source-map changes, no type-shape changes.
3. @suaveplan/audio-transport — transport.ts split
- 3.1 Extract
src/transport/transport-schedule.ts+.md(schedule/cancel/lookahead helpers). - 3.2 Extract
src/transport/transport-tempo.ts+.md(BPM + tempo automation helpers). - 3.3 Shrink
transport.tsto delegating shell (≤300 lines). - 3.4 Verify:
bunx turbo lint typecheck test:coverage build --filter=@suaveplan/audio-transportgreen; test count unchanged. - 3.5 Diff
dist/**/*.d.tsvs baseline — no type-shape changes.
4. @suaveplan/audio-metadata — id3v2.ts split (largest)
- 4.1 Extract
src/parsers/id3v2/id3v2-header.ts+.md+.test.ts(header / extended header parsing). - 4.2 Extract
src/parsers/id3v2/id3v2-text-encoding.ts+.md+.test.ts(ISO-8859-1 / UTF-16 / UTF-16BE / UTF-8 decoders). - 4.3 Extract
src/parsers/id3v2/id3v2-unsync.ts+.md+.test.ts(unsynchronisation reversal). - 4.4 Extract
src/parsers/id3v2/id3v2-frames-text.ts+.md+.test.ts(T... / TXXX text frame decoders). - 4.5 Extract
src/parsers/id3v2/id3v2-frames-binary.ts+.md+.test.ts(APIC / UFID / GEOB binary frame decoders). - 4.6 Extract
src/parsers/id3v2/id3v2-frames-url.ts+.md+.test.ts(W... URL frame decoders). - 4.7 Shrink
id3v2.tsto publicparseId3v2()+ frame-dispatch only (≤300 lines). - 4.8 Shrink
id3v2.test.tsto end-to-end fixture parses only (≤500 lines). - 4.9 Verify: per-file split tests cover the same code paths; aggregate test count ≥ pre-split (1340-line file's tests redistributed, none deleted).
5. @suaveplan/audio-metadata — mp4-atom.ts + tests split
- 5.1 Extract
src/parsers/mp4-atom/mp4-atom-itunes.ts+.md+.test.ts(iTunes/ilst decoders). - 5.2 Shrink
mp4-atom.tsto publicparseMp4Atom()+ container walker (≤300 lines). - 5.3 Shrink
mp4-atom.test.tsto container + non-iTunes tests (≤500 lines).
6. @suaveplan/audio-metadata — ogg-vorbis.test.ts split
- 6.1 Extract
src/parsers/ogg-vorbis/ogg-vorbis-frames.test.ts(frame-level tests). - 6.2 Shrink
ogg-vorbis.test.tsto page parsing + comment header tests (≤500 lines).
7. Per-package verification (post-split)
- 7.1
bunx turbo lint typecheck test:coverage build --filter=@suaveplan/audio-timeline— 100/100/100/100. - 7.2
bunx turbo lint typecheck test:coverage build --filter=@suaveplan/audio-transport— 100/100/100/100. - 7.3
bunx turbo lint typecheck test:coverage build --filter=@suaveplan/audio-metadata— 100/100/100/100. - 7.4 File-size sweep:
find packages/audio/audio-timeline/src packages/audio/audio-transport/src packages/audio/audio-metadata/src -name "*.ts" ! -name "*.test.ts" | xargs awk 'END { if (NR > 300) print FILENAME, NR " lines" }'— empty. - 7.5 Test-size sweep: same
find ... -name "*.test.ts" ...with cap 500 — empty. - 7.6 Diff
package.jsonexportsmaps vs baseline — identical for all three packages. - 7.7 Diff
dist/**/*.d.tsvs baseline — only path/source-map changes.
8. Per-package docs refresh
- 8.1 Update
MANIFEST.mdviabun scripts/folder-reorg/generate-manifest.ts(new sub-modules surfaced). - 8.2 No
STATUS.mdchange — packages remain✅Completed. - 8.3
bunx markdownlint-cli2 --fixover touched files; re-stage; verify exit 0 without--fix.
9. Archive
- 9.1 Fold
specs/audio-timeline/spec.md,specs/audio-transport/spec.md, andspecs/audio-metadata/spec.mdinto the canonicalopenspec/specs/<capability>/spec.mdfiles. - 9.2 Move
openspec/changes/audio-shipped-file-size-cleanup/→openspec/archive/YYYY-MM-DD-audio-shipped-file-size-cleanup/.
10. Follow-up (separate change)
- 10.1 Open a
tooling-add-file-size-ci-gatechange that addsscripts/lint/check-file-sizes.ts(run frombunx turbo lint) so the 300/500 caps are enforced automatically. Out of scope here.