conductor(checkpoint): Phase 4: Final Validation and Reporting complete

This commit is contained in:
2026-02-25 08:59:20 -05:00
parent 3378fc51b3
commit 551e41c27f
3 changed files with 54 additions and 4 deletions

View File

@@ -24,6 +24,21 @@ $SystemPrompts = @{
$SelectedPrompt = $SystemPrompts[$Role]
$SafePrompt = "$SelectedPrompt`n`nUSER PROMPT:`n$Prompt"
# Ensure log directory exists
if (-not (Test-Path "logs")) { New-Item -ItemType Directory -Path "logs" | Out-Null }
$LogFile = "logs/mma_delegation.log"
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$LogEntry = @"
--------------------------------------------------
TIMESTAMP: $Timestamp
TIER: $Role
SYSTEM PROMPT: $SelectedPrompt
USER PROMPT: $Prompt
--------------------------------------------------
"@
$LogEntry | Out-File -FilePath $LogFile -Append
if ($ShowContext) {
Write-Host "`n[MMA ORCHESTRATOR] Spawning Tier: $Role" -ForegroundColor Cyan
Write-Host "[MMA SYSTEM PROMPT]:`n$SelectedPrompt" -ForegroundColor Gray
@@ -43,13 +58,18 @@ try {
$cleanJsonString = $fullString.Substring($jsonStartIndex)
$parsed = $cleanJsonString | ConvertFrom-Json
# Log response
"RESPONSE:`n$($parsed.response)" | Out-File -FilePath $LogFile -Append
# Output only the clean response text
Write-Output $parsed.response
} else {
"ERROR: No JSON found in output.`n$fullString" | Out-File -FilePath $LogFile -Append
Write-Warning "No JSON object found in output."
Write-Output $fullString
}
} catch {
"FATAL ERROR: Parsing failed.`n$_" | Out-File -FilePath $LogFile -Append
# Fallback if parsing fails
Write-Warning "Failed to parse JSON from sub-agent. Raw output:"
Write-Output $jsonOutput