kotoba-main

Crates.iokotoba-main
lib.rskotoba-main
version0.1.22
created_at2025-09-19 15:05:58.968492+00
updated_at2025-09-19 15:05:58.968492+00
descriptionGP2-based Graph Rewriting Language - ISO GQL-compliant queries, MVCC+Merkle persistence, and distributed execution
homepagehttps://github.com/com-junkawasaki/kotoba
repositoryhttps://github.com/com-junkawasaki/kotoba
max_upload_size
id1846593
size18,075,912
Jun Kawasaki (jun784)

documentation

https://docs.rs/kotoba

README

Kotoba : "ใ“ใจใฐ" - Core Graph Processing System

GP2-based Graph Rewriting + Event Sourcing + ISO GQL - A comprehensive graph processing platform featuring complete Event Sourcing, ISO GQL-compliant queries, MVCC+Merkle persistence, and distributed execution using hexagonal architecture.

๐ŸŒŸ Core Graph Processing System
๐Ÿ”„ GP2-based Graph Rewriting Engine
๐Ÿ“Š Event Sourcing + Materialized Views
๐Ÿ” ISO GQL-compliant Graph Queries
โšก MVCC + Merkle DAG Persistence
๐Ÿ—๏ธ  Hexagonal Architecture (Port/Adapter Pattern)
๐Ÿ”ง Pluggable Storage Adapters (RocksDB, Redis, In-Memory)

Rust Test Coverage License Build Status Architecture

๐Ÿ“– Overview

Kotoba is a Core Graph Processing System featuring GP2-based graph rewriting with complete Event Sourcing capabilities, ISO GQL-compliant queries, MVCC+Merkle persistence, and distributed execution using hexagonal architecture.

๐ŸŽฏ Core Features

  • ๐Ÿ”„ GP2-based Graph Rewriting: Theoretical foundation for graph transformations
  • ๐Ÿ“Š Complete Event Sourcing: Immutable events, projections, materialized views
  • ๐Ÿ” ISO GQL-compliant Queries: Standardized graph query language
  • โšก MVCC + Merkle DAG Persistence: Consistent distributed data management
  • ๐Ÿ—๏ธ Hexagonal Architecture: Clean separation of business logic and infrastructure
  • ๐Ÿ”ง Pluggable Storage: Choose from RocksDB, Redis, or In-Memory implementations
  • ๐ŸŒ Distributed Execution: Multi-node coordination and consensus
  • ๐Ÿ”’ Type Safety: Full Rust type system with compile-time guarantees

๐Ÿ—๏ธ Architecture Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    ๐Ÿ›๏ธ PRESENTATION LAYER                    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚                ๐ŸŒ HTTP/GraphQL API                 โ”‚    โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚            ๐Ÿ“ฑ CLI & Web Clients             โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
                      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 ๐ŸŽฏ APPLICATION LAYER                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚           ๐Ÿ”„ CORE GRAPH PROCESSING                 โ”‚    โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        โœ๏ธ  GRAPH REWRITING ENGINE (GP2)     โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐Ÿ“Š EVENT SOURCING ENGINE             โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐Ÿ“ˆ PROJECTION ENGINE                  โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐Ÿ” GQL QUERY ENGINE                   โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐Ÿ›ฃ๏ธ  ROUTING ENGINE                     โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐ŸŽญ STATE GRAPH ENGINE                 โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
                      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 ๐Ÿ”ง INFRASTRUCTURE LAYER                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚              ๐Ÿ’พ STORAGE ADAPTERS                   โ”‚    โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐Ÿ—„๏ธ  RocksDB Adapter                  โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐Ÿ”ด Redis Adapter                      โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        ๐Ÿง  In-Memory Adapter                  โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        โ˜๏ธ  Distributed Storage               โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Key Features

๐Ÿ”„ Core Graph Processing Engine

  • GP2-based Graph Rewriting: Theoretical foundation for graph transformations
  • Graph Pattern Matching: Complex graph traversal and pattern recognition
  • Rule-based Transformations: Declarative graph rewriting rules
  • Graph Isomorphism: Advanced graph matching algorithms
  • Concurrent Processing: Parallel graph operations and transformations

๐ŸŽช Complete Event Sourcing System

  • Event Store: Immutable event storage with versioning
  • Projection Engine: Real-time materialized views and read models
  • Command Processing: CQRS pattern with command validation
  • Event Streaming: Real-time event processing and subscriptions

๐Ÿ” Advanced Graph Query Language

  • ISO GQL Compliance: Industry-standard graph query language
  • Path Queries: Variable-length path queries with constraints
  • Aggregation Functions: Statistical and analytical operations
  • Graph Analytics: Built-in graph algorithms and metrics

๐Ÿ—๏ธ Hexagonal Architecture (Port/Adapter Pattern)

  • Clean Architecture: Business logic independent of infrastructure
  • Dependency Inversion: Interfaces define contracts, implementations are pluggable
  • Testability: Easy unit testing with mock adapters
  • Technology Agnostic: Database/storage technology can be changed without affecting business logic

โšก High-Performance Storage Options

  • RocksDB: LSM-Tree based persistent storage with high write throughput
  • Redis: In-memory caching with persistence options
  • In-Memory: Fast development and testing storage
  • Distributed: Multi-node storage with consensus

๐ŸŒ Distributed & Scalable

  • Multi-Node Coordination: Raft consensus for distributed operations
  • Horizontal Scaling: Automatic partitioning and load balancing
  • High Availability: Fault-tolerant design with automatic failover
  • Global Distribution: Edge computing with CDN integration

๐Ÿš€ Advanced Deployment Extensions

  • CLI Extension: Complete deployment management CLI with progress bars, configuration files, and detailed options
  • Controller Extension: Advanced deployment strategies including rollback, blue-green, and canary deployments
  • Network Extension: CDN integration (Cloudflare, AWS CloudFront), security features, and edge optimization
  • Security Features: Rate limiting, WAF, DDoS protection, SSL/TLS certificate management
  • Scalability: Intelligent scaling with performance monitoring and cost optimization

๐Ÿš€ Quick Start

Prerequisites

  • Rust 1.70.0 or later
  • Cargo package manager
  • Optional: RocksDB or Redis for persistent storage

๐Ÿ—๏ธ Choose Your Storage Backend

Kotoba supports multiple storage backends through its Port/Adapter architecture:

Option 1: RocksDB (Persistent, High-Performance)

# Install system dependencies (Ubuntu/Debian)
sudo apt-get install clang llvm-dev libclang-dev

# Install system dependencies (macOS)
brew install llvm

# RocksDB will be automatically downloaded and built

Option 2: Redis (In-Memory with Persistence)

# Install Redis
# Ubuntu/Debian:
sudo apt-get install redis-server

# macOS:
brew install redis

# Start Redis server
redis-server

Option 3: In-Memory (Development/Testing)

# No additional setup required - default option

๐Ÿ“ฆ Installation & Basic Usage

# Clone the repository
git clone https://github.com/com-junkawasaki/kotoba.git
cd kotoba

# Build the project (includes all crates)
cargo build --release

# Run the CLI
./target/release/kotoba --help

# Or run with cargo
cargo run -- --help

๐ŸŽฏ Basic Examples

1. Execute a GQL Query

# Create a simple graph and query it
echo 'CREATE GRAPH test;
INSERT (:Person {name: "Alice"})-[:KNOWS]->(:Person {name: "Bob"});
MATCH (p:Person) RETURN p.name;' > query.gql

cargo run -- query --file query.gql

2. Event Sourcing Example

# Start event sourcing with in-memory storage
cargo run -- event-stream --create example_stream

# Add events
cargo run -- event-stream --stream example_stream --add "UserCreated" '{"id": 1, "name": "Alice"}'

# Create projection
cargo run -- projection --create user_count --query "MATCH (u:User) RETURN count(u) as total"

3. Graph Rewriting Example

# Define a graph rewriting rule
echo 'rule: {
  left: (:A)-[:edge]->(:B)
  right: (:A)-[:edge]->(:C)-[:edge]->(:B)
  conditions: []
}' > rewrite_rule.jsonnet

cargo run -- rewrite --rule rewrite_rule.jsonnet --apply

๐Ÿณ Docker Development (Alternative)

# Build Docker image
docker build -t kotoba .

# Run with RocksDB storage
docker run -v $(pwd)/data:/data kotoba --storage rocksdb --path /data

# Run with Redis storage
docker run -p 6379:6379 -d redis
docker run --network host kotoba --storage redis --url redis://localhost:6379

The Nix environment provides:
- โœ… Exact Rust version (1.82.0)
- โœ… All required dependencies
- โœ… Development tools (docker, kind, kubectl, helm)
- โœ… Reproducible builds
- โœ… Cross-platform support

### Installation

```bash
# Clone the repository
git clone https://github.com/com-junkawasaki/kotoba.git
cd kotoba

# Install dependencies and build
cargo build

# Run comprehensive test suite (38/38 tests passing)
cargo test --workspace

# Build release version
cargo build --release

Basic Usage Examples

Jsonnet Evaluation

Kotoba includes a complete Jsonnet implementation supporting arrays, objects, functions, and string interpolation:

example.jsonnet

// Local variables and functions
local version = "1.0.0";
local add = function(x, y) x + y;

// Object with computed values
{
  app: {
    name: "Kotoba Demo",
    version: version,
    features: ["jsonnet", "graph", "gql"],
  },

  // Array operations
  numbers: [1, 2, 3, 4, 5],
  doubled: [x * 2 for x in self.numbers],

  // String interpolation
  greeting: "Hello, %(name)s!" % { name: "World" },

  // Function calls
  sum: add(10, 20),

  // Conditional logic
  status: if self.sum > 25 then "high" else "low",
}

Run with Kotoba:

# Evaluate Jsonnet file
cargo run --bin kotoba-jsonnet evaluate example.jsonnet

# Convert to JSON
cargo run --bin kotoba-jsonnet to-json example.jsonnet

Graph Processing

Users create .kotoba files in Jsonnet format for graph processing:

graph.kotoba

{
  // Graph data
  graph: {
    vertices: [
      { id: "alice", labels: ["Person"], properties: { name: "Alice", age: 30 } },
      { id: "bob", labels: ["Person"], properties: { name: "Bob", age: 25 } },
    ],
    edges: [
      { id: "follows_1", src: "alice", dst: "bob", label: "FOLLOWS" },
    ],
  },

  // GQL queries
  queries: [
    {
      name: "find_people",
      gql: "MATCH (p:Person) RETURN p.name, p.age",
    },
  ],

  // ๅฎŸ่กŒใƒญใ‚ธใƒƒใ‚ฏ
  handlers: [
    {
      name: "main",
      function: "execute_queries",
      metadata: { description: "Execute all defined queries" },
    },
  ],
}

ๅฎŸ่กŒๆ–นๆณ•

# .kotobaใƒ•ใ‚กใ‚คใƒซใ‚’ๅฎŸ่กŒ
kotoba run app.kotoba

# ใพใŸใฏใ‚ตใƒผใƒใƒผใƒขใƒผใƒ‰ใง่ตทๅ‹•
kotoba server --config app.kotoba

๐Ÿ—๏ธ Architecture

Multi-Crate Architecture

Kotoba adopts a modular multi-crate architecture for maximum flexibility:

โ”œโ”€โ”€ kotoba-core/           # Core types and IR definitions
โ”œโ”€โ”€ kotoba-jsonnet/        # Complete Jsonnet implementation (38/38 tests passing)
โ”œโ”€โ”€ kotoba-graph/          # Graph data structures and operations
โ”œโ”€โ”€ kotoba-storage/        # High-performance RocksDB + Redis hybrid storage
โ”œโ”€โ”€ kotoba-execution/      # Query execution and planner
โ”œโ”€โ”€ kotoba-rewrite/        # Graph rewriting engine
โ”œโ”€โ”€ kotoba-server/         # HTTP server and handlers
โ”œโ”€โ”€ kotoba-kotobas/         # KotobaScript - Declarative programming language
โ”œโ”€โ”€ kotoba2tsx/            # TypeScript/React code generation

# ๐Ÿš€ Advanced Deployment Extensions
โ”œโ”€โ”€ kotoba-deploy-core/    # Core deployment types and configurations
โ”œโ”€โ”€ kotoba-deploy-cli/     # Advanced deployment CLI with progress bars
โ”œโ”€โ”€ kotoba-deploy-controller/ # Advanced deployment strategies (rollback, blue-green, canary)
โ”œโ”€โ”€ kotoba-deploy-network/ # CDN integration, security, and edge optimization
โ”œโ”€โ”€ kotoba-deploy-scaling/ # AI-powered scaling and performance monitoring
โ”œโ”€โ”€ kotoba-deploy-git/     # Git integration and webhook handling
โ”œโ”€โ”€ kotoba-deploy-hosting/ # Application hosting and runtime management
โ””โ”€โ”€ kotoba/                # Main integration crate

Each crate can be used independently, allowing you to pick only the features you need.

Crate Highlights

kotoba-jsonnet - Complete Jsonnet Implementation

  • โœ… 38/38 tests passing - Full test coverage
  • โœ… Arrays, Objects, Functions - Complete Jsonnet language support
  • โœ… String Interpolation - "%(name)s" % { name: "World" }
  • โœ… Local Variables - local x = 42; x + 1
  • โœ… JSON/YAML Output - Multiple serialization formats

kotoba-graph - Graph Processing Core

  • โœ… Vertex/Edge Management - Full graph operations
  • โœ… GP2 Rewriting - Theoretical graph transformations
  • โœ… ISO GQL Queries - Standardized graph query language

Integration Features

  • โœ… Workspace Testing - cargo test --workspace passes
  • โœ… Clean Codebase - Clippy warnings minimized
  • โœ… Documentation - Comprehensive API docs

๐Ÿš€ Deployment Extension Highlights

  • CLI Extension (kotoba-deploy-cli):

    • โœ… Complete Deployment CLI - Progress bars, configuration files, detailed options
    • โœ… Multi-format Output - JSON, YAML, human-readable formats
    • โœ… Deployment Management - List, status, stop, scale, logs commands
    • โœ… Configuration Handling - Auto-generation and validation
    • โœ… Interactive Progress - Real-time deployment progress tracking
  • Controller Extension (kotoba-deploy-controller):

    • โœ… Advanced Deployment Strategies - Rollback, blue-green, canary deployments
    • โœ… Deployment History - Comprehensive deployment tracking and rollback
    • โœ… Health Checks - Integrated health monitoring and auto-rollback
    • โœ… Traffic Management - Gradual traffic shifting and canary releases
    • โœ… Multi-strategy Support - Flexible deployment strategy selection
  • Network Extension (kotoba-deploy-network):

    • โœ… CDN Integration - Cloudflare, AWS CloudFront, Fastly, Akamai support
    • โœ… Security Features - Rate limiting, WAF, DDoS protection
    • โœ… SSL/TLS Management - Automatic certificate renewal and custom certs
    • โœ… Edge Optimization - Image optimization, compression, caching
    • โœ… Geographic Routing - Nearest edge location selection
    • โœ… Performance Monitoring - Real-time metrics and analytics
  • Scaling Extension (kotoba-deploy-scaling) - Planned:

    • ๐Ÿ”„ AI-Powered Scaling - Machine learning based traffic prediction
    • ๐Ÿ”„ Cost Optimization - Intelligent resource allocation
    • ๐Ÿ”„ Performance Monitoring - Advanced metrics collection
    • ๐Ÿ”„ Auto-scaling - Dynamic scaling based on multiple factors
    • ๐Ÿ”„ Load Balancing - Intelligent load distribution

ไฝฟ็”จไพ‹

# .kotobaใƒ•ใ‚กใ‚คใƒซใงๅ…จใฆๅฎš็พฉ
kotoba run myapp.kotoba

# ้–‹็™บๆ™‚ใฏใ‚ฆใ‚ฉใƒƒใƒใƒขใƒผใƒ‰
kotoba run myapp.kotoba --watch

Rust API๏ผˆๅ†…้ƒจไฝฟ็”จ๏ผ‰

// Rust APIใฏไธปใซๅ†…้ƒจๅฎŸ่ฃ…ใงไฝฟ็”จ
use kotoba_core::types::*;
use kotoba_graph::prelude::*;

WASMๅฏพๅฟœ

ๅ„crateใฏๆกไปถไป˜ใใ‚ณใƒณใƒ‘ใ‚คใƒซใซใ‚ˆใ‚ŠWASMใ‚ฟใƒผใ‚ฒใƒƒใƒˆใซใ‚‚ๅฏพๅฟœใ—ใฆใ„ใพใ™๏ผš

# WASMใƒ“ใƒซใƒ‰
cargo build --target wasm32-unknown-unknown --features wasm

Process Network Graph Model

Kotoba is based on a Process Network Graph Model, where all components are centrally managed through dag.jsonnet.

Main Components

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                          lib.rs                             โ”‚
โ”‚                    (Main Library)                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚          execution/          โ”‚          rewrite/            โ”‚
โ”‚       (Query Executor)       โ”‚       (DPO Rewriter)         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚          planner/            โ”‚          storage/            โ”‚
โ”‚       (Query Planner)        โ”‚       (MVCC+Merkle)          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           graph/             โ”‚            ir/               โ”‚
โ”‚       (Data Structures)      โ”‚       (Core IR)              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                          types.rs                           โ”‚
โ”‚                    (Common Types)                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Build Order (Topological Sort)

// Get build order from dag.jsonnet
$ jsonnet eval dag.jsonnet | jq .topological_order
[
  "types",
  "ir_catalog",
  "ir_rule",
  "ir_query",
  "ir_patch",
  "graph_vertex",
  "graph_edge",
  "ir_strategy",
  "graph_core",
  "storage_mvcc",
  "storage_merkle",
  "storage_lsm",  // RocksDB-based high-performance storage
  "planner_logical",
  "planner_physical",
  "execution_parser",
  "rewrite_matcher",
  "rewrite_applier",
  "planner_optimizer",
  "rewrite_engine",
  "execution_engine",
  "lib"
]

๐Ÿ“‹ Usage

1. Basic GQL Queries

queries.kotoba

{
  config: {
    type: "config",
    name: "QueryExample",
  },

  // ใ‚ฐใƒฉใƒ•ใƒ‡ใƒผใ‚ฟ
  graph: {
    vertices: [
      { id: "alice", labels: ["Person"], properties: { name: "Alice", age: 30 } },
      { id: "bob", labels: ["Person"], properties: { name: "Bob", age: 25 } },
      { id: "charlie", labels: ["Person"], properties: { name: "Charlie", age: 35 } },
    ],
    edges: [
      { id: "f1", src: "alice", dst: "bob", label: "FOLLOWS" },
      { id: "f2", src: "bob", dst: "charlie", label: "FOLLOWS" },
    ],
  },

  // GQLใ‚ฏใ‚จใƒชๅฎš็พฉ
  queries: [
    {
      name: "follow_network",
      gql: "MATCH (p:Person)-[:FOLLOWS]->(f:Person) WHERE p.age > 25 RETURN p.name, f.name",
      description: "25ๆญณไปฅไธŠใฎไบบใŒใƒ•ใ‚ฉใƒญใƒผใ—ใฆใ„ใ‚‹ไบบใ‚’ๅ–ๅพ—",
    },
  ],

  handlers: [
    {
      name: "execute_query",
      function: "run_gql_query",
      parameters: { query_name: "follow_network" },
    },
  ],
}
kotoba run queries.kotoba

2. Graph Rewriting

rewrite.kotoba

{
  config: {
    type: "config",
    name: "RewriteExample",
  },

  // ใ‚ฐใƒฉใƒ•ๆ›ธๆ›ใˆใƒซใƒผใƒซ
  rules: [
    {
      name: "triangle_collapse",
      description: "ไธ‰่ง’ๅฝขใ‚’ๆŠ˜ใ‚ŠใŸใŸใ‚€",
      lhs: {
        nodes: [
          { id: "u", type: "Person" },
          { id: "v", type: "Person" },
          { id: "w", type: "Person" },
        ],
        edges: [
          { id: "e1", src: "u", dst: "v", type: "FOLLOWS" },
          { id: "e2", src: "v", dst: "w", type: "FOLLOWS" },
        ],
      },
      rhs: {
        nodes: [
          { id: "u", type: "Person" },
          { id: "w", type: "Person" },
        ],
        edges: [
          { id: "e3", src: "u", dst: "w", type: "FOLLOWS" },
        ],
      },
    },
  ],

  // ๅฎŸ่กŒๆˆฆ็•ฅ
  strategies: [
    {
      name: "exhaust_triangle_collapse",
      rule: "triangle_collapse",
      strategy: "exhaust",
      order: "topdown",
    },
  ],

  handlers: [
    {
      name: "apply_rewrite",
      function: "execute_rewrite",
      parameters: { strategy_name: "exhaust_triangle_collapse" },
    },
  ],
}

3. HTTP Server with Graph Operations

server.kotoba

{
  config: {
    type: "config",
    name: "GraphServer",
    server: { host: "127.0.0.1", port: 3000 },
  },

  // ใƒซใƒผใƒˆๅฎš็พฉ
  routes: [
    {
      method: "GET",
      pattern: "/api/users",
      handler: "list_users",
      description: "ใƒฆใƒผใ‚ถใƒผไธ€่ฆงใ‚’ๅ–ๅพ—",
    },
    {
      method: "POST",
      pattern: "/api/users",
      handler: "create_user",
      description: "ใƒฆใƒผใ‚ถใƒผใ‚’ไฝœๆˆ",
    },
  ],

  // ใ‚ฐใƒฉใƒ•ใ‚นใ‚ญใƒผใƒž
  schema: {
    node_types: ["User", "Post"],
    edge_types: ["FOLLOWS", "LIKES"],
  },

  handlers: [
    {
      name: "list_users",
      function: "execute_gql",
      parameters: {
        query: "MATCH (u:User) RETURN u.name, u.email",
        format: "json",
      },
    },
    {
      name: "create_user",
      function: "create_graph_node",
      parameters: {
        type: "User",
        properties: ["name", "email", "age"],
      },
    },
  ],
}

๐Ÿ“„ .kotoba File Format

Kotobaใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใงใฏใ€่จญๅฎšใƒ•ใ‚กใ‚คใƒซใ‚„UIๅฎš็พฉใชใฉใซ.kotobaใƒ•ใ‚กใ‚คใƒซๅฝขๅผใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ใ“ใ‚ŒใฏJsonnetๅฝขๅผใ‚’ใƒ™ใƒผใ‚นใจใ—ใŸๆง‹้€ ๅŒ–ใ•ใ‚ŒใŸ่จญๅฎšใƒ•ใ‚ฉใƒผใƒžใƒƒใƒˆใงใ™ใ€‚

ๆฆ‚่ฆ

.kotobaใƒ•ใ‚กใ‚คใƒซใฏไปฅไธ‹ใฎ็‰นๅพดใ‚’ๆŒใกใพใ™๏ผš

  • Jsonnetๅฝขๅผ: JSONใฎใ‚นใƒผใƒ‘ใƒผใ‚ปใƒƒใƒˆใงใ€ๅค‰ๆ•ฐใ€้–ขๆ•ฐใ€ๆกไปถๅˆ†ๅฒใชใฉใฎๆฉŸ่ƒฝใ‚’ๆดป็”จ
  • ๆง‹้€ ๅŒ–่จญๅฎš: ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใจ้…ๅˆ—ใซใ‚ˆใ‚‹้šŽๅฑค็š„ใช่จญๅฎšๆง‹้€ 
  • ใƒฆใƒผใƒ†ใ‚ฃใƒชใƒ†ใ‚ฃ้–ขๆ•ฐ: ่จญๅฎš็”ŸๆˆใฎใŸใ‚ใฎๅ†ๅˆฉ็”จๅฏ่ƒฝใช้–ขๆ•ฐๅฎš็พฉ
  • ่จˆ็ฎ—ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ: ๅ‹•็š„ใช่จญๅฎš็”Ÿๆˆใจใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณ
  • ๅž‹ๅฎ‰ๅ…จ: Jsonnetใฎๅž‹ใ‚ทใ‚นใƒ†ใƒ ใซใ‚ˆใ‚‹่จญๅฎšใฎๆ•ดๅˆๆ€ง็ขบไฟ

ใƒ•ใ‚กใ‚คใƒซๅฝขๅผไป•ๆง˜

ๅŸบๆœฌๆง‹้€ 

// ่จญๅฎšใƒ•ใ‚กใ‚คใƒซใฎๅŸบๆœฌๆง‹้€ 
{
  // ่จญๅฎšใ‚ปใ‚ฏใ‚ทใƒงใƒณ
  config: {
    type: "config",
    name: "MyApp",
    version: "1.0.0",
    metadata: {
      description: "ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ่จญๅฎš",
    },
  },

  // ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆๅฎš็พฉ
  components: [
    // ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆ
  ],

  // ใƒฆใƒผใƒ†ใ‚ฃใƒชใƒ†ใ‚ฃ้–ขๆ•ฐ
  makeComponent: function(name, type, props={}) {
    // ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆ็”Ÿๆˆ้–ขๆ•ฐ
  },
}

ไธป่ฆใชใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ

  • type (ๅฟ…้ ˆ): ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใฎ็จฎ้กžใ‚’ๆŒ‡ๅฎš
  • name (ๆŽจๅฅจ): ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใฎไธ€ๆ„ใช่ญ˜ๅˆฅๅญ
  • metadata (ใ‚ชใƒ—ใ‚ทใƒงใƒณ): ่ฟฝๅŠ ๆƒ…ๅ ฑ๏ผˆ่ชฌๆ˜Žใ€ใƒใƒผใ‚ธใƒงใƒณใชใฉ๏ผ‰
  • localๅค‰ๆ•ฐ: Jsonnetใฎใƒญใƒผใ‚ซใƒซๅค‰ๆ•ฐใซใ‚ˆใ‚‹่จญๅฎšใฎๅ…ฑ้€šๅŒ–
  • ้–ขๆ•ฐ: ่จญๅฎš็”ŸๆˆใฎใŸใ‚ใฎๅ†ๅˆฉ็”จๅฏ่ƒฝใช้–ขๆ•ฐ
  • ::ๆผ”็ฎ—ๅญ: ่จˆ็ฎ—ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃใซใ‚ˆใ‚‹ๅ‹•็š„่จญๅฎš็”Ÿๆˆ

ไธป่ฆใชใ‚ปใ‚ฏใ‚ทใƒงใƒณ

1. config - ่จญๅฎšใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆ

ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณๅ…จไฝ“ใฎ่จญๅฎšใ‚’ๅฎš็พฉใ—ใพใ™ใ€‚

local appVersion = "1.0.0";

config: {
  type: "config",
  name: "MyApp",
  version: appVersion,
  host: "127.0.0.1",
  port: 8080,
  theme: "light",
  metadata: {
    description: "ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ่จญๅฎš",
    environment: "development",
  },
}

2. routes / middlewares - HTTP่จญๅฎš

HTTPใ‚ตใƒผใƒใƒผใฎใƒซใƒผใƒˆใจใƒŸใƒ‰ใƒซใ‚ฆใ‚งใ‚ขใ‚’ๆง‹้€ ๅŒ–ใ—ใฆๅฎš็พฉใ—ใพใ™ใ€‚

// ใƒฆใƒผใƒ†ใ‚ฃใƒชใƒ†ใ‚ฃ้–ขๆ•ฐ
local makeRoute = function(method, pattern, handler, desc) {
  type: "route",
  method: method,
  pattern: pattern,
  handler: handler,
  metadata: { description: desc },
};

routes: [
  makeRoute("GET", "/api/" + appVersion + "/users", "list_users", "List users"),
  makeRoute("POST", "/api/" + appVersion + "/users", "create_user", "Create user"),
],

middlewares: [
  {
    type: "middleware",
    name: "cors",
    order: 10,
    function: "cors_middleware",
    metadata: {
      description: "CORS handling middleware",
      allowed_origins: ["*"],
    },
  },
],

3. components - UIใ‚ณใƒณใƒใƒผใƒใƒณใƒˆๅฎš็พฉ

Reactใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚’ๆง‹้€ ๅŒ–ใ—ใฆๅฎš็พฉใ—ใพใ™ใ€‚

local styles = {
  button: { primary: "button primary", secondary: "button secondary" },
  layout: { header: "header", sidebar: "sidebar" },
};

local makeButton = function(name, text, style, onClick) {
  type: "component",
  name: name,
  component_type: "button",
  props: {
    text: text,
    className: style,
    onClick: onClick,
  },
  metadata: { description: name + " button" },
};

components: [
  makeButton("SaveButton", "Save", styles.button.primary, "handleSave"),
  makeButton("CancelButton", "Cancel", styles.button.secondary, "handleCancel"),
],

4. handlers / states - ใ‚คใƒ™ใƒณใƒˆใจ็Šถๆ…‹็ฎก็†

ใ‚คใƒ™ใƒณใƒˆใƒใƒณใƒ‰ใƒฉใƒผใจ็Šถๆ…‹ใ‚’ๅฎš็พฉใ—ใพใ™ใ€‚

handlers: [
  {
    type: "handler",
    name: "handleSave",
    function: "handleSave",
    metadata: { description: "Save form data" },
  },
],

states: [
  {
    type: "state",
    name: "user",
    initial: null,
    metadata: { description: "Current user state" },
  },
  {
    type: "state",
    name: "loading",
    initial: false,
    metadata: { description: "Loading state" },
  },
],

5. ่จˆ็ฎ—ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃใจใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณ

JsonnetใฎๆฉŸ่ƒฝใ‚’ๆดป็”จใ—ใŸๅ‹•็š„่จญๅฎšใจใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณใ€‚

// ่จˆ็ฎ—ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ
allRoutes:: [r.pattern for r in self.routes],
routeCount:: std.length(self.routes),

// ใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณ้–ขๆ•ฐ
validateRoutes:: function() {
  local duplicates = [
    pattern
    for pattern in std.set([r.pattern for r in self.routes])
    if std.count([r.pattern for r in self.routes], pattern) > 1
  ];
  if std.length(duplicates) > 0 then
    error "Duplicate route patterns: " + std.join(", ", duplicates)
  else
    "Routes validation passed";
},

ไฝฟ็”จไพ‹

HTTPใ‚ตใƒผใƒใƒผ่จญๅฎšไพ‹

// config.kotoba - HTTPใ‚ตใƒผใƒใƒผ่จญๅฎš
local apiVersion = "v1";
local defaultTimeout = 30000;

{
  // ใ‚ตใƒผใƒใƒผ่จญๅฎš
  config: {
    type: "config",
    host: "127.0.0.1",
    port: 8080,
    max_connections: 1000,
    timeout_ms: defaultTimeout,
    metadata: {
      description: "HTTP server configuration",
      environment: "development",
    },
  },

  // ใƒฆใƒผใƒ†ใ‚ฃใƒชใƒ†ใ‚ฃ้–ขๆ•ฐ
  makeRoute: function(method, pattern, handler, desc) {
    type: "route",
    method: method,
    pattern: pattern,
    handler: handler,
    metadata: { description: desc },
  },

  makeMiddleware: function(name, order, func, desc) {
    type: "middleware",
    name: name,
    order: order,
    function: func,
    metadata: { description: desc },
  },

  // ใƒซใƒผใƒˆๅฎš็พฉ
  routes: [
    $.makeRoute("GET", "/ping", "ping_handler", "Simple ping endpoint"),
    $.makeRoute("GET", "/health", "health_check", "Health check endpoint"),
    $.makeRoute("GET", "/api/" + apiVersion + "/users", "list_users", "List users"),
    $.makeRoute("POST", "/api/" + apiVersion + "/users", "create_user", "Create user"),
  ],

  // ใƒŸใƒ‰ใƒซใ‚ฆใ‚งใ‚ขๅฎš็พฉ
  middlewares: [
    $.makeMiddleware("cors", 10, "cors_middleware", "CORS handling"),
    $.makeMiddleware("auth", 20, "auth_middleware", "Authentication"),
    $.makeMiddleware("logger", 100, "request_logger", "Request logging"),
  ],

  // ่จˆ็ฎ—ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ
  serverInfo:: {
    host: $.config.host,
    port: $.config.port,
    routes_count: std.length($.routes),
    middlewares_count: std.length($.middlewares),
  },
}

React UI่จญๅฎšไพ‹

// app.kotoba - React UI่จญๅฎš
local appName = "MyApp";
local appVersion = "1.0.0";

{
  // ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ่จญๅฎš
  config: {
    type: "config",
    name: appName,
    version: appVersion,
    theme: "light",
    title: "My App",
    metadata: {
      framework: "React",
      description: "Sample React application",
    },
  },

  // ใ‚นใ‚ฟใ‚คใƒซๅฎšๆ•ฐ
  styles: {
    button: {
      primary: "button primary",
      secondary: "button secondary",
    },
    layout: {
      header: "header",
      main: "main-content",
    },
  },

  // ใƒฆใƒผใƒ†ใ‚ฃใƒชใƒ†ใ‚ฃ้–ขๆ•ฐ
  makeComponent: function(name, componentType, props={}, children=[], desc="") {
    type: "component",
    name: name,
    component_type: componentType,
    props: props,
    children: children,
    metadata: { description: desc },
  },

  makeButton: function(name, text, style, onClick, desc) {
    $.makeComponent(name, "button", {
      text: text,
      className: style,
      onClick: onClick,
    }, [], desc),
  },

  // ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆๅฎš็พฉ
  components: [
    $.makeComponent("App", "div", {}, ["Header", "Main"], "Root application component"),
    $.makeComponent("Header", "header", {
      title: $.config.title,
      className: $.styles.layout.header,
    }, ["Nav"], "Application header"),
    $.makeButton("SaveBtn", "Save", $.styles.button.primary, "handleSave", "Save button"),
    $.makeButton("CancelBtn", "Cancel", $.styles.button.secondary, "handleCancel", "Cancel button"),
  ],

  // ใ‚คใƒ™ใƒณใƒˆใƒใƒณใƒ‰ใƒฉใƒผ
  handlers: [
    {
      type: "handler",
      name: "handleSave",
      function: "handleSave",
      metadata: { description: "Handle save action" },
    },
    {
      type: "handler",
      name: "handleCancel",
      function: "handleCancel",
      metadata: { description: "Handle cancel action" },
    },
  ],

  // ็Šถๆ…‹็ฎก็†
  states: [
    {
      type: "state",
      name: "user",
      initial: null,
      metadata: { description: "Current user state" },
    },
    {
      type: "state",
      name: "theme",
      initial: $.config.theme,
      metadata: { description: "Current theme state" },
    },
  ],
}

ใƒ‘ใƒผใ‚นใจไฝฟ็”จๆ–นๆณ•

Jsonnetใƒ•ใ‚กใ‚คใƒซใฏjsonnetใ‚ณใƒžใƒณใƒ‰ใพใŸใฏใƒ—ใƒญใ‚ฐใƒฉใƒ ใซใ‚ˆใ‚‹่ฉ•ไพกใŒๅฟ…่ฆใงใ™๏ผš

# Jsonnetใƒ•ใ‚กใ‚คใƒซใ‚’่ฉ•ไพกใ—ใฆJSONใซๅค‰ๆ›
jsonnet eval config.kotoba

# ใพใŸใฏใƒ—ใƒญใ‚ฐใƒฉใƒ ใง็›ดๆŽฅไฝฟ็”จ
jsonnet eval config.kotoba | jq .routes
// Rustใงใฎไฝฟ็”จไพ‹
use std::process::Command;

// Jsonnetใƒ•ใ‚กใ‚คใƒซใ‚’่ฉ•ไพก
let output = Command::new("jsonnet")
    .arg("eval")
    .arg("config.kotoba")
    .output()?;

let config_json: serde_json::Value = serde_json::from_slice(&output.stdout)?;

// ่จญๅฎšใ‚’ไฝฟ็”จ
if let Some(routes) = config_json.get("routes") {
    println!("Found {} routes", routes.as_array().unwrap().len());
}

Jsonnetๅ›บๆœ‰ใฎๆฉŸ่ƒฝๆดป็”จ

1. ๅค‰ๆ•ฐใจๅฎšๆ•ฐใฎไฝฟ็”จ

local appVersion = "v1";
local defaultPort = 8080;

{
  config: {
    version: appVersion,
    port: defaultPort,
  },
  routes: [
    { pattern: "/api/" + appVersion + "/users" },
  ],
}

2. ้–ขๆ•ฐใซใ‚ˆใ‚‹่จญๅฎš็”Ÿๆˆ

local makeApiRoute = function(method, resource, action) {
  type: "route",
  method: method,
  pattern: "/api/v1/" + resource + "/" + action,
  handler: resource + "_" + action,
};

routes: [
  makeApiRoute("GET", "users", "list"),
  makeApiRoute("POST", "users", "create"),
],

3. ่จˆ็ฎ—ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃใซใ‚ˆใ‚‹ๅ‹•็š„่จญๅฎš

{
  components: [/* ... */],
  // ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆๆ•ฐใฎ่จˆ็ฎ—
  componentCount:: std.length(self.components),

  // ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚ฟใ‚คใƒ—ๅˆฅใฎ้›†่จˆ
  componentTypes:: std.set([c.component_type for c in self.components]),
}

4. ๆกไปถๅˆ†ๅฒใจใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณ

local environment = "production";

{
  config: {
    debug: if environment == "development" then true else false,
    port: if environment == "production" then 80 else 3000,
  },

  // ใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณ
  validate:: function() {
    if std.length(self.config.name) == 0 then
      error "Application name is required"
    else
      "Configuration is valid";
  },
}

ใƒ™ใ‚นใƒˆใƒ—ใƒฉใ‚ฏใƒ†ใ‚ฃใ‚น

  1. ๅค‰ๆ•ฐใฎๆดป็”จ: ๅ…ฑ้€šใฎๅ€คใ‚’localๅค‰ๆ•ฐใงๅฎš็พฉใ—ใฆDRYๅŽŸๅ‰‡ใ‚’ๅฎˆใ‚‹
  2. ้–ขๆ•ฐใซใ‚ˆใ‚‹ๆŠฝ่ฑกๅŒ–: ่จญๅฎš็”Ÿๆˆใƒ‘ใ‚ฟใƒผใƒณใ‚’้–ขๆ•ฐๅŒ–ใ—ใฆๅ†ๅˆฉ็”จๆ€งใ‚’้ซ˜ใ‚ใ‚‹
  3. ่จˆ็ฎ—ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃใฎไฝฟ็”จ: ::ๆผ”็ฎ—ๅญใงๅ‹•็š„ใช่จญๅฎšๅ€คใ‚’็”Ÿๆˆ
  4. ๆง‹้€ ๅŒ–: ่จญๅฎšใ‚’่ซ–็†็š„ใชใ‚ปใ‚ฏใ‚ทใƒงใƒณ๏ผˆconfig, routes, components็ญ‰๏ผ‰ใซๅˆ†ใ‘ใ‚‹
  5. ใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณ: ่จญๅฎšใฎๅฆฅๅฝ“ๆ€งใ‚’ๆคœ่จผใ™ใ‚‹้–ขๆ•ฐใ‚’ๅฎš็พฉ
  6. ใ‚ณใƒกใƒณใƒˆ: Jsonnetใฎ//ใ‚ณใƒกใƒณใƒˆใ‚’ๆดป็”จใ—ใฆ่จญๅฎšใฎๆ„ๅ›ณใ‚’ๆ˜Ž็ขบใซ
  7. ๅ†ๅˆฉ็”จ: ๅ…ฑ้€šใฎ้–ขๆ•ฐใ‚„ใ‚นใ‚ฟใ‚คใƒซใ‚’ๅˆฅใƒ•ใ‚กใ‚คใƒซใซๅˆ†้›ขใ—ใฆimport

ๆ‹กๅผตๆ€ง

.kotobaๅฝขๅผ๏ผˆJsonnet๏ผ‰ใฏ้žๅธธใซๆ‹กๅผตๆ€งใŒ้ซ˜ใใ€Jsonnetใฎๅ…จๆฉŸ่ƒฝใ‚’ๆดป็”จใงใใพใ™๏ผš

ใ‚ซใ‚นใ‚ฟใƒ ้–ขๆ•ฐใƒฉใ‚คใƒ–ใƒฉใƒช

// utils.libsonnet
{
  // ๆฑŽ็”จใƒฆใƒผใƒ†ใ‚ฃใƒชใƒ†ใ‚ฃ้–ขๆ•ฐ
  makeCrudRoutes(resource):: [
    {
      type: "route",
      method: "GET",
      pattern: "/api/v1/" + resource,
      handler: resource + "_list",
    },
    {
      type: "route",
      method: "POST",
      pattern: "/api/v1/" + resource,
      handler: resource + "_create",
    },
  ],

  // ใ‚นใ‚ฟใ‚คใƒซๅฎšๆ•ฐ
  themes: {
    light: { bg: "#ffffff", fg: "#000000" },
    dark: { bg: "#000000", fg: "#ffffff" },
  },
}

่จญๅฎšใฎๅˆๆˆ

// ่ค‡ๆ•ฐใฎ่จญๅฎšใƒ•ใ‚กใ‚คใƒซใ‚’ๅˆๆˆ
local base = import "base.libsonnet";
local api = import "api.libsonnet";

base + api + {
  // ่ฟฝๅŠ ่จญๅฎš
  customRoutes: [
    { pattern: "/health", handler: "health_check" },
  ],
}

็’ฐๅขƒๅˆฅ่จญๅฎš

// ็’ฐๅขƒใซๅฟœใ˜ใŸ่จญๅฎšๅˆ‡ใ‚Šๆ›ฟใˆ
local environment = std.extVar("ENVIRONMENT");

{
  config: {
    debug: environment != "production",
    port: if environment == "production" then 80 else 3000,
    database: {
      host: if environment == "production"
            then "prod-db.example.com"
            else "localhost",
    },
  },
}

้–‹็™บใƒฏใƒผใ‚ฏใƒ•ใƒญใƒผ

# ่จญๅฎšใƒ•ใ‚กใ‚คใƒซใฎๆคœ่จผ
jsonnet eval config.kotoba

# ็‰นๅฎšใฎใ‚ปใ‚ฏใ‚ทใƒงใƒณใฎใฟๅ–ๅพ—
jsonnet eval -e "(import 'config.kotoba').routes"

# ใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณๅฎŸ่กŒ
jsonnet eval -e "(import 'config.kotoba').validate()"

# ่จญๅฎšใ‚’JSONใจใ—ใฆไฟๅญ˜
jsonnet eval config.kotoba > config.json

๐Ÿ› ๏ธ Development

Using dag.jsonnet

1. Dependency Analysis

# Check dependencies of specific component
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.get_dependencies('execution_engine')"

# Check components that depend on this component
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.get_dependents('types')"

2. Build Order Verification

# Get overall build order
jsonnet eval dag.jsonnet | jq .topological_order[]

# Check build order for specific node
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.get_build_order('graph_core')"

3. Causality Identification During Troubleshooting

# Get investigation order when problems occur
jsonnet eval dag.jsonnet | jq .reverse_topological_order[]

Using lib.jsonnet

1. Build Configuration Verification

# Get configuration for specific target
jsonnet eval -e "local lib = import 'lib.jsonnet'; lib.get_target_config('x86_64-apple-darwin')"

# Resolve component dependencies
jsonnet eval -e "local lib = import 'lib.jsonnet'; lib.resolve_dependencies('kotoba-core', ['full'])"

2. Packaging Configuration

# Get Docker image configuration
jsonnet eval lib.jsonnet | jq .packaging.docker

# Get Debian package configuration
jsonnet eval lib.jsonnet | jq .packaging.debian

Development Workflow

# 1. Make code changes
vim src/some_component.rs

# 2. Check dependencies
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.get_dependencies('some_component')"

# 3. Run tests
cargo test --package some_component

# 4. Check overall consistency
cargo check

# 5. Validate DAG
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.validate_dag()"

# 6. Commit
git add .
git commit -m "Update some_component"

๐Ÿงช Testing

Test Coverage: 95%

Kotoba maintains high test coverage across all components, with particular emphasis on the storage layer achieving 95% coverage.

# Run all tests
cargo test

# Run storage tests (95% coverage)
cargo test -p kotoba-storage

# Run specific test
cargo test test_graph_operations

# Run documentation tests
cargo test --doc

# Generate coverage report (requires cargo-tarpaulin)
cargo tarpaulin -p kotoba-storage --out Html

Coverage Highlights

  • Storage Layer: 95% coverage with comprehensive LSM tree testing
  • Core Types: Full coverage of Value, GraphRef, and IR types
  • Graph Operations: Extensive testing of rewriting and query operations
  • HTTP Server: Integration tests for API endpoints

Integration Tests

# Run integration tests
cargo test --test integration

# Run benchmarks
cargo bench

LDBC-SNB Benchmark

# Run benchmark with LDBC-SNB dataset
cargo run --bin kotoba-bench -- --dataset ldbc-snb

๐Ÿ“ฆ Packaging

Docker Image

# Build Docker image
docker build -t kotoba:latest .

# Run the image
docker run -p 8080:8080 kotoba:latest

Debian Package

# Create Debian package
cargo deb

# Install the package
sudo dpkg -i target/debian/kotoba_0.1.0_amd64.deb

Homebrew

# Install Homebrew Formula
brew install kotoba

๐Ÿ”ง CLI Tools

Kotoba CLI Extensions

Kotobaใฏ2ใคใฎไธป่ฆใชCLIใ‚’ๆไพ›ใ—ใพใ™๏ผš

1. Core Kotoba CLI - Graph Processing & Development

Deno CLIใ‚’ๅ‚่€ƒใซใ—ใŸไฝฟใ„ใ‚„ใ™ใ„ใ‚ณใƒžใƒณใƒ‰ใƒฉใ‚คใƒณใ‚คใƒณใ‚ฟใƒผใƒ•ใ‚งใƒผใ‚นใ‚’ๆไพ›ใ—ใพใ™ใ€‚ใ‚ฐใƒฉใƒ•ๅ‡ฆ็†ใ€ใ‚ฏใ‚จใƒชๅฎŸ่กŒใ€ใƒ•ใ‚กใ‚คใƒซๆ“ไฝœใชใฉใ‚’ใ‚ตใƒใƒผใƒˆใ—ใฆใ„ใพใ™ใ€‚

2. Advanced Deploy CLI - Deployment Management

ๅฎŒๅ…จใชใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆ็ฎก็†ๆฉŸ่ƒฝใ‚’ๆไพ›ใ™ใ‚‹้ซ˜ๅบฆใชCLIใ€‚ใƒ—ใƒญใ‚ฐใƒฌใ‚นใƒใƒผใ€่จญๅฎšใƒ•ใ‚กใ‚คใƒซๅ‡ฆ็†ใ€่ฉณ็ดฐใ‚ชใƒ—ใ‚ทใƒงใƒณใ‚’ๅ‚™ใˆใฆใ„ใพใ™ใ€‚

๐Ÿ—๏ธ Core Kotoba CLI

ใ‚คใƒณใ‚นใƒˆใƒผใƒซ

# ใƒ“ใƒซใƒ‰ใ—ใฆใ‚คใƒณใ‚นใƒˆใƒผใƒซ
cargo build --release --features binary
cp target/release/kotoba ~/.local/bin/  # ใพใŸใฏPATHใฎ้€šใฃใŸๅ ดๆ‰€ใซ

ๅŸบๆœฌ็š„ใชไฝฟ็”จๆ–นๆณ•

# ใƒ˜ใƒซใƒ—่กจ็คบ
kotoba --help

# ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๆƒ…ๅ ฑ่กจ็คบ
kotoba info
kotoba info --detailed --json

# GQLใ‚ฏใ‚จใƒชๅฎŸ่กŒ
kotoba query "MATCH (n) RETURN n" --format json

# ใƒ•ใ‚กใ‚คใƒซๅฎŸ่กŒ
kotoba run myfile.kotoba

# ใƒ•ใ‚กใ‚คใƒซๆคœ่จผ
kotoba check src/
kotoba check --all

# ใƒ•ใ‚กใ‚คใƒซใƒ•ใ‚ฉใƒผใƒžใƒƒใƒˆ
kotoba fmt src/
kotoba fmt --all --check

# ใ‚ตใƒผใƒใƒผ่ตทๅ‹•
kotoba server --port 3000 --host 127.0.0.1

# ๆ–ฐ่ฆใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๅˆๆœŸๅŒ–
kotoba init my-project --template web

# ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆ็”Ÿๆˆ
kotoba doc --output ./docs --format html

# ใƒใƒผใ‚ธใƒงใƒณ่กจ็คบ
kotoba version

๐Ÿš€ Advanced Deploy CLI

ใ‚คใƒณใ‚นใƒˆใƒผใƒซ

# Deploy CLIใ‚’ใƒ“ใƒซใƒ‰
cargo build --release -p kotoba-deploy-cli
cp target/release/kotoba-deploy-cli ~/.local/bin/kotoba-deploy

# ใพใŸใฏCargo็ตŒ็”ฑใงใ‚คใƒณใ‚นใƒˆใƒผใƒซ
cargo install --path crates/kotoba-deploy-cli

้ซ˜ๅบฆใชใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆๆฉŸ่ƒฝ

# ใƒ˜ใƒซใƒ—่กจ็คบ
kotoba-deploy --help

# ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆๅฎŸ่กŒ
kotoba-deploy deploy --name my-app --entry-point app.js --runtime nodejs --port 3000

# ่จญๅฎšใƒ•ใ‚กใ‚คใƒซใ‚’ไฝฟ็”จใ—ใŸใƒ‡ใƒ—ใƒญใ‚ค
kotoba-deploy deploy --config deploy.json

# ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆไธ€่ฆง่กจ็คบ
kotoba-deploy list --detailed

# ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆใ‚นใƒ†ใƒผใ‚ฟใ‚น็ขบ่ช
kotoba-deploy status my-deployment-id

# ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆๅœๆญข
kotoba-deploy stop my-deployment-id --force

# ใ‚นใ‚ฑใƒผใƒซ่ชฟๆ•ด
kotoba-deploy scale my-deployment-id 5

# ใƒญใ‚ฐ่กจ็คบ
kotoba-deploy logs my-deployment-id --follow --lines 100

# ่จญๅฎš็ฎก็†
kotoba-deploy config --show
kotoba-deploy config --set log_level=debug

Deploy CLIใฎไธปใชใ‚ณใƒžใƒณใƒ‰

ใ‚ณใƒžใƒณใƒ‰ ่ชฌๆ˜Ž ไพ‹
deploy ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใ‚’ใƒ‡ใƒ—ใƒญใ‚ค deploy --name app --runtime nodejs
list ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆไธ€่ฆง่กจ็คบ list --detailed
status ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆใ‚นใƒ†ใƒผใ‚ฟใ‚น็ขบ่ช status deployment-123
stop ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆๅœๆญข stop deployment-123 --force
scale ใ‚คใƒณใ‚นใ‚ฟใƒณใ‚นๆ•ฐใ‚’่ชฟๆ•ด scale deployment-123 3
logs ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆใƒญใ‚ฐ่กจ็คบ logs deployment-123 --follow
config ่จญๅฎš็ฎก็† config --show

Deploy CLIใฎ้ซ˜ๅบฆใชใ‚ชใƒ—ใ‚ทใƒงใƒณ

# ่ฉณ็ดฐใชใƒ‡ใƒ—ใƒญใ‚คใ‚น่จญๅฎš
kotoba-deploy deploy \
  --name production-app \
  --entry-point dist/server.js \
  --runtime nodejs \
  --port 8080 \
  --env NODE_ENV=production \
  --env DATABASE_URL=postgres://... \
  --build-cmd "npm run build" \
  --start-cmd "npm start" \
  --min-instances 2 \
  --max-instances 10 \
  --cpu-threshold 0.8 \
  --memory-threshold 0.8 \
  --domain api.example.com \
  --dry-run

# CDN็ตฑๅˆ
kotoba-deploy deploy \
  --cdn-provider cloudflare \
  --cdn-zone-id ZONE_ID \
  --cdn-api-key API_KEY

# ใƒ–ใƒซใƒผใ‚ฐใƒชใƒผใƒณใƒ‡ใƒ—ใƒญใ‚ค
kotoba-deploy deploy \
  --strategy blue-green \
  --traffic-split 10 \
  --health-check-endpoint /health

่จญๅฎšใƒ•ใ‚กใ‚คใƒซไพ‹

deploy.json

{
  "metadata": {
    "name": "my-production-app",
    "version": "1.2.0"
  },
  "application": {
    "entry_point": "dist/app.js",
    "runtime": "nodejs",
    "environment": {
      "NODE_ENV": "production",
      "PORT": "8080"
    },
    "build_command": "npm run build",
    "start_command": "npm start"
  },
  "scaling": {
    "min_instances": 2,
    "max_instances": 10,
    "cpu_threshold": 0.8,
    "memory_threshold": 0.8,
    "auto_scaling_enabled": true
  },
  "network": {
    "domains": ["api.example.com"],
    "ssl_enabled": true,
    "cdn_enabled": true
  },
  "deployment": {
    "strategy": "canary",
    "traffic_percentage": 20,
    "rollback_on_failure": true
  }
}

๐Ÿ“Š ็ตฑๅˆใƒฏใƒผใ‚ฏใƒ•ใƒญใƒผ

# 1. ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ้–‹็™บ
kotoba run app.kotoba --watch

# 2. ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆๆบ–ๅ‚™
kotoba check deploy.kotoba

# 3. ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆๅฎŸ่กŒ
kotoba-deploy deploy --config deploy.json --dry-run
kotoba-deploy deploy --config deploy.json --wait

# 4. ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆ็ฎก็†
kotoba-deploy list
kotoba-deploy status production-app
kotoba-deploy scale production-app 5

# 5. ใƒญใ‚ฐ็›ฃ่ฆ–
kotoba-deploy logs production-app --follow

๐Ÿ“š API Documentation

# Generate documentation
cargo doc --open

# Generate documentation including private items
cargo doc --document-private-items --open

๐Ÿค Contributing

Contribution Guidelines

  1. Create Issue: Bug reports or feature requests
  2. Create Branch: feature/your-feature-name
  3. Implement Changes:
    • Add tests
    • Update documentation
    • Verify dag.jsonnet consistency
  4. Create Pull Request

Development Environment Setup

# Install development dependencies
cargo install cargo-edit cargo-watch cargo-deb

# Set up pre-commit hooks
cp pre-commit.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

Coding Standards

  • Rust: Use rustfmt and clippy
  • Commit Messages: Conventional Commits
  • Testing: Add tests for all changes
  • Documentation: Add documentation for all public APIs

๐Ÿ“„ License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • GP2 Team: Theoretical foundation for graph rewriting systems
  • ISO/IEC: GQL standard specification
  • Rust Community: Excellent programming language

๐Ÿ“ž Support


๐Ÿš€ What's New - Advanced Deployment Extensions

v0.1.0 - Deployment Extensions Release

โœ… Completed Extensions

๐Ÿ”ง CLI Extension (kotoba-deploy-cli)

  • Complete deployment CLI with progress bars and configuration management
  • Multi-format output (JSON, YAML, human-readable)
  • Advanced deployment options with environment variables, scaling, and networking
  • Deployment lifecycle management (list, status, stop, scale, logs)
  • Interactive progress tracking with real-time updates

๐ŸŽ›๏ธ Controller Extension (kotoba-deploy-controller)

  • Advanced deployment strategies: Rollback, Blue-Green, Canary
  • Comprehensive deployment history and rollback capabilities
  • Integrated health checks with auto-rollback on failure
  • Traffic management with gradual shifting and canary releases
  • Multi-strategy deployment orchestration

๐ŸŒ Network Extension (kotoba-deploy-network)

  • CDN Integration: Cloudflare, AWS CloudFront, Fastly, Akamai
  • Security Features: Rate limiting, WAF, DDoS protection
  • SSL/TLS Management: Auto-renewal and custom certificate support
  • Edge Optimization: Image optimization, compression, caching
  • Geographic Routing: Intelligent edge location selection
  • Performance Monitoring: Real-time metrics and analytics

๐Ÿ”„ Upcoming Extensions

๐Ÿ“ˆ Scaling Extension (kotoba-deploy-scaling)

  • AI-powered traffic prediction using machine learning
  • Cost optimization with intelligent resource allocation
  • Advanced performance monitoring and metrics collection
  • Dynamic auto-scaling based on multiple factors
  • Intelligent load balancing and distribution

๐Ÿ“Š Architecture Overview

Process Network Graph Model

Kotoba implements a Process Network Graph Model where all components are centrally managed through dag.jsonnet. This ensures topological consistency and proper dependency resolution.

Key Benefits:

  • Topological Sort: Build order verification
  • Reverse Topological Sort: Problem resolution order
  • Dependency Analysis: Automatic impact assessment
  • Consistency Validation: DAG structure verification

Usage Examples:

# Check build dependencies
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.get_dependencies('execution_engine')"

# Validate DAG structure
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.validate_dag()"

# Get deployment extension status
jsonnet eval -e "local dag = import 'dag.jsonnet'; dag.get_nodes_by_type('deploy_cli')"

Kotoba - Exploring the world of graphs through words, now with advanced deployment capabilities

Commit count: 535

cargo fmt