Files
zeekay c66e0302cd hanzo-memory: real BLAKE3 + fix render_vtt trailing newline
Two byte-equivalence bugs caught by cross-runtime parity check:

1. _blake3() was falling back to BLAKE2b when hashlib lacked BLAKE3 (it
   always does on stock CPython). Wallet addresses depend on the SAME
   hash across all five brain runtimes. Required the `blake3` pip
   package; no fallback. Python addresses now match the TS canonical
   (@noble/hashes/blake3): encode_address(32x0x00) → "hanzo:UFC8qCW8...".

2. render_vtt joined lines with "\n" and appended one "" at the end,
   producing a single trailing newline. Every other runtime emits "\n\n"
   after each segment so cues are separated by a blank line per WebVTT
   spec. Switched to explicit f-string append; render_srt fixed the same
   way.

53 tests still pass.
2026-05-11 12:27:11 -07:00

156 lines
3.6 KiB
TOML

[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "hanzo-memory"
version = "1.0.1"
description = "AI memory service with FastAPI and MCP support"
readme = "README.md"
requires-python = ">=3.12"
license = {text = "BSD"}
authors = [
{name = "Hanzo Industries Inc.", email = "[email protected]"}
]
keywords = ["ai", "memory", "mcp", "fastapi", "embeddings"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"pydantic>=2.9.0",
"pydantic-settings>=2.6.0",
"httpx>=0.28.0",
"python-multipart>=0.0.12",
"mcp>=1.2.0",
"structlog>=24.4.0",
"rich>=13.7.1",
"numpy>=1.26.0",
"sqlite-vec>=0.1.0", # SQLite with vector search capabilities
"blake3>=0.4.0", # Wallet-style content-addressable ids (byte-equivalent across all 5 brain runtimes)
]
[project.optional-dependencies]
dev = [
"pytest>=8.3.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"ruff>=0.8.0",
"mypy>=1.13.0",
"black>=24.10.0",
"pre-commit>=4.0.0",
"ipython>=8.29.0",
"ipdb>=0.13.0",
"twine>=4.0.0",
]
test = [
"pytest>=8.3.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"pytest-mock>=3.14.0",
"faker>=30.0.0",
"factory-boy>=3.3.0",
"respx>=0.21.0",
"polars>=1.0.0",
"httpx>=0.27.0",
]
docs = [
"mkdocs>=1.6.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.27.0",
]
[project.scripts]
hanzo-memory = "hanzo_memory.cli:main"
hanzo-memory-server = "hanzo_memory.server:run"
hanzo-memory-mcp = "hanzo_memory.mcp.server:main"
[project.urls]
Homepage = "https://github.com/hanzoai/memory"
Documentation = "https://docs.hanzo.ai/memory"
Repository = "https://github.com/hanzoai/memory"
Issues = "https://github.com/hanzoai/memory/issues"
[tool.setuptools.packages.find]
where = ["src"]
include = ["hanzo_memory*"]
[tool.setuptools.package-data]
hanzo_memory = ["py.typed"]
[tool.ruff]
line-length = 88
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long
"B008", # do not perform function calls in argument defaults
"W191", # indentation contains tabs
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-ra",
"--strict-markers",
]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
asyncio_mode = "auto"
[tool.coverage.run]
source = ["src/hanzo_memory"]
omit = ["*/tests/*", "*/test_*.py"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]