Table of Contents

v1.4.0 "Tōgō" - Integration & Unification

Release Date: TBD
Code Name: "Tōgō" (統合 - Integration/Unification)
Type: Minor Release


🎯 Overview

Version 1.4.0 represents a significant step toward unified architecture by integrating TaskManager infrastructure from JiroCloud services into Jiro.Shared. This release introduces enhanced command synchronization, improved gRPC integration, and comprehensive testing infrastructure while maintaining full backward compatibility.

The "Tōgō" release focuses on unifying distributed system components under a shared foundation, making it easier for Jiro ecosystem applications to manage asynchronous operations and inter-service communication.

🚀 Major Features

TaskManager Infrastructure Integration

  • Unified Task Management: Migrated TaskManager from JiroCloud services to Jiro.Shared for ecosystem-wide availability
  • Distributed System Support: Built-in support for managing tasks across multiple Jiro instances
  • Timeout Management: Automatic timeout monitoring and cleanup for long-running operations
  • Stream Operations: Channel-based streaming support for real-time data processing

New Components:

// Task management interfaces
public interface ITaskManager { }
public interface IInstanceTaskManager { }

// Core implementation
public class TaskManager : ITaskManager, IInstanceTaskManager, IDisposable

// Supporting models
public class QueuedRequest
public class InstanceManagedTask  
public class ChannelStreamTask
public class TaskManagerOptions

Enhanced Command Response Architecture

  • SynchronizationToken Model: New token-based command tracking replacing simple string IDs
  • Polymorphic Results: Improved command result handling with type-safe polymorphism
  • Session Integration: Enhanced session and instance correlation for distributed scenarios

Key Models:

public class SynchronizationToken
{
    public string InstanceId { get; set; }
    public string SessionId { get; set; }
    public string RequestId { get; set; }
}

public enum CommandType { Text = 0, Graph = 1 }

public abstract class CommandResult
public class TextResult : CommandResult
public class GraphResult : CommandResult

gRPC Protocol Buffer Distribution

  • Proto File Packaging: jiroHub.proto now included in NuGet package for client generation
  • Service Generation Support: Consuming projects can generate gRPC services from shared proto definitions
  • Version Synchronization: Ensures protocol consistency across Jiro ecosystem components

🛠️ Technical Improvements

Namespace Reorganization

  • Tasks Namespace: All task management components moved to Jiro.Shared.Tasks
  • Shared Models: Core models relocated to root Jiro.Shared namespace for better accessibility
  • gRPC Extensions: Enhanced ClientMessage conversion with proper type disambiguation

Test Infrastructure

  • Complete Test Suite: Added comprehensive test coverage for TaskManager functionality
  • CI Integration: Tests run automatically on PR and main branch commits
  • Mock Support: Full Moq integration for unit testing scenarios

Build & Packaging

  • NuGet Enhancement: Proto files included in package for downstream code generation
  • Content Files: Proper content file packaging for modern NuGet compatibility
  • Version Synchronization: Updated to .NET 9.0 with latest dependency versions

🔧 Breaking Changes

Namespace Updates

Applications using TaskManager components from JiroCloud services need namespace updates:

// Before v1.4.0
using JiroCloud.Core.Services.ResponseTask;
using JiroCloud.Core.Services.ResponseTask.Models;

// After v1.4.0  
using Jiro.Shared.Tasks;
using Jiro.Shared.Tasks.Models;

Model Relocations

Shared models moved from websocket-specific namespaces:

// Before v1.4.0
using Jiro.Shared.Websocket.Models;

// After v1.4.0
using Jiro.Shared; // SynchronizationToken, CommandType, CommandResult

Command Response Architecture

Enhanced command response model with synchronization tokens:

// Before v1.4.0
public class SessionCommandResponse
{
    public string CommandSyncId { get; set; }
}

// After v1.4.0
public class SessionCommandResponse  
{
    public SynchronizationToken SynchronizationToken { get; set; }
}

📦 NuGet Package Changes

Proto File Distribution

The jiroHub.proto file is now included in the NuGet package:

<ItemGroup>
  <Protobuf Include="Grpc\jiroHub.proto" GrpcServices="Client" />
</ItemGroup>

Content Files Structure

contentFiles/any/any/Grpc/jiroHub.proto
content/Grpc/jiroHub.proto

🧪 Testing & CI

Test Coverage

  • TaskManager Tests: Complete test suite covering all TaskManager operations
  • Mock Integration: Moq-based testing for logger and configuration dependencies
  • Timeout Scenarios: Comprehensive timeout and cancellation testing
  • Stream Operations: Channel-based streaming operation tests

Continuous Integration

  • Automated Testing: Tests run on every PR and main branch commit
  • Code Coverage: Coverage collection and reporting via Codecov
  • Build Verification: Multi-configuration build testing (Debug/Release)

🔍 Migration Guide

For JiroCloud Applications

  1. Update Namespaces:

    // Replace all instances
    using JiroCloud.Core.Services.ResponseTask;
    // With
    using Jiro.Shared.Tasks;
    
  2. Update Model References:

    // Old websocket-specific imports
    using Jiro.Shared.Websocket.Models.SynchronizationToken;
    // New shared imports  
    using Jiro.Shared.SynchronizationToken;
    
  3. Command Response Updates:

    // Update command sync ID usage
    response.SynchronizationToken.RequestId // instead of CommandSyncId
    response.SynchronizationToken.SessionId
    response.SynchronizationToken.InstanceId
    

For New Applications

  1. Install Updated Package:

    <PackageReference Include="Jiro.Shared" Version="1.4.0" />
    
  2. TaskManager Registration:

    services.Configure<TaskManagerOptions>(options => 
    {
        options.DefaultTimeoutSeconds = 30;
        options.MaxPendingTasks = 1000;
    });
    services.AddSingleton<ITaskManager, TaskManager>();
    
  3. Proto File Usage:

    <ItemGroup>
      <Protobuf Include="Grpc\jiroHub.proto" GrpcServices="Both" />
    </ItemGroup>
    

🐛 Issues Addressed

  • Task Management Fragmentation: Unified task management across Jiro ecosystem
  • Command Synchronization: Enhanced command tracking with comprehensive token system
  • gRPC Integration: Simplified service generation with packaged proto files
  • Testing Infrastructure: Complete test coverage for reliability assurance
  • Namespace Consistency: Logical organization of shared components

📈 Performance Improvements

  • Efficient Task Tracking: Optimized concurrent dictionary usage for task management
  • Memory Management: Proper disposal patterns and resource cleanup
  • Stream Processing: Channel-based streaming with backpressure handling
  • Timeout Monitoring: Background service for automatic task cleanup

🔗 Dependencies

Updated Dependencies

  • Microsoft.EntityFrameworkCore.* → 9.0.8
  • Microsoft.AspNetCore.SignalR.Client → 9.0.8
  • Microsoft.Extensions.* → 9.0.8
  • Z.EntityFramework.Plus.EFCore → 9.103.9.2

Test Dependencies

  • Microsoft.NET.Test.Sdk → 17.14.1
  • xUnit → 2.9.3
  • xUnit.runner.visualstudio → 3.1.3
  • Coverlet.collector → 6.0.4

Note: This release provides a unified foundation for task management and command synchronization across the Jiro ecosystem. The integration of TaskManager infrastructure enables more sophisticated distributed system scenarios while maintaining the simplicity and reliability that Jiro.Shared is known for.