Cratis.Screenplay.Generation.Contracts
0.4.0
Prefix Reserved
See the version list below for details.
dotnet add package Cratis.Screenplay.Generation.Contracts --version 0.4.0
NuGet\Install-Package Cratis.Screenplay.Generation.Contracts -Version 0.4.0
<PackageReference Include="Cratis.Screenplay.Generation.Contracts" Version="0.4.0" />
<PackageVersion Include="Cratis.Screenplay.Generation.Contracts" Version="0.4.0" />
<PackageReference Include="Cratis.Screenplay.Generation.Contracts" />
paket add Cratis.Screenplay.Generation.Contracts --version 0.4.0
#r "nuget: Cratis.Screenplay.Generation.Contracts, 0.4.0"
#:package Cratis.Screenplay.Generation.Contracts@0.4.0
#addin nuget:?package=Cratis.Screenplay.Generation.Contracts&version=0.4.0
#tool nuget:?package=Cratis.Screenplay.Generation.Contracts&version=0.4.0
Screenplay.Generation
Framework-neutral source adapter SDK for generating verified Cratis Screenplay definitions.
Packages
| Package | Responsibility |
|---|---|
Cratis.Screenplay.Generation.Contracts |
Typed semantic facts, evidence, provenance, and diagnostics contributed by source adapters |
Cratis.Screenplay.Generation |
Deterministic fact resolution, Screenplay lowering, canonical printing, and compiler verification |
Cratis.Screenplay.Generation.DotNet |
Reusable Roslyn compilation, symbol, authored-source, and type-shape APIs for .NET adapter authors |
Cratis.Screenplay.Generation.DotNet.Vogen |
Authored-source Vogen value-object discovery as neutral concept and primitive-representation facts |
Framework adapters remain owned by their source ecosystems:
- Arc:
Cratis.Arc.Screenplay - Critter Stack:
Cratis.CritterStack.Screenplay
Architecture
source adapter
-> typed facts and evidence
-> resolved application graph
-> lowerable Screenplay model
-> Screenplay AST
-> canonical printer
-> Screenplay compiler verification
-> .play
Adapters contribute semantic facts; they do not construct syntax nodes or concatenate .play fragments. This allows facts from related frameworks—such as Marten and Wolverine—to be resolved together before one document is emitted.
Cratis.Screenplay.Generation.DotNet deliberately does not own MSBuildWorkspace. Hosts such as Cratis CLI load a project once and pass Roslyn compilations to official adapters.
Vogen adapter composition
Cratis.Screenplay.Generation.DotNet.Vogen recognizes the exact Roslyn metadata names Vogen.ValueObjectAttribute, Vogen.ValueObjectAttribute`1, and Vogen.VogenDefaultsAttribute. It has no Vogen package or runtime dependency. Vogen is pinned only in the adapter's semantic spec project so production consumers remain decoupled from the source generator.
Each DotNetProjectCompilation requires the workspace host's authoritative AuthoredSyntaxTrees. Build this set from project documents before source generators update the compilation. Generated filenames and headers remain useful conventions, but they are not trusted as proof of authored origin.
A composition host references Cratis.Screenplay.Generation and Cratis.Screenplay.Generation.DotNet.Vogen directly, plus its external ecosystem adapter package. The Vogen adapter package brings Cratis.Screenplay.Generation.DotNet and Cratis.Screenplay.Generation.Contracts transitively; the analyzed application references Vogen itself.
A clean consumer composes Vogen with any external ecosystem adapter by keeping contributions separate until neutral resolution:
var adapters = new IDotNetScreenplayAdapter[]
{
new VogenConceptScreenplayAdapter(),
externalAdapter
};
var adapterOptions = new DotNetAdapterOptions();
var contributions = adapters
.Where(adapter => adapter.CanAnalyze(context))
.Select(adapter => adapter.Analyze(context, adapterOptions));
var definition = new ScreenplayDefinitionGenerator().Generate(
contributions,
new ScreenplayGenerationOptions { Domain = "Ordering" });
The Vogen contribution establishes only authored concepts and supported primitive representations. It never infers identity or validation, never treats generated members as primary evidence, and reports VOG0001 instead of inventing String for an unsupported backing type.
Concepts
Adapters can contribute ArtifactKind.Concept together with independently proven ConceptRepresentationFact, ConceptAttributeFact, and ConceptValidationRuleFact assertions. Primitive/enumeration representations, named attributes, and named external predicate rules resolve deterministically and lower to top-level Screenplay concepts without module placement.
TypeReferenceDefinition.Subject binds an artifact property to the exact concept subject rather than a simple display name. Missing, conflicting, unsupported, or same-named concept definitions produce stable diagnostics; generation never falls back to String.
Concept validation stays independent from identity, representation, attributes, and optionality. A rule uses an adapter-authored RuleIdentity for deterministic resolution, while Predicate is the authored predicate name emitted by lowering. Adapters contribute framework-neutral data and provenance only; they never reference Screenplay syntax:
var accountNumber = new SubjectId { Value = "dotnet://Banking/Concepts.AccountNumber" };
var validation = new ConceptValidationRuleFact
{
Id = new FactId { Value = "account-number:validation:format" },
Subject = accountNumber,
Definition = new ConceptValidationRuleDefinition
{
Concept = accountNumber,
RuleIdentity = "format",
Kind = ConceptValidationRuleKind.NamedPredicate,
Predicate = "BeValidAccountNumber",
Message = "Must be a valid account number",
ImplementationFile = "Concepts/Validation/BeValidAccountNumber.cs"
},
Evidence = new Evidence
{
Adapter = new AdapterIdentity { Id = "my-adapter", Version = "1.0.0" },
Strength = EvidenceStrength.Exact
}
};
Multiple adapters can assert the same definition with separate evidence. Incompatible definitions with the same (Concept, RuleIdentity) remain visible as a conflict without erasing the concept's representation or attributes. The nullable kind-specific Predicate keeps the transport record additive: named-predicate rules require it today, while later rule kinds can add typed operands without forcing unrelated placeholder values.
See IMPLEMENTATION_STATUS.md for the current implementation checkpoint and pre-release decisions.
Build and test
dotnet test Screenplay.Generation.slnx --configuration Debug
dotnet build Screenplay.Generation.slnx --configuration Release
dotnet pack Screenplay.Generation.slnx --no-build --configuration Release -o Artifacts/NuGet
All builds require zero errors and zero warnings. Generated Screenplay output must compile and remain stable through print/compile/print.
License
Screenplay.Generation is licensed under the MIT license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Cratis.Screenplay.Generation.Contracts:
| Package | Downloads |
|---|---|
|
Cratis.Arc.Screenplay
Generates a Cratis Screenplay .play file from the source of a Cratis Arc application |
|
|
Cratis.Screenplay.Generation.DotNet
Reusable Roslyn source analysis for Cratis Screenplay generation adapters |
|
|
Cratis.Screenplay.Generation
Resolves semantic adapter facts and generates verified Cratis Screenplay documents |
|
|
Cratis.CritterStack.Screenplay
Generates verified Cratis Screenplay definitions from Marten and Wolverine source |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.18.0 | 58 | 8/30/2026 |
| 0.17.0 | 120 | 8/28/2026 |
| 0.16.0 | 70 | 8/27/2026 |
| 0.15.0 | 147 | 8/27/2026 |
| 0.14.0 | 76 | 8/26/2026 |
| 0.13.2 | 120 | 8/26/2026 |
| 0.13.1 | 85 | 8/25/2026 |
| 0.13.0 | 93 | 8/25/2026 |
| 0.12.0 | 200 | 8/25/2026 |
| 0.11.0 | 97 | 8/25/2026 |
| 0.10.1 | 148 | 8/25/2026 |
| 0.10.0 | 154 | 8/24/2026 |
| 0.9.0 | 227 | 8/23/2026 |
| 0.8.0 | 211 | 8/23/2026 |
| 0.7.1 | 181 | 8/22/2026 |
| 0.7.0 | 270 | 8/22/2026 |
| 0.6.1 | 226 | 8/22/2026 |
| 0.6.0 | 152 | 8/22/2026 |
| 0.4.0 | 147 | 8/22/2026 |
| 0.3.0 | 131 | 8/22/2026 |