From 9fa84e24b35bafd1aff3bf9223c8f643eddf6b45 Mon Sep 17 00:00:00 2001 From: Loning Date: Sat, 20 Jun 2026 23:03:28 +0800 Subject: [PATCH] refactor(saga): convert rollup_scan to std.saga.department MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert github-devloop rollup_scan to std.saga.department: done=false, act = old pipeline body byte-for-byte (branches skip + with_lock + core.log_raise(devloop_rollup_ready) + helpers preserved in order), wrap=core.wrap_pipeline_failure name="rollup_scan". The full spec is preserved: consumes, both produces in order, fanout = { "devloop_branch_tick" }, and stall_window. saga-handler.allowlist (G10 3->2). Note: the first review round caught that the initial conversion DROPPED the spec `fanout = { "devloop_branch_tick" }` field (a static-graph regression); it was restored and the spec now matches origin exactly. An audit confirmed no prior merged saga slice dropped a spec field (their originals had none). sshx-reviewed (re-review 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_scan/main.lua | 20 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/migration/saga-handler.allowlist b/migration/saga-handler.allowlist index 3857c928..1d28fdf9 100644 --- a/migration/saga-handler.allowlist +++ b/migration/saga-handler.allowlist @@ -1,3 +1,2 @@ -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_scan/main.lua b/packages/github-devloop/departments/rollup_scan/main.lua index f191b5ef..350c87a9 100644 --- a/packages/github-devloop/departments/rollup_scan/main.lua +++ b/packages/github-devloop/departments/rollup_scan/main.lua @@ -1,14 +1,17 @@ local core = require("core") +local saga = require("std.saga") -local M = {} - -M.spec = { +local spec = { consumes = { "devloop_branch_tick" }, produces = { "devloop_rollup_ready", "github-proxy.github_issue_create_request" }, fanout = { "devloop_branch_tick" }, stall_window = "5m", } +local function done(_event) + return false +end + local function require_repo(repo) local value = tostring(repo or "") if value == "" or core.safe_repo(value) ~= value then @@ -84,7 +87,7 @@ local function create_rollup_pr(repo, upstream, integration, head_sha, ahead, pu error("github-devloop: rollup PR create failed: " .. tostring(result.stderr)) end -function pipeline(event) +local function act(event) core.log_entry("rollup_scan", event, "rollup", event and event.queue or "") local branches = core.branch_config() local cfg = core.devloop_config() @@ -163,6 +166,9 @@ function pipeline(event) end) end -pipeline = core.wrap_pipeline_failure("rollup_scan", pipeline) - -return M +return saga.department(spec, { + done = done, + act = act, + wrap = core.wrap_pipeline_failure, + name = "rollup_scan", +})