Vendors curry_core.py from Athena-Pro/Curry (with the str.format()/format_map() sandbox-escape fix from https://github.com/Athena-Pro/Curry/pull/4 already applied) into synapse/, since Curry itself isn't a pip-installable package - it's meant to be pointed at via a config path, which only works from a source checkout. Vendoring a single self-contained, stdlib-only file ships it inside NexusOS's own wheel with no extra dependency to reconcile. synapse/curry_store.py opens it into a module-level singleton (curry_db) at import time, the same pattern as memory.store.store and playbooks.store.playbook_store, and main.py imports it so it's genuinely initialized at process startup - preloaded, not lazy-on-first-use. Backed by its own CURRY_DB file (nexus_config.py), separate from memory.db. NexusOS builds exactly one wheel (py3-none-any, no compiled extensions) - there is no separate Windows/macOS/Linux artifact; platform differences are handled by requirement overlays at install time, not by building different wheels. Verified the same wheel actually carries this correctly: built it, confirmed twine check passes, confirmed synapse/curry_core.py and curry_store.py are present in the archive (bin/check.sh's packaging gate now asserts this too), then installed that exact wheel into a throwaway venv and round-tripped a declare_constant/get_constant_latest call against it with no source checkout present - proving "preloaded and ready to be called" holds from the shipped artifact, not just editable-install execution. Android/Termux is unaffected by this change in either direction: it already has a separate, documented, pre-existing blocker in docs/TERMUX.md (no published Android pydantic-core wheel) that has nothing to do with Curry, which is pure stdlib and adds no new native/binary dependency. Scope: preload only, nothing wired into a chat-facing tool yet - no model or user-authored content reaches declare_function/call_function today. Verified: 216 backend tests pass (4 new in test_curry_store.py, including a regression test proving the vendored sandbox fix survived the copy); the 12 pre-existing C/C++/Rust toolchain failures are unrelated and unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
23 lines
956 B
Python
23 lines
956 B
Python
"""NexusOS's own Curry instance: preloaded at import time, ready to be called.
|
|
|
|
Curry (curry_core.py, vendored alongside this file) is an immutable, versioned
|
|
fact store - constants, functions, model registrations, and inference
|
|
provenance, backed by SQLite. Nothing in NexusOS wires chat/model-authored
|
|
content into it yet; this module only makes it available - `from
|
|
synapse.curry_store import curry_db` and call `declare_constant`,
|
|
`get_constant_latest`, `declare_function`, `call_function`, etc. directly, the
|
|
same way `synapse.memory.store.store` and `synapse.playbooks.store.playbook_store`
|
|
are used elsewhere in this codebase.
|
|
|
|
Kept as a separate database file (CURRY_DB) from the memory/conversation store
|
|
on purpose: Curry's schema and lifecycle are independent of the memory store's.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from .curry_core import Curry
|
|
from .nexus_config import CURRY_DB
|
|
|
|
curry_db = Curry(str(CURRY_DB))
|
|
|
|
__all__ = ["curry_db"]
|