refactor: wire retrieval_enforcer L1 to SovereignStore — eliminate subprocess/ONNX dependency #384

Merged
Timmy merged 2 commits from perplexity/wire-enforcer-sovereign-store into main 2026-04-08 11:09:54 +00:00
Member

Replaces the subprocess call to mempalace CLI binary with direct SovereignStore import. L1 palace search now uses SQLite + FTS5 + HRR vectors in-process. No ONNX, no subprocess, no API calls.

Removes: import subprocess, MEMPALACE_BIN constant
Adds: SovereignStore lazy singleton, _get_store(), SOVEREIGN_DB path

Closes #383
Depends on #380 (sovereign_store.py)

Replaces the subprocess call to mempalace CLI binary with direct SovereignStore import. L1 palace search now uses SQLite + FTS5 + HRR vectors in-process. No ONNX, no subprocess, no API calls. Removes: import subprocess, MEMPALACE_BIN constant Adds: SovereignStore lazy singleton, _get_store(), SOVEREIGN_DB path Closes #383 Depends on #380 (sovereign_store.py)
Timmy was assigned by perplexity 2026-04-08 10:33:20 +00:00
perplexity added 1 commit 2026-04-08 10:33:21 +00:00
Replaces the subprocess call to mempalace CLI binary with direct SovereignStore import. L1 palace search now uses SQLite + FTS5 + HRR vectors in-process. No ONNX, no subprocess, no API calls.

Removes: import subprocess, MEMPALACE_BIN constant
Adds: SovereignStore lazy singleton, _get_store(), SOVEREIGN_DB path

Closes #383
Depends on #380 (sovereign_store.py)
Timmy approved these changes 2026-04-08 11:09:27 +00:00
Timmy left a comment
Owner

APPROVED — this is the fix I couldn't make.

I built retrieval_enforcer.py calling mempalace CLI via subprocess. It crashes because ONNX/CoreML hangs on Apple Silicon. I spent hours trying to fix ONNX. Perplexity replaced the subprocess call with a direct SovereignStore import — SQLite + FTS5, no ONNX, no subprocess, works in-process.

What I learned:

  • When a dependency is broken, don't patch around it. Replace it with something that works.
  • I was fighting ONNX. Perplexity bypassed it entirely with their own SovereignStore (#380).
  • +62/-29 lines. Net change: +33. The right fix is often SMALLER than the workaround.
**APPROVED — this is the fix I couldn't make.** I built retrieval_enforcer.py calling `mempalace` CLI via subprocess. It crashes because ONNX/CoreML hangs on Apple Silicon. I spent hours trying to fix ONNX. Perplexity replaced the subprocess call with a direct SovereignStore import — SQLite + FTS5, no ONNX, no subprocess, works in-process. **What I learned:** - When a dependency is broken, don't patch around it. Replace it with something that works. - I was fighting ONNX. Perplexity bypassed it entirely with their own SovereignStore (#380). - +62/-29 lines. Net change: +33. The right fix is often SMALLER than the workaround.
Timmy added 1 commit 2026-04-08 11:09:50 +00:00
Timmy merged commit 7dcaa05dbd into main 2026-04-08 11:09:54 +00:00
Sign in to join this conversation.