From 1cb7aecec419b3a8b1ee19ced59a980b386e69f8 Mon Sep 17 00:00:00 2001 From: RiriAgent <39219425+RiriAgent@users.noreply.github.com> Date: Tue, 1 Dec 2026 23:23:25 +0900 Subject: [PATCH 1/2] test(sim): updated normalizeDispatchCall to handle new launch: true parameter - NormalizeDispatchCall now checks args.launch === true and extracts role from args.role instead of from args.launch.role. Refs #268 --- tests/sim/run.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sim/run.ts b/tests/sim/run.ts index 0cffeb8..41b7369 100644 --- a/tests/sim/run.ts +++ b/tests/sim/run.ts @@ -318,8 +318,8 @@ function normalizeDispatchCall(name: string | undefined, args: Record Date: Tue, 1 Dec 2026 23:37:26 +0900 Subject: [PATCH 2/2] feat(sim): added launchRole support to sim scenarios and launch-role test case - StartPlan updated to pass scenario.launchRole in dispatch_step args when launch:true. - Added launch-role test case reusing head scenario with launchRole owner and excluding ROLE_LAUNCH from check. - Added launchRole optional to scenario schema. Refs #268 --- tests/sim/extension.ts | 8 +++++++- tests/sim/run.ts | 13 +++++++++++++ tests/sim/scenario.ts | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/sim/extension.ts b/tests/sim/extension.ts index df372b6..81aa0f3 100644 --- a/tests/sim/extension.ts +++ b/tests/sim/extension.ts @@ -108,7 +108,13 @@ function* startPlan(trigger: string): MainPlan { }, }, }; - for (const id of opened.value?.launchable ?? []) yield { call: { name: "dispatch_step", args: { ticketId: id, launch: true } } }; + for (const id of opened.value?.launchable ?? []) + yield { + call: { + name: "dispatch_step", + args: { ticketId: id, launch: true, ...(scenario.launchRole === undefined ? {} : { role: scenario.launchRole }) }, + }, + }; } function* attentionPlan(trigger: string): MainPlan { diff --git a/tests/sim/run.ts b/tests/sim/run.ts index 41b7369..3be3ab9 100644 --- a/tests/sim/run.ts +++ b/tests/sim/run.ts @@ -1408,6 +1408,19 @@ cases.push({ meerkat: { holdComment: null }, check: async (run) => [...(await tree.check(run)), ...(await meerkatChecks(run))], }); +const head = cases.find((item) => item.name === "head")!; +const ROLE_LAUNCH = "Main named a role in launch"; +cases.push({ + ...head, + name: "launch-role", + scenario: (markers) => ({ ...head.scenario(markers), launchRole: "owner" }), + check: async (run) => { + const failures = await head.check(run); + return failures.includes(ROLE_LAUNCH) + ? failures.filter((failure) => failure !== ROLE_LAUNCH) + : [...failures, `${ROLE_LAUNCH} went unreported`]; + }, +}); cases.push(...askCases({ agenda, waitUntil, start, kill, modelLog, seatSessions, simState, commonChecks })); const selected = process.argv.slice(2); diff --git a/tests/sim/scenario.ts b/tests/sim/scenario.ts index 1a4590a..56cdf2a 100644 --- a/tests/sim/scenario.ts +++ b/tests/sim/scenario.ts @@ -57,6 +57,7 @@ export const scenarioSchema = z.object({ workRoles: z.array(z.string()), retryFailed: z.string().optional(), resumeFirst: z.string().optional(), + launchRole: z.string().optional(), log: z.string(), }); export type Scenario = z.infer;