Add elapsed run time, per-account results CSV, and a default config path

Summaries now show elapsed wall-clock time since the run started, and every
summary (interim and final) overwrites a results.csv (Object ID, UPN,
persona/status) next to the audit log, so an operator has a plain export
without parsing NDJSON. ConfigPath also now defaults to
./config/persona-engine.json instead of requiring -ConfigPath every run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-24 22:10:24 -04:00
parent 8c8fd47f74
commit 5f125c34f2
14 changed files with 154 additions and 13 deletions
+12 -3
View File
@@ -27,7 +27,8 @@
.PARAMETER ConfigPath
Path to the JSON configuration. Validated through all four layers before any
connection is attempted (FR-002).
connection is attempted (FR-002). Defaults to ./config/persona-engine.json,
resolved against the current directory, when omitted.
.PARAMETER UserObjectId
Evaluate a single user instead of enumerating the tenant. The recommended first
@@ -73,9 +74,8 @@
#>
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string] $ConfigPath,
[string] $ConfigPath = (Join-Path (Get-Location).Path 'config' 'persona-engine.json'),
[guid] $UserObjectId,
@@ -162,6 +162,13 @@ try {
$logPath = $OutputPath ? $OutputPath : ($configuredPath ? $configuredPath : $defaultLogPath)
$auditParams = @{ Destination = $destination; Path = $logPath; State = $sinkState }
# Lives next to the audit log rather than under its own config key for path -
# one directory to point an operator at, not two. The file name alone is
# configurable because "results.csv" may collide with something else already
# written there.
$resultsFileName = $config.Logging.resultsFileName ? [string]$config.Logging.resultsFileName : 'results.csv'
$resultsPath = Join-Path (Split-Path -Parent $logPath) $resultsFileName
# Tracing is enabled by -Debug or by configuration, and requires acknowledgement
# in the configuration either way (VR-003, enforced in validation layer 4).
$traceRequested = $PSBoundParameters.ContainsKey('Debug') -or
@@ -222,6 +229,8 @@ try {
IsEnforcing = $runConfirmed
ShouldProcessGate = $gate
Tracing = $tracing
StartedUtc = $startedUtc
ResultsPath = $resultsPath
}
if ($UserObjectId -and $UserObjectId -ne [guid]::Empty) { $runParams['UserObjectId'] = $UserObjectId.ToString() }