Skip to content

fix retriever hardMinScore after decay#766

Merged
rwmjhb merged 2 commits into
CortexReach:masterfrom
TurboTheTurtle:fix-hard-min-score-after-decay
May 13, 2026
Merged

fix retriever hardMinScore after decay#766
rwmjhb merged 2 commits into
CortexReach:masterfrom
TurboTheTurtle:fix-hard-min-score-after-decay

Conversation

@TurboTheTurtle
Copy link
Copy Markdown
Contributor

Summary

Fix hardMinScore so it acts as a final returned-score floor after time/lifecycle decay instead of only as a pre-decay gate.

  • Move the hard cutoff after time_decay / decay_boost in vector, BM25-only tag, and hybrid retrieval paths.
  • Update diagnostics/drop summary ordering so timeDecay feeds hardMinScore, and noiseFilter receives already hard-filtered results.
  • Add a regression covering both vector and hybrid paths where a candidate starts above hardMinScore, decays below it, and must be dropped.

Fixes #699

Validation

  • node test/retriever-rerank-regression.mjs
  • node --test test/query-expander.test.mjs
  • git diff --check

Notes

node --test test/retriever-decay-recency-double-boost.mjs still fails on current master because the test constructs MemoryRetriever with { decayEngine } as the fourth constructor arg, but the class expects the decay engine object directly. This appears unrelated to this change.

@rwmjhb
Copy link
Copy Markdown
Collaborator

rwmjhb commented May 9, 2026

Please rebase this branch on current master and rerun CI before merge.

The fix is still valuable, but the branch is behind current master and the current check rollup includes packaging/core failures. After rebase, the remaining diff should stay focused on hardMinScore after decay plus its regression test.

@TurboTheTurtle TurboTheTurtle force-pushed the fix-hard-min-score-after-decay branch from 8278a38 to 68fb179 Compare May 12, 2026 07:52
Copy link
Copy Markdown
Collaborator

@rwmjhb rwmjhb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #766 Review: fix retriever hardMinScore after decay

Verdict: APPROVE | 6 rounds completed | Value: 51% | Size: MEDIUM | Author: TurboTheTurtle

Value Assessment

Problem: The retriever currently applies hardMinScore before time/lifecycle decay, allowing final returned scores to fall below the configured floor. This makes strict negative-query suppression and diagnostics misleading for users tuning retrieval quality.

Dimension Assessment
Value Score 51%
Value Verdict review
Issue Linked true
Project Aligned true
Duplicate false
AI Slop Score 0/6
User Impact medium
Urgency medium

Scope Drift: 3 flag(s)

  • index.ts: exporting isLayer1CircuitOpen appears unrelated to issue #699 and adds public API surface for a testability concern
  • test/issue606_sdk-migration.test.mjs: jiti-based loading and plugin SDK aliasing are not justified by the hardMinScore-after-decay problem statement
  • src/decay-engine.ts: including ds.recency in searchFloor changes lifecycle decay scoring semantics beyond enforcing hardMinScore as a final floor

Open Questions:

  • Should isLayer1CircuitOpen become public API, or should the test avoid exporting an internal helper?
  • Is the src/decay-engine.ts recency-floor change intentionally part of fixing #699, or should it be separated into its own PR?
  • The PR is marked stale_base=true; maintainers should confirm the branch has been rebased on current master before merge.

Summary

The retriever currently applies hardMinScore before time/lifecycle decay, allowing final returned scores to fall below the configured floor. This makes strict negative-query suppression and diagnostics misleading for users tuning retrieval quality.

Evaluation Signals

Signal Value
Blockers 0
Warnings 0
PR Size MEDIUM
Verdict Floor approve
Risk Level high
Value Model codex
Primary Model codex
Adversarial Model claude

Nice to Have

  • F1: Raw recency bypasses lifecycle weighting
  • F2: Regression test misses lifecycle and BM25-tag paths
  • MR1: Diagnostic dropSummary stage names shifted at fixed order positions — breaking change for consumers keyed by order
  • MR2: isLayer1CircuitOpen exported as public API solely for a test that the test itself flags as 'internal'
  • MR4: Stale-base flag is true but build was skipped — no confirmation the post-rebase tree compiles

Recommended Action

Ready to merge.


Reviewed at 2026-05-12T16:05:10Z | 6 rounds | Value: codex | Primary: codex | Adversarial: claude

@rwmjhb rwmjhb merged commit e343d00 into CortexReach:master May 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

retriever: hardMinScore is applied before decay, so final returned scores can fall below the configured threshold

2 participants