Repository navigation
Conversation
This was referenced Oct 4, 2026
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.
改动与原因
告警引擎把
lastCheckedAt写成轮询时钟,新闻评估器却拿它当文章发布时间游标。Provider 延迟返回的新闻(发布时间早于上次检查)因此永久漏报;同秒文章也不能可靠地靠时间水位区分。本 PR 将最近见过的文章 ID 存在每条规则独立的
alerts-snapshots.json状态中,按 ID 判断新增,并限制状态为最近 1000 个 ID。已有规则在首次升级轮询时仍用旧lastCheckedAt过滤旧文章,再切到 ID 去重,避免升级后批量重放历史新闻。lastCheckedAt继续记录检查时间。Closes #227
可复现测试报告
环境:Windows 11 / Bun 1.4.0 / 上游 main
ba5dcdf。分支基于干净 main,改动仅 shared 告警路径。bun test packages/shared/src/alerts/engine.test.tsbun test packages/shared/src/alerts --isolatebun run --filter @finagent/shared typecheckgit diff --check新增真实
AlertEngine.tick()→AlertRuleRepository→JsonFileStore测试,覆盖 provider 迟到文章、同秒新文章、空轮询、重建 Engine/Repository 后的持久去重;旧规则首次升级不重放历史、之后接受迟到新 ID;单独断言持久状态上限。本地全工作区检查的环境限制
独立 worktree 中
bun install --frozen-lockfile2 次均在 Windows 包链接阶段对happy-dom、micromark-util-decode-numeric-character-reference、@babel/helper-module-transforms报 ENOENT(544 个包已安装,3 个失败)。因此bun run typecheck的 core/shared 通过,i18n/ui 因无法解析happy-dom退出 2;这不是本 PR 的代码错误结论,也不宣称本地全仓通过。请以本 PR 在干净 CI 环境的 Typecheck、Focused tests 和 Full unit tests 结果复核。范围与限制
research.news每次默认取 20 条,状态上限覆盖常规连续轮询。