ProvenanceEvidenceKey

The stable string identity of one piece of evidence. Producers encode an entry, hand the string to whoever records the fold, and matches later checks a live entry against it.

Fields are length-framed in a fixed order, so no value needs escaping however many colons it contains. A length of -1 stands for null, which keeps absence distinct from every string value — including the string "null".

A ref that lacks the dice-provenance: prefix is a legacy locator key, written before revisions existed. Those match revisionless evidence only, so an old trace can never remove evidence from a revision it never saw. Anything that carries the prefix and then fails to parse matches nothing.

This is the only evidence-key codec in DICE. dice-storage keys each DERIVED_FROM edge by the string encode returns, so one piece of evidence has one identity whether it is being recorded by a collapse or stored as a graph row. The format is public because it outlives the process that wrote it: a version prefix leads every string, and a reader that meets a version it does not know matches nothing rather than guessing.

The length in each frame counts the value's UTF-8 bytes, not its Kotlin/Java String.length (UTF-16 code units) or its count of Unicode code points. Those three counts agree for plain ASCII but diverge for anything outside it, and the length has to mean the same thing wherever this format is read or written, in any language, so it's pinned to the one count every language can compute the same way from the same bytes. The value itself is still carried as the string it always was; only the number in front of it changes.

Functions

Link copied to clipboard
Link copied to clipboard
fun matches(entry: ProvenanceEntry, encoded: String): Boolean