From d57bd0176de30bd57c9ee033d53c03c57d9e9687 Mon Sep 17 00:00:00 2001 From: Ries630 Date: Wed, 26 Aug 2026 17:16:01 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Investment=E7=94=9F=E6=88=90=E7=89=A9?= =?UTF-8?q?=E3=81=AE=E5=8F=82=E7=85=A7=E5=85=88=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移転後の入力先を既定値にし、回帰テストとエージェント向け文書を更新する。\n\nRefs #87 --- AGENTS.md | 4 ++-- docs/adr/README.md | 2 ++ lib/holdings.py | 2 +- tests/test_holdings.py | 7 +++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 232bc82..fa11fcc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -106,8 +106,8 @@ Slack 通知には `.env` が要る (`cp .env.example .env`)。未設定でも ## 他プロジェクトとの関係 -- **Investment** (`~/Documents/Claude/Projects/Investment`): 保有銘柄は - `output/report_data_*.json` の `stock.holdings` を読むだけ。module import はしない (疎結合)。 +- **Investment**: 実入力ディレクトリの正は `lib/holdings.py` の `INVESTMENT_OUTPUT`。 + `report_data_*.json` の `stock.holdings` を読むだけ。module import はしない (疎結合)。 Investment 側のファイルを書き換えないこと。 - **TradingCopilot**: コード共有はしない (コピー流用の慣習)。指標エンジンの移植元 → [ADR-0001](docs/adr/0001-separate-sibling-project.md) diff --git a/docs/adr/README.md b/docs/adr/README.md index 0f500e5..86bff57 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -45,6 +45,8 @@ ADR の役目。 将来の設計判断ではなく、実装に合わせて更新する比較表として管理する - **ジャーナルの書式**([#19](https://github.com/Ries630/StockCopilot/issues/19)) — 正は `journal/README.md` にあり、ADR にすると二重管理になる +- **Investment 生成物の既定入力先**([#87](https://github.com/Ries630/StockCopilot/issues/87)) + — 可逆的なローカルパス変更であり、`tests/test_holdings.py` が移転後の既定値を固定している ## 一覧 diff --git a/lib/holdings.py b/lib/holdings.py index 0ffb20e..13c9109 100644 --- a/lib/holdings.py +++ b/lib/holdings.py @@ -23,7 +23,7 @@ from lib.journal import Execution, load_executions -INVESTMENT_OUTPUT = Path("~/Documents/Claude/Projects/Investment/output").expanduser() +INVESTMENT_OUTPUT = Path("~/AgentProjects/Investment/output").expanduser() # テクニカル分析可能な資産クラス _ANALYZABLE_CLASSES = {"国内株式", "米国株式", "海外ETF"} diff --git a/tests/test_holdings.py b/tests/test_holdings.py index 8d4a052..e89e5ef 100644 --- a/tests/test_holdings.py +++ b/tests/test_holdings.py @@ -19,6 +19,13 @@ from lib import holdings, journal +def test_investment_output_uses_agent_projects_default() -> None: + """Investment の移転後ディレクトリを既定の入力先にする。""" + assert holdings.INVESTMENT_OUTPUT == ( + Path.home() / "AgentProjects" / "Investment" / "output" + ) + + def _report(**overrides) -> dict: """テスト用の report_data 相当の dict を組み立てる。""" data = {