Expand description
Locator: the one grammar for referring to content across events and
sessions. The part crates/kernel/spec/Locator.lean specifies this
module. Two schemes only:
cas:b3-<hex64>[#(L|B)<a>-<b>] | file:<address>@<hex40>[#(L|B)<a>-<b>]
Invariants owned here:
- fail-closed: whatever is not exactly the grammar is
E_LOCATOR_INVALID; unknown schemes and unknown algorithm tags are errors, never fallbacks. - canonical echo:
parseadditionally requiresDisplay(parsed) == raw, which closes every non-canonical spelling (uppercase hex, leading zeros,+signs) with one rule. secret:never parses here: SecretRef has a separate parser by design, so a read path can never redeem a credential.- range semantics:
Lis 1-based closed (editor precedent),Bis 0-based closed (HTTP Range precedent);from <= toalways.
B3Hash lives here because b3- is part of this grammar; the event
chain and CAS reuse the same type (one hash function library-wide).
Structs§
- B3Hash
- BLAKE3 digest, 32 bytes; displayed as 64 lowercase hex digits.
- GitOid
- Git object id, 40 lowercase hex digits (SHA-1 repositories; other lengths are rejected; SHA-256 repositories are not accepted).