Skip to main content

Crate taskfleet_core

Crate taskfleet_core 

Source
Expand description

Core library for taskfleet.

See issues/taskfleet-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.

taskfleet-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_status_facts;
pub use cancel::read_node_statuses;
pub use cancel::CancelOutcome;
pub use cancel::NodeCancelOutcome;
pub use cancel::NodeStatusFact;
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::replay_unapplied_unlocked;
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::validate_event;
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::AgentOwner;
pub use schema::AgentSelection;
pub use schema::AwaitingInput;
pub use schema::ChildRef;
pub use schema::Event;
pub use schema::EvidenceStatus;
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::RetainedDisplay;
pub use schema::RunId;
pub use schema::SelectedAgentCandidate;
pub use schema::SkippedAgentCandidate;
pub use schema::Status;
pub use schema::TmuxIdentity;
pub use schema::TmuxRetentionPolicy;
pub use schema::WorkerEvidence;
pub use schema::WorkerExit;
pub use schema::STATE_SCHEMA_VERSION;
pub use schema::SUPPORTED_STATE_SCHEMAS;
pub use telemetry::parse_telemetry_update;
pub use telemetry::read_all_telemetry;
pub use telemetry::read_all_telemetry_with_clock;
pub use telemetry::read_telemetry;
pub use telemetry::read_telemetry_with_clock;
pub use telemetry::update_telemetry;
pub use telemetry::update_telemetry_with_clock;
pub use telemetry::SystemTelemetryClock;
pub use telemetry::TelemetryAccepted;
pub use telemetry::TelemetryClock;
pub use telemetry::TelemetryError;
pub use telemetry::TelemetrySampleStatus;
pub use telemetry::TelemetryState;
pub use telemetry::TelemetryUpdate;
pub use telemetry::TelemetryView;
pub use telemetry::TELEMETRY_FRESHNESS_SECS;
pub use telemetry::TELEMETRY_MAX_BYTES;
pub use telemetry::TELEMETRY_PROTOCOL_VERSION;
pub use telemetry::TELEMETRY_SCHEMA_VERSION;

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 taskfleet-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.
telemetry
Bounded, advisory worker-telemetry samples.

Functions§

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