| | | 1 | | using Intentum.Core.Intents; |
| | | 2 | | |
| | | 3 | | namespace Intentum.Runtime.Policy; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Context for policy evaluation: system load, region, recent intents, and custom data. |
| | | 7 | | /// Used by context-aware policy rules to decide based on more than intent alone. |
| | | 8 | | /// </summary> |
| | | 9 | | /// <param name="Intent">The inferred intent being evaluated.</param> |
| | | 10 | | /// <param name="SystemLoad">Optional system load (0–1 or metric). Used e.g. to Escalate when load is high.</param> |
| | | 11 | | /// <param name="Region">Optional region or geography. Used e.g. for region-specific rules.</param> |
| | | 12 | | /// <param name="RecentIntents">Optional recent intent summaries for this entity. Used e.g. to detect patterns.</param> |
| | | 13 | | /// <param name="CustomContext">Optional custom key-value context from the application.</param> |
| | | 14 | | public sealed record PolicyContext( |
| | | 15 | | Intent Intent, |
| | | 16 | | double? SystemLoad = null, |
| | | 17 | | string? Region = null, |
| | | 18 | | IReadOnlyList<IntentSummary>? RecentIntents = null, |
| | | 19 | | IReadOnlyDictionary<string, object>? CustomContext = null); |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Summary of a past intent (name, confidence) for context-aware policies. |
| | | 23 | | /// </summary> |
| | 2 | 24 | | public sealed record IntentSummary( |
| | 2 | 25 | | string Name, |
| | 1 | 26 | | string ConfidenceLevel, |
| | 4 | 27 | | double ConfidenceScore); |