Skip to content

fix(mcp): apply_delta() in probe paths operates on stale pre-decay score (load-before-delta gap) #2323

@bug-ops

Description

@bug-ops

Problem

In crates/zeph-mcp/src/manager.rs (lines ~583-591 and ~738-741), TrustScoreStore::apply_delta() is called in probe paths without a preceding load(). This means decay is not persisted before the delta is applied, so the delta operates on the stale (higher) stored score rather than the true decayed value.

Impact

Slightly more lenient effective trust scores for servers whose scores have decayed since last load(). The error is bounded by the decay accumulated since the last persisting read.

Fix

Ensure load() is called (and decay persisted) before apply_delta() in all probe paths in manager.rs. Consider a wrapper that atomically loads-and-applies.

Priority

P3 — conservative effect (slightly over-lenient scores), no security hole.

Related: #2312 (trust score decay persistence fix)

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitybugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions