Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .agents/skills/analyze-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ gh issue view <issue_number> --repo helloJamest/FinAgent --comments

### Step 5: 生成分析文档

保存到 `.Codex/reviews/issues/issue-<number>.md`
保存到 `.claude/reviews/issues/issue-<number>.md`

## Output Document Format

Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/analyze-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gh run view <run_id> --log-failed

### Step 5: 生成评审文档

保存到 `.Codex/reviews/prs/pr-<number>.md`
保存到 `.claude/reviews/prs/pr-<number>.md`

## Output Document Format

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/fix-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

### Step 1: 确认分析基线

检查 `.Codex/reviews/issues/issue-<number>.md` 是否存在;如果不存在,先补做 issue 分析或在本次修复中补齐最小分析结论。
检查 `.claude/reviews/issues/issue-<number>.md` 是否存在;如果不存在,先补做 issue 分析或在本次修复中补齐最小分析结论。

### Step 2: 选择安全的工作方式

Expand Down Expand Up @@ -50,7 +50,7 @@

### Step 5: 更新 issue 分析文档

在 `.Codex/reviews/issues/issue-<number>.md` 中补充:
在 `.claude/reviews/issues/issue-<number>.md` 中补充:

```markdown
## Fix Implementation
Expand Down
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## PR Type

- [ ] 新功能
- [ ] 改进
- [ ] 修复
- [ ] 文档
- [ ] 测试
- [ ] chore

## Background And Problem

<!-- What problem does this PR solve? Link related context when possible. -->

## Scope Of Change

<!-- List the files/modules touched and keep unrelated changes out. -->

## Issue Link

<!-- e.g. Fixes #123, or "None". -->

## Verification Commands And Results

<!-- Paste commands and concise results. If skipped, explain why. -->

## Compatibility And Risk

<!-- API/schema/config/deployment/user-visible compatibility notes. -->

## Rollback Plan

<!-- How to revert or disable this safely. -->
8 changes: 8 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Repository Instructions For Copilot And Coding Agents

Canonical source: `AGENTS.md`.

`CLAUDE.md` is a compatibility entry that must point to `AGENTS.md`.
Repository skills live in `.claude/skills/` and are mirrored in `.agents/skills/`.

If any instruction here conflicts with `AGENTS.md`, follow `AGENTS.md`.
9 changes: 9 additions & 0 deletions .github/instructions/backend.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Backend Instructions

Canonical source: `AGENTS.md`.

- Put backend changes in `src/`, `data_provider/`, `api/`, or `bot/`.
- Prefer existing services, repositories, schemas, and scripts.
- Validate Python backend changes with `bash scripts/ci_gate.sh` when practical.
- For small Python edits, at minimum run `python -m py_compile <changed_python_files>`.
- Keep data-source fallback and notification failure paths fail-open unless the task explicitly says otherwise.
9 changes: 9 additions & 0 deletions .github/instructions/client.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Client Instructions

Canonical source: `AGENTS.md`.

- Put Web changes in `apps/finagent-web/`.
- Put desktop changes in `apps/finagent-desktop/`.
- For Web changes, run `npm ci`, `npm run lint`, and `npm run build` from `apps/finagent-web/`.
- For desktop changes, build the Web app first, then run the desktop build.
- Keep API/schema changes backward compatible where possible.
9 changes: 9 additions & 0 deletions .github/instructions/governance.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Governance Instructions

Canonical source: `AGENTS.md`.

- Do not commit, tag, or push without explicit user confirmation.
- Keep `.env.example` and relevant docs in sync with new configuration.
- Update `docs/CHANGELOG.md` for user-visible, CLI/API, deployment, workflow, notification, or report changes.
- Keep `[Unreleased]` flat: `- [类型] 描述`, with type one of `新功能`, `改进`, `修复`, `文档`, `测试`, or `chore`.
- Run `python scripts/check_ai_assets.py` after changing AI collaboration assets.
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
ai-governance:
name: AI asset governance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Check AI collaboration assets
run: python scripts/check_ai_assets.py

backend-gate:
name: Backend gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: |
requirements.txt
requirements-ci.txt

- name: Install backend CI dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-ci.txt

- name: Run backend gate
run: bash scripts/ci_gate.sh

docker-build:
name: Docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: docker build -f docker/Dockerfile -t finagent-ci .

- name: Smoke import key modules
run: docker run --rm finagent-ci python -c "import api.app; import src.core.pipeline; import data_provider.base"

web-gate:
name: Web gate
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/finagent-web
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: apps/finagent-web/package-lock.json

- name: Install web dependencies
run: npm ci

- name: Lint web
run: npm run lint

- name: Build web
run: npm run build
37 changes: 37 additions & 0 deletions .github/workflows/network-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Network Smoke

on:
schedule:
- cron: "0 2 * * 1"
workflow_dispatch:

permissions:
contents: read

jobs:
network-smoke:
name: Network smoke
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: |
requirements.txt
requirements-ci.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-ci.txt

- name: Run network-marked pytest
run: python -m pytest -m network

- name: Run quick deterministic smoke
run: bash test.sh quick --dry-run --no-notify
38 changes: 38 additions & 0 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PR Review

on:
pull_request:
types: [opened, edited, synchronize, reopened]
workflow_dispatch:

permissions:
contents: read
pull-requests: read

jobs:
pr-static-checks:
name: PR static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Check AI assets
run: python scripts/check_ai_assets.py

- name: Check PR template exists
run: test -f .github/PULL_REQUEST_TEMPLATE.md

ai-review-hook:
name: Optional AI review hook
runs-on: ubuntu-latest
continue-on-error: ${{ vars.AI_REVIEW_STRICT != 'true' }}
if: ${{ vars.AI_REVIEW_ENABLED == 'true' }}
steps:
- name: No reviewer configured
run: |
echo "AI_REVIEW_ENABLED is true, but no repository AI reviewer command is configured."
echo "Keep this job non-blocking unless AI_REVIEW_STRICT=true is intentionally enabled."
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
- `AGENTS.md` 是仓库内 AI 协作规则的唯一真源。
- `CLAUDE.md` 必须是指向 `AGENTS.md` 的软链接,用于兼容 Claude 生态。
- `.github/copilot-instructions.md` 与 `.github/instructions/*.instructions.md` 是 GitHub Copilot / Coding Agent 的镜像或分层补充;若与本文件冲突,以 `AGENTS.md` 为准。
- 仓库协作 skill 存放在 `.claude/skills/`,分析产物存放在 `.claude/reviews/`;前者可以入库,后者默认视为本地产物
- 仓库协作 skill 存放在 `.claude/skills/`,`.agents/skills/` 是同义镜像;分析产物存放在 `.claude/reviews/`,默认视为本地产物
- 根目录 `SKILL.md` 与 `docs/openclaw-skill-integration.md` 属于产品或外部集成说明,不是仓库协作规则真源。
- 若未来新增 `.agents/skills/` 或其他 agent 专用目录,必须先明确单一真源,再通过脚本或镜像同步;禁止手工长期维护多份同义内容。
- 若未来新增其他 agent 专用目录,必须先明确单一真源,再通过脚本或镜像同步;禁止手工长期维护多份同义内容。
- 修改 AI 协作治理资产时,执行:

```bash
Expand Down
27 changes: 0 additions & 27 deletions CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions CLAUDE.md
4 changes: 3 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- [修复] 补回 GitHub Actions 每日股票分析工作流,恢复 fork 后手动/定时运行能力(fixes #31)。
- [新功能] 打板策略(screen_board_play):通过 AKShare 获取龙虎榜、涨停池、连板天梯、涨停概念数据,自动筛选 1进2/2进3/3进4 晋级股,输出板块策略 + 连板预测 + 个股买入建议
- [改进] 打板策略结果在 UI 中按连板层级(1进2 / 2进3 / 3进4)分组展示,不同层级使用不同颜色区分
- [新增] API 客户端新增 `getBoardData` 方法支持直接获取打板策略原始数据
- [新功能] API 客户端新增 `getBoardData` 方法支持直接获取打板策略原始数据
- [chore] 恢复 CI、网络冒烟与 PR 静态检查工作流,并补齐 GitHub Copilot / Coding Agent 协作资产镜像
- [测试] 新增 AI 资产、CI 工作流与 Changelog `[Unreleased]` 格式守卫,防止协作治理漂移
- [修复] `AGENT_MAX_STEPS` 在 orchestrator 多 Agent 模式下改为作为各子 Agent 的步数上限而非硬覆盖;TechnicalAgent 等高默认值 Agent 会被封顶,低默认值 Agent 保持原值,减少不必要的 LLM 调用膨胀与配额消耗。
- [修复] **MiniMax-M2.7 模型连接测试支持** — 修复 LLM 通道连接测试在 MiniMax-M2.7 模型下返回 "Empty response" 的问题;增加了 `max_tokens` 上限(8→256)以容纳 MiniMax 思考过程,并添加 `content_blocks` 格式解析逻辑统一处理 MiniMax 响应格式差异。
- [修复] 移除 `HistoryItem` 与 `ReportSummary` 响应 Schema 中 `sentiment_score` 的 `ge=0/le=100` 约束(fixes #942)——历史库中存储的超范围负值或大于 100 的情绪评分不再触发 Pydantic ValidationError,历史列表与详情接口恢复正常返回。
Expand Down
2 changes: 2 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ docs: 更新 README 部署说明

| 检查项 | 说明 | 必须通过 |
|--------|------|:--------:|
| ai-governance | 校验 `AGENTS.md` / `CLAUDE.md` / `.github` 指令 / repository skills 关系 | ✅ |
| backend-gate | `scripts/ci_gate.sh`(py_compile + flake8 严重错误 + 本地核心脚本 + offline pytest) | ✅ |
| docker-build | Docker 镜像构建与关键模块导入 smoke | ✅ |
| web-gate | 前端变更时执行 `npm run lint` + `npm run build` | ✅(触发时) |
| network-smoke | 定时/手动执行 `pytest -m network` + `test.sh quick`(非阻断) | ❌(观测项) |
| pr-review | PR 模板与协作资产静态检查,AI review hook 可选启用 | ❌(辅助项) |

**本地运行检查:**

Expand Down
2 changes: 2 additions & 0 deletions docs/CONTRIBUTING_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ After opening a PR, CI will automatically run the following PR checks:

| Check | Description | Required |
|-------|-------------|:--------:|
| `ai-governance` | Checks `AGENTS.md` / `CLAUDE.md` / `.github` instructions / repository skills alignment | ✅ |
| `backend-gate` | `scripts/ci_gate.sh` — py_compile + flake8 critical errors + `./test.sh code` + `./test.sh yfinance` + offline pytest | ✅ |
| `docker-build` | Docker image build and key module import smoke test | ✅ |
| `web-gate` | `npm run lint` + `npm run build` (triggered when `apps/finagent-web/` changes) | ✅ (when triggered) |
| `pr-review` | PR template and collaboration asset static checks; optional AI review hook | ❌ (auxiliary) |

Separately, the repository also has a non-blocking `network-smoke` workflow in `.github/workflows/network-smoke.yml`, but it is only triggered by `schedule` and `workflow_dispatch`, not by pull requests.

Expand Down
Loading
Loading