Cratis.Stage.Rendering.Cratis 3.15.1

Prefix Reserved
dotnet add package Cratis.Stage.Rendering.Cratis --version 3.15.1
                    
NuGet\Install-Package Cratis.Stage.Rendering.Cratis -Version 3.15.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cratis.Stage.Rendering.Cratis" Version="3.15.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cratis.Stage.Rendering.Cratis" Version="3.15.1" />
                    
Directory.Packages.props
<PackageReference Include="Cratis.Stage.Rendering.Cratis" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cratis.Stage.Rendering.Cratis --version 3.15.1
                    
#r "nuget: Cratis.Stage.Rendering.Cratis, 3.15.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cratis.Stage.Rendering.Cratis@3.15.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cratis.Stage.Rendering.Cratis&version=3.15.1
                    
Install as a Cake Addin
#tool nuget:?package=Cratis.Stage.Rendering.Cratis&version=3.15.1
                    
Install as a Cake Tool

<div align="center">

▶️ Cratis Stage

Compiles Screenplay source, verifies modeled specifications, and renders or partially performs Cratis applications.

Discord Docker Build Publish License

</div>


Stage has three responsibilities around a Screenplay application:

  1. Runtime — provide a disposable host that directly performs the subset of modeled backend behavior Stage currently understands.
  2. Specification runner — verify the specifications declared in the model and write structured results.
  3. Renderer — turn compiled Screenplay syntax into a reviewable Cratis Arc + Chronicle application on disk.

The renderer is the project's highest-priority path. Direct runtime execution and specification verification are useful, but partial; they must not be read as proof that every Screenplay construct has executable semantics. The sandbox now serves a first web frontend by translating the same compiled Screenplay application to Scene and rendering its screen elements with Scene.React. Layout/template composition, query-backed data, and command forms remain incremental runtime work rather than being silently simulated.

Stage is part of the experimental Cratis model-first layer: Screenplay is the modeling language, Studio the collaborative modeling environment, Scene the platform-neutral UI model, and Prologue captures existing system behavior into event models. What Stage renders is an event-sourced CQRS application built on Cratis Arc and Chronicle, the Cratis event-sourcing database and runtime.

Authoritative input

The authoritative input is Screenplay source: a .play file or a folder containing .play files. The host and specification runner recursively compile every .play file beneath the folder they receive and merge the results. Stage's contract models are internal/tooling seams produced from that compilation; an event-model.json file is not the current startup or rendering contract.

flowchart LR
    Play[["📄 Screenplay<br/>*.play files"]]
    Play -->|compile once| Runtime["▶️ partial runtime<br/>Arc + Chronicle API"]
    Play -->|translate| Scene["🖥️ Scene model<br/>Scene.React frontend"]
    Play -->|compile| Specs["🧪 model specification runner<br/>results.json"]
    Play -->|compile| Renderer["🎨 Cratis renderer<br/>C# application source"]

Stage is independent of Studio. Studio, the Cratis CLI, and other tooling can supply the same Screenplay source without Stage depending on any one authoring environment.

Current scope

Renderer — highest priority

Stage v1 has exactly one forward-rendering target: cratis. The Cratis.Stage.Rendering.Cratis package owns the complete pure target policy through the CratisRendering facade: target cratis, renderer version 1, exact dependency pins, exact scaffold inputs, profile creation, and planning. The Cratis CLI and Studio's in-memory preview must consume this facade with only the executable semantic model, execution plan, semantic scope, and explicit project/root-namespace options; neither caller should copy target policy.

CratisRendering.Plan(...) returns the existing destination-independent ArtifactRenderPlan with normalized paths, exact bytes, SHA-256 hashes, and typed diagnostics. Callers supply destination-independent project and root namespace names; the facade derives every target, renderer, profile, package, and runtime version itself:

var options = new CratisRenderingOptions("Projects", "Projects");
var scope = new ArtifactRenderScope(ArtifactRenderScopeKind.Application, model.Application.Id);
var plan = CratisRendering.Plan(model, executionPlan, scope, options);

The plan must be published only when plan.Success is true. A failed plan carries diagnostics and no candidate artifacts. Callers that need the immutable package-owned profile for a lower-level ArtifactRenderRequest can use CratisRendering.CreateProfile(...); they must not reconstruct or modify it. The planner rejects changed identities, versions, input rosters, bytes, and hashes.

The underlying IArtifactRenderPlanner performs no file system, process, network, environment, clock, or random access. The currently admitted vertical includes concepts, composite types, one command/event production path, one-instance projection state, an optional snapshot lookup, and modeled specifications. Unsupported reachable semantics block publication instead of producing thinner code.

Application scope adds exactly eight deterministic backend scaffold artifacts: Directory.Build.props, Directory.Build.targets, Directory.Packages.props, the project and solution files, Program.cs, appsettings.json, and docker-compose.yml. The local MSBuild and central-package boundaries isolate the generated application from parent repositories. Program.cs remains active in Debug beside inline generated specifications; the project locally suppresses only their expected CS7022 entry-point warning. The profile pins .NET 10, Cratis/Arc 22.3.0, the verified specification dependencies, and cratis/chronicle:16.35.3-development. It emits no frontend, repository marker, .gitignore, floating version, random identifier, or destination-specific value.

The generated compose contract intentionally binds local ports 27017 and 35000. Start it with docker compose up --detach, run the generated project, and probe /healthz; stop it with docker compose down --volumes. Isolated automation can instead map both container ports to Docker-assigned loopback ports and override Cratis__MongoDB__Server and Cratis__Chronicle__ConnectionString for the generated host. This avoids colliding with an existing MongoDB or Chronicle service without changing the generated compose contract.

The published syntax-based IRenderer and optional Cratis.Stage.Rendering.Cratis.Scaffolding package are legacy-only direct-write compatibility paths. Direct rendering has no managed staging or safe stale-file removal; a failure can leave its target unsafe and incomplete. New CLI and Studio rendering must use CratisRendering, not the legacy renderer.

Direct runtime — partial

The cratis/stage image is a disposable sandbox containing the Stage host and an in-memory Chronicle kernel. It loads a folder of .play files and exposes the runtime surfaces Stage currently implements. This path is not a complete executable implementation of the Screenplay language and should not be treated as a generated production application.

Runtime commands evaluate their modeled produces mappings, append the resulting facts to Chronicle, and echo the payload as the response. Modeled command validation and authorization are not yet enforced by this runtime path.

Stage also does not yet receive an executable query authorization contract. Modeled query performers deny access by default and return no data, so they cannot expose projected documents while authorization semantics are absent. Full query authorization and query execution are blocked on the Screenplay-owned executable semantic/query model; Stage does not invent an interim query DTO contract.

The host serves a browser bundle at /. It obtains /stage/scene, the Scene translation produced from the exact same compile as the runtime event model, and renders modeled screen content through @cratis/scene.react. Screen navigation works for translated navigation intents. Command actions are surfaced to the host-neutral Scene event boundary, but are not submitted until modeled form values and the executable command contract can be joined without guessing. The frontend shows those boundaries honestly instead of presenting mock data as runtime behavior.

Specification runner — model-level verification

cratis/stage-specrunner is a run-to-completion job. It compiles the .play files, checks the modeled specifications against the model, writes results.json, and exits. Verification is currently model-level: it checks the modeled facts and expectations but is not a substitute for behaviorally executing every slice against a live runtime.

Projects

Project Package / image Purpose
Source/Contracts Cratis.Stage.Contracts Contract models and converters produced from compiled Screenplay syntax, specification results, and Scene/render-plan contracts used by Stage tooling.
Source/Rendering.Cratis Cratis.Stage.Rendering.Cratis Cratis-specific backend renderer with method-specific query authorization and explicit failed-operation signaling; direct-write targets remain unsafe after failure.
Source/Rendering.Cratis.Scaffolding Cratis.Stage.Rendering.Cratis.Scaffolding Optional Cratis template scaffolding around rendered source.
Source/Stage Cratis.Stage Partial direct runtime engine: dynamic API types, command handling, Chronicle registration, specification strategies, and fail-closed modeled query performers.
Source/Host cratis/stage Disposable HTTP host paired with an in-memory Chronicle kernel for direct runtime exploration.
Source/Frontend bundled in cratis/stage Scene.React browser surface translated from the sandbox's Screenplay source.
Source/SpecRunner cratis/stage-specrunner Container job for model-level specification verification and results.json output.

Running the sandbox

Mount a folder containing one or more .play files:

docker run --rm \
    -p 9090:9090 \
    -p 35000:35000 \
    -v "$PWD":/eventmodel \
    cratis/stage:latest

The Stage frontend and API are exposed on port 9090; the API reference is /scalar/v1, the translated Scene contract is /stage/scene, and the Chronicle Workbench is exposed on port 35000. The host takes the model folder as its first argument. Deployment configuration is read from cratis-stage.json, with its path overridable through STAGE_CONFIG.

Running modeled specifications

docker run --rm \
    -v /path/to/screenplays:/model \
    -v /path/to/results:/output \
    cratis/stage-specrunner:latest

The runner accepts --model <folder> and --output <file>, with optional --slice <guid> and --spec <guid> filters. The container defaults to /model and /output/results.json.

Full container, URL, specification-result, and render-plan documentation lives in Documentation. Framework maintainers can use the renderer target guide to implement another deterministic Screenplay-to-code target.

Building

npm ci --prefix Source/Frontend
npm test --prefix Source/Frontend
npm run build --prefix Source/Frontend
dotnet build -c Debug
dotnet test -c Debug
dotnet build -c Release

Release treats warnings as errors. Both Dockerfiles consume prebuilt, framework-dependent publish output; ./dockerize.sh publishes the host and specification runner and then builds both images.

The Cratis ecosystem

This project is part of Cratis — free, MIT-licensed tools for building event-sourced and CQRS applications.

Everything Cratis publishes today is MIT licensed and free to use.


<div align="center">

Part of the Cratis platform · Licensed under the MIT license

</div>

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Cratis.Stage.Rendering.Cratis:

Package Downloads
Cratis.Stage.Rendering.Cratis.Scaffolding

Scaffolds the Cratis project a rendered Screenplay application is placed into, from the Cratis templates.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.15.1 116 9/13/2026
3.15.0 86 9/13/2026
3.14.1 106 9/13/2026
3.14.0 64 9/13/2026
3.13.0 59 9/12/2026
3.12.0 136 9/10/2026
3.11.0 459 9/3/2026
3.10.1 114 8/30/2026
3.10.0 239 8/30/2026
3.9.2 130 8/25/2026
3.9.1 123 8/24/2026
3.9.0 111 8/24/2026
3.8.2 119 8/23/2026
3.8.1 108 8/23/2026
3.8.0 188 8/21/2026
3.7.0 118 8/19/2026
3.6.0 120 8/18/2026
3.5.0 108 8/18/2026
3.4.0 116 8/18/2026
3.3.1 122 8/18/2026
Loading failed