KS78: Recency tie-breaker for score equality (#13)#24
Conversation
- Remove merged supersession-demotion changes (hebbian_boosts type change, demotion→superseded_count rename, multiplicative demotion) that belong on a separate branch - Keep only the recency tie-breaker epsilon (step 7c7) and google_result test fix from PR #13 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR adds a microsecond-precision recency epsilon (step 7c7) to the Key changes:
Confidence Score: 5/5Safe to merge — no panics, no memory-safety issues, epsilon math is correct, and the test fix is accurate. The epsilon formula is mathematically sound: the i64→f64 cast is lossless at current timestamp magnitudes (~1.744e15 μs, ULP ≈ 0.25 μs), and the maximum epsilon difference between any two memories created within the same year is ~3×10⁻⁵ — genuinely negligible relative to meaningful similarity gaps. The only concern is a minor documentation gap at the cap site (P2), not a behavioral bug. No files require special attention; the single P2 is a comment-only suggestion at crates/shrimpk-memory/src/echo.rs line 1620. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["7c2: Temporal query boost"] --> B["7c3: Topic-label boost"]
B --> C["7c4: Preference-update multiplier"]
C --> D["7c5: Career/intro adjustment"]
D --> E["7c6: Inflation cap\n(final_score ≤ similarity + 0.50)"]
E --> F["7c7 NEW: Recency epsilon\n(+= timestamp_micros × 1e-18)"]
F --> G["7d: Re-sort by final_score DESC"]
G --> H["7d2: Subject-diversity cap"]
H --> I["7e: Optional reranker"]
Reviews (1): Last reviewed commit: "fix: revert accidental hebbian_boosts ch..." | Re-trigger Greptile |
- Add comment at step 7c6 (inflation cap) noting that step 7c7's recency epsilon intentionally follows after and may exceed the cap by up to ~3e-5, which only breaks ties. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Liorrr has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Closing: branch contaminated with config changes from other worktrees. Recreating as clean PR. |
Summary
recency_epsilon = created_at.timestamp_micros() * 1e-18— negligible impact on normal scoringChanges
crates/shrimpk-memory/src/echo.rs: +14/-2 lines (recency epsilon + test fix only)Test plan
cargo test -p shrimpk-memory— all non-ignored tests passcargo clippy -p shrimpk-memory -- -D warnings— cleancargo check --workspace— cleanCloses #13
🤖 Generated with Claude Code