Files
KArtSell.Aegis/scripts/START_JOB_893_MONITOR.ps1
kjh2064 fed750f881
ci / backend (push) Failing after 1s
ci / static (push) Failing after 7s
Build & Test with Secrets / build (push) Failing after 0s
deploy / deploy (push) Failing after 1m44s
Build & Test with Secrets / security-scan (push) Failing after 8s
deploy / notify (push) Successful in 1s
ci / frontend (push) Successful in 3m17s
Build & Test with Secrets / frontend (push) Successful in 3m13s
ci / publish (push) Has been skipped
Build & Test with Secrets / notification (push) Failing after 1s
feat: Complete DateTime.Now IClock abstraction (all 12 files)
- Fixed 12 production files with DateTime.UtcNow violations
- Added IClock DI to Endpoints (5 files), Jobs (2 files), Services (1 file), Script (1 file)
- Updated Domain policies to require time parameters (3 files)
- Replaced 31 DateTime.UtcNow instances with _clock.UtcNow
- Architecture Test: DateTime violations = 0 
- AGENTS.md v16.0 #8 compliance verified

Files fixed:
   VS03_IngestionEndpoint.cs (1 instance)
   VS03_IngestionJobs.cs (3 instances)
   VS04_RebalanceEndpoint.cs (9 instances)
   VS05_RiskMetricsEndpoint.cs (4 instances)
   VS06_VS07_RiskEndpoint.cs (2 instances)
   VS08_DashboardEndpoint.cs (8 instances)
   VS02_SecurityMasterJobs.cs (2 instances)
   ApiCallMetricsService.cs (3 instances)
   MonitorJob893.cs (2 instances)
   VS02_SecurityMasterPolicy.cs (parameter required)
   VS03_MarketDataPolicy.cs (parameter required)
   VS08_DashboardPolicy.cs (clean)

Co-Authored-By: Fork Agent <fork@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-06 13:25:25 +09:00

121 lines
3.7 KiB
PowerShell

#!/usr/bin/env pwsh
<#
.SYNOPSIS
Start Job 893 Phase 1 Shadow Run monitoring in background
.DESCRIPTION
Monitors Job 893 progress every 5 minutes
- Displays current status, progress, rows processed
- Detects completion (Completed/Failed)
- Logs to file for historical tracking
.EXAMPLE
./START_JOB_893_MONITOR.ps1
#>
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
$repoRoot = Split-Path -Parent $scriptPath
$logFile = Join-Path $scriptPath "Job893_Monitor_$(Get-Date -Format 'yyyyMMdd_HHmmss').log"
Write-Host "=== Job 893 Monitoring ===" -ForegroundColor Cyan
Write-Host "Repo: $repoRoot" -ForegroundColor White
Write-Host "Log file: $logFile" -ForegroundColor White
# Compile monitoring script
Write-Host "`n=== Compiling Monitor ===" -ForegroundColor Cyan
$csharpFile = Join-Path $scriptPath "MonitorJob893.cs"
$exePath = Join-Path $scriptPath "MonitorJob893.exe"
if (-not (Test-Path $csharpFile)) {
Write-Error "MonitorJob893.cs not found at $csharpFile"
exit 1
}
# Compile with csc.exe (included in .NET SDK)
$dotnetSdk = & dotnet --version 2>$null
if (-not $dotnetSdk) {
Write-Error "dotnet SDK not found"
exit 1
}
Write-Host "✅ .NET SDK version: $dotnetSdk" -ForegroundColor Green
# Compile using dotnet cli
Write-Host "`n=== Compiling with dotnet ===" -ForegroundColor Cyan
$tempProject = Join-Path $scriptPath "MonitorJob893.csproj"
@"
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Npgsql" Version="9.0.0" />
</ItemGroup>
</Project>
"@ | Set-Content -Path $tempProject
try {
Push-Location $scriptPath
# Restore and compile
& dotnet build -o "." -c Release MonitorJob893.csproj 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Host "⚠️ Compilation with project file failed, trying direct CSC..." -ForegroundColor Yellow
# Try simpler approach: use dotnet run
Write-Host "Using dotnet run approach..." -ForegroundColor Yellow
$exePath = "dotnet"
}
else {
Write-Host "✅ Compiled successfully" -ForegroundColor Green
}
} finally {
Pop-Location
}
# Start monitoring in background
Write-Host "`n=== Starting Monitor ===" -ForegroundColor Cyan
$monitorCommand = if ($exePath -eq "dotnet") {
"dotnet run --project '$tempProject' --"
} else {
"'$exePath'"
}
$job = Start-Job -ScriptBlock {
param($cmd, $log)
# Start monitoring
Invoke-Expression "$cmd" | Tee-Object -FilePath $log -Append
} -ArgumentList $monitorCommand, $logFile
Write-Host "✅ Monitor started (Job ID: $($job.Id))" -ForegroundColor Green
Write-Host "PID: $($job.PSChildJobs[0].Id)" -ForegroundColor White
Write-Host "Log file: $logFile" -ForegroundColor White
Write-Host "`n=== Commands ===" -ForegroundColor Cyan
Write-Host "View logs:" -ForegroundColor White
Write-Host " Get-Content '$logFile' -Tail 20 -Wait" -ForegroundColor Cyan
Write-Host "`nStop monitor:" -ForegroundColor White
Write-Host " Stop-Job -Id $($job.Id)" -ForegroundColor Cyan
Write-Host "`nCheck status:" -ForegroundColor White
Write-Host " Get-Job -Id $($job.Id) | Select-Object State, HasMoreData" -ForegroundColor Cyan
# Display initial check
Write-Host "`n=== Initial Status ===" -ForegroundColor Cyan
Start-Sleep -Seconds 2
if ($job.State -eq "Running") {
Write-Host "✅ Monitor is running" -ForegroundColor Green
Write-Host "`n[Monitor output will appear in log file above]" -ForegroundColor Gray
Write-Host "Next auto-update in 5 minutes..." -ForegroundColor Gray
} else {
Write-Host "⚠️ Monitor job state: $($job.State)" -ForegroundColor Yellow
}