From b81fd90c5962fb5112b96d90dd935a079721dc50 Mon Sep 17 00:00:00 2001 From: Loning Date: Sat, 20 Jun 2026 22:37:25 +0800 Subject: [PATCH] refactor(saga): convert rollup_merge to std.saga.department MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert github-devloop rollup_merge (consumes devloop_rollup_ready, produces {}) to std.saga.department: done=false, no accept, act = old pipeline body byte-for-byte (caller-verified empty body diff) — the is_supported skip, with_lock, all gate/validation skips (dry-run, head/base mismatch, foreign-head, ci-merge-gate, merge-fail), run_verified_pr_merge, and log_apply kept in act in order. wrap=core.wrap_pipeline_failure with name "rollup_merge" preserved (old had it). saga-handler.allowlist (G10 4->3). sshx-reviewed (3/3 approve); full test 9 packages 0 failed. ⟦AI:FKST⟧ Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_0163uaeg6woT12QeZE1cAkn6 --- migration/saga-handler.allowlist | 1 - .../departments/rollup_merge/main.lua | 20 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/migration/saga-handler.allowlist b/migration/saga-handler.allowlist index 99e63143..3857c928 100644 --- a/migration/saga-handler.allowlist +++ b/migration/saga-handler.allowlist @@ -1,4 +1,3 @@ -packages/github-devloop/departments/rollup_merge/main.lua packages/github-devloop/departments/rollup_scan/main.lua packages/github-devloop/departments/sync_conflict/main.lua packages/github-devloop/departments/sync_scan/main.lua diff --git a/packages/github-devloop/departments/rollup_merge/main.lua b/packages/github-devloop/departments/rollup_merge/main.lua index e7ce79fb..3b41cf03 100644 --- a/packages/github-devloop/departments/rollup_merge/main.lua +++ b/packages/github-devloop/departments/rollup_merge/main.lua @@ -1,13 +1,16 @@ local core = require("core") +local saga = require("std.saga") -local M = {} - -M.spec = { +local spec = { consumes = { "devloop_rollup_ready" }, produces = {}, stall_window = "5m", } +local function done(_event) + return false +end + local function log_skip(payload, reason) core.log_line("info", "rollup_merge", "rollup", "GATE", { "repo=" .. tostring(core.payload_field(payload, "repo")), @@ -17,7 +20,7 @@ local function log_skip(payload, reason) }) end -function pipeline(event) +local function act(event) local payload = event.payload or {} if not core.is_supported_rollup_ready(payload) then core.log_entry("rollup_merge", event, "rollup", core.payload_field(payload, "dedup_key")) @@ -78,6 +81,9 @@ function pipeline(event) end) end -pipeline = core.wrap_pipeline_failure("rollup_merge", pipeline) - -return M +return saga.department(spec, { + done = done, + act = act, + wrap = core.wrap_pipeline_failure, + name = "rollup_merge", +})