Add optional embedding reranker#13
Merged
Da7-Tech merged 2 commits intoJul 14, 2026
Merged
Conversation
d78b5fa to
1bc3854
Compare
1bc3854 to
00c7572
Compare
Owner
|
Maintainer audit revision pushed as The critical fixes are provenance-aware fallback (no external/hash vector-space mixing), transient-failure retry, zero-vector rejection, and temporary-file stdout capture before the one-megabyte parse limit. Documentation now states the trusted-command boundary and timeout control. All 278 tests plus the benchmark, multilingual, discrimination, soak, fuzz, embedded-command, and LongMemEval smoke paths pass locally. Waiting for the refreshed nine-job matrix before merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1.
Summary
MIND_EMBED_CMDcommand-backed embedder for recall head re-rankingHashEmbedon missing commands, timeouts, non-zero exits, oversized output, invalid or zero vectors, or dimension mismatchMIND_EMBED_TIMEOUTMaintainer audit corrections
The initial implementation had two correctness/resource defects:
HashEmbed.similarity()for both texts.The audit also added:
Behavior and trust boundary
MIND_EMBED_CMDis explicit operator configuration for a trusted local executable. It is parsed withshlexand passed tosubprocesswithoutshell=True. The command receives one text on stdin and must print a JSON vector or whitespace/comma-separated floats.Only the recall head re-ranker uses it. Dream clustering, fuzzy fallback, pattern separation, storage, persistence, graph mutation, and the default offline recall path continue to use the deterministic built-in embedder.
Verification
python3 -m unittest discover -s tests— 278 passed after rebasing onto current mainpython3 bench/bench.pyenv MIND_EMBED_CMD='/bin/echo 1 0' python3 bench/bench.pypython3 bench/multilang.pypython3 bench/discrim.pypython3 bench/soak.pypython3 bench/fuzz.py --quickpython3 bench/longmemeval.py --data tests/fixtures/longmemeval_tiny.json --limit 2python3 -m compileall mind.py bench/bench.py bench/longmemeval.py tests/test_mind.py tests/test_longmemeval_bench.pygit diff --checkManual security/privacy review found no shell execution, secret persistence, network calls, or personal data in the added code or maintainer commit metadata.