Workflow and Source Panels
Dispatcher Branch Panel
Route a command through scalar branch logic while replay shows the selected path.
dispatcher branch
Branch-based dispatch avoids stored function values and keeps Lua replay scalar.
Dispatcher Branch Panel
dispatcher_branch_panel.lua
Replay: real traced execution (multi-file project)
local mode = "status"
local access = "ok"
local handled = ""
if mode == "refresh" then
handled = "cache:" .. mode
elseif mode == "archive" then
access = "review"
handled = "queue:" .. mode
else
handled = "handled:" .. mode
end
print("mode=" .. mode)
print("access=" .. access)
print(handled)
local mode = "refresh"
local access = "ok"
local handled = ""
if mode == "refresh" then
handled = "cache:" .. mode
elseif mode == "archive" then
access = "review"
handled = "queue:" .. mode
else
handled = "handled:" .. mode
end
print("mode=" .. mode)
print("access=" .. access)
print(handled)
local mode = "archive"
local access = "ok"
local handled = ""
if mode == "refresh" then
handled = "cache:" .. mode
elseif mode == "archive" then
access = "review"
handled = "queue:" .. mode
else
handled = "handled:" .. mode
end
print("mode=" .. mode)
print("access=" .. access)
print(handled)
mode ← status, access ← ok, handled ← (empty)
1local mode→ status = "status" --@mode="refresh", "archive"2local access→ ok = "ok"3local handled→ (empty) = ""handled ← handled:status
9 handled = "queue:" .. mode10else11 handled→ handled:status = "handled:" .. modestatus12endprint("mode=" .. mode)
14print("mode=" .. modestatus)15print("access=" .. accessok)16print(handledhandled:status)outputmode=status access=ok handled:status
mode ← refresh, access ← ok, handled ← (empty)
1local mode→ refresh = "refresh"2local access→ ok = "ok"3local handled→ (empty) = ""handled ← cache:refresh
5if moderefresh == "refresh" then6 handled→ cache:refresh = "cache:" .. moderefresh7elseif mode == "archive" thenprint("mode=" .. mode)
14print("mode=" .. moderefresh)15print("access=" .. accessok)16print(handledcache:refresh)outputmode=refresh access=ok cache:refresh
mode ← archive, access ← ok, handled ← (empty)
1local mode→ archive = "archive"2local access→ ok = "ok"3local handled→ (empty) = ""access ← review, handled ← queue:archive
6 handled = "cache:" .. mode7elseif modearchive == "archive" then8 access→ review = "review"9 handled→ queue:archive = "queue:" .. modearchive10elseprint("mode=" .. mode)
14print("mode=" .. modearchive)15print("access=" .. accessreview)16print(handledqueue:archive)outputmode=archive access=review queue:archive