| | | 1 | | using Intentum.Runtime.Policy; |
| | | 2 | | |
| | | 3 | | namespace Intentum.Observability; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Record of a single policy evaluation for logging and correlation (matched rule, intent name, decision, duration). |
| | | 7 | | /// Use with <see cref="ObservablePolicyEngine.DecideWithExecutionLog"/> to log policy execution and failure trace. |
| | | 8 | | /// </summary> |
| | | 9 | | /// <param name="IntentName">Name of the intent that was evaluated.</param> |
| | | 10 | | /// <param name="MatchedRuleName">Name of the rule that matched, or null if none.</param> |
| | | 11 | | /// <param name="Decision">Policy decision (Allow, Block, Observe, etc.).</param> |
| | | 12 | | /// <param name="DurationMs">Evaluation duration in milliseconds.</param> |
| | | 13 | | /// <param name="Success">True if evaluation completed without exception.</param> |
| | | 14 | | /// <param name="ExceptionMessage">Exception message when Success is false; null otherwise.</param> |
| | | 15 | | /// <param name="ExceptionTrace">Stack trace when Success is false; null otherwise.</param> |
| | 13 | 16 | | public sealed record PolicyExecutionRecord( |
| | 2 | 17 | | string IntentName, |
| | 2 | 18 | | string? MatchedRuleName, |
| | 2 | 19 | | PolicyDecision Decision, |
| | 1 | 20 | | double DurationMs, |
| | 4 | 21 | | bool Success = true, |
| | 4 | 22 | | string? ExceptionMessage = null, |
| | 16 | 23 | | string? ExceptionTrace = null); |