You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two compounding problems on branch feature/arc-screenplay make cratis screenplay generate produce no output at all for most real Arc applications:
ScreenplayCompilationLoader loads the project with MSBuildWorkspace and calls GetCompilationAsync(), which does not run source generators. Any application whose compilation depends on generated types — which includes every app following the Cratis house style ([LoggerMessage] partials, generated message-constant classes) — comes back with hundreds of missing-symbol errors, and Cratis.Arc.Screenplay raises SP0024 at Error severity.
GenerateScreenplayCommand.ExecuteAsync returns before writing the document whenever any Error diagnostic is present. So the user gets diagnostics and an exit code, but no .play file — even when the generated document is essentially complete.
Reproduction (real application)
Loading Ada (Core.csproj, ~1,800 syntax trees) via MSBuildWorkspace and calling the generator exactly as the branch does:
607 compilation errors, all missing source-generated types (first: The name 'AccountsMessages' does not exist in the current context);
SP0024 [Error] The source did not compile - 607 error(s) … Nothing recovered from it describes the application reliably;
yet result.Source was a 5,362-line document that compiles under the official Screenplay compiler with 0 errors / 1 warning and matches a known-good document for the same app almost byte-for-byte.
With the branch's current control flow, all of that is discarded.
Suggested fix
Run source generators in the loader: after GetCompilationAsync(), run the project's analyzer references through CSharpGeneratorDriver.RunGeneratorsAndUpdateCompilation(...) and hand the updated compilation to the generator. (PR Add Cratis.Arc.Screenplay package for generating Screenplay from Arc source Arc#2384 explicitly listed "does MSBuildWorkspace include generator output" as an unverified risk — it does not.)
Write the document even when generation reports errors (at least when --file is given): write the file, print the diagnostics, and exit non-zero. A 99%-complete document plus honest diagnostics is strictly more useful than nothing. Keeping stdout clean in the redirect case can stay as-is.
A companion issue on Cratis/Arc proposes calibrating SP0024's severity/wording so "607 errors, 5,300 lines recovered" is not reported as "nothing recovered reliably".
#44 proposes fetching a .play from a running app (GET /.cratis/screenplay) and rejected offline generation on the grounds that fluent Define() artifacts need a live container. The merged generator reads fluent definitions statically (Roslyn source analysis), so that rejection no longer holds for the source route. The two designs are complementary (source = works from a checkout, nothing running; fetch = runtime fidelity, no SDK needed) — but the docs/README story should say which is canonical, and the fetch route's Arc endpoint does not exist yet.
Summary
Two compounding problems on branch
feature/arc-screenplaymakecratis screenplay generateproduce no output at all for most real Arc applications:ScreenplayCompilationLoaderloads the project withMSBuildWorkspaceand callsGetCompilationAsync(), which does not run source generators. Any application whose compilation depends on generated types — which includes every app following the Cratis house style ([LoggerMessage]partials, generated message-constant classes) — comes back with hundreds of missing-symbol errors, andCratis.Arc.ScreenplayraisesSP0024at Error severity.GenerateScreenplayCommand.ExecuteAsyncreturns before writing the document whenever any Error diagnostic is present. So the user gets diagnostics and an exit code, but no.playfile — even when the generated document is essentially complete.Reproduction (real application)
Loading Ada (
Core.csproj, ~1,800 syntax trees) viaMSBuildWorkspaceand calling the generator exactly as the branch does:The name 'AccountsMessages' does not exist in the current context);SP0024 [Error] The source did not compile - 607 error(s) … Nothing recovered from it describes the application reliably;result.Sourcewas a 5,362-line document that compiles under the official Screenplay compiler with 0 errors / 1 warning and matches a known-good document for the same app almost byte-for-byte.With the branch's current control flow, all of that is discarded.
Suggested fix
GetCompilationAsync(), run the project's analyzer references throughCSharpGeneratorDriver.RunGeneratorsAndUpdateCompilation(...)and hand the updated compilation to the generator. (PR Add Cratis.Arc.Screenplay package for generating Screenplay from Arc source Arc#2384 explicitly listed "does MSBuildWorkspace include generator output" as an unverified risk — it does not.)--fileis given): write the file, print the diagnostics, and exit non-zero. A 99%-complete document plus honest diagnostics is strictly more useful than nothing. Keeping stdout clean in the redirect case can stay as-is.Relation to #44
#44 proposes fetching a
.playfrom a running app (GET /.cratis/screenplay) and rejected offline generation on the grounds that fluentDefine()artifacts need a live container. The merged generator reads fluent definitions statically (Roslyn source analysis), so that rejection no longer holds for the source route. The two designs are complementary (source = works from a checkout, nothing running; fetch = runtime fidelity, no SDK needed) — but the docs/README story should say which is canonical, and the fetch route's Arc endpoint does not exist yet.Environment
feature/arc-screenplay(ScreenplayCompilationLoader.cs,GenerateScreenplayCommand.cs)Cratis.Arc.Screenplay20.65.0 (now on NuGet — the conditionalCratisArcScreenplayProjectopt-in reference can become a plainPackageReference)