Skip to content
tokumagPublic

About

HORA — AI Workforce Orchestrator

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HORA — AI Workforce Orchestrator

HORA is a vendor-neutral AI Workforce Orchestrator that enables specialized AI workers to operate together through persistent, observable, resilient workflows.

HORA does not replace AI workers. HORA makes them work together.


1. What is HORA?

HORA is a command center and deterministic execution engine for assembling heterogeneous AI workers (such as Claude, ChatGPT, Gemini, Antigravity, local models, or CLI agents) into cooperative teams.

HORA enforces an essential architectural separation:

  • Roles define responsibilities (e.g., Architect, Developer, Auditor).
  • Workflows define the deterministic execution graph and conditional transitions.
  • Workers supply the cognitive intelligence.
  • HORA coordinates the state, transitions, dependencies, retries, and events.

2. Why Does HORA Exist?

Complex intellectual deliverables—such as production software engineering, deep research, or security audits—cannot be achieved reliably in a single chat prompt. They require:

  • Multi-role division of labor.
  • Strict validation gates (e.g. implementation code audited by an independent review role before completion).
  • Deterministic error recovery and refinement loops.
  • Structured, observable handoffs and persistent state tracking.

Without an orchestrator, users are forced to manually copy-paste intermediate outputs across disjointed AI chat windows. HORA automates and governs this multi-agent lifecycle deterministically.


3. Current Phase Status

Phase 4.1 — UX/UI Polish, Product Refinement & End-to-End Visual Validation (Complete)

HORA features a native PySide6 desktop application workbench built for developer productivity, dense situational awareness, and real-time observability. Inspired by the spatial organization and agent-workbench philosophy of DeepSeek Harness, HORA provides an information-dense operational cockpit answering "What is my AI workforce doing right now?" within seconds.

Current Capabilities

  • Desktop Application UI (hora/ui/): Native PySide6 workbench with 3-column architecture (220px Categorized Sidebar, >=600px Workbench Canvas, 320px Contextual Inspector).
  • Dark-First Technical Design System: Restrained, developer-tool aesthetic (#0B0D10 Deep Carbon, #151921 Slate, #0EA5E9 Cyan Horizon accent) with full WCAG AA non-color-only accessible status semantics (Shape + Icon + Text + Color).
  • Interactive Workbench Views:
    • Workforce Overview (Live Control Center): Real-time status pills (Workers: N Pool, Status: READY/RUNNING, Active Tasks: N), metric cards, active DAG pipeline tracker with directional connectors and one-click run, dual live workbench (active tasks + live activity stream), and execution history.
    • Execution Matrix Workbench: Visual DAG pipeline flow (DAGCard + directional connectors), live execution matrix table, and streaming activity terminal (LogTerminalWidget) with real-time autoscroll and filtering.
    • Workforce & Role Catalog: Registered worker agent catalog, summary metrics strip (Total, Available, Busy, Roles), and clickable role definitions with detailed inspector binding.
    • Workspace Artifacts: Deliverables catalog with size, file path, empty-state fallback, and SHA-256 integrity inspection.
    • System Activity Log: Full audit stream with category filter pills (ALL, WORKFLOW, TASKS, WORKERS, ERRORS), semantic event icons, and formatted JSON payload inspection with copy-to-clipboard.
  • Polymorphic Contextual Inspector Panel: Collapsible 320px drawer displaying live task parameters, instructions, failure traces, JSON outputs, worker capabilities, role definitions, artifact SHA-256 hash copying, and task cancellation actions.
  • Strict Application Boundary (hora/application/): Complete decoupling of UI from lower-level orchestration. Typed commands (StartWorkflowCommand, CancelWorkflowCommand, CancelTaskCommand), projection queries, and application services (InspectionService, ProjectService, OrchestrationService).
  • Thread-Safe Qt ↔ AsyncIO Architecture (Option A): PySide6 owns the Main GUI Thread; dedicated background RuntimeHost manages the asyncio event loop driving AsyncRuntime. Coroutines dispatched safely via asyncio.run_coroutine_threadsafe().
  • Real-Time QtEventBridge: Translates engine EventBus publications to Qt signals with thread-safe Qt.QueuedConnection delivery and 16ms / 60 FPS throttling.
  • Strongly-Typed Domain & State Machine: Full Pydantic v2 domain models and explicit finite-state validation preventing invalid transitions.
  • Asynchronous Execution Runtime (AsyncRuntime): Native asyncio execution with bounded concurrency (asyncio.Semaphore), parallel DAG branch dispatch, and multi-predecessor fork-join gating.
  • Atomic Persistence Task Claiming: Race-free claims via atomic SQL updates preventing duplicate worker dispatch.
  • Cooperative Cancellation & Timeouts: Non-blocking task and workflow cancellation hierarchy, execution timeouts, and retry backoff.
  • Heartbeat & Stale Liveness Tracking: Regular heartbeat tracking and background housekeeping detecting stale workers.
  • Concurrency-Safe SQLite Persistence (Option A+): SQLite WAL mode + PRAGMA busy_timeout=5000; combined with AsyncDatabaseCoordinator serializing writes via asyncio.Lock and executing short-lived transactions in threads.
  • Repository & Unit of Work Pattern: Typed repositories and atomic transactions with rollback protection.
  • Durable Monotonic Event Store: Persistent events with autoincrementing sequence numbers and correlation IDs.

Current Limitations (Phase 4.1 Boundaries)

  • Zero External AI Provider Calls in Phase 4.1: Testing uses local deterministic mock workers (SuccessfulMockWorker, FailingMockWorker, SlowMockWorker). Third-party LLM integrations (Claude, OpenAI, Gemini, CLI, MCP) are scheduled for Phase 5.
  • Visual Drag-and-Drop Workflow Builder: Graphical workflow canvas editor is scheduled for Phase 8.
  • Desktop Clipboard & Automation: OS clipboard assistance and window tracking are scheduled for Phase 6.

4. System Architecture

┌────────────────────────────────────────────────────────────────────────┐
│                        PySide6 UI Layer (Qt)                           │
│  MainWindow, NavigationSidebar, WorkbenchCanvas, InspectorPanel,       │
│  StatusHeader, Theme/Design System, Custom Widgets                     │
└───────────────────────────────────┬────────────────────────────────────┘
                                    │ Qt Signals & Slots
                                    ▼
┌────────────────────────────────────────────────────────────────────────┐
│                     UI ViewModels & State Store                        │
│  ProjectViewModel, ExecutionViewModel, WorkforceViewModel,             │
│  ArtifactsViewModel, ActivityViewModel                                 │
└───────────────────────────────────┬────────────────────────────────────┘
                                    │ Commands & Queries
                                    ▼
┌────────────────────────────────────────────────────────────────────────┐
│                    Application Service Layer (Boundary)                │
│  InspectionService, ProjectService, OrchestrationService,              │
│  QtEventBridge (Thread Boundary Translator)                            │
└───────────────────┬────────────────────────────────┬───────────────────┘
                    │ asyncio.run_coroutine_threadsafe│ UnitOfWork queries
                    ▼                                ▼
┌───────────────────────────────────┐    ┌───────────────────────────────┐
│     AsyncRuntime & Engine         │    │  Persistence & Workspace      │
│  AsyncRuntime, AsyncScheduler,    │    │  DatabaseManager, Repositories│
│  EventBus, TimeProvider           │    │  WorkspaceManager, Artifacts  │
└───────────────────────────────────┘    └───────────────────────────────┘

5. Quick Start

Prerequisites

HORA requires Python 3.12+.

# Clone repository
git clone https://github.com/tokumag/Hora.git
cd Hora

# Install dependencies (including PySide6 and pytest-qt)
pip install -e ".[dev]"

Launching the Desktop Application

# Launch the desktop UI workbench
python -m hora.ui.app

The application will automatically initialize the database (hora.db), run schema migrations, pre-seed a demonstration workspace with mock workers, and launch the 3-column operational cockpit.

Running Tests

# Run complete test suite (231 tests)
python -m pytest tests/ -v

# Run with test coverage report
python -m pytest tests/ --cov=hora --cov-report=term-missing --tb=short

Current test suite baseline: 231 passed, 0 failures, 0 skipped, 92% overall code coverage.


6. Roadmap Summary

  • Phase 1 (Complete): Core Deterministic Engine (Domain, State Machine, Graph, Scheduler, Events).
  • Phase 1.1 (Complete): Hardening, scheduler deduplication (_execute), 16 master architecture documents.
  • Phase 2 (Complete): SQLite & SQLAlchemy Persistence, Durable Event History, Filesystem Workspace Management.
  • Phase 3 (Complete): Async Runtime, Bounded Concurrency, Parallel DAGs, Atomic Task Claiming, Timeouts, Heartbeats, WAL Persistence.
  • Phase 4 (Complete): PySide6 Desktop GUI Application with 3-Column Dark Workbench, Telemetry, and Qt ↔ AsyncIO Bridge.
  • Phase 5 (Next): Real AI Worker Adapters (Claude, OpenAI, Gemini, Local CLI agents, MCP).
  • Phase 6: Desktop Clipboard Assistance & OS Window Automation.
  • Phase 7: Automated Failover Engine & Context Compiler.
  • Phase 8: Visual Drag-and-Drop Workflow Builder.
  • Phase 9: Production Hardening, Security Sandbox & Binary Packaging.

See docs/ROADMAP.md for full details.


7. Master Documentation Index

All technical design documents are stored in the docs/ directory:


License

MIT

About

HORA — AI Workforce Orchestrator

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages