| | | 1 | | using NexusLabs.Needlr.AgentFramework.Diagnostics; |
| | | 2 | | using NexusLabs.Needlr.AgentFramework.Workflows.Sequential; |
| | | 3 | | using NexusLabs.Needlr.AgentFramework.Workspace; |
| | | 4 | | |
| | | 5 | | namespace NexusLabs.Needlr.AgentFramework.Testing; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Defines a pipeline scenario for multi-stage agent workflow testing. |
| | | 9 | | /// Extends the single-agent scenario pattern with pipeline stage construction |
| | | 10 | | /// and pipeline-specific verification. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <remarks> |
| | | 13 | | /// <para> |
| | | 14 | | /// Each scenario declares its own workspace seed data, pipeline stages, and |
| | | 15 | | /// verification logic. The <see cref="PipelineScenarioRunner"/> handles workspace |
| | | 16 | | /// creation, pipeline execution via <see cref="SequentialPipelineRunner"/>, and |
| | | 17 | | /// invokes <see cref="Verify"/> after execution. |
| | | 18 | | /// </para> |
| | | 19 | | /// </remarks> |
| | | 20 | | public interface IPipelineScenario |
| | | 21 | | { |
| | | 22 | | /// <summary>Gets the scenario name (used for selection and reporting).</summary> |
| | | 23 | | string Name { get; } |
| | | 24 | | |
| | | 25 | | /// <summary>Gets a human-readable description of what this scenario tests.</summary> |
| | | 26 | | string Description { get; } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Populates the workspace with files needed before the pipeline runs. |
| | | 30 | | /// Called by the runner before execution begins. |
| | | 31 | | /// </summary> |
| | | 32 | | /// <param name="workspace">The workspace to seed with test data.</param> |
| | | 33 | | void SeedWorkspace(IWorkspace workspace); |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Builds the ordered list of pipeline stages for this scenario. |
| | | 37 | | /// </summary> |
| | | 38 | | /// <param name="services"> |
| | | 39 | | /// The service provider for resolving agents and other dependencies |
| | | 40 | | /// needed to construct stage executors. |
| | | 41 | | /// </param> |
| | | 42 | | /// <returns>An ordered list of stages to execute sequentially.</returns> |
| | | 43 | | IReadOnlyList<PipelineStage> BuildPipeline(IServiceProvider services); |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// Returns optional pipeline configuration such as completion gates and |
| | | 47 | | /// total token budgets. Returns <see langword="null"/> to use defaults. |
| | | 48 | | /// </summary> |
| | | 49 | | /// <returns>Pipeline options, or <see langword="null"/>.</returns> |
| | 0 | 50 | | SequentialPipelineOptions? GetOptions() => null; |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Verifies the pipeline results after execution. |
| | | 54 | | /// Throw an exception (e.g., <see cref="ScenarioVerificationException"/>) to indicate failure. |
| | | 55 | | /// </summary> |
| | | 56 | | /// <param name="workspace">The workspace after pipeline execution.</param> |
| | | 57 | | /// <param name="result">The pipeline run result containing per-stage diagnostics.</param> |
| | | 58 | | void Verify(IWorkspace workspace, IPipelineRunResult result); |
| | | 59 | | } |