26 Scenario execution and submodules🔗ℹ

raco mcp scenario module.rkt runs the module’s test submodule in a fresh module registry and under a dedicated custodian. It reports Racket test-log results and fails when a test reports failure, even when RackUnit catches the assertion exception. Unhandled failures and a missing test submodule also fail the command. Resources owned by the run are shut down on return or exception. A prior run’s results and instantiated modules do not carry into the next run.

The equivalent run-scenarios function is provided by mcp/scenario and mcp/cli. It accepts a module file path and returns a pair of failed and total test counts on success; reported test failures raise an exception. Frameworks using Racket’s raco/testing log participate in the same accounting. Successful code with no logged tests returns (0 . 0); the runner does not manufacture assertions. This tooling uses the declared native compiler-lib dependency.

Within #lang mcp, module+ groups and module* with #f retain ordinary Racket module bodies. They inherit the parent interface binding instead of generating another interface and executable entry point. Repeated groups, imports, definitions and macro-generated groups compose normally. Declarations inside these ordinary submodules remain ordinary descriptor values and are not published in the parent’s interface. To define an independent MCP child language, use an explicit language, for example (module* child mcp/lang ...).

The clock example now uses an ordinary module+ test RackUnit import followed by its authored scenario. The existing scenario body remains Racket test code. The complete transport-selectable fault-injection language remains an implementation gate; this runner does not claim to supply it.