Repository navigation
Release v0.6.1: Hub Sync State Persistence & BM25 Search Scoring Symmetry
Release v0.6.1 is a maintenance and reliability patch addressing two critical operational areas: state persistence in zero-knowledge hub synchronization and scoring symmetry/stemming precision in the in-memory BM25 search engine.
1. Bug Fixes & Improvements
Hub Sync State Persistence Across CLI Invocations (#51, #53)
- Problem: Each CLI invocation (
okf hub push|pull|sync) spawns a freshsync.Engineprocess. Previously,cachedHeadandcachedTreewere maintained exclusively in memory. Consequently, subsequent pushes lacked the expected head hash and were rejected by the hub CAS with409 head_mismatch. Subsequentsyncruns reconciled against an empty base tree, erroneously classifying legitimate local edits as collisions and moving them to*.conflict-local.md. Furthermore, every push re-encrypted and re-uploaded the entire bundle, bypassing plaintext hash deduplication. - Resolution: Persisted the sync position (
version,vault_id,head,tree,saved_at) in<bundle>/.okf/sync-state.json. Because.okf/is a hidden directory,ScanBundleautomatically ignores it, ensuring sync state is never uploaded. State files are written atomically via temp file and rename (0o700directory permissions). Missing, corrupt, or foreign-vault state files gracefully degrade to default empty-state behavior. - Credit: Implemented in PR #53 by @akushonkamen; reported with reproduction by @cdcore09.
BM25 Search Scoring Symmetry, Acronym Suppression & TF Caps (#42)
-
DF/TF Symmetry: Previously, Document Frequency (DF) used raw substring matching (
strings.Contains) over concatenated concept content, while Term Frequency (TF) operated over tokenized streams. This caused short acronyms (ci,ui,id) to match as substrings inside unrelated words (decision,require,identification), inflating DF to$N$ and collapsing IDF to near-zero. DF now uses the exact same tokenization and matching logic as TF. -
Short-Stem Prefix Matching: Term Frequency prefix matching (
strings.HasPrefix) previously matched short stems erroneously (e.g.logmatchinglogin). Query terms with fewer than 4 runes now enforce strict exact token matching (token == term). Prefix matching is permitted only for query terms with 4 or more runes. - Metadata TF Saturation Caps: Enforced bounded saturation caps across metadata fields (Title: 2.0, Tags: 2.0, Description: 3.0, ID: 2.0, Body: 5.0) to prevent keyword stuffing from inflating concept rankings.
- Credit: Reported and analyzed by @Khouloud-Kessentini.
Developer Tooling & Security Pipeline
- Dependency & Tool Updates: Added
make update-depsandmake update-toolsMakefile targets to streamline updating Go dependencies and development tools (govulncheck,golangci-lint,gofumpt,gosec). - Security Audit Target: Standardized security audit targets and integration within the local pipeline.
2. Knowledge & Architecture
- Updated architecture/search-tokenization to formally document DF/TF tokenization symmetry, stem length prefix rules (< 4 runes), and metadata frequency caps.
- Synchronized knowledge/log.md with concept mutation and release entries.
3. Community & Special Thanks
- @akushonkamen: For implementing persistent sync state across engine invocations in #53.
- @cdcore09: For the detailed bug reports and reproduction steps on lost sync state and index collision mechanics in #51 and #52.
- @Khouloud-Kessentini: For identifying and analyzing DF/TF asymmetry, acronym suppression, and prefix false positives in BM25 search scoring in #42.
4. Pre-Built Binaries
Pre-compiled standalone binaries for macOS, Linux, and Windows are available in the release assets on GitHub:
- macOS (
darwin/arm64,darwin/amd64) - Linux (
linux/amd64,linux/arm64) - Windows (
windows/amd64,windows/arm64)
Full Changelog
See commits between v0.6.0...v0.6.1 on GitHub.