// Copyright (c) Microsoft. All rights reserved. namespace VerifySamples; /// /// Describes a sample to verify, including its expected output. /// internal sealed class SampleDefinition { /// /// Display name for the sample (e.g., "01_hello_agent"). /// public required string Name { get; init; } /// /// Relative path from the dotnet/ directory to the sample project directory. /// public required string ProjectPath { get; init; } /// /// Environment variables that the sample requires for a meaningful run. /// The runner checks these before running and will skip the sample if any are unset, /// recording a skip reason that indicates which required variables are missing. /// public string[] RequiredEnvironmentVariables { get; init; } = []; /// /// Environment variables that the sample can use but typically has fallbacks or defaults for. /// If these are not set, the sample might prompt or behave interactively, which could cause /// automated verification to hang. The runner checks these and skips the sample if they are unset /// to avoid non-deterministic or blocking behavior in automated runs. /// public string[] OptionalEnvironmentVariables { get; init; } = []; /// /// If set, the sample is skipped with this reason. /// Use only for structural reasons (e.g., web server, multi-process, needs external service). /// Do NOT use for missing environment variables — those are checked dynamically. /// public string? SkipReason { get; init; } /// /// Substrings that must appear in stdout for the sample to pass. /// Used for deterministic verification. /// public string[] MustContain { get; init; } = []; /// /// Substrings that must not appear in stdout for the sample to pass. /// public string[] MustNotContain { get; init; } = []; /// /// If true, entries cover the entire expected output — /// no AI verification is needed. /// public bool IsDeterministic { get; init; } /// /// Natural-language description of what the sample output should look like. /// Used by the AI verifier for non-deterministic samples. /// Each entry describes one aspect of the expected output that should be verified. /// public string[] ExpectedOutputDescription { get; init; } = []; /// /// Sequence of stdin inputs to feed to the sample process. /// Each entry is written as a line (followed by newline) to the process stdin. /// A null entry inserts a delay without writing anything. /// Inputs are sent with a short delay between each to allow the process to prompt. /// public string?[] Inputs { get; init; } = []; /// /// Delay in milliseconds between each input line. Default is 2000ms. /// Increase for samples that need more time between prompts (e.g., LLM calls between inputs). /// public int InputDelayMs { get; init; } = 2000; }