1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-- vendored from evalframe v0.4.0 (~/.algocline/packages/evalframe/swarm/init.lua)
-- DO NOT EDIT here — upstream sync via manual copy
--[[
evalframe.swarm — Swarm evaluation DSL
Provides declarative primitives for Swarm-based evaluation.
The actual tick loop (runner) is user-provided.
Implement a runner function that receives config and returns a SwarmTrace.
Usage:
local sw = require("evalframe.swarm")
local env = sw.env "troubleshooting" { scenario = "memory_leak" }
local actions = sw.actions {
sw.action "CheckStatus" { description = "Check service health" },
sw.action "ReadLogs" { description = "Read logs", target = "service" },
}
local swarm_cfg = sw.swarm { workers = 3, max_ticks = 20 }
local provider = sw.provider(my_runner, {
env = env, actions = actions, swarm = swarm_cfg,
})
]]
local env_mod = require
local actions_mod = require
local config_mod = require
local trace_mod = require
local provider_mod = require
local M =
-- Declarations
M. = env_mod.
M. = actions_mod.
M. = actions_mod.
M. = config_mod.
-- Trace construction
M. = trace_mod.
-- Provider adapter
M. = provider_mod.
-- Graders (DSL layer — the primary API for trace evaluation)
M. = require
-- Analysis (multi-trace aggregate)
M. = require
-- Type checks
M. = env_mod.
M. = actions_mod.
M. = actions_mod.
M. = config_mod.
M. = trace_mod.
return M