63 lines
2.6 KiB
PowerShell
63 lines
2.6 KiB
PowerShell
param(
|
|
[string]$QueueCsv = "",
|
|
[string]$PrepareSummaryJson = "",
|
|
[string]$ApiBaseUrl = "http://192.168.3.90:8001/api/v1",
|
|
[string]$AdminEmail = "admin@example.com",
|
|
[string]$AdminPassword = "",
|
|
[string]$ArtifactRoot = ""
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
|
if (-not (Test-Path "$HOME\.Codex\skills\gstack\bin")) {
|
|
throw "GSTACK_MISSING: gstack is required for AI-assisted work in this repo."
|
|
}
|
|
|
|
if ([string]::IsNullOrWhiteSpace($QueueCsv)) {
|
|
$planRoot = Join-Path $repoRoot "project-docs\qa-artifacts\phase14-incremental-batch-plan"
|
|
$latest = Get-ChildItem $planRoot -Directory | Where-Object { Test-Path (Join-Path $_.FullName "source-review-queue.csv") } | Sort-Object Name -Descending | Select-Object -First 1
|
|
if ($null -eq $latest) {
|
|
throw "No source-review-queue.csv found under $planRoot"
|
|
}
|
|
$QueueCsv = Join-Path $latest.FullName "source-review-queue.csv"
|
|
}
|
|
if ([string]::IsNullOrWhiteSpace($PrepareSummaryJson)) {
|
|
$PrepareSummaryJson = Join-Path $repoRoot "project-docs\qa-artifacts\cn-laws-download-import\2026-05-20T09-53-00\cn_laws_prepare_summary_20260520.json"
|
|
}
|
|
if ([string]::IsNullOrWhiteSpace($ArtifactRoot)) {
|
|
$ArtifactRoot = Join-Path $repoRoot "project-docs\qa-artifacts\phase14-source-review-verification"
|
|
}
|
|
|
|
$timestamp = Get-Date -Format "yyyy-MM-ddTHH-mm-ss-fff"
|
|
$artifactDir = Join-Path $ArtifactRoot $timestamp
|
|
New-Item -ItemType Directory -Force -Path $artifactDir | Out-Null
|
|
|
|
if ([string]::IsNullOrWhiteSpace($AdminPassword)) {
|
|
if (-not [string]::IsNullOrWhiteSpace($env:AICP_ADMIN_PASSWORD)) {
|
|
$AdminPassword = $env:AICP_ADMIN_PASSWORD
|
|
} elseif (-not [string]::IsNullOrWhiteSpace($env:AI_CONTRACT_ADMIN_PASSWORD)) {
|
|
$AdminPassword = $env:AI_CONTRACT_ADMIN_PASSWORD
|
|
} else {
|
|
$AdminPassword = "123456"
|
|
}
|
|
}
|
|
|
|
$toolPath = Join-Path $repoRoot "backend\tools\verify_phase14_source_review_queue.py"
|
|
$toolOutput = & python $toolPath `
|
|
--queue-csv $QueueCsv `
|
|
--prepare-summary-json $PrepareSummaryJson `
|
|
--api-base-url $ApiBaseUrl `
|
|
--admin-email $AdminEmail `
|
|
--admin-password $AdminPassword `
|
|
--output-dir $artifactDir
|
|
|
|
$toolExitCode = if ($LASTEXITCODE -is [int]) { $LASTEXITCODE } else { 0 }
|
|
($toolOutput -join [Environment]::NewLine) | Set-Content -Encoding UTF8 -Path (Join-Path $artifactDir "phase14-source-review-verification-tool.log")
|
|
if ($toolExitCode -ne 0) {
|
|
throw "verify_phase14_source_review_queue.py failed with exit code $toolExitCode."
|
|
}
|
|
|
|
Write-Host "PHASE14_SOURCE_REVIEW_VERIFICATION_PASS $artifactDir"
|
|
Write-Output ($toolOutput -join [Environment]::NewLine)
|