Summary
Constraint names that carry separators in their runtime name (kebab-case is idiomatic for Chronicle constraint names) are sanitized by deleting the separator characters, producing unreadable all-lowercase run-together identifiers in the generated document.
Evidence (real application)
Ada declares:
public class UniqueTimesheetStartConstraint : IConstraint
{
public const string Name = "unique-timesheet-start";
public void Define(IConstraintBuilder builder) => builder
.Unique<TimesheetStarted>(name: Name);
}
The generated document emits:
constraint uniquetimesheetstart
unique event TimesheetStarted
All 31 constraints in the document look like this (uniqueinvitationemail, uniqueengagementonboardingcompletion, uniquetimesheetoverduereminder, …). The Screenplay identifier rules ([A-Za-z_]\w*) force some transformation, but deleting separators is the least readable choice, and it discards word boundaries that were present in the source.
Suggested fix
When sanitizing a name for an identifier position, treat separator characters (-, _, spaces, dots) as word boundaries and PascalCase the segments: unique-timesheet-start → UniqueTimesheetStart. Where a declaring type exists (as with IConstraint implementations), the type name minus a Constraint suffix is an even better candidate (UniqueTimesheetStartConstraint → UniqueTimesheetStart).
Round-trip note: the constraint's runtime name is the string, and a future .play→code path would regenerate a different string from the PascalCase identifier. If that matters, the mapping convention (PascalCase ↔ kebab-case) should be stated in the docs.
Environment
Cratis.Arc.Screenplay 20.65.0 (Emission/Naming/ScreenplayNaming.cs sanitization)
Summary
Constraint names that carry separators in their runtime name (kebab-case is idiomatic for Chronicle constraint names) are sanitized by deleting the separator characters, producing unreadable all-lowercase run-together identifiers in the generated document.
Evidence (real application)
Ada declares:
The generated document emits:
All 31 constraints in the document look like this (
uniqueinvitationemail,uniqueengagementonboardingcompletion,uniquetimesheetoverduereminder, …). The Screenplay identifier rules ([A-Za-z_]\w*) force some transformation, but deleting separators is the least readable choice, and it discards word boundaries that were present in the source.Suggested fix
When sanitizing a name for an identifier position, treat separator characters (
-,_, spaces, dots) as word boundaries and PascalCase the segments:unique-timesheet-start→UniqueTimesheetStart. Where a declaring type exists (as withIConstraintimplementations), the type name minus aConstraintsuffix is an even better candidate (UniqueTimesheetStartConstraint→UniqueTimesheetStart).Round-trip note: the constraint's runtime name is the string, and a future .play→code path would regenerate a different string from the PascalCase identifier. If that matters, the mapping convention (PascalCase ↔ kebab-case) should be stated in the docs.
Environment
Cratis.Arc.Screenplay20.65.0 (Emission/Naming/ScreenplayNaming.cssanitization)