Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b27e2ac
feat(pack-memory): wire khive-retrieval as recall composer (ADR-011/021)
ohdearquant May 25, 2026
be2fd2b
feat(pack-memory): expose top_k/fusion_strategy/score_floor knobs on …
ohdearquant May 25, 2026
1169b41
style(adr-033): deno fmt re-pad recall knob table (post-merge cleanup)
ohdearquant May 25, 2026
7402dda
feat(embedding): dual-model registry (MiniLM + paraphrase) per ADR-043
ohdearquant May 25, 2026
092170c
tune(recall): grid search infra + PARTIAL default changes
ohdearquant May 25, 2026
31f2595
fix(retrieval): correct doctest import — use re-export at crate root
ohdearquant May 25, 2026
d943b7f
revert(memory): keep RecallConfig defaults — corpus ceiling made chan…
ohdearquant May 25, 2026
539ae5b
fix(pack-memory): address PR #406 codex findings — top_k cast + stron…
ohdearquant May 25, 2026
54056ad
fix(embedding): address PR #407 codex findings — ADR amendment + 3 da…
ohdearquant May 25, 2026
be85904
docs(tune): document khive_contract dependency + run instructions
ohdearquant May 25, 2026
a9f5585
style: cargo fmt --all
ohdearquant May 25, 2026
d973c29
style: deno fmt ADR tables
ohdearquant May 25, 2026
0bf1927
fix(test): use single-token query matching all fixture memories
ohdearquant May 25, 2026
c194923
fix(test): align partial_config test with reverted default decay_model
ohdearquant May 25, 2026
8d52a8e
fix(embedding): codex round 2 — runtime-layer atomicity + ADR interna…
ohdearquant May 25, 2026
c3d8caf
ci: force re-trigger
ohdearquant May 25, 2026
36cfa61
ci: force re-trigger via doc whitespace touch
ohdearquant May 25, 2026
a275972
style: deno fmt
ohdearquant May 25, 2026
1a80278
Merge remote-tracking branch 'origin/main' into slice/v022/08-param-t…
ohdearquant May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/khive-pack-memory/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ pub struct RecallConfig {
pub fallback_during_migration: bool,
}

// Tuning artifact: tests/khive-contract/tune/ swept 116 configs but the synthetic corpus
// produced an identical recall@10 = 0.9333 for every config — i.e. a flat landscape that
// cannot empirically distinguish these parameters. Defaults below stay at the prior values
// until a harder corpus (embed-enabled, synonym queries, partial matches) provides signal.
// See tests/khive-contract/tune/REPORT.md for the analysis.
impl Default for RecallConfig {
fn default() -> Self {
Self {
Expand Down
18 changes: 14 additions & 4 deletions crates/khive-pack-memory/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ impl MemoryPack {
#[cfg(test)]
mod tests {
use super::*;
use crate::config::DecayModel;

#[test]
fn validate_memory_type_rejects_invalid() {
Expand Down Expand Up @@ -1046,9 +1047,14 @@ mod tests {

#[test]
fn compute_score_exponential_decay_at_decay_factor_half_life() {
let cfg = RecallConfig::default(); // temporal_half_life = 30 days, default decay_factor=0.01
// ADR-021 §5: importance_decayed = salience * exp(-decay_factor * age_days)
// At age = ln(2)/0.01 ≈ 69.3 days: importance_decayed ≈ 0.5
// Use explicit exponential decay config — not relying on default decay_model.
// ADR-021 §5: importance_decayed = salience * exp(-decay_factor * age_days)
// At age = ln(2)/0.01 ≈ 69.3 days: importance_decayed ≈ 0.5
let cfg = RecallConfig {
decay_model: DecayModel::Exponential,
temporal_half_life_days: 30.0,
..RecallConfig::default()
};
let age_days = std::f64::consts::LN_2 / 0.01;
let (_, bd) = compute_score(&cfg, 0.5, 1.0, 0.01, age_days);
assert!(
Expand All @@ -1063,7 +1069,11 @@ mod tests {

#[test]
fn compute_score_temporal_halves_at_temporal_half_life() {
let cfg = RecallConfig::default(); // temporal_half_life = 30 days
// Use explicit half_life=30 — not relying on default temporal_half_life_days.
let cfg = RecallConfig {
temporal_half_life_days: 30.0,
..RecallConfig::default()
};
let (_, bd) = compute_score(&cfg, 0.5, 1.0, 0.01, 30.0);
// At age = temporal_half_life = 30 days: temporal = exp(-ln2/30 * 30) = 0.5
assert!(
Expand Down
Loading
Loading