@intentius/chant 0.115.0 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/handlers/run-generate.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.d.ts +7 -0
- package/dist/cli/handlers/run-wave.d.ts.map +1 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +5 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/lexicon.d.ts +22 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/op/generate-pipeline.d.ts +15 -1
- package/dist/op/generate-pipeline.d.ts.map +1 -1
- package/dist/op/index.d.ts +6 -2
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/op-waves-run.d.ts +115 -0
- package/dist/op/op-waves-run.d.ts.map +1 -0
- package/dist/op/op-waves.d.ts +139 -0
- package/dist/op/op-waves.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/cli/handlers/run-generate.ts +51 -1
- package/src/cli/handlers/run-wave.ts +43 -0
- package/src/cli/main.ts +14 -0
- package/src/cli/registry.ts +5 -1
- package/src/lexicon.ts +26 -0
- package/src/op/generate-pipeline.ts +49 -0
- package/src/op/index.ts +13 -2
- package/src/op/op-waves-run.ts +325 -0
- package/src/op/op-waves.test.ts +95 -0
- package/src/op/op-waves.ts +224 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { opWaveJobs, opWaveShare, type OpWavesSpec } from "./op-waves";
|
|
6
|
+
import { runOpWave, type OpWaveExec, type OpWaveShowAtBase } from "./op-waves-run";
|
|
7
|
+
import { memoryGateLedgerPort } from "./gate";
|
|
8
|
+
import { waveSetDigest } from "../gated-waves";
|
|
9
|
+
|
|
10
|
+
const spec: OpWavesSpec = {
|
|
11
|
+
name: "migrations",
|
|
12
|
+
op: "migrate",
|
|
13
|
+
plan: ["tool", "plan", "{target}", "--out", "{plan}"],
|
|
14
|
+
apply: ["tool", "apply", "{target}", "--plan", "{plan}"],
|
|
15
|
+
waves: [
|
|
16
|
+
{ name: "dev", runs: [{ target: "dev" }], gate: "never" },
|
|
17
|
+
{ name: "staging", runs: [{ target: "staging" }], gate: "on-destructive" },
|
|
18
|
+
{ name: "prod", runs: [{ target: "t3" }, { target: "t1" }, { target: "t2" }], shares: 2 },
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
describe("opWaveJobs", () => {
|
|
23
|
+
test("one job per wave, a deciding job and share jobs for a wide one, each wave needing the last", () => {
|
|
24
|
+
const jobs = opWaveJobs(spec, "waves.json");
|
|
25
|
+
expect(jobs.map((j) => [j.jobName, j.needs])).toEqual([
|
|
26
|
+
["wave-1-dev", []],
|
|
27
|
+
["wave-2-staging", ["wave-1-dev"]],
|
|
28
|
+
["wave-3-prod-decide", ["wave-2-staging"]],
|
|
29
|
+
["wave-3-prod-share-1", ["wave-3-prod-decide"]],
|
|
30
|
+
["wave-3-prod-share-2", ["wave-3-prod-decide"]],
|
|
31
|
+
]);
|
|
32
|
+
expect(jobs[2]!.command.join(" ")).toBe("chant run wave --spec waves.json --wave 3 --decide");
|
|
33
|
+
expect(jobs[4]!.command.join(" ")).toBe("chant run wave --spec waves.json --wave 3 --share 2");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test("shares slice the runs by target", () => {
|
|
37
|
+
const runs = spec.waves[2]!.runs;
|
|
38
|
+
expect(opWaveShare(runs, 1, 2).map((r) => r.target)).toEqual(["t1", "t2"]);
|
|
39
|
+
expect(opWaveShare(runs, 2, 2).map((r) => r.target)).toEqual(["t3"]);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("runOpWave", () => {
|
|
44
|
+
function harness(plans: Record<string, { planDigest: string; destructive?: boolean }>, policyAtBase: string | null) {
|
|
45
|
+
const cwd = mkdtempSync(join(tmpdir(), "op-waves-"));
|
|
46
|
+
const calls: string[] = [];
|
|
47
|
+
const exec: OpWaveExec = (argv, dir) => {
|
|
48
|
+
calls.push(argv.join(" "));
|
|
49
|
+
if (argv[1] === "plan") writeFileSync(join(dir, argv[4]!), JSON.stringify(plans[argv[2]!]));
|
|
50
|
+
return 0;
|
|
51
|
+
};
|
|
52
|
+
const show: OpWaveShowAtBase = () => ({ sha: "b".repeat(40), text: policyAtBase });
|
|
53
|
+
return { cwd, calls, exec, show, done: () => rmSync(cwd, { recursive: true, force: true }) };
|
|
54
|
+
}
|
|
55
|
+
const digest = (n: string) => `sha256:${n.repeat(64)}`;
|
|
56
|
+
|
|
57
|
+
test("the policy comes from the base commit: a change that sets staging to never still waits", async () => {
|
|
58
|
+
const h = harness({ staging: { planDigest: digest("a"), destructive: true } }, JSON.stringify(spec));
|
|
59
|
+
const loosened = { ...spec, waves: spec.waves.map((w) => ({ ...w, gate: "never" as const })) };
|
|
60
|
+
const gates = memoryGateLedgerPort();
|
|
61
|
+
const result = await runOpWave({ spec: loosened, specFile: "waves.json", wave: 2, cwd: h.cwd, exec: h.exec, show: h.show, gates });
|
|
62
|
+
expect(result.exitCode).toBe(3);
|
|
63
|
+
expect(result.decision).toMatchObject({ policy: "on-destructive", policySource: "base", status: "waiting", gate: "migrations-wave-2" });
|
|
64
|
+
expect(gates.appended[0]!.planDigest).toBe(waveSetDigest([{ member: "staging", planDigest: digest("a") }]));
|
|
65
|
+
expect(h.calls.some((c) => c.startsWith("tool apply"))).toBe(false);
|
|
66
|
+
h.done();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("an approval of the set digest lets the wave apply; a non-destructive plan needs none", async () => {
|
|
70
|
+
const h = harness({ staging: { planDigest: digest("a"), destructive: true } }, JSON.stringify(spec));
|
|
71
|
+
const set = waveSetDigest([{ member: "staging", planDigest: digest("a") }]);
|
|
72
|
+
const gates = memoryGateLedgerPort({
|
|
73
|
+
resolutions: [{ version: 1, op: "migrations", gate: "migrations-wave-2", resolvedBy: "alice", timestamp: "2026-10-10T00:00:00Z", planDigest: set }],
|
|
74
|
+
});
|
|
75
|
+
const approved = await runOpWave({ spec, specFile: "waves.json", wave: 2, cwd: h.cwd, exec: h.exec, show: h.show, gates });
|
|
76
|
+
expect(approved).toMatchObject({ exitCode: 0, applied: ["staging"], decision: { status: "approved", approvedBy: "alice" } });
|
|
77
|
+
h.done();
|
|
78
|
+
|
|
79
|
+
const quiet = harness({ staging: { planDigest: digest("c") } }, JSON.stringify(spec));
|
|
80
|
+
const free = await runOpWave({ spec, specFile: "waves.json", wave: 2, cwd: quiet.cwd, exec: quiet.exec, show: quiet.show, gates: memoryGateLedgerPort() });
|
|
81
|
+
expect(free).toMatchObject({ exitCode: 0, applied: ["staging"], decision: { status: "not-required" } });
|
|
82
|
+
quiet.done();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("a share refuses a run whose plan moved since the decision", async () => {
|
|
86
|
+
const plans: Record<string, { planDigest: string }> = { t1: { planDigest: digest("1") }, t2: { planDigest: digest("2") }, t3: { planDigest: digest("3") } };
|
|
87
|
+
const h = harness(plans, JSON.stringify({ ...spec, waves: spec.waves.map((w) => ({ ...w, gate: "never" })) }));
|
|
88
|
+
const decided = await runOpWave({ spec, specFile: "waves.json", wave: 3, decide: true, cwd: h.cwd, exec: h.exec, show: h.show, gates: memoryGateLedgerPort() });
|
|
89
|
+
expect(decided).toMatchObject({ exitCode: 0, applied: [], decision: { status: "not-required" } });
|
|
90
|
+
plans.t2 = { planDigest: digest("9") };
|
|
91
|
+
const share = await runOpWave({ spec, specFile: "waves.json", wave: 3, share: 1, cwd: h.cwd, exec: h.exec, show: h.show });
|
|
92
|
+
expect(share).toMatchObject({ exitCode: 4, applied: ["t1"], moved: ["t2"] });
|
|
93
|
+
h.done();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gated waves of Op runs (#3679): a pipeline that applies one Op per
|
|
3
|
+
* environment, or per target in a set, in order, each wave behind one gate.
|
|
4
|
+
*
|
|
5
|
+
* A product built on chant that applies a migration to dev, then staging, then
|
|
6
|
+
* prod, or the same change to every tenant database of an environment, used to
|
|
7
|
+
* render that ordering itself, once per forge, and compute each wave's set
|
|
8
|
+
* digest itself. This module holds the forge-neutral part: the spec, the jobs
|
|
9
|
+
* it becomes and the commands they run. Each forge lexicon (github, gitlab,
|
|
10
|
+
* forgejo) renders these jobs with its own transport, so the three cannot
|
|
11
|
+
* disagree about order or commands. `./op-waves-run.ts` is what the jobs run.
|
|
12
|
+
*
|
|
13
|
+
* ## Jobs
|
|
14
|
+
*
|
|
15
|
+
* A wave is one job, `wave-<k>-<name>`, running `chant run wave --spec <file>
|
|
16
|
+
* --wave <k>`: plan every run, decide the wave's gate, apply. A wide wave
|
|
17
|
+
* (`shares` > 1) is a deciding job that plans every run and decides the gate,
|
|
18
|
+
* plus `shares` jobs that each apply a slice of the runs and refuse a run
|
|
19
|
+
* whose plan moved since the decision. Each wave's jobs need the previous
|
|
20
|
+
* wave's last jobs, so a wave that waits (exit 3) or fails stops every later
|
|
21
|
+
* wave.
|
|
22
|
+
*
|
|
23
|
+
* ## The gate
|
|
24
|
+
*
|
|
25
|
+
* Wave k waits on `waveGateName(<gate>, k)`, recorded under the spec's name,
|
|
26
|
+
* bound to {@link waveSetDigest} over its runs' plan digests (`../gated-waves.ts`,
|
|
27
|
+
* the same digest a component fan-out's wave binds). Whether it waits at all
|
|
28
|
+
* is the wave's gate policy, read from the base commit's copy of the spec
|
|
29
|
+
* file, so a change cannot loosen the rule that gates its own merge.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import type { OpEnvironment, OpSetupStep } from "../lexicon";
|
|
33
|
+
|
|
34
|
+
/** When a wave waits for an approval. */
|
|
35
|
+
export type OpWaveGatePolicy =
|
|
36
|
+
/** Whenever the wave changes something. */
|
|
37
|
+
| "always"
|
|
38
|
+
/** When a run's plan says it is destructive. */
|
|
39
|
+
| "on-destructive"
|
|
40
|
+
/** Never: only review and branch protection stand in front of the wave. */
|
|
41
|
+
| "never";
|
|
42
|
+
|
|
43
|
+
export const OP_WAVE_GATE_POLICIES: readonly OpWaveGatePolicy[] = ["always", "on-destructive", "never"];
|
|
44
|
+
|
|
45
|
+
/** One Op run in a wave: an Op applied to one target (an environment, a database, a tenant). */
|
|
46
|
+
export interface OpWaveRun {
|
|
47
|
+
/** What the run applies to. Unique within its wave; it names the run in the set digest. */
|
|
48
|
+
target: string;
|
|
49
|
+
/** The Op to run. Default: the spec's `op`. */
|
|
50
|
+
op?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** One wave: runs that apply together, behind one gate. */
|
|
54
|
+
export interface OpWave {
|
|
55
|
+
/** The wave's name, usually its environment. Lowercase letters, digits, `-` and `_`. */
|
|
56
|
+
name: string;
|
|
57
|
+
runs: OpWaveRun[];
|
|
58
|
+
/**
|
|
59
|
+
* When the wave waits. Default `"always"`. The runner reads this from the
|
|
60
|
+
* spec file at the base commit, never from the change being applied.
|
|
61
|
+
*/
|
|
62
|
+
gate?: OpWaveGatePolicy;
|
|
63
|
+
/**
|
|
64
|
+
* Split the wave into a deciding job and this many share jobs, each
|
|
65
|
+
* applying a slice of the runs. Default 1: one job plans, decides and
|
|
66
|
+
* applies.
|
|
67
|
+
*/
|
|
68
|
+
shares?: number;
|
|
69
|
+
/** The forge deployment environment the wave's jobs run in (GitHub and GitLab; Forgejo has none). */
|
|
70
|
+
environment?: OpEnvironment;
|
|
71
|
+
/** Variables for this wave's jobs alone. */
|
|
72
|
+
variables?: Record<string, string>;
|
|
73
|
+
/** Steps this wave's jobs run after the checkout, as `ScheduledOpSpec.setup`. */
|
|
74
|
+
setup?: OpSetupStep[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* An ordered list of waves of Op runs, as a pipeline and as the file its jobs
|
|
79
|
+
* read. Commands are argv templates; each `{op}`, `{target}`, `{wave}` and
|
|
80
|
+
* `{plan}` is replaced per run.
|
|
81
|
+
*/
|
|
82
|
+
export interface OpWavesSpec {
|
|
83
|
+
/** The pipeline's name, and the op the wave gates are recorded under (`chant approve <name> <gate>-wave-<k>`). */
|
|
84
|
+
name: string;
|
|
85
|
+
/** The Op a run runs when it names none. */
|
|
86
|
+
op: string;
|
|
87
|
+
/** The base gate name. Default: `name`. */
|
|
88
|
+
gate?: string;
|
|
89
|
+
/** Branches whose pushes run the waves. Default `["main"]`. */
|
|
90
|
+
branches?: string[];
|
|
91
|
+
/**
|
|
92
|
+
* The commit the gate policy is read from. Default `HEAD^1`, the first
|
|
93
|
+
* parent: on a merge or squash onto the branch, the branch before the change.
|
|
94
|
+
*/
|
|
95
|
+
base?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Plan one run and write its plan file to `{plan}`: JSON `{ "planDigest":
|
|
98
|
+
* string, "destructive"?: boolean, "empty"?: boolean }`. `destructive` is
|
|
99
|
+
* what `on-destructive` waits on; a wave whose runs are all `empty` never
|
|
100
|
+
* waits.
|
|
101
|
+
*/
|
|
102
|
+
plan: string[];
|
|
103
|
+
/** Apply one run whose plan is at `{plan}`. Default `chant run {op} --env {target}`. */
|
|
104
|
+
apply?: string[];
|
|
105
|
+
waves: OpWave[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** The default apply command. */
|
|
109
|
+
export const OP_WAVE_DEFAULT_APPLY = ["chant", "run", "{op}", "--env", "{target}"];
|
|
110
|
+
|
|
111
|
+
/** Where the runner keeps a wave's decision; a wide wave's deciding job hands it to its share jobs. */
|
|
112
|
+
export function opWaveRecordPath(spec: Pick<OpWavesSpec, "name">, wave: number): string {
|
|
113
|
+
return `.chant/op-waves/${spec.name}/wave-${wave}.json`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** One generated job. */
|
|
117
|
+
export interface OpWaveJob {
|
|
118
|
+
jobName: string;
|
|
119
|
+
/** 1-based wave number. */
|
|
120
|
+
wave: number;
|
|
121
|
+
/** The wave's name. */
|
|
122
|
+
waveName: string;
|
|
123
|
+
/** `wave`: plan, decide and apply. `decide`: plan and decide. `share`: apply one slice. */
|
|
124
|
+
kind: "wave" | "decide" | "share";
|
|
125
|
+
/** 1-based, on a share job. */
|
|
126
|
+
share?: number;
|
|
127
|
+
/** Jobs this one waits on. */
|
|
128
|
+
needs: string[];
|
|
129
|
+
/** The job's command, as argv. */
|
|
130
|
+
command: string[];
|
|
131
|
+
/** On a share job: the decision record to download. On a deciding job: the one to upload. */
|
|
132
|
+
record?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const NAME = /^[a-z0-9][a-z0-9_-]*$/;
|
|
136
|
+
|
|
137
|
+
/** Refuse a spec no job could run, naming what is wrong. */
|
|
138
|
+
export function assertOpWavesSpec(spec: OpWavesSpec): void {
|
|
139
|
+
const where = `Op waves "${spec.name}"`;
|
|
140
|
+
if (!NAME.test(spec.name)) throw new Error(`${where}: the name must be lowercase letters, digits, "-" and "_"`);
|
|
141
|
+
if (!spec.op) throw new Error(`${where} names no \`op\`. Name the Op a run runs when it names none.`);
|
|
142
|
+
if (!Array.isArray(spec.plan) || spec.plan.length === 0) {
|
|
143
|
+
throw new Error(`${where} has no \`plan\` command. Each wave plans its runs to bind its gate to their plan digests.`);
|
|
144
|
+
}
|
|
145
|
+
if (!spec.plan.some((part) => part.includes("{plan}"))) {
|
|
146
|
+
throw new Error(`${where}: the \`plan\` command never names {plan}, the file it writes the plan digest to.`);
|
|
147
|
+
}
|
|
148
|
+
if (spec.waves.length === 0) throw new Error(`${where} has no waves.`);
|
|
149
|
+
const names = new Set<string>();
|
|
150
|
+
for (const wave of spec.waves) {
|
|
151
|
+
if (!NAME.test(wave.name)) {
|
|
152
|
+
throw new Error(`${where}: wave "${wave.name}" must be named with lowercase letters, digits, "-" and "_"`);
|
|
153
|
+
}
|
|
154
|
+
if (names.has(wave.name)) throw new Error(`${where} names wave "${wave.name}" twice.`);
|
|
155
|
+
names.add(wave.name);
|
|
156
|
+
if (wave.gate !== undefined && !OP_WAVE_GATE_POLICIES.includes(wave.gate)) {
|
|
157
|
+
throw new Error(`${where}: wave "${wave.name}" has gate "${wave.gate}"; use ${OP_WAVE_GATE_POLICIES.join(", ")}.`);
|
|
158
|
+
}
|
|
159
|
+
if (wave.runs.length === 0) throw new Error(`${where}: wave "${wave.name}" has no runs.`);
|
|
160
|
+
const targets = new Set<string>();
|
|
161
|
+
for (const run of wave.runs) {
|
|
162
|
+
if (!run.target) throw new Error(`${where}: wave "${wave.name}" has a run with no target.`);
|
|
163
|
+
if (targets.has(run.target)) throw new Error(`${where}: wave "${wave.name}" names target "${run.target}" twice.`);
|
|
164
|
+
targets.add(run.target);
|
|
165
|
+
}
|
|
166
|
+
const shares = wave.shares ?? 1;
|
|
167
|
+
if (!Number.isInteger(shares) || shares < 1) {
|
|
168
|
+
throw new Error(`${where}: wave "${wave.name}" has shares ${wave.shares}; use a whole number from 1.`);
|
|
169
|
+
}
|
|
170
|
+
if (shares > wave.runs.length) {
|
|
171
|
+
throw new Error(`${where}: wave "${wave.name}" has ${shares} shares for ${wave.runs.length} runs, so a share would apply nothing.`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The runs share `share` (1-based) of `shares` applies: the wave's runs sorted
|
|
178
|
+
* by target, cut into contiguous slices whose sizes differ by at most one.
|
|
179
|
+
*/
|
|
180
|
+
export function opWaveShare<T extends { target: string }>(runs: readonly T[], share: number, shares: number): T[] {
|
|
181
|
+
const sorted = [...runs].sort((a, b) => (a.target < b.target ? -1 : a.target > b.target ? 1 : 0));
|
|
182
|
+
const base = Math.floor(sorted.length / shares);
|
|
183
|
+
const extra = sorted.length % shares;
|
|
184
|
+
const start = (share - 1) * base + Math.min(share - 1, extra);
|
|
185
|
+
const size = base + (share <= extra ? 1 : 0);
|
|
186
|
+
return sorted.slice(start, start + size);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The jobs of an Op waves pipeline, in order. `specFile` is the spec's path
|
|
191
|
+
* from the job's working directory, which every command names.
|
|
192
|
+
*/
|
|
193
|
+
export function opWaveJobs(spec: OpWavesSpec, specFile: string): OpWaveJob[] {
|
|
194
|
+
assertOpWavesSpec(spec);
|
|
195
|
+
const jobs: OpWaveJob[] = [];
|
|
196
|
+
let previous: string[] = [];
|
|
197
|
+
spec.waves.forEach((wave, index) => {
|
|
198
|
+
const k = index + 1;
|
|
199
|
+
const command = ["chant", "run", "wave", "--spec", specFile, "--wave", String(k), ...(spec.base ? ["--base", spec.base] : [])];
|
|
200
|
+
const prefix = `wave-${k}-${wave.name}`;
|
|
201
|
+
const shares = wave.shares ?? 1;
|
|
202
|
+
if (shares === 1) {
|
|
203
|
+
jobs.push({ jobName: prefix, wave: k, waveName: wave.name, kind: "wave", needs: previous, command });
|
|
204
|
+
previous = [prefix];
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const record = opWaveRecordPath(spec, k);
|
|
208
|
+
const decide = `${prefix}-decide`;
|
|
209
|
+
jobs.push({ jobName: decide, wave: k, waveName: wave.name, kind: "decide", needs: previous, command: [...command, "--decide"], record });
|
|
210
|
+
const shareJobs: string[] = [];
|
|
211
|
+
for (let share = 1; share <= shares; share++) {
|
|
212
|
+
const jobName = `${prefix}-share-${share}`;
|
|
213
|
+
shareJobs.push(jobName);
|
|
214
|
+
jobs.push({ jobName, wave: k, waveName: wave.name, kind: "share", share, needs: [decide], command: [...command, "--share", String(share)], record });
|
|
215
|
+
}
|
|
216
|
+
previous = shareJobs;
|
|
217
|
+
});
|
|
218
|
+
return jobs;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** The wave a job belongs to. */
|
|
222
|
+
export function opWaveOf(spec: OpWavesSpec, job: Pick<OpWaveJob, "wave">): OpWave {
|
|
223
|
+
return spec.waves[job.wave - 1]!;
|
|
224
|
+
}
|