The Ethos: Tooling should not force you into a proprietary configuration language (like YAML) when the host language is already expressive, typed, and testable. Runkernel cures "YAML inflation" by returning control flow and dependency execution back to compiled Rust.
This document governs how AI agents should interact with, debug, and extend the Runkernel core engine across its workspace crates.
Before executing complex tasks or architecture changes, you must ingest the relevant skill file:
- Engine Development (
runkernel-dev): See.agents/skills/runkernel-dev/SKILL.mdfor instructions on extending the DAG scheduler, cache manager, DFS sorting, and internal protocol. - Library Usage (
runkernel-usage): See.agents/skills/runkernel-usage/SKILL.mdfor building workflows and using the engine as a consumer.
- Language: Rust (Strictly enforced)
- Async Runtime: Tokio
- Workspace Layout:
crates/runkernel: Core DAG scheduler, caching engine, and task state.crates/runkernel-cli: User-facing CLI and manifest discovery.crates/runkernel-cli-support: Support library handling the__runkernelinternal IPC protocol.
Do not guess command flags. Use these exact commands to validate the workspace:
- Format check:
cargo fmt --all -- --check - Linting:
cargo clippy --workspace --all-targets --all-features -- -D warnings - Testing:
cargo test --workspace(Note: If sandboxed, invoke withBypassSandbox: true) - Run Workflow Examples:
cargo run -p ops(Run twice to verify[CACHE]hits) - Run CLI manually:
cargo run -p runkernel-cli -- list
- Never introduce distributed/remote execution: Runkernel v0.1 is strictly local-first. Do not add remote worker logic, distributed queues, or Kubernetes dependencies to the core engine.
- Never parse YAML pipelines:
runkernel.tomlis strictly for manifest discovery and CLI defaults, never for defining tasks or dependencies. Rust is the absolute source of truth. - Never break the
__runkernelprotocol: The CLI and support crates communicate via JSON over stdout. Never write raw text to stdout in the support crate that breaks the expected JSON schema (PROTOCOL_VERSION = 1). - Never block the Tokio executor: The DAG scheduler (
pipeline.rs) relies on asynchronous concurrency. Do not use blocking I/O orstd::thread::sleepinside the execution loops.
- Before modifying DFS Cycle Detection: The topological sorting algorithm in
pipeline.rsis critical for validation. Propose algorithmic changes before modifying theUnvisited/Visiting/Visitedstate machine. - Before changing Cache Identity rules: Modifying how
cache.rscomputes the SHA-256 hash (involving globs, env vars, and shell commands) risks breaking cache determinism across the entire ecosystem. - Before altering shared state: Inter-task output passing relies on a thread-safe
Arc<Mutex<HashMap<...>>>. Propose locking strategy changes before implementation to avoid deadlocks during parallel task execution.
- Maintain collision-safe cache logic: When modifying cache storage, ensure paths remain sanitized and retain the 16-character hex hash suffix (
{sanitized_task_name}-{hash16}.json) to prevent naming collisions. - Propagate exact failure state: Ensure that changes to task execution properly honor the
FailurePolicy(FailFast,FinishRunning,ContinueIndependent) and correctly trigger the configuredRollbackPolicy. - Update Protocol Serializers: If you add a new capability or attribute to
Task, you must update the JSON serialization inrunkernel-cli-supportso the CLI can correctly render it inrunkernel explainandrunkernel graph.