Skip to content

feat(memory): validate temporal_decay_rate config value on deserialization #1777

@bug-ops

Description

@bug-ops

The temporal_decay_rate field in GraphConfig accepts NaN and Inf from TOML without validation. A NaN value causes degraded recall quality (NaN scores) without crashing.

Add clamping/validation on deserialization: reject negative values, NaN, and Inf. Clamp to [0.0, 10.0] range or error on invalid input.

Found by: security audit in feat/issue-1341 (SEC-T-02, low severity).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmemoryzeph-memory crate (SQLite)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions