Render a context path against what the enclosing artifact receives - #33
Conversation
A rendered command handler is an Arc model-bound Handle(), and Arc's CommandContext carries none of Occurred, Identity, Tenant, CausedBy or Causation - those are on Screenplay's own CommandContext, a different type a rendered application never receives. Rendering every context expression as 'context.<PascalPath>' therefore emitted members that do not exist, and the application did not compile. The enclosing artifact now supplies the rendering. An event context is still read straight off 'context'; a command handler asks the runtime for what it needs through handler parameters, and reports the paths it cannot reach rather than naming a member for them.
… names The spec harness compiled rendered files against the implicit usings alone, so it saw neither the FluentValidation the Cratis package brings in nor the IIdentityProvider ambiguity that same set creates. It now mirrors the package's global usings, which is what makes the new compile assertion mean anything.
|
Reviewer context. How this was found, and the number it moves. The harness was under-reporting and over-reporting at the same time. Why A spec defended the old shape. Verified the new specs bite. Reverting Not verified: nothing was run against a live Chronicle or MongoDB. The four collaborators are types the Cratis runtime registers by convention ( Deliberately out of scope, on #32: whether a rendered application should reference |
Fixed
$contextpath in aproducesmapping is rendered against what the enclosing artifact actually receives, so a rendered application compiles. A command handler receives Arc'sCommandContext, which carries none ofOccurred,Identity,Tenant,CausedByorCausation— those belong to Screenplay's own context type — and rendering them as members of it produced 15 compilation errors on the language's owninvoicing.play. The handler now asks the runtime for what the document reads: the tenant fromITenantIdAccessor, the caller fromIIdentityProvider, roles and claims fromICurrentPrincipalAccessor, the cause fromICausationManager, and$context.occurredfrom the clock. (Rendering a $context path emits members Arc's CommandContext does not have #32)Uuidconcept — is dropped and reported instead of rendered into a conversion that does not exist. (Rendering a $context path emits members Arc's CommandContext does not have #32)$eventContextor$eventSourceId, which it runs too early to have, is reported rather than rendered. (Rendering a $context path emits members Arc's CommandContext does not have #32)