ワンクリックで
fleur-dagster-backfill-runbook
fleur 的 Dagster 回填操作手册。用于选择 dg launch 命令、资产选择、partition 或 partition-range 参数,以及各数据源的回填模板。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
fleur 的 Dagster 回填操作手册。用于选择 dg launch 命令、资产选择、partition 或 partition-range 参数,以及各数据源的回填模板。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
fleur 的 raw 层数据契约、Parquet schema adapter、字段 glossary、dbt sources.yml 和 data_dict 生成工作流。用于新增或修改 pipeline/contracts/datasets、维护 parquet.fields/source/clickhouse_raw 字段事实、维护 external_description_zh/description_zh、运行 fleur-contracts 与 scheduler contract schema 边界校验、修复生成物漂移。
fleur 的 Dagster HTTP 数据源资产开发流程。用于当用户提供远端 HTTP/HTTPS 链接、API endpoint 或接口样例,希望新增或修改 Dagster source asset,将远端数据抓取并写入 S3 Parquet,再通过 contract 驱动同步到 ClickHouse raw 层;覆盖 endpoint profiling、数据契约、scheduler SourceBundle、PyArrow schema 转换、测试和 dg 验收。
fleur 的 dbt staging 前置准备工作流。用于新增或重写 staging model、讨论 staging 清洗规则、为 raw table 设计 canonical 字段、或需要先完成 raw source profiling 再写 stg SQL/YAML/tests 的任务。
fleur 的项目 harness 工程技能。用于把复杂开发、重构、质量治理、需求投递、文档维护和 agent 可读性工作落到仓库内的 docs、架构事实文档、测试、脚本和质量门禁中;尤其适用于需要整理 AGENTS.md、docs/architecture、ADR/RFC/plan/archive/issue/job report、架构边界或长期维护规则的任务。
fleur 前端 CDP 调试流程。用于调试 Racingline 或 app/ 下其他前端时,通过全局 playwright-cli 连接 vnc-mini-desktop 暴露的 Chromium CDP 端点 9222,检查页面截图、DOM snapshot、console、network、响应式布局和交互问题;也用于验证 PLAYWRIGHT_CDP_ENDPOINT、安装/使用官方 Playwright CLI agent skill、或排查 CDP 浏览器连接。
fleur 的多工程版本管理技能。用于判断和执行组件 SemVer bump、dataset contract version bump、Alembic revision/version 记录、Rust crate 独立版本维护、deploy release manifest、集成 tag、release note 和运行时版本暴露;适用于用户要求处理版本号、发布版本、组件 tag、集成 tag、release manifest、changelog/release note、运行时版本展示或版本一致性校验时。
| name | fleur-dagster-backfill-runbook |
| description | fleur 的 Dagster 回填操作手册。用于选择 dg launch 命令、资产选择、partition 或 partition-range 参数,以及各数据源的回填模板。 |
当 pipeline/scheduler 里的回填可以用 dg launch 表达时,使用这个 skill。
dg / dagster 命令必须使用根目录 .env 中的 DAGSTER_HOME 作为 Dagster home.env:set -a; . ./.env; set +amake dagster-home,确保 Dagster home 和 pool 限制已初始化pipeline/ 下执行命令uv run dg ...--target-path scheduler 指向 scheduler 项目backfill__fetch_history_sources_to_raw_job。backfill__fetch_history_sources_to_raw_job;start_date 和 end_date 仍必填,但该 scope 会主动忽略日期。backfill__fetch_history_sources_to_marts_job。daily__fetch_history_sources_to_marts_schedule_job;它不是 history backfill,但复用 source-to-marts registry,把 target_date 映射为单日增量。uv run dg list defs --target-path scheduler --json 验证选择。dry_run: true,确认计划后再执行真实回填或真实 daily run。raw-only 首选手动入口:
cd pipeline
uv run dg launch --target-path scheduler \
--job backfill__fetch_history_sources_to_raw_job \
--config-json '{
"ops": {
"backfill__fetch_history_sources_to_raw_controller": {
"config": {
"target_scope": "baostock_daily_kline",
"start_date": "2026-01-01",
"end_date": "2026-06-30",
"execution_mode": "full",
"refresh_prerequisite_snapshots": false,
"overwrite_source_partitions": false,
"dry_run": true
}
}
}
}'
raw-only target_scope:
baostock_daily_klinemarket_events(只纳入 THS limit up pool;Jiuyan 异动不进入统一 raw-only 或 source-to-marts 入口)eastmoney_f10chinabondsnapshot_reference_data(日期字段必填,但该 scope 忽略日期)all_raw_yearlysnapshot reference data raw-only dry-run 示例:
cd pipeline
uv run dg launch --target-path scheduler \
--job backfill__fetch_history_sources_to_raw_job \
--config-json '{
"ops": {
"backfill__fetch_history_sources_to_raw_controller": {
"config": {
"target_scope": "snapshot_reference_data",
"start_date": "2024-01-01",
"end_date": "2024-01-01",
"execution_mode": "full",
"dry_run": true
}
}
}
}'
覆盖本轮 source/raw 能力时,在 Web UI 中分两次启动:all_raw_yearly 加真实日期区间,snapshot_reference_data 加占位日期区间。Jiuyan 异动、行业列表和 OCR 后续独立规划,不再通过统一模板拼入本轮 source-to-marts 入口。
执行规则:
dry_run: true 只输出 source、compacted source 和 raw sync 的计划。dry_run: false 会按计划顺序创建 child materialization runs,并写入统一 backfill.* tags。execution_mode: raw_only 只重跑 raw sync,假设 source/compacted source 已经成功存在。refresh_prerequisite_snapshots 只刷新当前 scope 显式声明的 source snapshot prerequisites,不刷新无关 snapshot。cutoff_trade_date。refresh_until_date。历史 source/raw 修复后继续重建 downstream 的手动入口:
cd pipeline
uv run dg launch --target-path scheduler \
--job backfill__fetch_history_sources_to_marts_job \
--config-json '{
"ops": {
"backfill__fetch_history_sources_to_marts_controller": {
"config": {
"target_scope": "all_source_to_marts",
"start_date": "2024-01-01",
"end_date": "2024-12-31",
"execution_mode": "full",
"refresh_prerequisite_snapshots": false,
"overwrite_source_partitions": false,
"dry_run": true
}
}
}
}'
target_scope:
baostock_daily_klinemarket_events(只纳入 THS limit up pool;排除 Jiuyan 异动)eastmoney_f10chinabondsnapshot_reference_data(日期字段必填,但 source/raw stage 忽略日期)all_raw_yearlyall_source_to_martsexecution_mode:
full:source/raw + dbt staging/intermediate + Furnace calculation + marts。source_raw_only:只展开 source/raw 阶段,用于和 raw-only 入口对比计划。downstream_only:假设 source/raw 已完成,只重建 downstream。Source-to-marts 规则:
dry_run: true 只输出 expanded plan,不提交 child materialization runs。replace-cascade;dry-run child config 使用 dry-run。日常 source -> raw -> stg -> int -> calculation -> mart 主入口:
cd pipeline
uv run dg launch --target-path scheduler \
--job daily__fetch_history_sources_to_marts_schedule_job \
--config-json '{
"ops": {
"daily__fetch_history_sources_to_marts_schedule_controller": {
"config": {
"target_scope": "all_source_to_marts",
"target_date": "2026-06-30",
"execution_mode": "full",
"refresh_prerequisite_snapshots": false,
"overwrite_source_partitions": false,
"dry_run": true
}
}
}
}'
Daily 规则:
target_date 必填;daily wrapper 将它映射为 history source-to-marts 的 start_date=end_date=target_date。snapshot_reference_data 仍要求传 target_date,但底层 snapshot source/raw plan 忽略日期窗口。dry_run: true 只输出 expanded daily plan,不提交 child materialization runs。append-latest;历史修复仍走 backfill__fetch_history_sources_to_marts_job 的 replace-cascade。daily__fetch_history_sources_to_marts_schedule 是唯一 daily source-to-marts ScheduleDefinition,默认 stopped;当前 schedule config 为 dry_run: false,启用后提交真实 daily runs。docs/jobs/reports/2026-07-01-daily-fetch-history-sources-to-marts-schedule-job-dry-run.md。all_source_to_marts + full 的 terminal step 提交。key:source/ths__limit_up_pooltag:source=thsgroup:s3_sources--partition-range "2024-01-01...2024-01-31"--partition 2024eastmoney_run_pool,当前上限为 3 个 runcd pipeline
uv run dg launch --target-path scheduler --assets "key:source/ths__limit_up_pool" --partition-range "2024-01-01...2024-01-31"
uv run dg launch --target-path scheduler --assets "key:source/baostock__query_history_k_data_plus_daily" --partition 2024-01-02
uv run dg launch --target-path scheduler --assets "key:source/baostock__query_history_k_data_plus_daily" --partition-range "2026-01-01...2026-06-24" --config-json '{"ops":{"source__baostock__query_history_k_data_plus_daily":{"config":{"overwrite_existing_partitions":false,"cutoff_trade_date":"2026-06-24"}}}}'
uv run dg launch --target-path scheduler --assets "key:source/baostock__query_history_k_data_plus_daily_compacted" --partition 2024
uv run dg launch --target-path scheduler --assets "key:source/eastmoney__balance" --partition 2024
如果回填需要下面这些能力,就改用 Python 包装器:
ClickHouse 四层 database 迁移(fleur_raw / fleur_staging / fleur_intermediate / fleur_marts)已于 2026-06-02 完成;决策见 docs/ADR/0009-clickhouse-layered-databases.md,执行记录见 docs/plans/archive/0026-clickhouse-layered-database-migration-implementation-plan.md。下面只保留日常 raw sync 回填的可复用规则。
年分区 raw sync 按 --partition YYYY 单年运行,跨年时按年份循环:
cd pipeline
uv run dg launch --target-path scheduler \
--assets "key:clickhouse/raw/<dataset>" \
--partition YYYY
snapshot raw sync 不传 partition:
cd pipeline
uv run dg launch --target-path scheduler \
--assets "key:clickhouse/raw/<snapshot-dataset>"
不要用旧 clickhouse__raw_sync_all_job 作为历史分区已全部同步的证明;该 job
当前不再 registered。历史同步范围以 unified controller plan 或逐分区 run log 为准。