import sqlite3, json, time DB_PATH = '/root/.hermes/kanban/boards/research-hub/kanban.db' TS = int(time.time()) project_path = "/opt/ai-os/products/ceo/content/research/educational_planning_positions" conn = sqlite3.connect(DB_PATH) c = conn.cursor() # Lam sach c.execute("DELETE FROM tasks") c.execute("DELETE FROM task_links") tasks = [ { "id": f"ep_p1a_{TS}", "title": "[Phase 1a] Khảo sát & Khám phá — Xác định danh sách trường, methodology", "assignee": "r-and-d", "status": "done", "skills": json.dumps(["web_search", "paper_search_mcp"]), "body": f"Project: {project_path}/research_plan.md" }, { "id": f"ep_p1b_{TS}", "title": "[Phase 1b] Xây dựng Research Output Template", "assignee": "r-and-d", "status": "done", "skills": json.dumps([]), "body": f"Template: {project_path}/research_output_template.md" }, { "id": f"ep_p2_us_{TS}", "title": "[Phase 2a] Deep Research — Mỹ (US)", "assignee": "r-and-d", "status": "blocked", "skills": json.dumps(["web_search", "notebooklm-research"]), "body": f"""[CONTEXT] Project: {project_path} Bắt buộc ĐỌC: research_plan.md và research_output_template.md [PROFILE] r-and-d — thực hiện nghiên cứu và phân tích chính sách giáo dục. [MỤC TIÊU] Nghiên cứu chi tiết từng trường Mỹ trong danh sách Phase 1a theo đúng research_output_template.md. [OUTPUT] {project_path}/master_reports/educational_planning_us.md [MANUAL GATE] Ghi output → comment (kèm link Funnel) → done → DỪNG. Chờ user duyệt.""" }, { "id": f"ep_p2_uk_{TS}", "title": "[Phase 2b] Deep Research — Anh (UK)", "assignee": "r-and-d", "status": "blocked", "skills": json.dumps(["web_search", "notebooklm-research"]), "body": f"""[CONTEXT] Project: {project_path} Bắt buộc ĐỌC: research_plan.md và research_output_template.md [PROFILE] r-and-d — thực hiện nghiên cứu và phân tích chính sách giáo dục. [MỤC TIÊU] Nghiên cứu chi tiết từng trường Anh trong danh sách Phase 1a theo đúng research_output_template.md. [OUTPUT] {project_path}/master_reports/educational_planning_uk.md [MANUAL GATE] Ghi output → comment (kèm link Funnel) → done → DỪNG. Chờ user duyệt.""" }, { "id": f"ep_p2_cn_{TS}", "title": "[Phase 2c] Deep Research — Trung Quốc (China)", "assignee": "r-and-d", "status": "blocked", "skills": json.dumps(["web_search", "notebooklm-research"]), "body": f"""[CONTEXT] Project: {project_path} Bắt buộc ĐỌC: research_plan.md và research_output_template.md [PROFILE] r-and-d — thực hiện nghiên cứu và phân tích chính sách giáo dục. [MỤC TIÊU] Nghiên cứu chi tiết từng trường Trung Quốc trong danh sách Phase 1a theo đúng research_output_template.md. Tìm kiếm bằng tiếng Trung và tiếng Anh. [OUTPUT] {project_path}/master_reports/educational_planning_china.md [MANUAL GATE] Ghi output → comment (kèm link Funnel) → done → DỪNG. Chờ user duyệt.""" }, { "id": f"ep_p2_au_{TS}", "title": "[Phase 2d] Deep Research — Úc (Australia)", "assignee": "r-and-d", "status": "blocked", "skills": json.dumps(["web_search", "notebooklm-research"]), "body": f"""[CONTEXT] Project: {project_path} Bắt buộc ĐỌC: research_plan.md và research_output_template.md [PROFILE] r-and-d — thực hiện nghiên cứu và phân tích chính sách giáo dục. [MỤC TIÊU] Nghiên cứu chi tiết từng trường Úc trong danh sách Phase 1a theo đúng research_output_template.md. [OUTPUT] {project_path}/master_reports/educational_planning_australia.md [MANUAL GATE] Ghi output → comment (kèm link Funnel) → done → DỪNG. Chờ user duyệt.""" }, { "id": f"ep_p3_{TS}", "title": "[Phase 3] Tổng hợp & So sánh 4 quốc gia (US, UK, CN, AU)", "assignee": "writers", "status": "blocked", "skills": json.dumps([]), "body": f"""[CONTEXT] Project: {project_path} ĐỌC TOÀN BỘ: educational_planning_us.md, educational_planning_uk.md, educational_planning_china.md, educational_planning_australia.md ĐỌC: research_plan.md, research_output_template.md [PROFILE] writers — biên tập và tổng hợp báo cáo, viết ma trận so sánh liên quốc gia. [MỤC TIÊU] 1. Đọc toàn bộ 4 master reports. 2. Xây dựng ma trận đối sánh 4 quốc gia trên các tiêu chí: — Mục tiêu giáo dục chiến lược của từng trường — Tên gọi vị trí hoạch định (US: Institutional Research / Strategic Planning; UK: PVC / Planning & BI; China: Phát triển Quy hoạch xử; AU: Planning & BI) — JD, yêu cầu tuyển dụng, kỹ năng — Lý do hình thành vị trí — Cấp bậc, reporting line — Mức độ tập trung (centralized vs decentralized) 3. Phân tích nguyên nhân khác biệt: văn hoá, lịch sử, chính sách giáo dục quốc gia. 4. Chỉ ra xu hướng chung giữa 4 quốc gia. 5. Cập nhật index.md. [OUTPUT] {project_path}/master_reports/comparative_analysis.md {project_path}/index.md [MANUAL GATE] Ghi output → comment → done → DỪNG. Chờ user duyệt.""" }, { "id": f"ep_p4a_{TS}", "title": "[Phase 4a] Phản biện chất lượng — Review comparative_analysis.md", "assignee": "grill-qa", "status": "blocked", "skills": json.dumps(["research-critism"]), "body": f"""[CONTEXT] Project: {project_path} ĐỌC: comparative_analysis.md, research_plan.md, và các báo cáo master. [PROFILE] grill-qa (reviewer) — đóng vai trò phản biện độc lập. Chạy research-critism để bắt lỗi và nâng cao chất lượng nghiên cứu. [MỤC TIÊU] 1. Kiểm tra tính chính xác của dữ liệu và trích dẫn. 2. Phát hiện khoảng trống thông tin, thiếu sót trong phân tích. 3. Đánh giá chất lượng lập luận, logic so sánh. 4. Đề xuất cải thiện cụ thể (từng mục trong comparative_analysis.md). [OUTPUT] Tạo file: {project_path}/master_reports/review_notes.md Ghi critique vào comment của task Phase 3 và Phase 4a. [MANUAL GATE] Ghi output → comment → done → DỪNG. Chờ user duyệt.""" }, { "id": f"ep_p4b_{TS}", "title": "[Phase 4b] Writers chỉnh sửa comparative_analysis.md sau review", "assignee": "writers", "status": "blocked", "skills": json.dumps([]), "body": f"""[CONTEXT] Project: {project_path} ĐỌC: review_notes.md, comparative_analysis.md [PROFILE] writers — chỉnh sửa và hoàn thiện báo cáo dựa trên góp ý phản biện. [MỤC TIÊU] 1. Đọc review_notes.md (danh sách đề xuất cải thiện từ Phase 4a). 2. Đọc comparative_analysis.md phiên bản hiện tại. 3. Chỉnh sửa comparative_analysis.md theo từng đề xuất trong review_notes.md. 4. Cập nhật index.md nếu cần. [OUTPUT] {project_path}/master_reports/comparative_analysis.md (sau chỉnh sửa) {project_path}/index.md (cập nhật nếu có) [MANUAL GATE] Ghi output → comment → done → DỪNG. Chờ user duyệt lâm thời.""" } ] # Insert tasks for t in tasks: c.execute(""" INSERT INTO tasks ( id, title, assignee, status, body, skills, created_at, goal_mode, workspace_kind, priority, consecutive_failures, block_recurrences ) VALUES (?, ?, ?, ?, ?, ?, ?, 1, 'scratch', 0, 0, 0) """, (t["id"], t["title"], t["assignee"], t["status"], t["body"], t["skills"], TS)) # Create links p2_us = f"ep_p2_us_{TS}" p2_uk = f"ep_p2_uk_{TS}" p2_cn = f"ep_p2_cn_{TS}" p2_au = f"ep_p2_au_{TS}" p3 = f"ep_p3_{TS}" p4a = f"ep_p4a_{TS}" p4b = f"ep_p4b_{TS}" # P1b -> P2x (tạm thời không cần vì P1b đã done) # P2x -> P3 for src in [p2_us, p2_uk, p2_cn, p2_au]: c.execute("INSERT INTO task_links (parent_id, child_id) VALUES (?, ?)", (src, p3)) # P3 -> P4a c.execute("INSERT INTO task_links (parent_id, child_id) VALUES (?, ?)", (p3, p4a)) # P4a -> P4b c.execute("INSERT INTO task_links (parent_id, child_id) VALUES (?, ?)", (p4a, p4b)) conn.commit() conn.close() print("Kanban structure v3 created successfully!")