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
4 changes: 2 additions & 2 deletions .agents/skills/joinquant-archive-sync/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy==2.4.4
pandas==3.0.2
numpy==2.4.6
pandas==3.0.3
requests
beautifulsoup4
pyyaml==6.0.3
Expand Down
24 changes: 13 additions & 11 deletions .agents/skills/run-local-quant-research/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---
name: run-local-quant-research
description: Use when 用户或 Agent 需要依据项目配置与共享行情快照执行本地量化研究、复算研究结果、核验必需输出,或固化可追溯证据
description: Use when 用户或 Agent 需要基于仓库项目配置与共享行情快照执行或复核一次本地量化研究场景
---

# 本地量化研究流程

只编排通用研究入口。让共享脚本校验配置、行情身份、项目结果和摘要;不要在 Skill(技能)中解释策略字段或复制项目逻辑
只编排一次通用本地研究调用。共享脚本负责校验配置、行情身份、单场景结果和摘要;Skill(技能)不解释策略字段,不复制项目逻辑,不读取复数分析计划

## 执行前提

- 从仓库根目录运行项目 `.venv`(虚拟环境),不回退系统 Python(编程语言),不静默安装依赖。
- 配置必须声明项目入口、共享 `snapshot_id`(快照标识)、参数集合、仓库内路径和必需输出
- 配置必须声明项目入口、共享 `snapshot_id`(快照标识)、一个场景、仓库内路径和一份必需结果
- 配置或快照缺失时停止,不猜测路径、不改用旧快照、不缩减资产范围。

## 固定流程

1. 校验行情快照:只读取配置声明的 `snapshot_id`,从共享行情中心验证来源、范围、字段、价格口径和内容摘要。
2. 校验项目配置:检查其余结构、仓库边界、项目入口、参数集合、三态和必需输出声明。
3. 运行项目入口:由通用 CLI(命令行接口)调用配置声明的项目进程;项目自行解释策略参数。
4. 校验必需输出:重新读取输出文件并核对状态、运行身份、输入摘要和输出摘要。
5. 固化运行证据:原子写入不可变清单;相同输入和相同输出复用既有运行,摘要冲突则失败。
1. 校验行情快照:只读取配置声明的 `snapshot_id`,验证共享行情中心的 `market-data.parquet`、来源、范围、字段、价格口径和内容摘要;查询只使用内存 DuckDB(嵌入式分析数据库),不创建持久数据库。
2. 校验单场景配置:拒绝候选数组、场景数组、分析计划和流程内循环,只接受一个项目场景及其必需输出声明。
3. 运行项目入口:由通用 CLI(命令行接口)调用配置声明的项目进程;项目自行解释策略参数,并在同一全新进程内分别完成一次冷启动和一次预热执行。
4. 校验单场景结果:重新读取唯一结果目录,核对状态、运行身份、输入摘要、性能证据、临时产物清理和输出摘要。
5. 固化运行证据:通过后原子写入不可变清单;相同输入和相同输出复用既有运行,摘要冲突则失败。
6. 返回调用者:完整运行固定输出 `next_action=return_to_caller`。复数场景由主 agent(代理)多次调用本 Skill,不在 Skill 内聚合、分析、报告或推荐。

统一公开命令:

Expand All @@ -29,9 +30,9 @@ description: Use when 用户或 Agent 需要依据项目配置与共享行情快

## 结果判断

- `complete`(完整):配置、快照、项目进程、全部必需输出和证据摘要均通过
- `evidence_insufficient`(证据不足):执行前缺少身份、快照、范围或声明输入,或项目按自身规则判定可信输入不足以形成研究建议
- `failed`(失败):既有证据被篡改或摘要不一致,或执行、输出、硬约束、确定性和原子固化任一环节失败
- `complete`(完整):配置、快照、项目进程、单场景性能门禁、唯一必需结果和证据摘要全部通过,然后返回调用者
- `evidence_insufficient`(证据不足):执行前缺少身份、快照、范围或声明输入,包括缺失单场景配置
- `failed`(失败):既有证据被篡改或摘要不一致,或执行、输出、180 秒门槛、确定性、清理、原子固化任一环节失败

只接受这三种最终状态。缺失证据与既有证据损坏必须严格区分。

Expand All @@ -40,3 +41,4 @@ description: Use when 用户或 Agent 需要依据项目配置与共享行情快
- 本地结果只属于探索性研究,不代表正式回测、稳健性通过或实盘准入。正式回测和模拟交易只在 JoinQuant(聚宽)云端运行。
- 不读取、打印或保存账号、密码、Cookie(浏览器凭证)或 Token(访问令牌)。需要认证或远端数据时,调用仓库已有的专用能力。
- 不在 Skill(技能)目录沉淀行情、策略代码或运行结果;共用能力保留在仓库脚本,项目能力保留在项目目录。
- 策略分析、Vibe-Trading(AI 研究助理)、完整报告、推荐和人工确认属于独立流程,不在本 Skill 内调用。
20 changes: 15 additions & 5 deletions .build-and-verify/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,18 @@
"pytest",
"tests\\local_quant_research",
"-k",
"not test_skill_public_command_runs_complete_turtle_workflow and not test_non_strategy_project_completes_through_shared_market_and_runner"
"not test_non_strategy_project_completes_through_shared_market_and_runner"
],
"paths": [
".agents/skills/run-local-quant-research/**",
".claude/skills/run-local-quant-research",
"scripts/research/market_data/**",
"scripts/research/local_quant_research/**",
"scripts/research/analysis_data/**",
"scripts/research/quant_analysis/**",
"joinquant/strategies/strategy-003/research/**",
"tests/local_quant_research/**",
"tests/quant_analysis/**",
"tests/test_skill_layout.py",
"requirements*.txt"
],
Expand All @@ -315,8 +318,11 @@
".claude/skills/run-local-quant-research",
"scripts/research/market_data/**",
"scripts/research/local_quant_research/**",
"scripts/research/analysis_data/**",
"scripts/research/quant_analysis/**",
"joinquant/strategies/strategy-003/research/**",
"tests/local_quant_research/**",
"tests/quant_analysis/**",
"tests/test_skill_layout.py",
"requirements.txt",
"requirements-dev.txt"
Expand All @@ -330,18 +336,19 @@
".\\.venv\\Scripts\\python.exe",
"-m",
"pytest",
"tests\\local_quant_research\\test_turtle_e2e.py",
"tests\\local_quant_research\\test_generic_e2e.py",
"-k",
"skill_public_command_runs_complete_turtle_workflow or non_strategy_project_completes_through_shared_market_and_runner"
"tests\\local_quant_research\\test_turtle_e2e.py"
],
"paths": [
".agents/skills/run-local-quant-research/**",
".claude/skills/run-local-quant-research",
"scripts/research/market_data/**",
"scripts/research/local_quant_research/**",
"scripts/research/analysis_data/**",
"scripts/research/quant_analysis/**",
"joinquant/strategies/strategy-003/research/**",
"tests/local_quant_research/**",
"tests/quant_analysis/**",
"tests/test_skill_layout.py",
"requirements*.txt"
],
Expand All @@ -350,15 +357,18 @@
".claude/skills/run-local-quant-research",
"scripts/research/market_data/**",
"scripts/research/local_quant_research/**",
"scripts/research/analysis_data/**",
"scripts/research/quant_analysis/**",
"joinquant/strategies/strategy-003/research/**",
"tests/local_quant_research/**",
"tests/quant_analysis/**",
"tests/test_skill_layout.py",
"requirements.txt",
"requirements-dev.txt"
],
"checkParallel": false,
"pytestXdistWorkers": 1,
"timeoutSeconds": 180
"timeoutSeconds": 300
},
{
"id": "verify.openspec",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/full-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true

- name: Set up Node
uses: actions/setup-node@v4
Expand Down
Loading
Loading