Skip to content

Feat/composition set operations#29

Merged
surafelfikru merged 73 commits into
Qoba-ai:mainfrom
surafelfikru:feat/composition-set-operations
Mar 12, 2026
Merged

Feat/composition set operations#29
surafelfikru merged 73 commits into
Qoba-ai:mainfrom
surafelfikru:feat/composition-set-operations

Conversation

@DagmawiKK

Copy link
Copy Markdown
Contributor

This PR introduces two new set operations (composition and union) to the Mork API along with comprehensive frontend implementations, status polling, and enhanced utilities.

Key Changes:

Backend (Rust API):

  1. New Routes:

    • /spaces/composition - Performs composition of multiple source namespaces into a target namespace
    • /spaces/union - Performs union operations across multiple namespaces
  2. Status Endpoint:

    • Added /status/<namespace> endpoint for checking namespace status
    • Supports polling to wait for operations to complete
  3. Enhanced Transform Logic:

    • Composition creates transforms with pattern variables ($0, $1, etc.)
    • Union creates multiple independent transforms with sequential execution
    • Added polling mechanism with 40-second timeout
  4. Testing:

    • Added comprehensive unit tests for composition and union transforms
    • Integration tests with mock server for composition endpoints

Frontend (SolidJS):

  1. New Pages:

    • Composition Page: Builder UI for creating composition operations
    • Union Page: Builder UI for union operations
  2. Enhanced Components:

    • Reusable CompositionInput and UnionInput components for namespace selection
    • Real-time S-expression preview with copy functionality
    • Polling status indicators and progress feedback
  3. API Integration:

    • Added composition() and union() API functions
    • Enhanced importSpace() with proper path handling
    • Added status polling utilities
  4. Utility Functions:

    • Added pathToSExpr() for converting path arrays to S-expressions
    • Enhanced existing utilities with better error handling

Features:

  • Real-time Polling: Operations automatically poll for completion status
  • Permission Validation: Checks token permissions for source and target namespaces
  • Responsive UI: Clean, modern interface with card-based layouts
  • Error Handling: Comprehensive error states and user feedback
  • Copy Functionality: One-click copying of generated S-expressions

Technical Details:

  • Composition: Combines multiple source namespaces into a single target using pattern variables
  • Union: Creates independent transforms for each source namespace into a common target
  • Status Polling: Uses timeout-based polling with 1-second intervals
  • Token Integration: Leverages existing token-based authentication system

Testing:

  • Unit tests for transform generation logic
  • Integration tests with mock HTTP server
  • Path normalization and S-expression generation tests

Related Issue

Closes #38

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have read the Contributing Guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

DagmawiKK and others added 30 commits November 10, 2025 15:49
DagmawiKK and others added 27 commits November 18, 2025 11:43
- added a union function
- added a function to convert ns to pathes
- added test to function responsible for parsing
@vercel

vercel Bot commented Feb 13, 2026

Copy link
Copy Markdown

@surafelfikru is attempting to deploy a commit to the timverhaegen's projects Team on Vercel.

A member of the Team first needs to authorize it.

@surafelfikru surafelfikru merged commit e930bfe into Qoba-ai:main Mar 12, 2026
1 check failed
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.

3 participants