Expand description
tatara-lisp-source — resolve a Nix-flake-style URL into bytes.
Implements theory/WASM-PACKAGING.md §II:
a tatara-script user can pass any of the following as the script
path argument, and the resolver fetches the bytes + computes a
BLAKE3 content hash for caching:
./local/path.tlisp
github:owner/repo/path/to/program.tlisp
github:owner/repo/path/to/program.tlisp?ref=v0.1.0
github:owner/repo/path/to/program.tlisp?ref=abc123
gitlab:owner/repo/path.tlisp?ref=main
codeberg:owner/repo/path.tlisp
https://example.com/program.tlisp#blake3=abc123…The wasm-operator (cluster-side) and tatara-script (host-side)
use this crate identically — same code, different deployment.
§Caching
Every fetch returns a Resolved with the bytes and a BLAKE3 hash.
Callers store the bytes keyed by the hash; subsequent resolves of
the same URL find the cache by hash and skip the network.
When a URL has #blake3=<hash> (per Nix’s content-pin convention),
the resolver verifies the fetched bytes match before returning.
Structs§
- File
Cache - File-system-backed cache — used by
tatara-scripthost-side. - Memory
Cache - In-memory cache — useful for one-off scripts and tests.
- Resolved
- Result of resolving a
Source— the raw bytes plus the BLAKE3 hash. - Resolver
- The resolver — composes a
Cachewith the host-side fetcher.
Enums§
- Resolve
Error - Source
- Typed source — every variant carries everything needed to fetch.
Traits§
- Cache
- Cache contract. Keys are stable per-URL strings (see
crate::Source::cache_key).
Functions§
- blake3_
hex - Helper for callers that already have bytes and want a hash.
- resolve_
once - Helper for callers without their own
Cache— resolves once, returns the bytes + hash, no caching.