MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / identity

Function identity

tests/test_coverage_flush.py:37–46  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

35
36
37def identity(path):
38 resolved = Path(path).resolve(strict=True)
39 info = resolved.stat()
40 if not stat.S_ISREG(info.st_mode) or not os.access(str(resolved), os.X_OK):
41 raise ValueError("not an executable regular file: " + str(resolved))
42 digest = hashlib.sha256()
43 with resolved.open("rb") as stream:
44 for block in iter(lambda: stream.read(1024 * 1024), b""):
45 digest.update(block)
46 return {"path": str(resolved), "sha256": digest.hexdigest(), "bytes": info.st_size}
47
48
49def save_json(path, value):

Callers 1

mainFunction · 0.70

Calls 4

strFunction · 0.85
openMethod · 0.80
updateMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected