MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _code_fingerprint

Function _code_fingerprint

graphify/reflect.py:729–739  ·  view source on GitHub ↗

Content hash of the node's ``source_file``, or '' if unavailable. Coarse on purpose — a file-level hash over-flags (any edit to the file marks every node in it stale) rather than under-flags, which is the safe direction for a "re-verify" hint.

(node: dict[str, Any] | None, graph_path: Path)

Source from the content-addressed store, hash-verified

727
728
729def _code_fingerprint(node: dict[str, Any] | None, graph_path: Path) -> str:
730 """Content hash of the node's ``source_file``, or '' if unavailable.
731
732 Coarse on purpose — a file-level hash over-flags (any edit to the file marks
733 every node in it stale) rather than under-flags, which is the safe direction
734 for a "re-verify" hint.
735 """
736 if not node:
737 return ""
738 sp = _resolve_source_path(node.get("source_file") or "", graph_path)
739 return _content_hash(sp) if sp is not None else ""
740
741
742def _provenance_for(node: str, prov_map: dict[str, list],

Calls 3

_resolve_source_pathFunction · 0.85
_content_hashFunction · 0.85
getMethod · 0.45