Spanfold Rust
Rust 1.95.0 / Rust 2024 preview of Spanfold's library and CLI surface. The API is intentionally pre-1.0 and may change between minor releases.
The Rust package now covers the main comparison contract: typed temporal primitives, window histories, fixture parsing, staged preparation/alignment, core and advanced comparators, cohort/source-matrix/hierarchy analytics, deterministic exports, audit bundles, liveness helpers, and testing utilities.
Implementation planning specs live under packages/rust/specs/.
Install
The library crate is spanfold. The installed CLI command is also spanfold.
See the Rust changelog
for release details.
Rust API
use for_events;
let mut pipeline =
.record_windows
.track_window
.build?;
pipeline.ingest.expect;
let result = pipeline
.history
.compare
.target_source
.against_source
.scope_window
.overlap
.residual
.missing
.coverage
.run;
Rust Selectors
Rust supports selector-backed comparison plans as first-class API. Selectors can be serializable descriptors for portable exports or runtime-only predicates for local execution.
use ComparisonSelector;
let target = for_source
.and;
let against = for_source;
let result = history
.compare
.target_selector
.against_selector
.scope_window
.overlap
.run;
Repository development commands
Parity Status
| Area | Status |
|---|---|
| Core temporal model and window records | Implemented; cross-language conformance gate pending |
| Direct history queries, snapshots, grouping summaries | Implemented |
| Window annotations and known-at annotation filtering | Implemented |
| Fixture parsing and validation | Implemented; cross-language conformance gate pending |
| Comparison preparation and deterministic alignment | Implemented; cross-language conformance gate pending |
| Overlap, residual, missing, coverage, gap, symmetric difference | Implemented |
| Containment, lead/lag, as-of | Implemented |
| Known-at filtering, live horizons, row finality, changelog | Implemented |
| Cohorts, source matrix, hierarchy, nested roll-ups | Implemented |
| JSON, JSON Lines, Markdown, debug HTML, LLM context exports and configured run exports | Implemented; conformance gate pending |
| Fixture CLI, window JSONL audit CLI, audit bundles | Implemented |
| Event JSONL/CSV import and audit CLI | Implemented |
| Liveness helpers | Implemented |
| Testing helpers, snapshot normalization, virtual clocks | Implemented |
| Pipeline emissions, batch ingestion, event-time recording, configured metadata, callbacks, boundary reasons, roll-up segment projection | Implemented |
| Criterion/throughput benchmark suite | Implemented; published workload baselines pending |
Event Import Map
import-events and audit-events consume JSON Lines or header-row CSV events
with a declarative map. Selectors are field paths/column names and predicates
are fixed comparisons, so maps do not execute user code.
Runtime Boundary
Spanfold can ingest events, keep open windows, run live comparisons at explicit horizons, and mark provisional evidence. It is not a stream processor, hosted observability backend, durable queue, or scheduler; callers own IO, timers, and persistence.