跳到正文
GitHub·· 9 天前AI 评分38

MarketPulseWire:自托管 AI 市场信息雷达,聚焦半导体与 AI 基础设施

Stayfoool/MarketPulseWire

AI 导读

MarketPulseWire 是一个自托管 AI 市场信息雷达,把官方来源、公告、RSS、行业媒体和持仓相关新闻统一转为经证据校验的即时提醒、每日摘要或归档,重点覆盖半导体与 AI 基础设施。

正文

简体中文 | English

CI GitHub Release Python License: MIT

A self-hosted AI market-information radar that turns scattered official sources, filings, RSS feeds, industry media, and holding-related news into validated immediate alerts, daily-digest items, or archives.

MarketPulseWire is built for personal market and industry research, with a particular focus on semiconductors and AI infrastructure. It keeps credentials, portfolios, private decision rules, and runtime data on infrastructure you control, while providing Feishu delivery and a local Web workbench.

MarketPulseWire is not an investment adviser and does not generate buy/sell recommendations.

Why MarketPulseWire

Important market signals rarely arrive through one clean feed. They are spread across company announcements, official blogs, exchange disclosures, regional supply-chain media, research summaries, fast-news services, and social sources. A keyword alert catches too much noise; an unconstrained LLM cannot be trusted to decide what should be pushed.

MarketPulseWire addresses both problems:

  • One information flow: every admitted source becomes a NormalizedMarketItem and uses the same decision, storage, deduplication, delivery, and display path.
  • Evidence-validated decisions: the LLM evaluates reviewed private rules and must return exact minimum source evidence for every push or daily result.
  • Fail-closed behavior: model, schema, evidence, version, or private-audit failures create no valid DecisionResult and cannot enter delivery.
  • No source privilege: a source name, category, or content type cannot create immediate-push eligibility.
  • Self-hosted operation: credentials, portfolios, cookies, private rules, SQLite data, and sensitive decision audits stay outside Git.
  • Operational visibility: the Web workbench exposes market information, decision results, source profiles, task health, source health, feedback, settings, and holdings management.

Information Processing Flow

Every enabled source shares this structure. DecisionResult.action is the only authority for immediate-push eligibility.

flowchart LR
    Sources["Official sources · filings · RSS · industry media · holding news · optional X browser source"]
    Collector["collector<br/>compliant fetching · technical dedup · enrichment · source health"]
    Item["NormalizedMarketItem"]
    Admission["Range admission<br/>holding · semiconductor/AI · macro data · Fed policy · trade policy"]
    Process["process_market_item"]
    Decision["decision_engine<br/>validated DecisionResult"]
    Interpreter["market_interpreter<br/>thin interpretation"]
    Review["review_store<br/>market_reviews"]
    Delivery["market_delivery<br/>delivery dedup · execution audit"]
    Web["Web workbench"]
    Feishu["Feishu immediate alert"]
    Daily["Daily digest"]
    Archive["Archive"]
    Excluded["Admission audit"]
    Retry["failed_retryable<br/>no DecisionResult · no delivery"]

    Sources --> Collector --> Item --> Admission
    Admission -->|excluded| Excluded
    Admission -->|admitted| Process --> Decision
    Decision -->|model, validation, evidence, version, or audit failure| Retry
    Decision -->|valid| Interpreter --> Review
    Review --> Web
    Review -->|push| Delivery --> Feishu
    Review -->|daily| Daily
    Review -->|archive| Archive

Loading

The key correctness boundary is deliberately narrow:

  1. A collector discovers and normalizes information, but cannot persist a completed review or send an item.
  2. Range admission decides whether the content is in scope, but cannot assign an action.
  3. decision_engine produces and strictly validates one DecisionResult.
  4. market_interpreter adds only a short explanation and cannot change the action.
  5. review_store persists the decision; market_delivery may block duplicates but cannot change it.
  6. Only push reaches immediate Feishu delivery. daily waits for the digest, and archive remains searchable history.

For the complete current implementation, see Architecture.

Product Surfaces

Web workbench

The loopback-only Web workbench provides:

  • information center with source, action, status, date, and text filters;
  • LLM decision review with rule results and retained audit metadata;
  • current range-admission and decision-rule views;
  • source profiles, source health, task health, and failure visibility;
  • Feishu feedback metrics and examples;
  • private settings, media keywords, and holdings management.

Feishu delivery

Items with a valid DecisionResult.action=push can be sent as Feishu cards. Delivery records execution outcomes only; it cannot create or promote push eligibility. Optional signed feedback actions record whether a delivered item was especially useful, duplicated, or invalid.

Built-In Source Radar

MarketPulseWire includes reusable collectors and source definitions for:

Source group Examples
Official company feeds OpenAI, NVIDIA, Samsung Semiconductor, SK hynix, Micron
Official policy sources U.S. Federal Register, USTR, European Commission, MOFCOM
Company disclosures CNINFO announcements and investor-relations records
Industry and supply-chain media TrendForce, SEMI releases, DIGITIMES, Nikkei xTECH, The Elec
China financial information Sina Finance, First Yicai, CLS, Star Market Daily, WallstreetCN
Research summaries AlphaAbstract and configured public/authorized research sources
Optional browser source Logged-in X “Following” timeline through a private Chromium profile

Source access is intentionally bounded. MarketPulseWire does not bypass paywalls, login walls, WAF challenges, or other access controls. See the Source Catalog for URLs, methods, and compliance notes.

Quick Start: Open the Web Workbench

This starts a local empty workbench for evaluating the interface and configuration model. Python 3.10 or newer is required; CI runs on Python 3.11.

git clone https://github.com/Stayfoool/MarketPulseWire.git
cd MarketPulseWire
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
cp config/portfolio.example.json config/portfolio.json
python scripts/market_db.py
python scripts/portfolio_import.py
python scripts/holdings_web.py --host 127.0.0.1 --port 8787

Open http://127.0.0.1:8787.

The workbench alone does not start collectors. Production monitoring requires reviewed private range-admission rules, reviewed private LLM decision rules, an OpenAI-compatible model, and configuration for only the sources you are authorized to use.

Configure Monitoring

Copy .env.example to .env and fill only the capabilities you use. The preferred model configuration is:

LLM_PROVIDER=qwen_flash_snapshot
LLM_API_KEY=<your_deepseek_api_key>
LLM_BASE_URL=https://api.deepseek.com
LLM_MODEL=deepseek-chat
LLM_GLM_API_KEY=<your_zhipu_api_key>
LLM_QWEN_API_KEY=<your_bailian_api_key>
LLM_QWEN_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
LLM_TIMEOUT_SECONDS=90
LLM_RETRY_COUNT=2

The workbench's 当前模型 control switches between 阿里云百炼千问, the 百炼 qwen3.8 series, 百炼 GLM 5.3, DeepSeek and Zhipu GLM 5.3 Flash. The default model is 阿里云百炼 qwen3.7-flash-2026-07-15 (LLM_PROVIDER=qwen_flash_snapshot); when it reports insufficient balance the same request is retried once against the stable qwen3.7-flash on the same endpoint, and qwen_flash selects the stable model directly. qwen38_max, qwen38_2_4t_a95b, qwen38_27b, qwen38_flash and qwen38_max_0902 select the 百炼 qwen3.8 series; when one model's quota is exhausted the request walks the ordered chain Max → 2.4T A95B → 27B → Flash → Max 0902 in the same round. When LLM_PROVIDER=deepseek points LLM_BASE_URL at the Bailian endpoint (Bailian-hosted DeepSeek such as deepseek-v4-pro-0813), an exhausted quota switches to the same chain starting from its head, using the separate Bailian Qwen connection below; the official DeepSeek endpoint has no Bailian fallback. LLM_PROVIDER=glm_bailian selects the 百炼-hosted glm-5.3 and shares the Bailian connection below. The Qwen connection uses the separate LLM_QWEN_API_KEY with LLM_QWEN_BASE_URL, which defaults to the Beijing OpenAI-compatible endpoint, and sends enable_thinking=false plus JSON mode. The Zhipu connection is fixed to the official https://open.bigmodel.cn/api/paas/v4 endpoint and glm-5.3-flash; requests always use the model-supported thinking=enabled, reasoning_effort=low, and JSON mode instead of inheriting another model's disabled-thinking setting. These API keys remain only in the private mode-0600 .env and are never returned in clear text. Existing LLM_PROVIDER=openai_compatible configurations continue to use LLM_API_KEY, LLM_BASE_URL, and LLM_MODEL.

Two separate private rule files are required for production collection:

  • RULE_CORE_CONFIG: range admission, maintained outside Git;
  • LLM_DECISION_RULE_CONFIG: reviewed push and daily conditions, maintained outside Git with mode 0600.

The tracked files config/rule_core_v1.test.json and config/llm_decision_rules.test.json contain synthetic CI fixtures. They are not production configurations and must not be treated as recommended market rules.

阿里云百炼 Qwen, DeepSeek, Zhipu GLM 5.3 Flash, and existing compatible models share one OpenAI-compatible call path. Only the LLM_* names are supported for the primary decision model.

Deployment

The recommended always-on deployment is a Linux server with:

  • Python 3.10+ and SQLite;
  • systemd services and timers;
  • the Web workbench bound to 127.0.0.1;
  • an SSH tunnel for operator access;
  • private .env, rule files, browser profiles, reports, and SQLite owned by the service account.

MarketPulseWire also includes an optional manually triggered GitHub Actions SSH deployment workflow. GitHub deploys code; runtime secrets and private rules remain on the target server.

See Deployment for the complete systemd, secret, browser, synchronization, log-retention, and production-verification procedures.

Privacy and Security Boundaries

Do not commit or publish:

  • real portfolios or watchlists;
  • .env, API keys, Feishu secrets, cookies, or browser profiles;
  • private range-admission or LLM decision rules;
  • SQLite databases, logs, reports, private model audits, or paid content;
  • raw private API responses or source material your access rights do not permit you to redistribute.

Sensitive LLM request/response audits are designed to remain in service-account-owned mode-0600 files. Full model input, source bodies, and raw model responses do not enter Git, SQLite, the Web workbench, or Feishu.

Read Security and Compliance before enabling production sources.

Development and Verification

The CI-safe regression list has one entry point:

python -m py_compile scripts/*.py
bash -n scripts/*.sh
python scripts/run_test_suite.py
python scripts/scan_secrets.py

Tests that use real credentials, send messages, upload media, or call production services remain operator smoke tests and do not run in ordinary CI.

Contributions are welcome for official source adapters, parser fixes, Web workbench improvements, model-output validation, failure handling, tests, and documentation. See Contributing.

Documentation

License

MIT

来源:GitHub · github.com