Skip to content

fix(mcp): decayed trust score not persisted back to SQLite on read #2312

@bug-ops

Description

@bug-ops

Problem

TrustScoreStore::get_score() applies asymmetric decay in-memory at read time but does not write the decayed value back to SQLite. The next read will re-apply decay from the stale persisted value, causing over-decay if multiple reads happen within the same decay window.

Fix

Either persist the decayed score on read (UPDATE trust_scores SET score = ? WHERE server_id = ?), or track last_decay_at timestamp and compute decay only when advancing to a new window.

Priority

P3 — over-decay is conservative (makes scores lower, not higher), so it does not create a security hole but may cause unnecessary tool filtering.

Related: PR #2310

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitybugSomething isn't workingmemoryzeph-memory crate (SQLite)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions