Skip to main content

Crate crackle_runtime

Crate crackle_runtime 

Source
Expand description

§crackle-runtime

The crackle glaze forms in the cooling, not the firing.

A task execution framework where tasks have a firing phase (hot execution) and a cooling phase (deferred pattern detection). During cooling, the runtime detects emergent patterns across completed tasks that weren’t visible during execution.

§Core Metaphor

In pottery, the most beautiful moment is not the firing — it’s the cooling. The glaze and clay contract at different rates, producing craze lines: unique, unrepeatable patterns that record the history of the transformation. You cannot design these cracks. You can only create the conditions for them and get out of the way.

Similarly, crackle-runtime executes tasks (firing) and then observes what patterns emerge across completed tasks during a cooling phase — patterns that were invisible during the heat of execution.

§Quick Start

use crackle_runtime::{CrackleTask, Kiln, ThermalProfile, GlazeLayer, TaskOutput};
use std::time::Duration;

/// A simple task that produces a number
struct NumberTask { value: f64 }

impl CrackleTask for NumberTask {
    type Output = f64;

    fn fire(&self) -> TaskOutput<Self::Output> {
        TaskOutput::new(self.value, vec![("magnitude".into(), self.value.abs())])
    }
}

// Build a kiln with fast cooling (more cracks, more patterns)
let mut kiln = Kiln::new(ThermalProfile::fast_cooling());

// Fire tasks
kiln.fire_task(NumberTask { value: 3.14 }).unwrap();
kiln.fire_task(NumberTask { value: 2.71 }).unwrap();

// Let the kiln cool and detect patterns
let patterns = kiln.cool();

// Inspect what emerged
for pattern in &patterns {
    println!("{:?}: {}", pattern.kind(), pattern.description());
}

Structs§

ClusteringPattern
Detector for clustering patterns — tasks that complete near each other in metric space.
ConservationPattern
Detector for conservation laws — metrics whose sum stays near-constant across tasks.
CorrelationPattern
Detector for unexpected correlations between tasks.
CracklePattern
A pattern detected during the cooling phase.
GlazeLayer
A decorator that adds pattern-detection capability to any task.
Kiln
The kiln — the runtime that fires tasks and cools them to detect patterns.
PhaseTransitionPattern
Detector for phase transitions — shifts in output distributions.
TaskEntry
A completed task entry stored in the kiln.
TaskMetadata
Metadata about a task’s execution.
TaskOutput
The output of firing a task, including named metrics for pattern detection.
ThermalProfile
The thermal profile controls how the kiln cools.
Timestamp
A timestamp for when a task was fired or cooled.

Enums§

CoolingRate
How fast the kiln cools — controls pattern sensitivity.
CrackleError
Errors that can occur during crackle runtime operations.
PatternKind
The kind of pattern detected during cooling.

Traits§

CrackleTask
The core trait for tasks in the crackle runtime.

Functions§

entropy
Compute Shannon entropy of a set of continuous values.
joint_entropy
Compute joint entropy of two variables.
jsd
Compute Jensen-Shannon divergence between two distributions.
kl_divergence
Compute Kullback-Leibler divergence between two distributions.
mutual_information
Compute mutual information between two variables.
permutation_entropy
Compute permutation entropy of a time series.
transfer_entropy
Compute transfer entropy from X to Y.

Type Aliases§

Result
A specialized result type for crackle runtime operations.