mcpField
E
edge-pipeline-orchestrator

edge-pipeline-orchestrator

github.com/mphinance其他3286 次安装3 天前更新
代码仓库

关于 edge-pipeline-orchestrator

将 edge 研究各阶段串联为自动化流程,从 tickets 或 OHLCV 数据到评审和策略导出。支持从 drafts 阶段恢复,也可试运行而不导出。

主要功能

  1. 01运行基于 tickets 或 OHLCV 的流程
  2. 02生成提示、概念和草案
  3. 03通过反馈循环评审和修订草案
  4. 04从 drafts 阶段恢复运行
  5. 05试运行且不导出策略
  6. 06在清单中记录执行轨迹

适用场景

  1. 01根据市场 tickets 生成策略草案
  2. 02继续未完成的流程
  3. 03评审和修订现有草案
  4. 04预览流程结果而不导出

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mphinance/alpha-skills --skill edge-pipeline-orchestrator

安装后在 Claude Code 中输入/edge-pipeline-orchestrator确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

README.md
references/
pipeline_flow.md
revision_loop_rules.md
scripts/
orchestrate_edge_pipeline.py
scripts/tests/
conftest.py
test_orchestrate_edge_pipeline.py

详细介绍

Edge 管道编排器

将所有 Edge 研究阶段协调为一次自动化管道运行。

适用场景

  • 从工单(或 OHLCV)运行完整的 Edge 管道,直到导出策略
  • 从草稿阶段恢复未完成的管道
  • 通过反馈循环审查和修订现有策略草稿
  • 试运行管道,在不导出的情况下预览结果

工作流

  1. 从 CLI 参数加载管道配置
  2. 如果提供了 --from-ohlcv,则运行 auto_detect 阶段(从原始 OHLCV 数据生成工单)
  3. 运行 hints 阶段,从市场摘要和异常中提取 Edge 提示
  4. 运行 concepts 阶段,根据工单和提示综合抽象的 Edge 概念
  5. 运行 drafts 阶段,根据概念设计策略草稿
  6. 运行审查-修订反馈循环:
    • 审查所有草稿(最多 2 轮)
    • 累积 PASS 结果;累积 REJECT 结果
    • REVISE 结果会触发 apply_revisions,然后重新审查
    • 达到最大轮数后,仍为 REVISE 的结果将降级为 research_probe
  7. 导出符合条件的草稿(PASS + export_ready_v1 + 可导出的 entry_family)
  8. 写入包含完整执行跟踪记录的 pipeline_run_manifest.json

CLI 用法

# Full pipeline from tickets
python3 scripts/orchestrate_edge_pipeline.py \
  --tickets-dir path/to/tickets/ \
  --output-dir reports/edge_pipeline/

# Full pipeline from OHLCV
python3 scripts/orchestrate_edge_pipeline.py \
  --from-ohlcv path/to/ohlcv.csv \
  --output-dir reports/edge_pipeline/

# Resume from drafts stage
python3 scripts/orchestrate_edge_pipeline.py \
  --resume-from drafts \
  --drafts-dir path/to/drafts/ \
  --output-dir reports/edge_pipeline/

# Review-only mode
python3 scripts/orchestrate_edge_pipeline.py \
  --review-only \
  --drafts-dir path/to/drafts/ \
  --output-dir reports/edge_pipeline/

# Dry run (no export)
python3 scripts/orchestrate_edge_pipeline.py \
  --tickets-dir path/to/tickets/ \
  --output-dir reports/edge_pipeline/ \
  --dry-run

输出

所有产物都会写入 --output-dir:

output-dir/
├── pipeline_run_manifest.json
├── tickets/          (from auto_detect)
├── hints/hints.yaml  (from hints)
├── concepts/edge_concepts.yaml
├── drafts/*.yaml
├── exportable_tickets/*.yaml
├── reviews_iter_0/*.yaml
├── reviews_iter_1/*.yaml  (if needed)
└── strategies/<candidate_id>/
    ├── strategy.yaml
    └── metadata.json

Claude Code 大模型增强工作流

完全在 Claude Code 中运行大模型增强管道:

  1. 运行 auto_detect,生成 market_summary.json + anomalies.json
  2. Claude Code 分析数据并生成 Edge 提示
  3. 将提示保存到 YAML 文件:
- title: Sector rotation into industrials
  observation: Tech underperforming while industrials show relative strength
  symbols: [CAT, DE, GE]
  regime_bias: Neutral
  mechanism_tag: flow
  preferred_entry_family: pivot_breakout
  hypothesis_type: sector_x_stock
  1. 使用 --llm-ideas-file 和 --promote-hints 运行编排器:
python3 scripts/orchestrate_edge_pipeline.py \
  --tickets-dir path/to/tickets/ \
  --llm-ideas-file llm_hints.yaml \
  --promote-hints \
  --as-of 2026-02-28 \
  --max-synthetic-ratio 1.5 \
  --strict-export \
  --output-dir reports/edge_pipeline/
可选标志
  • --as-of YYYY-MM-DD — 传递给 hints 阶段,用于按日期筛选
  • --strict-export — 对包含任何 warn 发现的问题的可导出草稿,使用 REVISE 代替 PASS
  • --max-synthetic-ratio N — 将合成工单数量限制为真实工单数量的 N 倍(下限:3)
  • --overlap-threshold F — 概念去重的条件重叠阈值(默认值:0.75)
  • --no-dedup — 禁用概念去重

注意:--llm-ideas-file 和 --promote-hints 仅在运行完整管道时生效。 --resume-from drafts 和 --review-only 会跳过 hints/concepts 阶段,因此这些标志会被忽略。

资源

  • references/pipeline_flow.md — 管道阶段、数据契约和架构
  • references/revision_loop_rules.md — 审查-修订反馈循环规则和启发式方法

评论

支持 Markdown