Skip to content

test(research): cover signal scoping across security groups - #277

Open
adityaanikam wants to merge 1 commit into
TNT-Likely:mainfrom
adityaanikam:fix-research-group-signals
Open

adityaanikam wants to merge 1 commit into
TNT-Likely:mainfrom
adityaanikam:fix-research-group-signals

Conversation

@adityaanikam

@adityaanikam adityaanikam commented Nov 5, 2026 •

Copy link
Copy Markdown

Background

Closes #276. When more than max_group_size securities are bound, each group used to carry every signal and ResearchInput rejected it. #284 has since fixed this on main through ResearchInput.for_stocks, so this PR no longer changes production code.

Changes

Two tests in test_research.py use two groups with a signal for each security, one for the normal path and one for the risk evidence request.

Scope

Regression tests only.

Validation

Tested commit: 6d13f5b

Commands and results:

  • python -m pytest packages/pan-investment-research/tests -q: 119 passed.
  • With the signal filter in for_stocks removed locally, both new tests fail and none of the other tests in test_research.py do.
  • I did not run the rest of the backend suite or the frontend checks.

Acceptance evidence

Steps: run the two new tests, test_multi_group_scopes_signals_to_their_group and test_multi_group_evidence_request_scopes_signals_to_their_group.

Expected: both research runs complete with a recommendation for each security.

Observed: both pass at the tested commit.

Evidence: with the signal filter removed from for_stocks, both fail on signal outside research scope or analysis cutoff (assert 'review' == 'ready' and assert 'validation_failed' == 'complete').

Boundaries and risks

  • Tests only, no behaviour change.
  • Not tested against live market data or a real model.

Follow-up

None.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the pr:needs-work PanWatch contribution policy; see docs/pr-policy.md label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

PanWatch contribution check

The mechanical PR requirements are satisfied. Product acceptance, evidence quality and code review remain maintainer decisions.

Scope: 0 production files, 0 added + deleted production lines. Tests, Markdown docs and known lockfiles are excluded.

Contribution policy

本检查只核对材料与改动规模,不代表产品或实现已经验收。首次提示后有14天整改窗口;第7天提醒,逾期仍未达标自动关闭。维护者可用 pr:hold 暂停;关闭后仍可重开或提交拆分版本。

@github-actions github-actions Bot removed the pr:needs-work PanWatch contribution policy; see docs/pr-policy.md label Nov 6, 2026
@TNT-Likely

Copy link
Copy Markdown
Owner

@adityaanikam Thanks for this clean fix! The logic for scoping signals per group looks solid, and main's pre-existing backend test issue has now been resolved (#322).

However, this branch is currently behind main with merge conflicts. Could you please rebase onto the latest main, re-run the pan-investment-research tests, and update Tested commit: in the PR description? Once CI is green we can review and merge it quickly.

@adityaanikam
adityaanikam force-pushed the fix-research-group-signals branch from 2bdef39 to 6d13f5b Compare December 2, 2026 12:33
@adityaanikam adityaanikam changed the title fix(research): scope signals to each security group test(research): cover signal scoping across security groups Dec 2, 2026
@adityaanikam

Copy link
Copy Markdown
Author

Rebased onto the latest main. #284 already fixed the bug through ResearchInput.for_stocks, so I kept main's code and this PR now only adds the two regression tests. The research tests pass (119). I updated the title, description and tested commit. If you would rather not take a tests-only PR, I can close it along with #276.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] agent盘前分析盘后复盘报错

3 participants