Skip to content

[Foundation] Effect-TS: Error layer, Schema layer, shared utilities #90

@Soushi888

Description

@Soushi888

Summary

Foundation layer for the Effect-TS 7-layer architecture (Epic #7). Implements Layer 4 (Error) and Layer 3 (Schema) — the only layers with no DHT dependencies — plus the shared utilities ported from Requests & Offers that all subsequent domain layers depend on.

Implemented by PR #89.

Scope

Layer 4 — Error

  • errors/person.errors.tsPersonError extends Data.TaggedError
  • errors/resource.errors.tsResourceError extends Data.TaggedError
  • errors/governance.errors.tsGovernanceError + WorkflowError extends Data.TaggedError (carries step, rejected_reasons)
  • errors/ppr.errors.tsPPRError extends Data.TaggedError
  • errors/error-contexts.tsPERSON_CONTEXTS, RESOURCE_CONTEXTS, GOVERNANCE_CONTEXTS, PPR_CONTEXTS, WORKFLOW_CONTEXTS

Layer 3 — Schema

  • schemas/person.schemas.tsPersonInput, UIPerson, EncryptedProfileInput
  • schemas/resource.schemas.tsResourceSpecInput, UIResourceSpec, EconomicResourceInput, UIEconomicResource
  • schemas/governance.schemas.tsVfActionSchema (all 16 Rust variants exactly), CommitmentInput, UICommitment, GovernanceTransitionResult
  • schemas/ppr.schemas.tsPerformanceMetrics, UIParticipationClaim, UIReputationSummary

Shared utilities (ported verbatim from Requests & Offers)

  • utils/zome-helpers.tswrapZomeCallWithErrorFactory
  • utils/effect-svelte-integration.tsuseEffectOnMount, createStoreInitializer, createEffectErrorBoundary
  • utils/store-helpers/core.tswithLoadingState, createErrorHandler
  • utils/store-helpers/cache-helpers.tscreateGenericCacheSyncHelper
  • utils/store-helpers/record-helpers.tscreateUIEntityFromRecord
  • utils/store-helpers/event-helpers.tscreateStandardEventEmitters
  • utils/store-helpers/fetching-helpers.tscreateEntityFetcher

Acceptance Criteria

  • All error types implement Data.TaggedError with fromError(unknown, context) static factory
  • VfActionSchema covers all 16 Rust VfAction variants — verified against zome source
  • All schema classes pass bun run check
  • Shared utilities are verbatim copies of R&O equivalents (no logic changes)
  • bun run build passes

Part of

Epic #7

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendFrontend development - UI, SvelteKit, Effect-TS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions