| param( | |
| [Parameter(Mandatory = $true)] | |
| [string]$Path | |
| ) | |
| $ErrorActionPreference = 'Stop' | |
| function Fail([string]$Message) { | |
| Write-Error $Message | |
| exit 1 | |
| } | |
| if (-not (Test-Path -LiteralPath $Path)) { | |
| Fail "File not found: $Path" | |
| } | |
| $text = Get-Content -LiteralPath $Path -Raw | |
| if ([string]::IsNullOrWhiteSpace($text)) { | |
| Fail "Empty file: $Path" | |
| } | |
| foreach ($needle in @( | |
| "version:", | |
| "kind: app", | |
| "app:", | |
| "workflow:", | |
| "graph:", | |
| "nodes:", | |
| "edges:", | |
| "type: start", | |
| "type: http-request", | |
| "type: iteration", | |
| "type: end" | |
| )) { | |
| if ($text -notmatch [regex]::Escape($needle)) { | |
| Fail "Missing required marker '$needle' in $Path" | |
| } | |
| } | |
| Write-Host "OK: $Path contains required markers (not a full YAML parse)." | |
| exit 0 | |