@opensip-cli/simulation 0.1.6 → 0.1.8
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/README.md +2 -2
- package/dist/__tests__/public-api.test.js +2 -1
- package/dist/__tests__/public-api.test.js.map +1 -1
- package/dist/__tests__/registry-cross-kind.test.js +1 -1
- package/dist/__tests__/registry-cross-kind.test.js.map +1 -1
- package/dist/__tests__/scenario-execution.test.js +1 -1
- package/dist/__tests__/scenario-execution.test.js.map +1 -1
- package/dist/__tests__/sim-failure-signal.test.js +1 -1
- package/dist/__tests__/sim-failure-signal.test.js.map +1 -1
- package/dist/__tests__/test-utils/with-sim-scope.d.ts.map +1 -1
- package/dist/__tests__/test-utils/with-sim-scope.js +2 -2
- package/dist/__tests__/test-utils/with-sim-scope.js.map +1 -1
- package/dist/__tests__/tool-live-view.test.js +2 -2
- package/dist/__tests__/tool-live-view.test.js.map +1 -1
- package/dist/__tests__/tool-show-mode.test.js +2 -2
- package/dist/__tests__/tool-show-mode.test.js.map +1 -1
- package/dist/__tests__/tool.test.js +26 -13
- package/dist/__tests__/tool.test.js.map +1 -1
- package/dist/cli/__tests__/report-data.test.d.ts +2 -0
- package/dist/cli/__tests__/report-data.test.d.ts.map +1 -0
- package/dist/cli/__tests__/report-data.test.js +44 -0
- package/dist/cli/__tests__/report-data.test.js.map +1 -0
- package/dist/cli/__tests__/sim-runner.test.js +18 -2
- package/dist/cli/__tests__/sim-runner.test.js.map +1 -1
- package/dist/cli/__tests__/sim-worker.test.js +1 -1
- package/dist/cli/__tests__/sim-worker.test.js.map +1 -1
- package/dist/cli/__tests__/sim.test.js +18 -18
- package/dist/cli/__tests__/sim.test.js.map +1 -1
- package/dist/cli/report-data.d.ts +35 -0
- package/dist/cli/report-data.d.ts.map +1 -0
- package/dist/cli/report-data.js +41 -0
- package/dist/cli/report-data.js.map +1 -0
- package/dist/cli/sim-recipes.d.ts +36 -0
- package/dist/cli/sim-recipes.d.ts.map +1 -0
- package/dist/cli/sim-recipes.js +65 -0
- package/dist/cli/sim-recipes.js.map +1 -0
- package/dist/cli/sim-runner.d.ts.map +1 -1
- package/dist/cli/sim-runner.js +20 -22
- package/dist/cli/sim-runner.js.map +1 -1
- package/dist/cli/sim-worker.d.ts.map +1 -1
- package/dist/cli/sim-worker.js +1 -0
- package/dist/cli/sim-worker.js.map +1 -1
- package/dist/cli/sim.d.ts +9 -6
- package/dist/cli/sim.d.ts.map +1 -1
- package/dist/cli/sim.js +15 -9
- package/dist/cli/sim.js.map +1 -1
- package/dist/framework/__tests__/assertions.test.js +0 -4
- package/dist/framework/__tests__/assertions.test.js.map +1 -1
- package/dist/framework/__tests__/resolve-metric.test.js +0 -6
- package/dist/framework/__tests__/resolve-metric.test.js.map +1 -1
- package/dist/framework/__tests__/result-builder.test.js +7 -3
- package/dist/framework/__tests__/result-builder.test.js.map +1 -1
- package/dist/framework/assertions.d.ts +0 -15
- package/dist/framework/assertions.d.ts.map +1 -1
- package/dist/framework/assertions.js +0 -33
- package/dist/framework/assertions.js.map +1 -1
- package/dist/framework/resolve-metric.d.ts +0 -13
- package/dist/framework/resolve-metric.d.ts.map +1 -1
- package/dist/framework/resolve-metric.js +0 -19
- package/dist/framework/resolve-metric.js.map +1 -1
- package/dist/framework/scenario-metric-key.d.ts +1 -1
- package/dist/framework/scenario-metric-key.d.ts.map +1 -1
- package/dist/kinds/chaos/__tests__/executor.test.js +4 -4
- package/dist/kinds/chaos/__tests__/executor.test.js.map +1 -1
- package/dist/kinds/chaos/config.d.ts +5 -2
- package/dist/kinds/chaos/config.d.ts.map +1 -1
- package/dist/kinds/chaos/define.d.ts +1 -1
- package/dist/kinds/chaos/define.js +4 -4
- package/dist/kinds/chaos/define.js.map +1 -1
- package/dist/kinds/chaos/executor.js +3 -3
- package/dist/kinds/chaos/executor.js.map +1 -1
- package/dist/persistence/session-replay.d.ts +9 -4
- package/dist/persistence/session-replay.d.ts.map +1 -1
- package/dist/persistence/session-replay.js +8 -9
- package/dist/persistence/session-replay.js.map +1 -1
- package/dist/persistence/session-replay.test.js +9 -8
- package/dist/persistence/session-replay.test.js.map +1 -1
- package/dist/plugins/__tests__/loader-scenarios.test.js +2 -2
- package/dist/plugins/__tests__/loader-scenarios.test.js.map +1 -1
- package/dist/recipes/__tests__/recipes.test.js +1 -1
- package/dist/recipes/__tests__/recipes.test.js.map +1 -1
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js +43 -61
- package/dist/tool.js.map +1 -1
- package/package.json +12 -8
|
@@ -69,12 +69,12 @@ describe('executeSim', () => {
|
|
|
69
69
|
assertions: [ASSERTIONS.lowErrorRate(1)],
|
|
70
70
|
}));
|
|
71
71
|
const { result } = await executeSim(args());
|
|
72
|
-
expect(result.type).toBe('
|
|
73
|
-
if (result.type === '
|
|
74
|
-
expect(result.
|
|
72
|
+
expect(result.type).toBe('run-presentation');
|
|
73
|
+
if (result.type === 'run-presentation') {
|
|
74
|
+
expect(result.envelope.recipe).toBe('default');
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
it('returns
|
|
77
|
+
it('returns an envelope-backed result with per-scenario outcomes', async () => {
|
|
78
78
|
currentScenarioRegistry().register(defineLoadScenario({
|
|
79
79
|
id: 'load-a',
|
|
80
80
|
name: 'load-a',
|
|
@@ -86,8 +86,8 @@ describe('executeSim', () => {
|
|
|
86
86
|
assertions: [ASSERTIONS.lowErrorRate(1)],
|
|
87
87
|
}));
|
|
88
88
|
const { result } = await executeSim(args());
|
|
89
|
-
expect(result.type).toBe('
|
|
90
|
-
if (result.type === '
|
|
89
|
+
expect(result.type).toBe('run-presentation');
|
|
90
|
+
if (result.type === 'run-presentation') {
|
|
91
91
|
// ADR-0011: per-scenario facts live on the envelope's `units` sidecar
|
|
92
92
|
// (one unit per scenario, slug === scenarioId).
|
|
93
93
|
expect(result.envelope.units).toHaveLength(1);
|
|
@@ -105,8 +105,8 @@ describe('executeSim', () => {
|
|
|
105
105
|
run: () => Promise.reject(new Error('boom')),
|
|
106
106
|
});
|
|
107
107
|
const { result } = await executeSim(args());
|
|
108
|
-
expect(result.type).toBe('
|
|
109
|
-
if (result.type === '
|
|
108
|
+
expect(result.type).toBe('run-presentation');
|
|
109
|
+
if (result.type === 'run-presentation') {
|
|
110
110
|
expect(result.envelope.verdict.summary.failed).toBe(1);
|
|
111
111
|
// ADR-0035: the single host verdict drives the exit (no `shouldFail` field).
|
|
112
112
|
// A crashed scenario carries a unit error → the run verdict fails.
|
|
@@ -136,7 +136,7 @@ describe('executeSim', () => {
|
|
|
136
136
|
run: () => Promise.reject(new Error('a-specific-message')),
|
|
137
137
|
});
|
|
138
138
|
const { result } = await executeSim(args());
|
|
139
|
-
if (result.type === '
|
|
139
|
+
if (result.type === 'run-presentation') {
|
|
140
140
|
// The scenario's thrown error is carried on its unit (slug === scenarioId).
|
|
141
141
|
expect(result.envelope.units[0]?.error).toContain('a-specific-message');
|
|
142
142
|
}
|
|
@@ -154,8 +154,8 @@ describe('executeSim', () => {
|
|
|
154
154
|
run: () => Promise.resolve(loadResultWithSignal('sig-scenario', 'some-other-source', 'low', 'fyi')),
|
|
155
155
|
});
|
|
156
156
|
const { result } = await executeSim(args());
|
|
157
|
-
expect(result.type).toBe('
|
|
158
|
-
if (result.type === '
|
|
157
|
+
expect(result.type).toBe('run-presentation');
|
|
158
|
+
if (result.type === 'run-presentation') {
|
|
159
159
|
const sig = result.envelope.signals.find((s) => s.message === 'fyi');
|
|
160
160
|
expect(sig?.source).toBe('sig-scenario');
|
|
161
161
|
}
|
|
@@ -173,15 +173,15 @@ describe('executeSim', () => {
|
|
|
173
173
|
run: () => Promise.resolve(loadResultWithSignal('crit-scenario', 'crit-scenario', 'critical', 'meltdown')),
|
|
174
174
|
});
|
|
175
175
|
const { result } = await executeSim(args());
|
|
176
|
-
expect(result.type).toBe('
|
|
177
|
-
if (result.type === '
|
|
176
|
+
expect(result.type).toBe('run-presentation');
|
|
177
|
+
if (result.type === 'run-presentation') {
|
|
178
178
|
const unit = result.envelope.units.find((u) => u.slug === 'crit-scenario');
|
|
179
179
|
// passed:true from the executor, but the critical signal flips the unit.
|
|
180
180
|
expect(unit?.passed).toBe(false);
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
183
|
});
|
|
184
|
-
/** Run a minimal sim and return its
|
|
184
|
+
/** Run a minimal sim and return its RunPresentation — the caller persists it.
|
|
185
185
|
* Hoisted to module scope (called inside the per-test scope from beforeEach). */
|
|
186
186
|
async function simDone() {
|
|
187
187
|
currentScenarioRegistry().register(defineLoadScenario({
|
|
@@ -195,8 +195,8 @@ async function simDone() {
|
|
|
195
195
|
assertions: [ASSERTIONS.lowErrorRate(1)],
|
|
196
196
|
}));
|
|
197
197
|
const { result } = await executeSim(args());
|
|
198
|
-
if (result.type !== '
|
|
199
|
-
throw new Error(`expected
|
|
198
|
+
if (result.type !== 'run-presentation')
|
|
199
|
+
throw new Error(`expected run-presentation, got ${result.type}`);
|
|
200
200
|
return result;
|
|
201
201
|
}
|
|
202
202
|
describe('sim session contribution → SessionRepo', () => {
|
|
@@ -213,8 +213,8 @@ describe('sim session contribution → SessionRepo', () => {
|
|
|
213
213
|
tool: 'sim',
|
|
214
214
|
startedAt: '1970-01-01T00:00:00.000Z',
|
|
215
215
|
completedAt: '1970-01-01T00:00:00.000Z',
|
|
216
|
-
cwd:
|
|
217
|
-
recipe: result.
|
|
216
|
+
cwd: process.cwd(),
|
|
217
|
+
recipe: result.envelope.recipe,
|
|
218
218
|
score: result.envelope.verdict.score,
|
|
219
219
|
passed: result.envelope.verdict.passed,
|
|
220
220
|
durationMs: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/sim.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAkB,MAAM,wBAAwB,CAAC;AAC1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AAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* report-data contribution — simulation's inputs to the cross-tool HTML report.
|
|
3
|
+
*
|
|
4
|
+
* Parity with fitness's `collectFitnessReportData` and graph's `collectReportData`
|
|
5
|
+
* (L6): sim returns ITS OWN dashboard catalog — the registered scenarios + sim
|
|
6
|
+
* recipes — under DISTINCT keys (`simScenarioCatalog` / `simRecipeCatalog`) so the
|
|
7
|
+
* CLI's `Object.assign` merge never clobbers another tool's catalog, and the
|
|
8
|
+
* dashboard's Simulation tab can render them. Scope-only reads (no I/O); a run
|
|
9
|
+
* without the sim subscope (or before any scenario pack loads) yields empty
|
|
10
|
+
* arrays, never a throw. Sessions stay host-owned (the CLI loads the cross-tool
|
|
11
|
+
* run history); this only contributes the catalog.
|
|
12
|
+
*/
|
|
13
|
+
import type { ToolScope } from '@opensip-cli/core';
|
|
14
|
+
/** Scenario catalog entry for the dashboard Simulation tab. */
|
|
15
|
+
export interface ScenarioCatalogEntry {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly kind: string;
|
|
19
|
+
readonly description: string;
|
|
20
|
+
readonly tags: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/** Sim recipe catalog entry for the dashboard Simulation tab. */
|
|
23
|
+
export interface SimRecipeCatalogEntry {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly displayName: string;
|
|
26
|
+
readonly description: string;
|
|
27
|
+
readonly tags: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Simulation's report-data contribution. Returns the scenario + recipe catalogs
|
|
31
|
+
* under sim-namespaced keys the dashboard consumes. A run without the sim
|
|
32
|
+
* subscope contributes empty arrays (the tab renders its graceful empty state).
|
|
33
|
+
*/
|
|
34
|
+
export declare function collectSimulationReportData(scope: ToolScope): Record<string, unknown>;
|
|
35
|
+
//# sourceMappingURL=report-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-data.d.ts","sourceRoot":"","sources":["../../src/cli/report-data.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBrF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// @fitness-ignore-file batch-operation-limits -- `scenarios.getAll()` reads the per-run IN-MEMORY scenario registry (bounded by pack registration), not a database query; it mirrors fitness's checkRegistry.list() catalog read (which avoids the heuristic only by its method name).
|
|
2
|
+
/**
|
|
3
|
+
* report-data contribution — simulation's inputs to the cross-tool HTML report.
|
|
4
|
+
*
|
|
5
|
+
* Parity with fitness's `collectFitnessReportData` and graph's `collectReportData`
|
|
6
|
+
* (L6): sim returns ITS OWN dashboard catalog — the registered scenarios + sim
|
|
7
|
+
* recipes — under DISTINCT keys (`simScenarioCatalog` / `simRecipeCatalog`) so the
|
|
8
|
+
* CLI's `Object.assign` merge never clobbers another tool's catalog, and the
|
|
9
|
+
* dashboard's Simulation tab can render them. Scope-only reads (no I/O); a run
|
|
10
|
+
* without the sim subscope (or before any scenario pack loads) yields empty
|
|
11
|
+
* arrays, never a throw. Sessions stay host-owned (the CLI loads the cross-tool
|
|
12
|
+
* run history); this only contributes the catalog.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Simulation's report-data contribution. Returns the scenario + recipe catalogs
|
|
16
|
+
* under sim-namespaced keys the dashboard consumes. A run without the sim
|
|
17
|
+
* subscope contributes empty arrays (the tab renders its graceful empty state).
|
|
18
|
+
*/
|
|
19
|
+
export function collectSimulationReportData(scope) {
|
|
20
|
+
const sim = scope.simulation;
|
|
21
|
+
// In-memory registry reads (only the scenarios/recipes registered this run,
|
|
22
|
+
// bounded by pack registration) — catalog reads, not I/O queries; they mirror
|
|
23
|
+
// fitness's checkRegistry.list(). See the file-level unbounded-memory waiver.
|
|
24
|
+
const scenarios = sim ? sim.scenarios.getAll() : [];
|
|
25
|
+
const recipes = sim ? sim.recipes.getAllRecipes() : [];
|
|
26
|
+
const simScenarioCatalog = scenarios.map((s) => ({
|
|
27
|
+
id: s.id,
|
|
28
|
+
name: s.name,
|
|
29
|
+
kind: s.kind,
|
|
30
|
+
description: s.description,
|
|
31
|
+
tags: [...s.tags],
|
|
32
|
+
}));
|
|
33
|
+
const simRecipeCatalog = recipes.map((r) => ({
|
|
34
|
+
name: r.name,
|
|
35
|
+
displayName: r.displayName,
|
|
36
|
+
description: r.description,
|
|
37
|
+
tags: [...(r.tags ?? [])],
|
|
38
|
+
}));
|
|
39
|
+
return { simScenarioCatalog, simRecipeCatalog };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=report-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-data.js","sourceRoot":"","sources":["../../src/cli/report-data.ts"],"names":[],"mappings":"AAAA,uRAAuR;AACvR;;;;;;;;;;;GAWG;AAqBH;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAgB;IAC1D,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC;IAC7B,4EAA4E;IAC5E,8EAA8E;IAC9E,8EAA8E;IAC9E,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvD,MAAM,kBAAkB,GAA2B,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACvE,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;KAClB,CAAC,CAAC,CAAC;IACJ,MAAM,gBAAgB,GAA4B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACpE,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;KAC1B,CAAC,CAAC,CAAC;IACJ,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sim-recipes command — list all available simulation recipes
|
|
3
|
+
* (tool-command-surface-taxonomy Task 3.3).
|
|
4
|
+
*
|
|
5
|
+
* Sim already supports RUNNING a recipe (`sim --recipe <name>`) but had no
|
|
6
|
+
* command to LIST recipes — a missing discoverability command, not an omission.
|
|
7
|
+
* This adds the equivalent of fitness's `listRecipes` (`cli/fit-recipes.ts`) and
|
|
8
|
+
* graph's `listGraphRecipes` (`cli/graph-recipes.ts`): it maps the scope-bound
|
|
9
|
+
* simulation recipe registry to the shared `ListRecipesResult` contract so the
|
|
10
|
+
* existing CLI renderer (`viewListRecipes`) handles the output with no contracts
|
|
11
|
+
* change. `checkCount` is a free-form label; sim reuses it for tags / a built-in
|
|
12
|
+
* marker.
|
|
13
|
+
*
|
|
14
|
+
* The command mounts only in the canonical nested `<tool> <verb>` form
|
|
15
|
+
* (`sim recipes`, `parent: 'sim'`) via the Phase 0 nested-mount capability — sim
|
|
16
|
+
* never had a legacy flat `sim-recipes`, so there is nothing to alias.
|
|
17
|
+
*/
|
|
18
|
+
import type { ListRecipesResult } from '@opensip-cli/contracts';
|
|
19
|
+
import type { CommandSpec, ToolCliContext } from '@opensip-cli/core';
|
|
20
|
+
/**
|
|
21
|
+
* Returns metadata for every registered simulation recipe (built-in plus
|
|
22
|
+
* user-defined). Loads sim plugins first (via {@link ensureScenariosLoaded}) so
|
|
23
|
+
* project-local + package recipes appear, mirroring how `fit-recipes` calls
|
|
24
|
+
* `ensureChecksLoaded` before reading the registry. Reads
|
|
25
|
+
* `currentSimulationRecipeRegistry()`, so it runs inside the entered RunScope.
|
|
26
|
+
*/
|
|
27
|
+
export declare function listSimRecipes(projectDir?: string): Promise<ListRecipesResult>;
|
|
28
|
+
/**
|
|
29
|
+
* `sim recipes` — list available simulation recipes. Mounts as a SUBCOMMAND of
|
|
30
|
+
* the `sim` primary (`parent: 'sim'`, via the Phase 0 nested-mount capability).
|
|
31
|
+
* `command-result`: the host dispatches the returned result through the shared
|
|
32
|
+
* seam (`--json` → JSON, else the shared `viewListRecipes` renderer) — the same
|
|
33
|
+
* path `graph recipes` / `fit recipes` use.
|
|
34
|
+
*/
|
|
35
|
+
export declare const simRecipesCommandSpec: CommandSpec<unknown, ToolCliContext>;
|
|
36
|
+
//# sourceMappingURL=sim-recipes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-recipes.d.ts","sourceRoot":"","sources":["../../src/cli/sim-recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,wBAAwB,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAErE;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAmBpF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,OAAO,EAAE,cAAc,CAcrE,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sim-recipes command — list all available simulation recipes
|
|
3
|
+
* (tool-command-surface-taxonomy Task 3.3).
|
|
4
|
+
*
|
|
5
|
+
* Sim already supports RUNNING a recipe (`sim --recipe <name>`) but had no
|
|
6
|
+
* command to LIST recipes — a missing discoverability command, not an omission.
|
|
7
|
+
* This adds the equivalent of fitness's `listRecipes` (`cli/fit-recipes.ts`) and
|
|
8
|
+
* graph's `listGraphRecipes` (`cli/graph-recipes.ts`): it maps the scope-bound
|
|
9
|
+
* simulation recipe registry to the shared `ListRecipesResult` contract so the
|
|
10
|
+
* existing CLI renderer (`viewListRecipes`) handles the output with no contracts
|
|
11
|
+
* change. `checkCount` is a free-form label; sim reuses it for tags / a built-in
|
|
12
|
+
* marker.
|
|
13
|
+
*
|
|
14
|
+
* The command mounts only in the canonical nested `<tool> <verb>` form
|
|
15
|
+
* (`sim recipes`, `parent: 'sim'`) via the Phase 0 nested-mount capability — sim
|
|
16
|
+
* never had a legacy flat `sim-recipes`, so there is nothing to alias.
|
|
17
|
+
*/
|
|
18
|
+
import { defineCommand } from '@opensip-cli/core';
|
|
19
|
+
import { currentSimulationRecipeRegistry } from '../recipes/registry.js';
|
|
20
|
+
import { ensureScenariosLoaded } from './sim.js';
|
|
21
|
+
/**
|
|
22
|
+
* Returns metadata for every registered simulation recipe (built-in plus
|
|
23
|
+
* user-defined). Loads sim plugins first (via {@link ensureScenariosLoaded}) so
|
|
24
|
+
* project-local + package recipes appear, mirroring how `fit-recipes` calls
|
|
25
|
+
* `ensureChecksLoaded` before reading the registry. Reads
|
|
26
|
+
* `currentSimulationRecipeRegistry()`, so it runs inside the entered RunScope.
|
|
27
|
+
*/
|
|
28
|
+
export async function listSimRecipes(projectDir) {
|
|
29
|
+
// Load plugins so user-defined recipes (project-local + package scenarios with
|
|
30
|
+
// co-located recipes) are registered before we read the registry.
|
|
31
|
+
await ensureScenariosLoaded(projectDir);
|
|
32
|
+
const recipes = currentSimulationRecipeRegistry()
|
|
33
|
+
.listForDisplay()
|
|
34
|
+
.map((recipe) => ({
|
|
35
|
+
name: recipe.name,
|
|
36
|
+
description: recipe.description,
|
|
37
|
+
// `checkCount` is a free-form label the shared renderer prints in dim
|
|
38
|
+
// parentheses; sim reuses it to surface the built-in/user-defined origin.
|
|
39
|
+
checkCount: recipe.isBuiltIn ? 'built-in' : 'user-defined',
|
|
40
|
+
}));
|
|
41
|
+
return {
|
|
42
|
+
type: 'list-recipes',
|
|
43
|
+
recipes,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `sim recipes` — list available simulation recipes. Mounts as a SUBCOMMAND of
|
|
48
|
+
* the `sim` primary (`parent: 'sim'`, via the Phase 0 nested-mount capability).
|
|
49
|
+
* `command-result`: the host dispatches the returned result through the shared
|
|
50
|
+
* seam (`--json` → JSON, else the shared `viewListRecipes` renderer) — the same
|
|
51
|
+
* path `graph recipes` / `fit recipes` use.
|
|
52
|
+
*/
|
|
53
|
+
export const simRecipesCommandSpec = defineCommand({
|
|
54
|
+
name: 'recipes',
|
|
55
|
+
parent: 'sim',
|
|
56
|
+
description: 'List available simulation recipes',
|
|
57
|
+
commonFlags: ['cwd', 'json'],
|
|
58
|
+
scope: 'project',
|
|
59
|
+
output: 'command-result',
|
|
60
|
+
handler: async (rawOpts) => {
|
|
61
|
+
const opts = rawOpts;
|
|
62
|
+
return listSimRecipes(opts.cwd);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=sim-recipes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-recipes.js","sourceRoot":"","sources":["../../src/cli/sim-recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAKjD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,UAAmB;IACtD,+EAA+E;IAC/E,kEAAkE;IAClE,MAAM,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAExC,MAAM,OAAO,GAAG,+BAA+B,EAAE;SAC9C,cAAc,EAAE;SAChB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,sEAAsE;QACtE,0EAA0E;QAC1E,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc;KAC3D,CAAC,CAAC,CAAC;IAEN,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAyC,aAAa,CAGtF;IACA,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,mCAAmC;IAChD,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACzB,MAAM,IAAI,GAAG,OAAsB,CAAC;QACpC,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-runner.d.ts","sourceRoot":"","sources":["../../src/cli/sim-runner.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"sim-runner.d.ts","sourceRoot":"","sources":["../../src/cli/sim-runner.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA0BH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,WAAW,EAEjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAA8B,MAAM,OAAO,CAAC;AAUnD;;iDAEiD;AACjD,KAAK,WAAW,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAwC1F;;kDAEkD;AAClD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IACzD;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,YAAY,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACrE,mFAAmF;IACnF,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;CACxC;AAED;oEACoE;AACpE,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,WAAW,EACX,UAAU,EACV,SAAS,EACT,WAAW,GACZ,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAwKrC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,oBAAoB,EAC9B,WAAW,CAAC,EAAE,eAAe,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAyB5B"}
|
package/dist/cli/sim-runner.js
CHANGED
|
@@ -20,8 +20,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
20
20
|
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
21
21
|
import { tmpdir } from 'node:os';
|
|
22
22
|
import { join } from 'node:path';
|
|
23
|
-
import { Banner, ClockProvider, ErrorMessage, LiveProgress, normalizeBannerSize, ProjectHeader, renderToInk, RunFooterHints, RunHeader, RunSummary, RunTimingProvider, ThemeProvider, UpdateHint,
|
|
24
|
-
import { runOffThreadOrInProcess, currentScope, } from '@opensip-cli/core';
|
|
23
|
+
import { Banner, ClockProvider, ErrorMessage, LiveProgress, normalizeBannerSize, ProjectHeader, renderToInk, RunFooterHints, RunHeader, RunSummary, RunTimingProvider, shouldRenderRunFooterHints, ThemeProvider, UpdateHint, DEFAULT_RUN_FOOTER_HINTS, viewFindingsGroups, } from '@opensip-cli/cli-ui';
|
|
24
|
+
import { runOffThreadOrInProcess, currentScope, liveEngineCorrelation, } from '@opensip-cli/core';
|
|
25
25
|
import { Box, Static, useApp, render } from 'ink';
|
|
26
26
|
import React, { useEffect, useState } from 'react';
|
|
27
27
|
import { buildSimulationSessionPayload } from '../persistence/session-payload.js';
|
|
@@ -60,8 +60,18 @@ export function SimRunner({ args, setExitCode, onEnvelope, onSession, liveContex
|
|
|
60
60
|
const specDir = mkdtempSync(join(tmpdir(), 'sim-worker-'));
|
|
61
61
|
const specPath = join(specDir, 'spec.json');
|
|
62
62
|
writeFileSync(specPath, JSON.stringify(args), 'utf8');
|
|
63
|
+
// Forward the parent run's correlation bag (composition root, Phase 0) so the
|
|
64
|
+
// forked live-engine worker's logs attribute to this run — symmetric to the
|
|
65
|
+
// spawn-path shard-runner. The transport injects OPENSIP_RUN_ID from
|
|
66
|
+
// currentScope()?.runId (B1); the descriptor omits runId and marks the
|
|
67
|
+
// live-engine fork via workerKind.
|
|
68
|
+
const correlation = liveEngineCorrelation(currentScope()?.correlation);
|
|
63
69
|
const run = runOffThreadOrInProcess({
|
|
64
|
-
descriptor: {
|
|
70
|
+
descriptor: {
|
|
71
|
+
command: process.argv[1] ?? '',
|
|
72
|
+
argv: ['sim-run-worker', specPath],
|
|
73
|
+
...(correlation ? { correlation } : {}),
|
|
74
|
+
},
|
|
65
75
|
inProcess: (emit) => executeSimWithProgress(args, emit),
|
|
66
76
|
});
|
|
67
77
|
setState({ phase: 'running', subscribe: run.onProgress });
|
|
@@ -86,11 +96,13 @@ export function SimRunner({ args, setExitCode, onEnvelope, onSession, liveContex
|
|
|
86
96
|
// `deliverSignals`; the root sets the exit from `envelope.verdict.passed`.
|
|
87
97
|
// Host-owned persistence (host-owned-run-timing Phase 2): surface the
|
|
88
98
|
// contribution; the host persists after the live view exits.
|
|
89
|
-
|
|
99
|
+
// envelope-first-presentation: `result` is the render-only RunPresentation —
|
|
100
|
+
// cwd comes from `args.cwd` (in scope), recipe from `result.envelope.recipe`.
|
|
101
|
+
if (result.type === 'run-presentation') {
|
|
90
102
|
onSession?.({
|
|
91
103
|
tool: 'sim',
|
|
92
|
-
cwd:
|
|
93
|
-
recipe: result.
|
|
104
|
+
cwd: args.cwd,
|
|
105
|
+
recipe: result.envelope.recipe,
|
|
94
106
|
score: result.envelope.verdict.score,
|
|
95
107
|
passed: result.envelope.verdict.passed,
|
|
96
108
|
payload: buildSimulationSessionPayload(result.envelope),
|
|
@@ -101,8 +113,6 @@ export function SimRunner({ args, setExitCode, onEnvelope, onSession, liveContex
|
|
|
101
113
|
phase: 'done',
|
|
102
114
|
result: {
|
|
103
115
|
envelope: result.envelope,
|
|
104
|
-
// duration omitted for summary (host provider supplies); keep if present for other internal use
|
|
105
|
-
...(result.durationMs === undefined ? {} : { durationMs: result.durationMs }),
|
|
106
116
|
verboseDetail: result.verboseDetail,
|
|
107
117
|
},
|
|
108
118
|
});
|
|
@@ -130,26 +140,14 @@ export function SimRunner({ args, setExitCode, onEnvelope, onSession, liveContex
|
|
|
130
140
|
}
|
|
131
141
|
const { summary } = state.result.envelope.verdict;
|
|
132
142
|
const { verboseDetail } = state.result;
|
|
143
|
+
const renderPolicy = { verbose: args.verbose === true };
|
|
133
144
|
const findingsDetail = verboseDetail?.kind === 'findings' && verboseDetail.groups.length > 0
|
|
134
145
|
? verboseDetail
|
|
135
146
|
: undefined;
|
|
136
147
|
return (_jsxs(_Fragment, { children: [header, _jsxs(Box, { flexDirection: "column", children: [args.quiet !== true && findingsDetail !== undefined && (_jsx(Box, { children: renderToInk(viewFindingsGroups(findingsDetail.groups)) })), (() => {
|
|
137
148
|
const summaryEl = (_jsx(RunSummary, { passed: state.result.envelope.verdict.passed, errors: summary.errors, warnings: summary.warnings }));
|
|
138
149
|
return liveContext?.runSession ? (_jsx(RunTimingProvider, { timer: liveContext.runSession.timing, children: summaryEl })) : (summaryEl);
|
|
139
|
-
})(), args.quiet !== true && (_jsx(RunFooterHints, { hints:
|
|
140
|
-
? [
|
|
141
|
-
{
|
|
142
|
-
text: 'opensip report for HTML report',
|
|
143
|
-
bold: ['opensip report'],
|
|
144
|
-
},
|
|
145
|
-
]
|
|
146
|
-
: [
|
|
147
|
-
VERBOSE_DETAIL_HINT,
|
|
148
|
-
{
|
|
149
|
-
text: 'opensip report for HTML report',
|
|
150
|
-
bold: ['opensip report'],
|
|
151
|
-
},
|
|
152
|
-
] }))] })] }));
|
|
150
|
+
})(), args.quiet !== true && shouldRenderRunFooterHints(renderPolicy) && (_jsx(RunFooterHints, { hints: DEFAULT_RUN_FOOTER_HINTS }))] })] }));
|
|
153
151
|
}
|
|
154
152
|
/**
|
|
155
153
|
* Render the live `sim` view. Resolves once the Ink app exits with a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-runner.js","sourceRoot":"","sources":["../../src/cli/sim-runner.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,cAAc,EACd,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"sim-runner.js","sourceRoot":"","sources":["../../src/cli/sim-runner.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,cAAc,EACd,SAAS,EACT,UAAU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AAW,GACxB,GACY,GACF,CACjB,CAAC;IACF,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;IAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,wEAAwE;IACxE,kDAAkD;IAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-worker.d.ts","sourceRoot":"","sources":["../../src/cli/sim-worker.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAgB3B;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBtE;AAED,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"sim-worker.d.ts","sourceRoot":"","sources":["../../src/cli/sim-worker.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAgB3B;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBtE;AAED,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,OAAO,EAAE,cAAc,CAiBvE,CAAC"}
|
package/dist/cli/sim-worker.js
CHANGED
|
@@ -51,6 +51,7 @@ export async function executeSimWorker(specPath) {
|
|
|
51
51
|
/** `sim-run-worker` — [internal] headless sim run, IPC progress/result. */
|
|
52
52
|
export const simRunWorkerCommandSpec = defineCommand({
|
|
53
53
|
name: 'sim-run-worker',
|
|
54
|
+
visibility: 'internal',
|
|
54
55
|
description: '[internal] Run sim headless and stream progress + result over IPC (forked by the live view)',
|
|
55
56
|
commonFlags: [],
|
|
56
57
|
args: [{ name: 'specPath', description: 'Path to a JSON sim-args spec file' }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-worker.js","sourceRoot":"","sources":["../../src/cli/sim-worker.ts"],"names":[],"mappings":"AAAA,iSAAiS;AACjS;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,aAAa,GAId,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAStC,kEAAkE;AAClE,SAAS,IAAI,CAAC,GAAkD;IAC9D,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAkB,CAAC;QACzE,IAAI,CAAC;YACH,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,sBAAsB,EAAE;SAClF,CAAC,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE;YACvC,UAAU,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CAC/B,IAAI,CAAC;gBACH,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE;aACxE,CAAC;SACL,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C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ACA,IAAI,EAAE,gBAAgB;IACtB,UAAU,EAAE,UAAU;IACtB,WAAW,EACT,6FAA6F;IAC/F,WAAW,EAAE,EAAE;IACf,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IAC9E,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,YAAY;IACpB,eAAe,EAAE,YAAY;IAC7B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAiB,EAAE;QACxC,MAAM,QAAQ,GAAI,OAAyC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7E,MAAM,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;CACF,CAAC,CAAC"}
|
package/dist/cli/sim.d.ts
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* registered scenario, parallel mode). With `--recipe <name>`, looks
|
|
6
6
|
* the recipe up in the registry and runs it.
|
|
7
7
|
*
|
|
8
|
-
* Returns a
|
|
9
|
-
* callers (CLI / Tool layer)
|
|
8
|
+
* Returns a render-only `RunPresentation` carrying the run envelope (the
|
|
9
|
+
* per-scenario outcomes ride on `envelope.units`); callers (CLI / Tool layer)
|
|
10
|
+
* render or JSON-serialize the envelope as appropriate.
|
|
10
11
|
*
|
|
11
12
|
* Scenario loading lifecycle (mirrors fitness's `ensureChecksLoaded`):
|
|
12
13
|
*
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
* the CLI exists to prevent. (The loader only structured-logs the
|
|
20
21
|
* empty registry; the fatal decision is the command's.)
|
|
21
22
|
*/
|
|
22
|
-
import type { ErrorResult,
|
|
23
|
+
import type { ErrorResult, RunPresentation, ToolOptions } from '@opensip-cli/contracts';
|
|
23
24
|
/**
|
|
24
25
|
* Plugin load errors recorded during the most recent ensureScenariosLoaded()
|
|
25
26
|
* call — on `scope.simulation.load` now, NOT a module singleton (audit F1). Read
|
|
@@ -43,13 +44,15 @@ export interface ExecuteSimOptions {
|
|
|
43
44
|
readonly onProgress?: (completed: number, total: number) => void;
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
|
-
* Run sim and return
|
|
47
|
-
* recipe is missing). The caller
|
|
47
|
+
* Run sim and return the render-only {@link RunPresentation} (or an
|
|
48
|
+
* {@link ErrorResult} when the recipe is missing / no scenarios run). The caller
|
|
49
|
+
* decides what to print or render. `recipeName`/`cwd` are no longer on the render
|
|
50
|
+
* object (the handler recovers them from `result.envelope.recipe` + `opts.cwd`).
|
|
48
51
|
*/
|
|
49
52
|
export declare function executeSim(args: ToolOptions & {
|
|
50
53
|
readonly verbose?: boolean;
|
|
51
54
|
}, opts?: ExecuteSimOptions): Promise<{
|
|
52
|
-
result:
|
|
55
|
+
result: RunPresentation;
|
|
53
56
|
} | {
|
|
54
57
|
result: ErrorResult;
|
|
55
58
|
}>;
|
package/dist/cli/sim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim.d.ts","sourceRoot":"","sources":["../../src/cli/sim.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sim.d.ts","sourceRoot":"","sources":["../../src/cli/sim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAwBH,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,WAAW,EAGZ,MAAM,wBAAwB,CAAC;AAOhC;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,MAAM,EAAE,CAEvD;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC9E;AA4ED,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClE;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,EAClD,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC,CA+HhE"}
|
package/dist/cli/sim.js
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* registered scenario, parallel mode). With `--recipe <name>`, looks
|
|
6
6
|
* the recipe up in the registry and runs it.
|
|
7
7
|
*
|
|
8
|
-
* Returns a
|
|
9
|
-
* callers (CLI / Tool layer)
|
|
8
|
+
* Returns a render-only `RunPresentation` carrying the run envelope (the
|
|
9
|
+
* per-scenario outcomes ride on `envelope.units`); callers (CLI / Tool layer)
|
|
10
|
+
* render or JSON-serialize the envelope as appropriate.
|
|
10
11
|
*
|
|
11
12
|
* Scenario loading lifecycle (mirrors fitness's `ensureChecksLoaded`):
|
|
12
13
|
*
|
|
@@ -140,8 +141,10 @@ function assembleEnvelopeInputs(scenarios) {
|
|
|
140
141
|
return { units, signals };
|
|
141
142
|
}
|
|
142
143
|
/**
|
|
143
|
-
* Run sim and return
|
|
144
|
-
* recipe is missing). The caller
|
|
144
|
+
* Run sim and return the render-only {@link RunPresentation} (or an
|
|
145
|
+
* {@link ErrorResult} when the recipe is missing / no scenarios run). The caller
|
|
146
|
+
* decides what to print or render. `recipeName`/`cwd` are no longer on the render
|
|
147
|
+
* object (the handler recovers them from `result.envelope.recipe` + `opts.cwd`).
|
|
145
148
|
*/
|
|
146
149
|
export async function executeSim(args, opts = {}) {
|
|
147
150
|
// Lifecycle: load .mjs plugins + scenario packages before the recipe
|
|
@@ -241,12 +244,15 @@ export async function executeSim(args, opts = {}) {
|
|
|
241
244
|
const verboseDetail = args.verbose === true
|
|
242
245
|
? { kind: 'findings', groups: buildFindingGroups(units, signals) }
|
|
243
246
|
: undefined;
|
|
247
|
+
// envelope-first-presentation: the render object is the render-only
|
|
248
|
+
// RunPresentation. recipeName/cwd are no longer carried on it — the handler
|
|
249
|
+
// recovers the recipe from `envelope.recipe` and cwd from `opts.cwd`. No
|
|
250
|
+
// `durationMs` is set: sim's summary duration is the envelope unit-sum (the
|
|
251
|
+
// presentation renderer falls back to it), matching the pre-migration render
|
|
252
|
+
// byte-for-byte (sim-done's durationMs field was never consumed by the view).
|
|
244
253
|
const result = {
|
|
245
|
-
type: '
|
|
246
|
-
|
|
247
|
-
cwd: args.cwd,
|
|
248
|
-
// durationMs optional on SimDoneResult (phase2 host timing); internal recipe makespan may be present.
|
|
249
|
-
...(recipeResult.durationMs === undefined ? {} : { durationMs: recipeResult.durationMs }),
|
|
254
|
+
type: 'run-presentation',
|
|
255
|
+
tool: 'simulation',
|
|
250
256
|
// ADR-0035: the run verdict is the single host verdict. With Phase 0 a failed
|
|
251
257
|
// scenario emits an error signal, so `envelope.verdict.passed` (with the {1,0}
|
|
252
258
|
// policy) is exactly the old `failed > 0`; the host derives the exit from it.
|