Skip to main content

Module fingerprint

Module fingerprint 

Source
Expand description

Interface fingerprints — a stable hash of a module’s public surface.

The fingerprint covers exactly the parts of a module that downstream importers can observe:

  • public functions, pipelines, tools, skills (name + signature)
  • public structs, enums, type aliases, interfaces (full shape)
  • pub import re-exports (target path + selective names)

It intentionally excludes anything internal — function bodies, comments, private helpers, local variable bindings — so an edit that changes only the implementation of a public function leaves the fingerprint stable and dependents stay valid.

The hash is BLAKE3 over a canonical textual rendering of the surface (alphabetized, single source of truth so trivial reorderings don’t flip the fingerprint either).

Functions§

fingerprint_file
Convenience: parse path (real file or <std> virtual path) and fingerprint its public surface. Returns None when the source can’t be read or doesn’t lex/parse — callers can treat that as “no fingerprint” rather than erroring.
fingerprint_hex
Hex-encode a fingerprint for human-readable output (NDJSON events, logs, etc.).
fingerprint_program
Compute the interface fingerprint for program (the parsed top-level statements of a module). Returns the BLAKE3 digest of a canonical textual rendering — see the module docs for what’s included.
fingerprint_source
Fingerprint an already-loaded source string. Lex + parse failures return None.

Type Aliases§

Fingerprint
A 32-byte BLAKE3 digest of a module’s public surface.