feat: include current holdings in pre-market AI prompt (#170) #174

Merged
jihoson merged 1 commits from feature/issue-170-holdings-in-prompt into main 2026-02-20 08:35:17 +09:00
Collaborator

Summary

  • generate_playbook() 및 _build_prompt()에 current_holdings 파라미터 추가
  • 보유 종목(종목코드, 수량, 매수가, 미실현손익%, 보유일수)을 Gemini 프롬프트의 ## Current Holdings 섹션으로 주입
  • AI가 후보 목록에 없더라도 보유 종목에 대한 SELL/HOLD 시나리오를 생성하도록 지시
  • _parse_response()에서 보유 종목 코드를 valid_codes에 포함

Test plan

  • test_build_prompt_includes_holdings_section
  • test_build_prompt_no_holdings_omits_section
  • test_build_prompt_empty_holdings_omits_section
  • test_build_prompt_holdings_instruction_included
  • test_generate_playbook_passes_holdings_to_prompt
  • test_holdings_stock_allowed_in_parse_response
  • 기존 53개 테스트 전체 통과

Closes #170

🤖 Generated with Claude Code

## Summary - generate_playbook() 및 _build_prompt()에 current_holdings 파라미터 추가 - 보유 종목(종목코드, 수량, 매수가, 미실현손익%, 보유일수)을 Gemini 프롬프트의 ## Current Holdings 섹션으로 주입 - AI가 후보 목록에 없더라도 보유 종목에 대한 SELL/HOLD 시나리오를 생성하도록 지시 - _parse_response()에서 보유 종목 코드를 valid_codes에 포함 ## Test plan - [x] test_build_prompt_includes_holdings_section - [x] test_build_prompt_no_holdings_omits_section - [x] test_build_prompt_empty_holdings_omits_section - [x] test_build_prompt_holdings_instruction_included - [x] test_generate_playbook_passes_holdings_to_prompt - [x] test_holdings_stock_allowed_in_parse_response - [x] 기존 53개 테스트 전체 통과 Closes #170 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-20 08:25:54 +09:00
feat: include current holdings in pre-market AI prompt (#170)
Some checks failed
CI / test (pull_request) Has been cancelled
b1f48d859e
- Add current_holdings parameter to generate_playbook() and _build_prompt()
- Inject '## Current Holdings' section into Gemini prompt with qty, entry
  price, unrealized PnL%, and holding days for each held position
- Instruct AI to generate SELL/HOLD scenarios for held stocks even if not
  in scanner candidates list
- Allow held stock codes in _parse_response() valid_codes set so AI-
  generated SELL scenarios for holdings pass validation
- Add 6 tests covering prompt inclusion, omission, and response parsing

Closes #170

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jihoson merged commit 7e6c912214 into main 2026-02-20 08:35:17 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#174