feat: 情报库检索忽略过时情报(可配置有效期) - #42
Open
moliyu1101 wants to merge 3 commits into
Open
Conversation
lookup_intel 四类检索新增 INTEL_MAX_AGE_SECONDS(默认 7 天)按 last_seen 过滤过期凭证/端点,避免持续注入失效情报造成误用与 token 浪费。cutoff 用 naive UTC 与 SQLite 存储形态一致,防 aware/naive 比较出错。
与情报有效期特性配套,声明默认值 7 天。
用内存 SQLite 验证 lookup_intel 丢弃过时情报、保留有效期内情报。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景:app/agents/intel.py 情报库只维护 last_seen 与 hit_count,无过期机制。过时凭证、已失效端点会被持续注入给后续 Worker,造成误用与 token 浪费。
修改:
验证:python -m unittest tests.test_intel_freshness -v 通过。