Expand description
Core library for orchestratectl.
See issues/orchestratectl-mvp/design.md for the canonical schema and
protocol references. This crate provides:
- The on-disk schema types (
Manifest,Node,Event,Discussion,SpinoffProposal). - Atomic write helpers (
atomic) and per-run advisoryflock(RunLock). - The canonical mutation entry point
(
append_and_apply_event): append one event and fold it into the projections under the run’sflock.
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_run;pub use cancel::cancel_run_unlocked;pub use cancel::CancelOutcome;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_discussion_id;pub use ids::new_proposal_id;pub use ids::new_run_id;pub use lock::Exclusive;pub use lock::LockedRun;pub use lock::RunLock;pub use paths::nofollow;pub use paths::run_dir;pub use paths::validate_run_id;pub use paths::RunPaths;pub use plan::parse_and_validate_plan;pub use plan::plan_v3_json_schema;pub use plan::validate_plan;pub use plan::Acceptance;pub use plan::Baseline;pub use plan::Check;pub use plan::Chunk;pub use plan::Feature;pub use plan::Plan;pub use plan::PlanValidationError;pub use plan::Tier;pub use plan::PLAN_SCHEMA_VERSION;pub use plan::PLAN_V3_JSON_SCHEMA;pub use plan::PROVENANCE_REQUIRED_SCHEMA;pub use plan::SUPPORTED_PLAN_SCHEMAS;pub use plan::TOLERATED_OPTIONAL_FIELDS;pub use projections::read_discussion;pub use projections::read_discussion_opt;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::read_spinoff;pub use projections::read_spinoff_opt;pub use projections::write_node;pub use reducer::plan_projections;pub use reducer::VIA_EXPLICIT_MERGE;pub use report::validate_report_payload;pub use report::ReportValidationError;pub use schema::is_run_id_prefix;pub use schema::ChildRef;pub use schema::Discussion;pub use schema::DiscussionId;pub use schema::DiscussionStatus;pub use schema::Event;pub use schema::IdValidationError;pub use schema::Kind;pub use schema::Lifecycle;pub use schema::Manifest;pub use schema::Node;pub use schema::NodeId;pub use schema::ProposalId;pub use schema::RunId;pub use schema::SpinoffProposal;pub use schema::SpinoffStatus;pub use schema::Status;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-corefile I/O and schema operations. - events
- Event append primitive +
seqrecovery (design.md §1.4, §4). - ids
- Identifier generators and types per design.md §1.1.
- lock
- Per-run advisory
flockprimitive (design.md §4). - paths
- Directory layout helpers for a single run.
- plan
plan.jsonv3 — serde types + structural validator (design.md §4, §7, §13).- 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.