Skip to main content

hyprstream_workers/workflow/
mod.rs

1//! WorkflowService - GitHub Actions compatible workflow orchestration
2//!
3//! Discovers workflows from git repositories, subscribes to events, and runs
4//! jobs as scheduled workloads (#527): each job's `runs_on:` + `resources:`
5//! route through the #525 P2 admission engine (`SandboxPool::acquire`) when
6//! the job requests isolation, or stay on the existing in-process VFS/Tcl
7//! execution path otherwise (see `workflow::scheduler` for the mapping).
8//! `WorkflowRunner` talks to `SandboxPool` directly — there is no
9//! `WorkerService` dependency in this crate's workflow engine.
10//!
11//! # Architecture
12//!
13//! ```text
14//! WorkflowService (RequestService)
15//!     │
16//!     ├── scan_repo()       → Discover .github/workflows/*.yml
17//!     ├── subscribe()       → Register event triggers
18//!     ├── dispatch()        → Manual workflow trigger
19//!     └── get_run()         → Query run status
20//!     │
21//!     └── WorkflowRunner
22//!           ├── JobScheduler → SandboxPool::acquire (isolated jobs) or
23//!           │                  in-proc (`IN_PROC_LABELS`) — #527
24//!           └── Executes steps via VFS `/bin/` ctl calls + TclShell
25//! ```
26
27pub mod adapter;
28pub mod gh_adapter;
29mod parser;
30mod runner;
31pub mod scheduler;
32mod service;
33mod subscription;
34mod triggers;
35
36pub use adapter::SubscriberAdapter;
37pub use gh_adapter::GitHubActionsAdapter;
38pub use parser::{Job, JobResources, ParseMode, Step, Workflow};
39pub use runner::WorkflowRunner;
40pub use scheduler::{JobScheduler, Placement};
41pub use service::WorkflowService;
42pub use subscription::WorkflowSubscription;
43pub use triggers::{EventHandler, EventTrigger, HandlerResult};
44
45/// Workflow ID
46pub type WorkflowId = String;
47
48/// Run ID
49pub type RunId = String;
50
51/// Subscription ID
52pub type SubscriptionId = String;