Effect v4 across the SDKs: @misofm/effect foundation, typed errors, Effect in public signatures - #28
Merged
Merged
Conversation
… the SDKs One SuiClient/SuiGraphQL service tag and one error vocabulary (Schema.TaggedError: ObjectNotFoundError, ObjectTypeMismatchError, SuiRpcError, BcsDecodeError, TransactionFailedError, GraphQLUnavailableError, DeploymentError), the shared object-read and dynamic-field primitives (getObjectContent, getOptionalObjectContent, getObjectsContent, listDynamicFields as a Stream, decodeBcs through Schema, assertObjectType), and the execute helpers (buildTx, signAndExecute, execThunks) with the pure effect extractors. Every SDK migrates onto this package next so consumers provide exactly one layer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGmuA3eMr4iaRTdz3J8JZJ
… API Every read that performs I/O now returns an Effect that requires the shared SuiClient service from @misofm/effect and fails with the tagged error vocabulary (ObjectNotFoundError, ObjectTypeMismatchError, SuiRpcError, BcsDecodeError); the client extensions keep their names and provide the service internally so their methods have no requirements. Domain types are Schema classes decoded from the generated BCS output, so no generated shape crosses the public boundary. PTB builders stay synchronous. - musicos 0.3.0: queries, view, and the miso() client; execute re-exports the foundation; optional extension reads return Option. - partyos 0.3.0: queries built on the foundation reads and the dynamic-field Stream; Party is a Schema class. - streaming 0.3.0: warmTrack is an Effect with interruption-driven abort and the same per-item tolerance; acquirePlayer is a Scope-managed player; play() stays a synchronous gesture-safe call. - transcoding 0.4.0: ./errors subpath and error-handling docs; already Effect-based. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGmuA3eMr4iaRTdz3J8JZJ
…ventions platform 0.26.0 depends on @misofm/effect and the migrated musicos, partyos, and streaming packages. Every read that performs I/O returns an Effect requiring the shared SuiClient (and SuiGraphQL where needed) and fails with the tagged errors in ./errors, which now also carry the domain not-found cases the api read service had to hand-roll (ReleaseNotFoundError, ReceiptNotFoundError, RecordPurchaseNotFoundError). Domain values (Pressing, Listing, PressingRecord, RoyaltyPool, RoyaltyStake, RoutedStake, Profile, Media, Cta, PlatformLink, Genre) are Schema classes; Genre is the pilot value object derived through the new PlatformDeployment service. The client extensions keep their names and provide the services internally; PTB builders stay synchronous. The isolated-consumer fixture installs all six tarballs, imports every package's ./errors subpath, and asserts a single copy of effect. transcoding pins streaming 0.3.0 so a consumer gets one copy. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGmuA3eMr4iaRTdz3J8JZJ
- share.initializeShareCurrencies: a rejecting onBatch callback is that batch's typed failure (SuiRpcError) instead of a defect, so it no longer interrupts sibling batches whose transactions are already submitted. - musicos.getWorksByIds: an id requested under two work kinds fails with ConflictingWorkKindError instead of a thrown defect. - platform README: the protocol accessor is optional until ready(). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGmuA3eMr4iaRTdz3J8JZJ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGmuA3eMr4iaRTdz3J8JZJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #27 (base is
feat/split-musicos-platform); rebase ontomainonce that merges.What changes
@misofm/effect(0.1.0): oneSuiClient/SuiGraphQLContext.Service, one tagged-error vocabulary (Schema.TaggedError), the object-read primitives (getObjectContent,getOptionalObjectContent,getObjectsContent,listDynamicFieldsas aStream,decodeBcsthroughSchema,assertObjectType) and the execute helpers. Every SDK depends on it so a consumer provides exactly one layer.@misofm/musicos0.3.0,@misofm/partyos0.3.0,@misofm/platform0.26.0: every read that performs I/O returnsEffect<A, E, SuiClient>; client extensions keep their names and provide the service internally (R = never); PTB builders stay synchronous; domain types areSchema.Classand no generated BCS shape crosses the public boundary; optional reads returnOption.isNotFoundis gone in favour ofEffect.catchTag("ObjectNotFoundError", …), and platform adds the domain not-found errors the api read service hand-rolled.@misofm/streaming0.3.0:warmTrackis an Effect (interruption aborts in-flight fetches; per-item tolerance unchanged);acquirePlayeris aScope-managed player;play()stays a synchronous gesture-safe call.@misofm/transcoding0.4.0: already Effect; gains the./errorssubpath and pins streaming 0.3.0.effectis an exact peer (4.0.0-rc.112) everywhere; theeffect-v*publish tag arm is added; root README and CLAUDE.md document the conventions.Verification
bun run typecheck,bun run build,bun run codegen:check: clean across all six workspaces.bun test: 352 pass; the 2 failures are transcoding's FFmpeg-binary tests (no FFmpeg on the dev box; green in CI).bun run test:consumer: six tarballs install into the fixture; every./errorssubpath resolves; single instance ofeffectand each@misofm/*.Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01QGmuA3eMr4iaRTdz3J8JZJ
Deliberate choices surfaced by review
read/*projections keepnullfor absent values (they feed the HTTP read service); library-level optional reads elsewhere returnOption.bcs/callgetters and./contracts/*as the documented escape hatch; no read or query returns a generated type.