Round #855

11 May 2026, 09:47· csharp· Meta-Llama-3.3-70B-Instruct· r15-firing-v3
Complexity
band 0
ZP / UO / OBS
6 / 0 / 0
Journey weight
386
Lightshift ΔL
-0.08

Prompt

Write a FluentValidation AbstractValidator<T> for a 'RegisterUser' command: email (valid format), password (≥ 8 chars, has digit and symbol), age (18+).

Zero-point index (what the engine surfaced)

ZPI-ZPI-0012 | 2026-05-11T09:47:54Z Write a FluentValidation AbstractValidator<T> for a 'RegisterUser' command: email (valid format), password (≥ 8 chars, has digit and symbol), age (18+). ZERO POINT — 6 entries (structural invariants) ● hsl(159.80, 100%, 36%) IValidator<T> [contract] ● hsl(240.67, 100%, 36%) AbstractValidator<T> [contract] ● hsl(175.80, 100%, 36%) IValidatableObject [contract] ● hsl(328.68, 100%, 36%) IValidatorFactory [contract] ● hsl(145.31, 100%, 36%) ValidationResult [contract] ● hsl(39.29, 100%, 36%) ValidationContext<T> [contract] UNOBSERVED — 0 entries (implied truths) OBSERVED — 0 entries (explicit in request) COMPLEXITY │ 6 entries │ spread: 0° │ band: LOW

Baseline response (no ZPI)

### RegisterUserValidator ```csharp using FluentValidation; public class RegisterUser { public string Email { get; set; } public string Password { get; set; } public int Age { get; set; } } public class RegisterUserValidator : AbstractValidator<RegisterUser> { public RegisterUserValidator() { RuleFor(x => x.Email) .NotEmpty() .WithMessage("Email is required") .EmailAddress() .WithMessage("Invalid email format"); RuleFor(x => x.Password) .NotEmpty() .WithMessage("Password is required") .MinimumLength(8) .WithMessage("Password must be at least 8 characters") .Matches(@"^(?=.*\d)(?=.*[^a-zA-Z0-9]).*$") .WithMessage("Password must contain at least one digit and one symbol"); RuleFor(x => x.Age) .GreaterThanOrEqualTo(18) .WithMessage("Age must be 18 or older"); } } ``` ### Example Usage ```csharp public class Program { public static void Main() { var validator = new RegisterUserValidator(); var registerUser = new RegisterUser { Email = "test@example.com", Password = "P@ssw0rd", Age = 25 }; var results = validator.Validate(registerUser); if (!results.IsValid) { foreach (var failure in results.Errors) { Console.WriteLine($"Property {failure.PropertyName} failed validation. Error: {failure.ErrorMessage}"); } } else { Console.WriteLine("Validation successful"); } } } ``` This code defines a `RegisterUserValidator` class that inherits from `AbstractValidator<RegisterUser>`. It uses FluentValidation's `RuleFor` method to define validation rules for the `Email`, `Password`, and `Age` properties of the `RegisterUser` class. The `Email` property is validated to ensure it is not empty and has a valid email format. The `Password` property is validated to ensure it is not empty, has a minimum length of 8 characters, and contains at least one digit and one symbol. The `Age` property is validated to ensure it is greater than or equal to 18. In the example usage, a `RegisterUser` object is created and validated using the `RegisterUserValidator`. If the validation fails, the error messages are printed to the console. If the validation succeeds, a success message is printed.

Enhanced response (with ZPI)

```csharp using FluentValidation; public class RegisterUserCommand { public string Email { get; set; } public string Password { get; set; } public int Age { get; set; } } public class RegisterUserCommandValidator : AbstractValidator<RegisterUserCommand> { public RegisterUserCommandValidator() { RuleFor(x => x.Email) .NotEmpty() .EmailAddress() .WithMessage("Invalid email format"); RuleFor(x => x.Password) .NotEmpty() .MinimumLength(8) .Matches(@"[0-9]") .WithMessage("Password must contain at least one digit") .Matches(@"[!@#$%^&*()_+=\[{};:'<>,./?]") .WithMessage("Password must contain at least one symbol"); RuleFor(x => x.Age) .GreaterThanOrEqualTo(18) .WithMessage("Age must be 18 or older"); } } ``` This implementation uses FluentValidation's `AbstractValidator<T>` to define validation rules for the `RegisterUserCommand` class. The `RuleFor` method is used to specify validation rules for each property, and the `WithMessage` method is used to provide a custom error message for each rule. The `Matches` method is used with regular expressions to validate the password format. To use this validator, you would create an instance of it and call the `Validate` method, passing in an instance of `RegisterUserCommand`. The `Validate` method returns a `ValidationResult` object, which contains a list of validation errors if any rules are not met. Note that this implementation does not include any dependency injection or error handling beyond what is provided by FluentValidation. Depending on your application's requirements, you may need to add additional error handling or registration code. This implementation requires more text to fully explain the usage and integration with the application.

Grader chain

Each grader reads the same baseline + enhanced pair and casts an independent verdict. Disagreement is the framework's own signal — not noise to be averaged away.

V1samba/Meta-Llama-3.3-70B-Instruct
Worse
V4qwen2.5-coder-3b-instruct
Better
V5openrouter/qwen/qwen3-235b-a22b-2507
Better
V7qwen2.5-coder-7b-instruct
Same
V8openai/gpt-4.1
Same
V9anthropic/claude-opus-4-7
Worse
V12openai/gpt-4o
Better

Comments

Our grader said what it said. What do you say? Comment as a guest below.

No comments yet. Be the first to say what you make of this round.

← back to all rounds