feat(fold): add ObjectiveRegistry<T> for dynamic objective dispatch#306
Merged
Conversation
Ports ObjectiveRegistry from khive-internal, adapted to OSS Selection.item API. Provides thread-safe registration and lookup of named objective functions for fold composition. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…time Per ADR-058, ObjectiveRegistry is runtime infrastructure (named lookup, concurrent mutable state), not fold algebra. Fixes from critic review: - Single RwLock over combined RegistryInner (fixes TOCTOU in set_default) - T: Send + Sync bounds on all public types - Debug impls for RegisteredObjective and ObjectiveRegistry - Documented score() as raw (no precision weighting per ADR-059) - Added error path tests (get/get_default/set_default on missing) - Added concurrent read/write test (validates RwLock) - Removed parking_lot from khive-fold (foundation stays pure math) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ohdearquant
added a commit
that referenced
this pull request
May 22, 2026
PR #306 relocated ObjectiveRegistry from khive-fold to khive-runtime. This branch predated that change — sync both crates to main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ohdearquant
added a commit
that referenced
this pull request
May 22, 2026
* feat: port khive-retrieval — hybrid retrieval composer Ports the retrieval orchestration layer from khive-internal. Composes khive-hnsw (vector), khive-bm25 (text), and khive-fusion into a unified hybrid search pipeline with graph traversal, persistence adapters, cross-encoder reranking support, and evaluation harness. Includes prerequisite crates (hnsw, bm25, fusion) and fold objective registry for compilability. Gates on their individual PRs for merge. ~7.1K LOC, tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(retrieval): add debug_assert for weighted fusion source count Weighted fusion is constrained to exactly 2 sources (vector + keyword) by the HybridSearcher trait hierarchy. Add assertion to catch misuse. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: cargo fmt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: sync khive-fold and khive-runtime with main PR #306 relocated ObjectiveRegistry from khive-fold to khive-runtime. This branch predated that change — sync both crates to main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
ObjectiveRegistry<T>from khive-internal, adapted to OSSSelection.itemAPIparking_lotdep to khive-foldSplit from #297 (staging). Smallest, lowest-risk piece — lands first so
khive-retrievalcan depend on it.Test plan
cargo check -p khive-foldcleancargo test -p khive-fold— 156 tests pass (151 existing + 5 new registry tests)🤖 Generated with Claude Code