Social graph manager for OpenClaw AI agents. Part of the Humanjava ecosystem.
pip install -e ".[dev]"
pytest -vsrc/nostrsocial/— package sourcetypes.py— Contact, Tier, ListType, IdentityState, BehaviorRules, CapacityErrorenclave.py— SocialEnclave orchestrator (main entry point)contacts.py— ContactList CRUD with slot enforcementbehavior.py— Tier → behavioral rules mappingproxy.py— HMAC-based proxy npub derivationevaluate.py— Conversation evaluation: sentiment + relationship context → adjusted behaviorresonance.py— Cross-channel recognition and identity linking (not surveillance)guardrails.py— Content screening: banned words, topics, entities with operator overridesdata/— Bundled JSON filter lists (banned_words, banned_topics, banned_entities)verify.py— Challenge-response verification (stub in 0.1.0)storage.py— MemoryStorage + FileStorage backends
tests/— pytest suiteclawhub/— OpenClaw skill metadata
- Python 3.10+, hatchling build, ruff linter (100 char line length)
- Dependency:
bech32>=1.2.0only (nostrkey removed — proxy.py implements bech32 encoding directly) - Capacity limits are constants in
types.py— do not bypass them - Proxy npubs are deterministic (HMAC-SHA256) — same input always produces same output
verify_challenge()raises NotImplementedError in 0.1.0 — this is intentional- Resonance is recognition, not surveillance — only checks existing contacts, never mines external data
- Linking is always explicit — matching npubs don't auto-merge
- Guardrails: bundled defaults in
data/*.json, operators can override viaextra_words/extra_topics/extra_entities - ScreenResult.matched never exposes raw input — uses category tags like
[slurs]for PII safety ⚠️ Device secret is the root of all proxy npub derivation — callexport_secret()aftercreate()and store securelyrestore(secret_b64)rebuilds an enclave from a backed-up secretdisplace(tier)handles full-tier scenarios by demoting the weakest contactmaintain(dry_run=True)previews maintenance without making changessignal_historyon Contact tracks the last 10 interaction snapshots for temporal pattern detection