Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
310421d
chore: introduce screening module and related components
Jun 18, 2026
3f7294b
chore: refactor screening models and scoring logic for improved clari…
Jul 1, 2026
2036527
chore: rename API endpoint constants for improved clarity
Jul 1, 2026
c419de8
chore: implement screening input and use case structure with validation
Jul 2, 2026
4c91754
chore: add project documentation and guidelines for memory maintenanc…
Jul 4, 2026
2ae43e6
chore: enhance screening interactor with additional repositories and …
Jul 4, 2026
63e4cd6
chore: extend screening struct with additional repositories and metri…
Jul 4, 2026
a5d801e
chore: refactor screening candidate and metrics conversion logic
Jul 4, 2026
e07f270
chore: add screening module with output, presenter, and response stru…
Jul 4, 2026
f0b4ccc
chore: add product_category field to company models and implement que…
Jul 8, 2026
12d8a9a
chore: implement stock retrieval by date with new query structure
Jul 19, 2026
ca2b357
chore: add base date price retrieval and enhance screening metrics
Jul 24, 2026
cc7bfd7
chore: add min_total_score to screening input and update screening logic
Jul 31, 2026
73f7757
chore: update expected RowStatement values in jquants_api test
Aug 2, 2026
53a2cb5
chore: implement screening controller and main execution logic
Aug 2, 2026
3d86fe5
chore: enhance screening logic with multiple value score policies
Aug 5, 2026
d62cb0b
chore: update screening logic to support multiple markets input
Aug 5, 2026
43be8f5
chore: enhance JQuants API integration with full year statement fetch…
Aug 6, 2026
6b75535
chore: enhance financial metrics fetching and selection logic for ful…
Aug 6, 2026
696ccf7
chore: improve error handling for unavailable statements and rate lim…
Aug 6, 2026
c38bffe
chore: update product_category handling and improve company structure…
Aug 8, 2026
1554a67
chore: add screening policy details for J-Quants master data
Aug 10, 2026
7d164de
chore: implement DSV repository for statement handling and add relate…
Aug 10, 2026
92c3f9d
chore: add current fiscal year end date to statement models and updat…
Aug 11, 2026
2db4669
chore: implement fetch scoring data functionality and related structures
Aug 17, 2026
b8eef26
chore: implement ScoreStock interactor and related structures for sco…
Aug 23, 2026
b5431f8
chore: add ScreenStocks module with input and output structures for s…
Aug 25, 2026
1ff99ea
chore: enhance scoring data structures with timestamps for fetching a…
Aug 26, 2026
b3b4d33
chore: add fetch scoring data functionality and related structures
Aug 31, 2026
c6f0c01
chore: implement ScoreStock controller and related structures for sco…
Sep 2, 2026
85a9565
chore: add new technical analysis models for ATR, RSI, Bollinger Band…
Sep 7, 2026
2cd7880
chore: refactor scoring model and update related imports
Sep 7, 2026
49b518d
chore: update README to clarify scoring universe policy terminology
Sep 7, 2026
021a1a4
chore: add technical analysis module with interactor, controller, inp…
Sep 11, 2026
635e743
chore: rename BodyEngulfing to BullishEngulfing and BearishEngulfing …
Sep 12, 2026
28485c7
chore: remove DirectionType from EventFact and update related event k…
Sep 12, 2026
1e080c1
chore: update file paths for scoring data and companies assets
Sep 12, 2026
7ec5e7c
chore: update SAMPLE_CODE constant to reflect new value
Sep 12, 2026
c2e2885
chore: update dependencies and refactor query string handling in jqua…
Sep 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 本プロジェクトはRustによる株価・財務指標分析ツール(README参照)。ヘキサゴナルアーキテクチャを崩さず、`domain`/`use_case`
でロジック、`infrastructure`/`presenter`で外部適合を行う。
- `domain`/`use_case` は `infrastructure`/`presenter` に依存してはならない(逆方向依存のみ許可)。

## 開発ガイドライン

Expand All @@ -15,6 +16,14 @@
- Focus areas: Error handling, API design, performance, interoperability
- Tools: rustfmt, clippy, cargo-audit

### 必須品質ゲート

- Rustコードを変更した場合は、最低限以下を実行する:
- `cargo fmt --check`
- `cargo clippy --all-targets --all-features -- -D warnings`
- `cargo test --all-features`
- 上記のうち、環境要因で実行不能なものがある場合は理由を明記する。

### Code Review Checklist

- [ ] Follows error handling patterns from guidelines
Expand All @@ -27,19 +36,57 @@
When using AI coding assistants, reference the guidelines file:
"Please follow the Microsoft Rust guidelines in `~/rust-guidelines.txt`"

### ツール利用方針

- コード探索・シンボル解析・参照追跡は **Serena** の利用を明示的に優先する。
- `rg` / `glob` は Serena で不足する範囲の補助として利用する。

### git-secrets 運用方針

- `git secrets --aws-provider` は有効なまま運用し、無効化で回避しない。
- `~/.aws/credentials` に `test` / `dummy` などの低エントロピー値を置かない。
- 誤検知が出た場合、まず provider 入力(credentials)を是正し、それでも必要な場合のみ `.gitallowed` に最小範囲で例外を追加する。

## コミュニケーション

- 非自明なアルゴリズムやデータ変換を触る際は簡潔なコメントで意図を共有。冗長な説明は避ける。
- 実行結果や差分を示す際はファイルパスをバッククオートで明示し、必要に応じて再現コマンドも提示。
- 不確実な点や既存の変更がある場合は、即座にユーザへ確認を取りながらペアプロする姿勢を保つ。
- 完了報告では、最低限「変更ファイル」「変更意図」「未検証項目(あれば)」を明記する。

## 実装責任の永続ルール

- 実装者は常にユーザーとし、AIアシスタントはメンター(手順提示・設計相談・レビュー)として振る舞う。
- ユーザーから明示的に「コードを書いて」「編集してよい」と指示されるまで、AIアシスタントはコード編集・ファイル変更・パッチ適用を行ってはならない。
- AIアシスタントが編集を提案する場合でも、実行前に必ずユーザー許可を確認し、許可が出るまで実行しない。

## 参照スキルガイド (Skills)

特定のタスクを実行する際は、必ず以下の対応するドキュメントを参照し、その指針に従ってください。

- Rustコードの実装・修正・リファクタリングを行う場合は `coding-standards` を必ず参照する。
- テスト追加・更新、またはテスト実行手順に触れる場合は `testing-practices` を必ず参照する。

- **coding-standards**
- Rust コード変更時の設計指針・レビュー前手順
- 📄 `.github/skills/coding-standards/SKILL.md`
- **testing-practices**
- テスト実行順序・品質ゲート・ログ共有手順
- 📄 `.github/skills/testing-practices/SKILL.md`

## J-Quants レート制限と責務分離(常時参照)

- 最終確認日: 2026-08-12
- 公式仕様: `https://jpx-jquants.com/ja/spec/rate-limits`
- Lightプラン上限: **60リクエスト/分**
- エンドポイント個別上限(プラン非依存):
- `/v2/fins/summary`: 60/分
- `/v2/fins/details`: 60/分
- 超過時: HTTP `429 Too Many Requests`
- 大幅超過継続時: 約5分の全面遮断が発生し得る

### 本プロジェクトの責務

- 本プロジェクトはライブラリとして他プロジェクトから利用される前提。
- レート制御(上限制御、スロットリング、バックオフ、再試行ポリシー)は**呼び出し側プロジェクトの責務**とする。
- 本ライブラリ側は429等の結果を明示的に返し、呼び出し側が制御判断できる設計を優先する。
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

examples/**/*.svg
examples/**/*.tsv
examples/**/*.json

/target

Expand Down
2 changes: 2 additions & 0 deletions .serena/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/cache
/project.local.yml
7 changes: 7 additions & 0 deletions .serena/memories/architecture/data_flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- Typical flow: controller `analyze` -> use_case interactor `handle` -> repository traits -> infra adapters -> domain model computations -> presenter `handle` -> response DTO.
- Trend analysis interactor orchestrates:
- company + stocks fetch
- SMA/MACD/candlestick derivations
- crossover and trend reversal aggregations
- output struct consumed by presenter.
- Financial indicator interactor fetches latest valid stock in ~1 week window and latest statement, then builds domain `FinancialIndicator`.
6 changes: 6 additions & 0 deletions .serena/memories/architecture/layers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Hexagonal boundary is strict: logic in `domain`/`use_case`, adapters in `infrastructure`/`presenter`.
- `controller` composes `use_case` interactor + presenter and maps external input into use-case input DTOs.
- `domain/repositories/*/repository.rs` defines async traits with default conversion from row models to domain models.
- `use_case/interfaces/*` defines interactor traits; `use_case/interactors/*` implements them.
- Infrastructure implements repository traits (e.g. `impl repository::Stock for JQuantsAPI`).
- Presenter traits accept use-case outputs and return response/view DTOs (JSON/Chart etc.).
6 changes: 6 additions & 0 deletions .serena/memories/conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Keep business logic in `domain`/`use_case`; adapters only in `infrastructure`/`presenter`.
- Prefer `Result` and custom error types; avoid `unwrap`/`expect` outside tests or initialization.
- Public APIs should use meaningful types and borrowed inputs like `&str`/`&[T]` where practical.
- Avoid unnecessary allocations and clones; prefer iterators and standard traits.
- Add short comments only where intent is non-obvious.
- Preserve existing style and minimize changes to touched modules.
5 changes: 5 additions & 0 deletions .serena/memories/core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Rust library for quantitative data analysis; preserve hexagonal boundaries: `domain`/`use_case` own business logic, `infrastructure`/`presenter` adapt external systems.
- When working in Rust code, consult `mem:tech_stack`, `mem:conventions`, and `mem:task_completion` as needed.
- Project-wide rule: do not let `domain`/`use_case` depend on `infrastructure`/`presenter`.
- J-Quants rate-limiting is caller responsibility; this library should surface 429s clearly rather than hide them.
- Use Serena for symbol-aware discovery/editing before falling back to raw file tools.
25 changes: 25 additions & 0 deletions .serena/memories/jquants/rate-limit-and-responsibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# J-Quants レート制限(重要・常時参照)

## 公式情報(最終確認)
- 確認日: 2026-08-12
- 参照URL: https://jpx-jquants.com/ja/spec/rate-limits

## レート制限(V2)
- Lightプラン: 60リクエスト/分
- 参考: Free 5/分, Standard 120/分, Premium 500/分
- エンドポイント個別制限(プラン非依存):
- /v2/fins/summary: 60/分
- /v2/fins/details: 60/分
- アドオン専用API制限(ベースプランと独立):
- 株価 分足・ティック: 60/分
- TDnet/適時開示情報: 100/分
- 超過時: HTTP 429 Too Many Requests
- 大幅超過継続時: 約5分間の全面遮断の可能性

## このプロジェクトでの責務分離(重要)
- 本プロジェクトはライブラリとして他プロジェクトから利用される前提。
- リクエスト回数の上限制御・スロットリング・バックオフ・再試行ポリシー等の運用制御は、原則として**呼び出し側プロジェクトの責務**とする。
- 本ライブラリは必要に応じて429等を明示的に返し、呼び出し側が制御判断できる設計を優先する。

## 運用メモ
- 仕様変更の可能性があるため、回答時は上記URLを優先参照し、必要に応じて再確認する。
33 changes: 33 additions & 0 deletions .serena/memories/memory_maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Memory Maintenance

## Discovery Model

- Core principle: progressive discovery through references, building a graph of memories.
- Initially, agents are provided with the list of all memories (names only).
- Agents should read `mem:core` as the top-level entry point (graph root).
This memory should contain references to other memories covering major project domains.
The referenced memories shall, in turn, shall contain references to even more specific memories, and so on.
The depth of the graph shall depend on the project complexity.
- Use topics/folders to group related memories in order to make the content structure explicit.
Folders can mirror project structure (e.g. modules like frontend/backend) or topics like debugging, architecture, etc.
- Memory references must use a mem: prefix inside backticks, e.g. `mem:frontend/core`.
The surrounding text should clearly indicate when to read the memory/which content to expect.
The text should provide more precise guidance than the memory name alone,
i.e. avoid a reference like "frontend debugging: `mem:frontend/debugging` and instead make clear which aspects of frontend debugging are covered.
- Memories themselves should not contain information about when to read them; this is the responsibility of the referring memory.

## Style

Dense agent notes, not prose docs. Prefer invariants, terse bullets.
Avoid obvious context, rationale, and examples unless they prevent likely mistakes.
Keep guidance durable and generalizable, not task-local.

## Add/update threshold

Add or update memories only with stable, non-obvious project conventions that avoid complex rediscovery in the future.
Do not add: quick-read facts; generic language/framework knowledge; one-off task notes; volatile line-level details; behavior likely to change soon.

## Maintenance Actions

- Renaming memories: References are updated automatically if handled via Serena's memory rename tool.
- Checking for stale memories (e.g. after deletion): Call `serena memories check` for a report.
19 changes: 19 additions & 0 deletions .serena/memories/preferences/collaboration-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# コラボレーション運用ルール(永続)

## 進め方
- 各フェーズで必ずユーザー確認を挟む。
- タスク分割は「意味のある最小単位」を優先する。
- 1ステップごとに目的・完了条件を短く示し、完了後に次ステップ着手前確認を行う。

## 実装スタイル
- ユーザーが自分でコードを書く前提(写経スタイル)で進める。
- ユーザーが明示的に「コードを生成して」と依頼するまで、AIはコード編集・生成・パッチ適用を行わない。
- それまでは、手順・差分方針・確認観点・レビューに徹する。

## 現在の技術コンテキスト
- 対象は `quantitative-data-analysis-rs`。
- 今フェーズは `aws_lambda_trend_analysis` を変更しない。
- 命名固定: `fetch_scoring_data` / `score_stocks` / `screen_stocks`。
- 出力先は `assets/` 配下。
- 後方互換は不要(破壊的変更可)。
- controllerレイヤー起点の3段実行を想定。
6 changes: 6 additions & 0 deletions .serena/memories/suggested_commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- `cargo fmt`
- `cargo clippy --all-targets --all-features`
- `cargo test --all-features`
- `cargo nextest run --all --all-features` when longer CI-like validation is needed
- `cargo audit` when dependency/security checks are needed
- macOS shell behavior is standard bash/zsh; use normal GNU-style command forms unless a tool output says otherwise.
4 changes: 4 additions & 0 deletions .serena/memories/task_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- For Rust changes, run: `cargo fmt --check`, `cargo clippy --all-targets --all-features -- -D warnings`, `cargo test --all-features`.
- If formatting or linting fails, fix the code and rerun the same command set.
- If dependency/security posture changes matter, add `cargo audit`.
- Report changed file paths in backticks and keep any command output summary concise.
5 changes: 5 additions & 0 deletions .serena/memories/tech_stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Language: Rust.
- Architecture: hexagonal layout with `domain`, `use_case`, `infrastructure`, `presenter` under `src/`.
- Quality tools: `cargo fmt`, `cargo clippy --all-targets --all-features`, `cargo test --all-features`.
- Additional security check when relevant: `cargo audit`.
- Follow Microsoft Pragmatic Rust Guidelines from `~/rust-guidelines.txt`.
Loading
Loading