feat: upgrade from health-check tool to investment research system#15
Merged
ShuhaoQing merged 6 commits intomainfrom Apr 8, 2026
Merged
feat: upgrade from health-check tool to investment research system#15ShuhaoQing merged 6 commits intomainfrom
ShuhaoQing merged 6 commits intomainfrom
Conversation
Phase 0: Migrate data directory from ~/.haoinvest/ to project-local .haoinvest/ for easier IDE browsing. Existing DB copied over. Phase 1a: Expand eastmoney RPT_LICO_FN_CPD from 6 fields to ALL (37), adding dividend yield, revenue/profit growth, EPS, BPS, cash flow per share. These were already in the API response but not extracted. Phase 1b: Support multi-period financial data (periods parameter) for historical trend analysis across quarterly reports. Phase 1c: Create skill reference files in references/ directory: - a-share-analysis-framework.md (5-dimension analysis for A-shares) - valuation-guide.md (relative valuation, industry-specific PE/PB) - position-management.md (add/reduce/rotate decision framework) - stock-screening-workflow.md (top-down screening with strategies) Phase 1d: Simplify hardcoded valuation judgments — code now outputs data-focused labels (PE/PB values) instead of absolute verdicts. Deep interpretation delegated to Claude via reference files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add screen_stocks() via eastmoney xuangu API with filters (PE, PB, ROE, market cap, dividend yield) and sector_flow() via push2 endpoint (beta). New CLI commands: `market screen` and `market sector-flow`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add InvestmentThesis model, DB table + CRUD, and CLI commands (add, list, show, invalidate, realize, review). Guardrails alerts now check for overdue thesis reviews and prefer structured theses over journal entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create vault directory structure with note templates (个股/政策). Update SKILL.md with screening, thesis, and Obsidian workflows. Add reference files and command docs for new Phase 2-3 features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ignals - Add `trends` analysis module: multi-period financial data (ROE, revenue growth, profit margin, EPS across 8 quarters) - Add PE/PB percentile within sector peers for relative valuation - Volume confirmation now votes (+1) in signal aggregation when anomaly detected, boosting confidence for volume-confirmed signals Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add json.loads exception handling in thesis CLI (friendly error message) - Fix config.py docstring (data/ → .haoinvest/) - Add THESIS_REVIEW AlertType instead of reusing GAIN_REVIEW - Unify get_financial_indicators return type to always list[dict] - Use bisect for O(log n) percentile calculation in peer comparison - Add _project_root() fallback warning log - Add screen_stocks PE exclusion note in docstring - Remove redundant datetime import in alerts.py - Add tests: thesis CRUD (7 tests), thesis review alerts (3 tests) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Transforms haoInvest from a stock "health check" tool into a full investment research system across 5 phases:
.haoinvest/, expanded eastmoney financial fields (37→ALL columns), multi-period data (8 quarters)market screen) and sector capital flow (market sector-flow)Changes (27 files, +1468/-124)
eastmoney.py(screening, sector flow, expanded fields)models.py(ThesisStatus, InvestmentThesis, expanded BasicInfo)db.py(investment_theses table + CRUD)trends.py(new),peer.py(percentiles),signals.py(volume voting),registry.py(8 modules)market.py(screen, sector-flow),portfolio.py(thesis subcommands)alerts.py(thesis review alerts)SKILL.md(workflows),references/(4 framework files)config.py(project-local data dir)Test plan
pytest— 346 passed, 15 deselected (integration)ruff check .— cleanruff format --check .— cleanuv run haoinvest market screen --pe-max 20 --roe-min 15uv run haoinvest portfolio thesis add 600519 1500 "test"uv run haoinvest analyze run 600519 --modules trends🤖 Generated with Claude Code