repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources15d ago| #1 | import json |
| #2 | import os |
| #3 | from pathlib import Path |
| #4 | |
| #5 | from mnemosyne.clawd_brain import BrainConfig, ClawdBrain |
| #6 | |
| #7 | |
| #8 | def test_clawd_brain_writes_memory_and_obsidian_note(tmp_path): |
| #9 | os.environ["MNEMOSYNE_DATA_DIR"] = str(tmp_path / "data") |
| #10 | try: |
| #11 | brain = ClawdBrain(BrainConfig(vault_path=tmp_path / "vault", bank="clawd")) |
| #12 | |
| #13 | result = brain.remember( |
| #14 | "BONK Perp Setup", |
| #15 | "Watch [[BONK]] liquidity on Solana before any perp trade.", |
| #16 | kind="perp", |
| #17 | source="test", |
| #18 | tags=["risk"], |
| #19 | ) |
| #20 | |
| #21 | note_path = Path(result["path"]) |
| #22 | assert note_path.exists() |
| #23 | text = note_path.read_text(encoding="utf-8") |
| #24 | assert "kind: \"perp\"" in text |
| #25 | assert "[[BONK]]" in text |
| #26 | assert "BONK" in result["links"] |
| #27 | |
| #28 | recalled = brain.recall("BONK liquidity perp", top_k=3) |
| #29 | assert recalled["notes"] |
| #30 | assert recalled["memories"] |
| #31 | finally: |
| #32 | os.environ.pop("MNEMOSYNE_DATA_DIR", None) |
| #33 | |
| #34 | |
| #35 | def test_clawd_brain_queues_research_topic(tmp_path): |
| #36 | os.environ["MNEMOSYNE_DATA_DIR"] = str(tmp_path / "data") |
| #37 | try: |
| #38 | brain = ClawdBrain(BrainConfig(vault_path=tmp_path / "vault", bank="clawd")) |
| #39 | result = brain.auto_research("Jupiter perps risk engine", tags=["jupiter"]) |
| #40 | note = Path(result["path"]).read_text(encoding="utf-8") |
| #41 | assert "research_status: \"queued\"" in note |
| #42 | assert "Jupiter perps risk engine" in note |
| #43 | finally: |
| #44 | os.environ.pop("MNEMOSYNE_DATA_DIR", None) |
| #45 | |
| #46 | |
| #47 | def test_clawd_brain_ingests_ooda_journal(tmp_path): |
| #48 | os.environ["MNEMOSYNE_DATA_DIR"] = str(tmp_path / "data") |
| #49 | try: |
| #50 | journal = tmp_path / "ticks.jsonl" |
| #51 | journal.write_text( |
| #52 | json.dumps( |
| #53 | { |
| #54 | "tick": 1, |
| #55 | "now": "2026-05-13T00:00:00Z", |
| #56 | "decision": {"action": "hold", "reason": "risk high"}, |
| #57 | "outcome": "applied", |
| #58 | } |
| #59 | ) |
| #60 | + "\n", |
| #61 | encoding="utf-8", |
| #62 | ) |
| #63 | brain = ClawdBrain(BrainConfig(vault_path=tmp_path / "vault", bank="clawd")) |
| #64 | result = brain.ingest_ooda_journal(journal, limit=10) |
| #65 | assert result["imported"] == 1 |
| #66 | assert brain.status()["by_kind"]["signal"] == 1 |
| #67 | finally: |
| #68 | os.environ.pop("MNEMOSYNE_DATA_DIR", None) |
| #69 |