|
| 1 | +$projectRoot= (Resolve-Path (Join-Path$PSScriptRoot'..\..')).Path |
| 2 | +$sampleDir=Join-Path$projectRoot'05_NUMBERS/test_outputs/samples' |
| 3 | +$canonicalRoot=Join-Path$projectRoot'05_NUMBERS/test_outputs/canonical' |
| 4 | +$packetRoot=Join-Path$projectRoot'05_NUMBERS/test_outputs/packets' |
| 5 | +$logPath=Join-Path$projectRoot'05_NUMBERS/test_outputs/review_surface.log' |
| 6 | + |
| 7 | +New-Item-ItemType Directory -Force -Path $sampleDir,$canonicalRoot,$packetRoot|Out-Null |
| 8 | +"phase4 review surface sample"|Set-Content-Path (Join-Path$sampleDir'review_surface_sample.md') -Encoding utf8 |
| 9 | + |
| 10 | +$registrationOut=Join-Path$sampleDir'review_surface_registration.json' |
| 11 | +$registerScript=Join-Path$projectRoot'02_EXODUS/runtime/intake/register_sources.ps1' |
| 12 | +& powershell -ExecutionPolicy Bypass -File $registerScript-InputPath (Join-Path$sampleDir'review_surface_sample.md') -RegistrationOut $registrationOut|Out-Null |
| 13 | +if ($LASTEXITCODE-ne0) { throw'register_sources failed in review surface smoke' } |
| 14 | + |
| 15 | +$canonicalMetaOut=Join-Path$sampleDir'review_surface_canonical_meta.json' |
| 16 | +$canonicalScript=Join-Path$projectRoot'02_EXODUS/runtime/canonicalize/canonicalize_sources.ps1' |
| 17 | +& powershell -ExecutionPolicy Bypass -File $canonicalScript-RegistrationPath $registrationOut-CanonicalRoot $canonicalRoot-CanonicalMetaOut $canonicalMetaOut|Out-Null |
| 18 | +if ($LASTEXITCODE-ne0) { throw'canonicalize_sources failed in review surface smoke' } |
| 19 | + |
| 20 | +$extractionOut=Join-Path$sampleDir'review_surface_extraction_record.json' |
| 21 | +$extractScript=Join-Path$projectRoot'02_EXODUS/runtime/extract/extract_statements.ps1' |
| 22 | +& powershell -ExecutionPolicy Bypass -File $extractScript-CanonicalMetaPath $canonicalMetaOut-ExtractionOut $extractionOut|Out-Null |
| 23 | +if ($LASTEXITCODE-ne0) { throw'extract_statements failed in review surface smoke' } |
| 24 | + |
| 25 | +$traceOut=Join-Path$sampleDir'review_surface_trace_record.json' |
| 26 | +$traceScript=Join-Path$projectRoot'02_EXODUS/runtime/trace/build_trace_links.ps1' |
| 27 | +& powershell -ExecutionPolicy Bypass -File $traceScript-ExtractionRecordPath $extractionOut-TraceOut $traceOut|Out-Null |
| 28 | +if ($LASTEXITCODE-ne0) { throw'build_trace_links failed in review surface smoke' } |
| 29 | + |
| 30 | +$discrepancyOut=Join-Path$sampleDir'review_surface_discrepancy_record.json' |
| 31 | +$discrepancyScript=Join-Path$projectRoot'02_EXODUS/runtime/discrepancy/detect_discrepancies.ps1' |
| 32 | +& powershell -ExecutionPolicy Bypass -File $discrepancyScript-ExtractionRecordPath $extractionOut-TraceRecordPath $traceOut-DiscrepancyOut $discrepancyOut|Out-Null |
| 33 | +if ($LASTEXITCODE-ne0) { throw'detect_discrepancies failed in review surface smoke' } |
| 34 | + |
| 35 | +$queueOut=Join-Path$sampleDir'review_surface_queue_index.json' |
| 36 | +$stateIndexOut=Join-Path$sampleDir'review_surface_project_state_index.json' |
| 37 | +$queueScript=Join-Path$projectRoot'02_EXODUS/runtime/review/rebuild_review_queue.ps1' |
| 38 | +& powershell -ExecutionPolicy Bypass -File $queueScript-DiscrepancyRecordPath $discrepancyOut-QueueOut $queueOut-StateIndexOut $stateIndexOut|Out-Null |
| 39 | +if ($LASTEXITCODE-ne0) { throw'rebuild_review_queue failed in review surface smoke' } |
| 40 | + |
| 41 | +$manifestOut=Join-Path$sampleDir'review_surface_packet_manifest.json' |
| 42 | +$packetScript=Join-Path$projectRoot'02_EXODUS/runtime/export/export_review_packet.ps1' |
| 43 | +& powershell -ExecutionPolicy Bypass -File $packetScript-DiscrepancyRecordPath $discrepancyOut-TraceRecordPath $traceOut-PacketRoot $packetRoot-ManifestOut $manifestOut|Out-Null |
| 44 | +if ($LASTEXITCODE-ne0) { throw'export_review_packet failed in review surface smoke' } |
| 45 | + |
| 46 | +$stateOut=Join-Path$sampleDir'review_surface_state.json' |
| 47 | +$surfaceScript=Join-Path$projectRoot'02_EXODUS/runtime/review/start_review_surface.ps1' |
| 48 | +$output=& powershell -ExecutionPolicy Bypass -File $surfaceScript-QueueIndexPath $queueOut-PacketManifestPath $manifestOut-ReviewStateOut $stateOut-LogPath $logPath |
| 49 | +$output|Set-Content-Path $logPath-Encoding utf8 |
| 50 | + |
| 51 | +if ($LASTEXITCODE-ne0) { throw'start_review_surface failed in review surface smoke' } |
| 52 | +if (-not ($output-match'REVIEW_SURFACE_READY')) { throw'REVIEW_SURFACE_READY missing' } |
| 53 | +if (-not ($output-match'human_accepted')) { throw'human_accepted missing' } |
| 54 | + |
| 55 | +Write-Output'REVIEW_SURFACE_READY' |
| 56 | +Write-Output'human_accepted' |
0 commit comments