Skip to content

Refactor SDK workflows to Effect v4 and consolidate shared utilities - #24

Draft
tamashi095 wants to merge 1 commit into
mainfrom
refactor/sdk-effect-efficiency
Draft

Refactor SDK workflows to Effect v4 and consolidate shared utilities#24
tamashi095 wants to merge 1 commit into
mainfrom
refactor/sdk-effect-efficiency

Conversation

@tamashi095

Copy link
Copy Markdown
Contributor

SDK workflows mixed Promise orchestration, duplicated decoding/paging logic, and loosely typed mapper boundaries. This change adds composable Effect v4 rc.112 APIs across all four SDKs while retaining Promise entry points and synchronous transaction builders.

The audit and detailed findings are tracked in #23. Work used the requested Astra medium audit, Astra low implementation agent per SDK, and a second medium regression review.

  • Add @misofm/utils for exact integers, Mysten-backed canonical codecs, typed failures, and reusable Promise adapters.
  • Compose query hydration, auth, publication, player startup, and transcoding stages in Effect. Preserve batching, optional-data policies, submission checkpoints, cancellation, and filesystem ownership.
  • Reuse protocol work reads/parsers in platform, remove handwritten any, consolidate pagination/module binding/filesystem helpers, and add predictable aliases and agent guidance.
  • Align streaming dependencies, fix stripped declaration dependencies, and add isolated consumer validation plus utility publishing support.

Validation: 328 unit tests pass; frozen install, all package/root typechecks, ordered builds, and five packed packages / 43 Node+TypeScript 5.9 entry points pass. Generated contracts are unchanged. The pinned FFmpeg/browser integration is unavailable locally: missing FFmpeg produces ToolNotFoundError, then the finalization-phase wait test times out; the existing pinned-image CI workflow remains required.

Compatibility details are in docs/effect-migration.md: exact Effect peer/TS 5.9+, canonical blob-ID strictness, bounded concurrency and validated batch limits, and player lifecycle behavior. New utilities must be published before dependents; this PR performs no npm release.

Code-size tradeoff: platform is 88 lines smaller and transcoding 46 smaller, but new APIs and utilities leave total handwritten source at 22,531 versus 22,330 (+0.9%). Duplication is reduced; the net line-count reduction objective is not achieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant