Skip to main content

Crate octl_core

Crate octl_core 

Source
Expand description

Core library for orchestratectl.

See issues/orchestratectl-mvp/design.md for the canonical schema and protocol references. This crate provides:

Higher-level supervisor and CLI logic live in their own crates / issues.

octl-core is the canonical library surface, so public items are required to carry doc comments (#![warn(missing_docs)]). Lint-level policy otherwise lives in the workspace [workspace.lints] table (pedantic clippy).

Re-exports§

pub use cancel::cancel_node;
pub use cancel::cancel_node_unlocked;
pub use cancel::cancel_run;
pub use cancel::cancel_run_unlocked;
pub use cancel::read_node_statuses;
pub use cancel::CancelOutcome;
pub use cancel::NodeCancelOutcome;
pub use envelope::SCHEMA_VERSION;
pub use error::Error;
pub use error::Result;
pub use events::append_and_apply_event;
pub use events::append_and_apply_idempotent;
pub use events::append_and_apply_unlocked;
pub use events::find_prior_with_key;
pub use events::quarantine_corrupt_lines;
pub use events::quarantine_corrupt_lines_unlocked;
pub use events::read_all_events;
pub use events::recover_last_seq;
pub use events::AppendOutcome;
pub use events::AppendResult;
pub use events::PriorEvent;
pub use events::Quarantine;
pub use ids::format_node_id;
pub use ids::new_op_id;
pub use ids::new_run_id;
pub use lock::Exclusive;
pub use lock::LockedRun;
pub use lock::RunLock;
pub use lock::Shared;
pub use paths::nofollow;
pub use paths::run_dir;
pub use paths::validate_run_id;
pub use paths::RunPaths;
pub use projections::read_manifest;
pub use projections::read_manifest_opt;
pub use projections::read_node;
pub use projections::read_node_opt;
pub use projections::write_node;
pub use reducer::plan_projections;
pub use reducer::KIND_MERGE_ABORTED;
pub use reducer::KIND_MERGE_STARTED;
pub use report::sanitize_report_advisory;
pub use report::validate_report_payload;
pub use report::AdvisoryWarning;
pub use report::ReportOrigin;
pub use report::ReportValidationError;
pub use report::SanitizedReport;
pub use report::REPORT_ORIGIN_KEY;
pub use report::VIA_EXPLICIT_MERGE;
pub use schema::aggregate_terminal_status;
pub use schema::is_run_id_prefix;
pub use schema::AwaitingInput;
pub use schema::ChildRef;
pub use schema::Event;
pub use schema::IdValidationError;
pub use schema::Kind;
pub use schema::Lifecycle;
pub use schema::Manifest;
pub use schema::MergeTxn;
pub use schema::Node;
pub use schema::NodeId;
pub use schema::RunId;
pub use schema::Status;
pub use schema::WorkerExit;
pub use schema::STATE_SCHEMA_VERSION;
pub use schema::SUPPORTED_STATE_SCHEMAS;

Modules§

atomic
Atomic write helpers (create-tempfile-then-rename) for projection files.
cancel
Single-lock run cancellation.
envelope
CLI envelope contract shared with downstream consumers.
error
Error type for octl-core file I/O and schema operations.
events
Event append primitive + seq recovery (design.md §1.4, §4).
ids
Identifier generators and types per design.md §1.1.
lock
Per-run advisory flock primitive (design.md §4).
paths
Directory layout helpers for a single run.
projections
Read-side helpers for projection files.
reducer
Event → projection reducer (design.md §1.4).
report
§7.3 terminal-report payload validation (design.md §7.3).
schema
On-disk state schema types per design.md §1.

Functions§

ensure_root
Ensure the orchestratectl root directory exists (<root>/runs, <root>/logs). Idempotent.