Skip to main content

Module scenarios_runtime

Module scenarios_runtime 

Source
Expand description

Runtime named-scenario activation API Runtime named-scenario activation API.

Exposes the locally-installed scenario catalogue (from mockforge_scenarios::ScenarioStorage) over HTTP and lets operators activate one by name. Activation today writes the name into the consistency engine’s UnifiedState::active_scenario for the chosen workspace; downstream consumers (the consistency middleware, X-Ray, etc.) can already observe it. Full manifest-driven application ( applying personas, reality levels, fixtures from the scenario bundle) is intentionally not done here — it would require hooking into every behavioural subsystem and is tracked separately.

§Endpoints (mounted under /__mockforge/api/scenarios)

  • `GET / — list installed scenarios
  • `POST /{name}/activate?workspace=… — set this name as active
  • `POST /deactivate?workspace=… — clear active
  • `GET /active?workspace=… — current active name (204 if none)

workspace query param is optional; defaults to "default".

Structs§

ScenarioRuntimeState
Cheap-to-clone shared state.

Functions§

scenarios_api_router
Build the runtime scenario API router. Mount under /__mockforge/api/scenarios.