[Good first issue] 对比两份研究报告时,把重复的同一条风险只计一次

Open Beginner friendly
#226 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, typescript
Domain
backend

Research direction

Start with packages/shared/src/research-diff/diff-service.ts at the linked list comparison logic, then run bun test packages/shared/src/research-diff/diff-service.test.ts. Check how exact duplicate text in risks affects added and removed changes, and whether the same logic covers bullish reasons, bearish reasons, and catalysts. Done when the three offline cases in the issue pass, including preserving the original report content.

Written by the indexing model from the issue text.

Description

bug good first issue

对比两份报告时,摘要里的变化数量会受同一条文字重复出现的次数影响。用两份其余字段相同的报告调用 buildDiff,旧报告的 risks 是空数组,新报告写了两次 Supply disruption。当前会得到两条 new,摘要显示 2 material change(s)。调换新旧报告,也会得到两条 removed。列表比较逻辑

验收时可以用三个离线样例

  • 同一条风险重复出现两次,新增或移除都只产生一条变化,摘要计数与明细一致。
  • 两种不同风险均有记录,并按它们在报告里首次出现的顺序展示。
  • 同一条风险在两份报告里都出现,仅重复次数变化时不产生差异。保留原报告的内容。

这段逻辑也用于看多理由、看空理由和催化剂。本任务只比较完全相同的文字。可从 bun test packages/shared/src/research-diff/diff-service.test.ts 开始,欢迎评论 /claim 认领。

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
1d 1h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.