waggle-core — the sans-I/O domain
The core performs no I/O, owns no clock, and generates no entropy
(design doc 03 §1). Every effect is a parameter:
- randomness arrives through [
Entropy] (blanket-implemented for closures — function passing, not global state), - time arrives as a [
Timestamp] value in every signature that needs one, - storage never appears here at all (see
waggle-store).
This is what lets the identical code run in the native daemon, in Cloudflare Workers wasm, and under deterministic tests.
CP-0 shipped the foundation trio: [Token], [Timestamp], [Entropy].
CP-1 adds the domain model: slugs ([Sharer], [Channel], [Stage]),
targets ([CanonicalUrl], [TargetMeta], [MediaRef]), the
three-zone [AttributionManifest] with variants, and [mint] — a pure
function of (spec, options, entropy, now). The sealed variant matcher
and folds land in CP-2/CP-3 (design docs 02–04).
use ;
// A deterministic entropy source: fine for tests, never for production.
let mut counter = 0u8;
let mut entropy = ;
let token = generate.expect;
assert_eq!;