Your Name
681b5ac949
run-migration / migrate (push) Failing after 12s
Type Sync Check / check-type-sync (push) Successful in 1m25s
CD Pipeline / build-and-deploy (push) Failing after 1m48s
feat(flywheel): W1 PR-R1 規則→Playbook 遷移 + PR-K1 timeline 防禦 ALTER
W1 第二波:onboarder 飛輪 80→90 路徑剩餘兩件 PR。
## PR-R1 — 25 條 yaml 規則 → DRAFT Playbook 遷移
斷鏈背景(onboarder C2):alert_rules.yaml 25 條規則 68% 寫死 RESTART,
沒有對應 Playbook → RAG 永遠 generic_fallback → 規則命中率沒回饋給 catalog。
修法:
- 新建 services/rule_to_playbook_migrator.py
- 自動從 alert_rules.yaml 解析每條 rule
- 產生 PlaybookRecord(status=DRAFT, ai_confidence=0.3, source=YAML_RULE)
- 誠實標示信心 0.3(非假 1.0,違反 feedback_confidence_truthfulness)
- INSERT ON CONFLICT 冪等(name LIKE 'AutoMigrated: %' 去重,不擾動 seed)
- 新建 scripts/migrate_rules_to_playbooks.py(CLI: --dry-run/--commit/--disable-flag)
- ENABLE_RULE_MIGRATION_DRAFT=true(rollback flag)
- 23 測試覆蓋(parse / build_dict / idempotent / dry_run / action_type /
severity_map / feature_flag / wildcard_filter / partial_existing 等)
## PR-K1 — timeline_events 防禦性 ALTER(db-expert finding)
任務原前提錯誤:onboarder 報告的 C7 斷鏈(incident_id 欄位)在
2026-04-24 P1.6 已修復 ORM。但生產環境若在 P1.6 前已建表,create_all 跳過
已存在的表 → ORM 寫入 SELECT 仍可能找不到 column。
修法:
- db/base.py:init_db() 補防禦性 ALTER:
ALTER TABLE timeline_events ADD COLUMN IF NOT EXISTS incident_id VARCHAR(64);
CREATE INDEX IF NOT EXISTS ix_timeline_incident_id ON timeline_events(incident_id);
- IF NOT EXISTS 為 no-op 安全(已有 column 不做事)
- stage 欄位是任務描述的幻覺(codebase 0 writer),不新增
未做:
- alembic migration(專案不用 alembic,遵循既有 init_db ALTER pattern)
- onboarder C7 在 ORM 層已修,本 commit 確保 prod schema 對齊
## 驗證
- 1608 unit tests 全綠(+23 from 1585)
- PR-R1 23 個測試獨立通過
## 期望影響
- 飛輪 RAG 終於有 25 條 DRAFT Playbook 可查 → +5 分
- prod schema 對齊保險 → 防 ORM SELECT 失敗
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:49:25 +08:00
..
2026-04-25 03:29:38 +08:00
2026-04-27 14:57:16 +08:00
2026-03-26 16:06:20 +08:00
2026-04-25 02:33:43 +08:00
2026-04-05 14:45:02 +08:00
2026-03-31 16:25:00 +08:00
2026-04-10 11:22:57 +08:00
2026-04-06 11:49:24 +08:00
2026-04-27 08:15:53 +08:00
2026-04-27 08:15:53 +08:00
2026-04-27 20:04:49 +08:00
2026-04-22 01:33:30 +08:00
2026-04-29 10:44:39 +08:00
2026-04-20 04:13:02 +08:00
2026-04-22 01:41:34 +08:00
2026-04-20 19:40:01 +08:00
2026-04-20 19:40:01 +08:00
2026-04-14 14:39:14 +08:00
2026-04-14 15:10:10 +08:00
2026-04-25 00:14:07 +08:00
2026-03-29 15:27:49 +08:00
2026-04-14 14:39:14 +08:00
2026-03-29 15:27:49 +08:00
2026-04-27 08:11:40 +08:00
2026-04-27 15:22:31 +08:00
2026-04-14 20:43:40 +08:00
2026-03-29 15:48:03 +08:00
2026-04-12 22:50:20 +08:00
2026-04-27 08:11:40 +08:00
2026-04-27 08:11:40 +08:00
2026-04-27 16:12:30 +08:00
2026-04-27 19:46:56 +08:00
2026-04-27 08:11:40 +08:00
2026-04-11 22:05:52 +08:00
2026-04-27 14:42:29 +08:00
2026-04-27 08:11:40 +08:00
2026-04-26 20:56:19 +08:00
2026-03-31 12:16:54 +08:00
2026-04-15 12:44:53 +08:00
2026-04-14 18:43:29 +08:00
2026-04-11 21:33:19 +08:00
2026-04-26 20:17:17 +08:00
2026-04-01 11:11:50 +08:00
2026-04-28 15:27:33 +08:00
2026-04-27 15:06:58 +08:00
2026-04-07 11:17:40 +08:00
2026-03-31 16:16:16 +08:00
2026-04-27 14:54:19 +08:00
2026-04-29 10:44:39 +08:00
2026-04-29 10:44:39 +08:00
2026-04-29 10:44:39 +08:00
2026-04-26 20:44:19 +08:00
2026-03-31 12:20:29 +08:00
2026-04-26 20:18:33 +08:00
2026-03-26 16:06:20 +08:00
2026-04-29 10:44:39 +08:00
2026-04-15 13:08:38 +08:00
2026-04-12 13:32:42 +08:00
2026-04-27 14:57:16 +08:00
2026-04-27 14:58:46 +08:00
2026-03-29 20:49:23 +08:00
2026-04-03 14:00:21 +08:00
2026-04-26 20:18:33 +08:00
2026-04-27 15:47:41 +08:00
2026-04-26 20:18:33 +08:00
2026-04-16 00:13:00 +08:00
2026-04-27 08:11:40 +08:00
2026-04-27 08:17:59 +08:00
2026-04-09 08:55:21 +08:00
2026-04-05 00:14:50 +08:00
2026-04-05 00:14:50 +08:00
2026-03-26 16:06:20 +08:00
2026-04-14 15:19:54 +08:00
2026-04-15 13:08:38 +08:00
2026-04-15 13:08:38 +08:00
2026-03-31 14:17:36 +08:00
2026-04-27 19:56:51 +08:00
2026-03-29 16:23:30 +08:00
2026-03-23 23:51:37 +08:00
2026-04-14 14:39:14 +08:00
2026-04-27 16:08:50 +08:00
2026-04-29 10:49:25 +08:00
2026-04-15 13:08:38 +08:00
2026-04-20 04:23:09 +08:00
2026-04-27 08:24:59 +08:00
2026-04-27 16:00:00 +08:00
2026-04-09 09:01:59 +08:00
2026-04-27 14:42:29 +08:00
2026-04-10 01:12:00 +08:00
2026-04-26 20:48:51 +08:00
2026-04-27 19:56:51 +08:00
2026-04-12 21:08:48 +08:00
2026-04-12 21:20:16 +08:00
2026-03-31 16:16:16 +08:00
2026-04-22 01:27:39 +08:00
2026-04-27 08:24:37 +08:00
2026-04-27 08:11:40 +08:00
2026-04-27 15:06:58 +08:00