From 2039f5ae48880ff1567fccef5efbae6a3fb463ef Mon Sep 17 00:00:00 2001 From: Mike Kell Date: Sat, 22 Aug 2026 08:44:04 -0400 Subject: [PATCH] fix(scripts): verify_agent_work.ps1 - remove unicode em-dashes, add cargo PATH discovery --- scripts/verify_agent_work.ps1 | 50 +++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/scripts/verify_agent_work.ps1 b/scripts/verify_agent_work.ps1 index ad98cb0..fa6a237 100644 --- a/scripts/verify_agent_work.ps1 +++ b/scripts/verify_agent_work.ps1 @@ -9,9 +9,32 @@ $RootDir = "$PSScriptRoot\.." $StartTime = Get-Date $FailCount = 0 +# Locate cargo — try common install locations if not already on PATH +$CargoExe = "cargo" +if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) { + $CandidatePaths = @( + "$env:USERPROFILE\.cargo\bin\cargo.exe", + "C:\Users\$env:USERNAME\.cargo\bin\cargo.exe", + "$env:LOCALAPPDATA\Programs\Rust\bin\cargo.exe" + ) + foreach ($candidate in $CandidatePaths) { + if (Test-Path $candidate) { + $CargoExe = $candidate + $env:PATH = "$([System.IO.Path]::GetDirectoryName($candidate));$env:PATH" + Write-Host " INFO: Found cargo at $candidate" -ForegroundColor Yellow + break + } + } + if ($CargoExe -eq "cargo") { + Write-Host " WARN: cargo not found on PATH or common locations. Rust checks will be skipped." -ForegroundColor Yellow + Write-Host " Run this script from a terminal where 'cargo' is available." -ForegroundColor Yellow + } +} + function Write-Step { param([string]$Message) - Write-Host "`n[$([int]((Get-Date) - $StartTime).TotalSeconds)s] $Message" -ForegroundColor Cyan + $elapsed = [int]((Get-Date) - $StartTime).TotalSeconds + Write-Host "`n[${elapsed}s] $Message" -ForegroundColor Cyan } function Write-Pass { @@ -30,7 +53,7 @@ Write-Host " CHRONOGRID P2P - AGENT VERIFICATION PIPELINE v2" -ForegroundColor Write-Host " $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" -ForegroundColor Cyan Write-Host "============================================================" -ForegroundColor Cyan -# ── 1. chronogrid_crypto ───────────────────────────────────────────────────── +# --- 1. chronogrid_crypto --- Write-Step "1. Checking chronogrid_crypto (compile + tests)..." Set-Location "$RootDir\crates\chronogrid_crypto" @@ -42,7 +65,7 @@ cargo test --quiet 2>&1 if ($LASTEXITCODE -ne 0) { Write-Fail "chronogrid_crypto tests failed" } else { Write-Pass "chronogrid_crypto tests pass" } -# ── 2. chronogrid_core ─────────────────────────────────────────────────────── +# --- 2. chronogrid_core --- Write-Step "2. Checking chronogrid_core (compile + tests)..." Set-Location "$RootDir\crates\chronogrid_core" @@ -54,7 +77,7 @@ cargo test --quiet 2>&1 if ($LASTEXITCODE -ne 0) { Write-Fail "chronogrid_core tests failed" } else { Write-Pass "chronogrid_core tests pass" } -# ── 3. chronogrid_net ──────────────────────────────────────────────────────── +# --- 3. chronogrid_net --- Write-Step "3. Checking chronogrid_net (compile + tests)..." Set-Location "$RootDir\crates\chronogrid_net" @@ -66,7 +89,7 @@ cargo test --quiet 2>&1 if ($LASTEXITCODE -ne 0) { Write-Fail "chronogrid_net tests failed" } else { Write-Pass "chronogrid_net tests pass" } -# ── 4. chronogrid_ai ───────────────────────────────────────────────────────── +# --- 4. chronogrid_ai --- Write-Step "4. Checking chronogrid_ai (compile + tests)..." Set-Location "$RootDir\crates\chronogrid_ai" @@ -78,7 +101,7 @@ cargo test --quiet 2>&1 if ($LASTEXITCODE -ne 0) { Write-Fail "chronogrid_ai tests failed" } else { Write-Pass "chronogrid_ai tests pass" } -# ── 5. chronogrid_ffi ──────────────────────────────────────────────────────── +# --- 5. chronogrid_ffi --- Write-Step "5. Checking chronogrid_ffi (compile + tests)..." Set-Location "$RootDir\crates\chronogrid_ffi" @@ -90,7 +113,7 @@ cargo test --quiet 2>&1 if ($LASTEXITCODE -ne 0) { Write-Fail "chronogrid_ffi tests failed" } else { Write-Pass "chronogrid_ffi tests pass" } -# ── 6. chronogrid_daemon (if scaffolded) ───────────────────────────────────── +# --- 6. chronogrid_daemon (if scaffolded) --- Write-Step "6. Checking chronogrid_daemon (if scaffolded)..." $DaemonCargoToml = "$RootDir\apps\chronogrid_daemon\Cargo.toml" if (Test-Path $DaemonCargoToml) { @@ -102,7 +125,7 @@ if (Test-Path $DaemonCargoToml) { Write-Host " SKIP: chronogrid_daemon not yet scaffolded (Task 2.7)" -ForegroundColor Yellow } -# ── 7. Schema Validation ───────────────────────────────────────────────────── +# --- 7. Schema Validation --- Write-Step "7. Validating schema.sql contains required tables..." $SchemaPath = "$RootDir\docs\API_CONTRACTS\schema.sql" $SchemaContent = Get-Content $SchemaPath -Raw @@ -117,7 +140,6 @@ $RequiredTables = @( "crdt_docs" ) -# Phase 2+ tables (checked only if present — not a failure if missing pre-Phase 2) $Phase2Tables = @( "time_blocks", "attachments", @@ -151,7 +173,7 @@ if ($Phase2Count -eq $Phase2Tables.Count) { Write-Host " INFO: $Phase2Count/$($Phase2Tables.Count) Phase 2 tables present (add remaining in Task 2.1)" -ForegroundColor Yellow } -# ── 8. Flutter Analysis ─────────────────────────────────────────────────────── +# --- 8. Flutter Analysis --- Write-Step "8. Checking Flutter shell (analyze)..." $FlutterDir = "$RootDir\apps\chronogrid_flutter" if (Test-Path "$FlutterDir\pubspec.yaml") { @@ -166,7 +188,7 @@ if (Test-Path "$FlutterDir\pubspec.yaml") { Write-Fail "Flutter pubspec.yaml not found at $FlutterDir" } -# ── 9. FRB Codegen Output Check ─────────────────────────────────────────────── +# --- 9. FRB Codegen Output Check --- Write-Step "9. Checking FRB codegen output (if generated)..." $FrbGenerated = "$RootDir\crates\chronogrid_ffi\src\frb_generated.rs" $DartGenerated = "$RootDir\apps\chronogrid_flutter\lib\src\rust\frb_generated.dart" @@ -183,7 +205,7 @@ if (Test-Path $DartGenerated) { Write-Host " INFO: frb_generated.dart not yet generated (run: flutter_rust_bridge_codegen generate)" -ForegroundColor Yellow } -# ── 10. DECISION_LOG.md Check ──────────────────────────────────────────────── +# --- 10. DECISION_LOG.md Check --- Write-Step "10. Checking DECISION_LOG.md is present and non-empty..." $DecisionLog = "$RootDir\DECISION_LOG.md" if (Test-Path $DecisionLog) { @@ -191,13 +213,13 @@ if (Test-Path $DecisionLog) { if ($LogSize -gt 500) { Write-Pass "DECISION_LOG.md present ($LogSize bytes)" } else { - Write-Fail "DECISION_LOG.md is suspiciously small ($LogSize bytes) — may be empty" + Write-Fail "DECISION_LOG.md is suspiciously small ($LogSize bytes) - may be empty" } } else { Write-Fail "DECISION_LOG.md not found" } -# ── Summary ─────────────────────────────────────────────────────────────────── +# --- Summary --- $Elapsed = [int]((Get-Date) - $StartTime).TotalSeconds Write-Host "`n============================================================" -ForegroundColor Cyan