Files
suaveplan/openspec/archive/2026-05-25-enterprise-video/tasks.md
2026-05-27 23:29:53 +01:00

3.7 KiB

Tasks: enterprise-video

Change ID: enterprise-video Package: @suaveplan/video Layout: packages/media/video/video/

0. Pre-flight

  • Confirm @suaveplan/error + @suaveplan/events are shipped on genesis via workspace:^.
  • Add video to the media super-category in scripts/folder-reorg/assignment.yml __categories__: row.

1. Scaffold

  • Create packages/media/video/video/{src,tests/setup} with feature directories.
  • package.json at 0.1.0, type: module, sideEffects: false.
  • Subpath exports per feature: ./error-codes/error-codes, ./errors/errors, ./types/video-types, ./processor/processor, ./pipeline-builder/pipeline-builder, ./detection/detection, ./duration/duration, ./resize/resize, ./trim/trim, ./format/format, ./instruments/instruments.
  • tsconfig.lib.json mirroring @suaveplan/image.
  • vite.config.ts mirroring @suaveplan/image.
  • vitest.config.ts mirroring @suaveplan/image (forks pool, istanbul 100/100/100/100, polyfills setup).
  • tests/setup/polyfills.ts re-exporting @suaveplan/testing/polyfills.

2. Error codes + typed error

  • src/error-codes/error-codes.ts — defineCodes("VIDEO", […]) with 16 codes covering every upstream factory plus CONFIG_INVALID.
  • VIDEO_ERROR_METADATA — preserved HTTP/severity/retry table.
  • registerVideoErrorCodes() — callable alias returning the metadata table.
  • src/errors/errors.ts — VideoError extends SuaveplanError<VideoCode> with typed context + 15 upstream factories.
  • Co-located .md for both modules.

3. Types + schemas

  • src/types/video-types/video-types.ts — Zod schemas for every public type; inferred types; RESOLUTION_PRESETS; VIDEO_MIME_TYPES; VideoEventMap.
  • Discriminated union VideoTransformOpSchema (9 variants).

4. Pure helpers

  • src/detection/detection.ts — detectVideoFormat.
  • src/resize/resize.ts — calculateVideoResize.
  • src/trim/trim.ts — validateTrimRange.
  • src/duration/duration.ts — formatDuration + parseDuration.
  • src/format/format.ts — videoFormatToExtension.
  • Co-located .md per module.

5. Processor + builder

  • src/instruments/instruments.ts — meter, 2 counters + 2 histograms, tracer.
  • src/processor/processor.ts — VideoProcessor composing EventBus<VideoEventMap>; extractMetadata + planTransform + createPipeline + on/once/off; AbortSignal + OTel + Zod config validation.
  • src/pipeline-builder/pipeline-builder.ts — VideoPipelineBuilder fluent surface; build() emits pipeline.built when wired.

6. Tests

  • Per-feature .test.ts files; all import from @suaveplan/testing/runner; every it(...) carries { timeout: 5000 }.
  • processor.spec-conformance.test.ts validates OTel + AbortSignal + event-emission contracts end-to-end.

7. Barrel + README

  • src/index.ts with explicit named re-exports only.
  • Package README.md with Modules index.

8. Pre-publish gate

  • bunx turbo lint typecheck test build --filter=@suaveplan/video green.
  • bunx turbo test:coverage --filter=@suaveplan/video at 100/100/100/100.
  • Banned-pattern scan clean.
  • Subpath-export count matches feature-module count.

9. Fold + archive

  • Fold specs/video/spec.md into openspec/specs/video/spec.md.
  • Move openspec/changes/enterprise-video/ to openspec/archive/2026-05-25-enterprise-video/.

10. STATUS + MANIFEST refresh

  • Flip @suaveplan/video from - to migrated in STATUS.md.
  • Update migrated/pending counter.
  • Run bun scripts/folder-reorg/generate-manifest.ts.