| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- param(
- [switch]$OpenReport,
- [switch]$StrictGate
- )
- $ErrorActionPreference = "Stop"
- Set-Location -LiteralPath $PSScriptRoot
- Write-Host "[dragon] running forward observation pipeline..."
- py .\dragon_forward_observation_pipeline.py
- $statePath = Join-Path $PSScriptRoot "dragon_rollout_state.json"
- $manifestPath = Join-Path $PSScriptRoot "dragon_daily_rc1_manifest.json"
- $state = $null
- $manifest = $null
- if (Test-Path -LiteralPath $statePath) {
- $state = Get-Content -Raw -LiteralPath $statePath | ConvertFrom-Json
- }
- if (Test-Path -LiteralPath $manifestPath) {
- $manifest = Get-Content -Raw -LiteralPath $manifestPath | ConvertFrom-Json
- }
- Write-Host "[dragon] reports updated:"
- Write-Host " - dragon_reports_index.html"
- Write-Host " - dragon_daily_signal_report.html"
- Write-Host " - dragon_forward_weekly_review.html"
- Write-Host " - dragon_rollout_governance_report.md"
- if ($null -ne $manifest) {
- Write-Host ("[dragon] latest bar: {0} | request date: {1}" -f $manifest.latest_bar_date, $manifest.as_of_request_date)
- }
- if ($null -ne $state) {
- $ok = 0
- $warn = 0
- $hard = 0
- if ($null -ne $state.gate_status_counts) {
- if ($state.gate_status_counts.PSObject.Properties.Name -contains "ok") { $ok = [int]$state.gate_status_counts.ok }
- if ($state.gate_status_counts.PSObject.Properties.Name -contains "warning") { $warn = [int]$state.gate_status_counts.warning }
- if ($state.gate_status_counts.PSObject.Properties.Name -contains "hard_fail") { $hard = [int]$state.gate_status_counts.hard_fail }
- }
- Write-Host ("[dragon] rollout decision: {0}" -f $state.decision)
- Write-Host ("[dragon] active/fallback: {0} / {1}" -f $state.active_branch, $state.fallback_branch)
- Write-Host ("[dragon] gate counts: ok={0}, warning={1}, hard_fail={2}" -f $ok, $warn, $hard)
- if ($StrictGate -and $state.decision -ne "FORWARD_OK") {
- Write-Error ("[dragon] strict gate blocked: decision={0}" -f $state.decision)
- exit 2
- }
- }
- if ($OpenReport) {
- Start-Process (Join-Path $PSScriptRoot "dragon_reports_index.html")
- }
|