[STAGING — DO NOT MERGE AS-IS] retrieval port + open-core scaffolds (split into reviewable PRs)#297
Draft
ohdearquant wants to merge 1 commit into
Draft
Conversation
…hannel / calendar / skills
STAGING BRANCH — for tomorrow's review and split into individually reviewable PRs.
Do not merge as a single PR; the intent is to break this down per concern.
What lands here:
1. Retrieval port from khive-internal/platform/retrieval (this session's earlier compact arc):
- khive-hnsw (HNSW with INT8 quantized two-phase search; ~9K LOC + tests)
- khive-bm25 (Okapi BM25 with deterministic scoring; ~5K LOC + tests)
- khive-fusion (RRF + Weighted + Union fusion; ~1.5K LOC + tests)
- khive-retrieval (hybrid composer over the above; ~12K LOC + tests)
- khive-fold/src/objective/registry.rs (NEW — ObjectiveRegistry<T> for dynamic
dispatch; adapted to OSS Selection.item API; parking_lot dep added)
- Tests: ~627 across the new code; all green via cargo check --workspace
2. Open-core surface scaffolds (intent in doc comments; impl tomorrow):
- khive-pack-comm — communication verb pack (declares note_kind=message)
- khive-pack-skills — skills verb pack (agent-discoverable directives)
- khive-channel — ChannelHandler trait + envelope types
- khive-channel-gmail — Gmail reference impl
- khive-channel-macos-mail — Mail.app via AppleScript / MailKit
- khive-channel-macos-imessage — Messages + iMessage via chat.db
- khive-calendar — CalendarHandler trait + event envelope types
- khive-calendar-google — Google Calendar reference impl
- Each lib.rs is doc-comment only; preserved AppleScript reference impls
(mail_bridge.applescript, cal_bridge.applescript, test_mail_sync.sh) live
under the respective crate's docs/reference/ for tomorrow's wiring pass.
3. Workspace update:
- crates/Cargo.toml registers the 12 new crates
Strategy + decisions captured separately in .khive/notes/ (gitignored — local
working memory). Tomorrow's session will read those, split this branch into
focused PRs (retrieval, fold registry, comm scaffolds, channel scaffolds,
calendar scaffolds, skills), and merge per concern.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 22, 2026
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.
Do not merge this PR as-is. This is a staging snapshot for tomorrow's review. Ocean and λ_khive will split this into individually reviewable PRs per concern before any merge to
main.What's in this snapshot
1. Retrieval port from
khive-internal/platform/retrievalVerified, formally-proof-paired implementation ported into OSS as 4 separate crates (one crate ↔ one proof tree):
khive-hnsw— HNSW with INT8 quantized two-phase search (~9K LOC + tests)khive-bm25— Okapi BM25 with deterministic scoring (~5K LOC + tests)khive-fusion— RRF + Weighted + Union fusion strategies (~1.5K LOC + tests)khive-retrieval— hybrid composer over the above (~12K LOC + tests)Plus
khive-fold/src/objective/registry.rs(NEW —ObjectiveRegistry<T>for dynamic objective dispatch; adapted to OSSSelection.itemAPI;parking_lotdep added to khive-fold).Tests: ~627 across the new code;
cargo check --workspaceclean.2. Open-core scaffolds for pack-comm / channel / calendar / skills
Doc-comment-only scaffolds; impl is tomorrow's work. Strategy locked in a separate decision record (local working note, not in this PR).
khive-pack-commnote_kind=message)khive-pack-skillskhive-channelChannelHandlertrait + envelope typeskhive-channel-gmailkhive-channel-macos-mailkhive-channel-macos-imessagekhive-calendarCalendarHandlertrait + event envelope typeskhive-calendar-googlePreserved AppleScript reference impls (
mail_bridge.applescript,cal_bridge.applescript,test_mail_sync.sh) live under the respective crate'sdocs/reference/for tomorrow's wiring pass.3. Workspace update
crates/Cargo.tomlregisters the 12 new crates.Suggested PR split for tomorrow
Each of these can land as its own PR with focused review:
khive-foldregistry port — addsObjectiveRegistry<T>+parking_lotdep. Tiny, lowest-risk first.khive-hnsw+khive-bm25+khive-fusion+khive-retrieval. Largest. Could optionally split further by crate.khive-channel+khive-pack-comm. Trait + pack that consumes it.khive-channel-gmail+khive-channel-macos-mail+khive-channel-macos-imessage. Three impls of the same trait; could be one PR or three.khive-calendar+khive-calendar-google. Mirrors the channel pattern.khive-pack-skills. Smallest scaffold, independent.Test plan
cargo check --workspace— verified clean locally before pushcargo test --workspacefor retrieval crates — verified ~627 tests pass locallynote_kind=message, edge endpoint rules) before any pack-comm impl🤖 Generated with Claude Code