file|issues [HARVEST] gov_profile_launcher_v1.6.ps1 Time=20251025_102018 BOM_UTF8=NO ---- TERNARY_LIKE with context (prev|hit|next) ---- [L 74] $blk = $m.Groups[1].Value [L 75] $infile = [regex]::Match($blk,'(?mi)^\s*MANIFEST_SHA256\s*:\s*([0-9a-f]+)\s*$').Groups[1].Value.ToLower() [L 76] $coreLines=@(); foreach($ln in ($blk -split "`r?`n")){ if($ln -match '^\s*MANIFEST_SHA256\s*:'){ continue }; $coreLines += $ln.TrimEnd() } -- [L 75] $infile = [regex]::Match($blk,'(?mi)^\s*MANIFEST_SHA256\s*:\s*([0-9a-f]+)\s*$').Groups[1].Value.ToLower() [L 76] $coreLines=@(); foreach($ln in ($blk -split "`r?`n")){ if($ln -match '^\s*MANIFEST_SHA256\s*:'){ continue }; $coreLines += $ln.TrimEnd() } [L 77] $core=[string]::Join("`r`n",$coreLines) -- [L 122] $manifest='N/A'; if(Test-Path $bp){ $raw=Get-Content -LiteralPath $bp -Raw -Encoding UTF8; $res=Recalc-ManifestShaObject $raw; if($res.ok){ $manifest=("file="+$res.infile+" ; recalc="+$res.recalc) } } [L 123] $kbPtr='N/A'; $kbPath=''; if(Test-Path $bp){ $raw=Get-Content -LiteralPath $bp -Raw -Encoding UTF8; $kbBlk=[regex]::Match($raw,'(?ms)^\[BUG_KB_JSON_POINTER\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $kbPath=[regex]::Match($kbBlk,'(?mi)^\s*Path\s*:\s*(.+)$').Groups[1].Value.Trim(); $kbPtr=$kbPath } [L 124] $logsPath=Join-Path $root 'logs' -- [L 151] $raw = Get-Content -LiteralPath $bp -Raw -Encoding UTF8 [L 152] $proj = [regex]::Match($raw,'(?mi)^\s*PROJECT:\s*(.+)$').Groups[1].Value.Trim() [L 153] $rootp= [regex]::Match($raw,'(?mi)^\s*ROOT:\s*(.+)$').Groups[1].Value.Trim() -- [L 152] $proj = [regex]::Match($raw,'(?mi)^\s*PROJECT:\s*(.+)$').Groups[1].Value.Trim() [L 153] $rootp= [regex]::Match($raw,'(?mi)^\s*ROOT:\s*(.+)$').Groups[1].Value.Trim() [L 154] $policy= [regex]::Match($raw,'(?ms)^\[POLICY\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value.Trim() -- [L 173] $ok.C2=($miss.Count -eq 0); $msg.C2=$(if($ok.C2){"OK"}else{"Manque: "+($miss -join ' ; ')}) [L 174] $kbblk=[regex]::Match($raw,'(?ms)^\[BUG_KB_JSON_POINTER\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $kbPath=[regex]::Match($kbblk,'(?mi)^\s*Path:\s*(.+)$').Groups[1].Value.Trim(); $kbShaIn=[regex]::Match($kbblk,'(?mi)^\s*SHA256:\s*([0-9A-Fa-f]+)$').Groups[1].Value.Trim().ToLower(); $kbShaReal=(FileSha $kbPath).ToLower(); $ok.C3=($kbShaReal -ne '' -and $kbShaIn -eq $kbShaReal); $msg.C3=$(if($ok.C3){"OK"}else{"SHA pointer="+$kbShaIn+" vs real="+$kbShaReal}) [L 175] $rawKB=''; if(Test-Path $kbPath){ $rawKB=Get-Content -LiteralPath $kbPath -Raw -Encoding UTF8 }; $i=$rawKB.LastIndexOf(']}'); if($i -gt 0){ $rawKB=$rawKB.Substring(0,$i+2) }; $kbEntriesIn=[regex]::Match($kbblk,'(?mi)^\s*Entries:\s*([0-9]+)$').Groups[1].Value; $kbCount=-1; try{ $kbCount=(($rawKB|ConvertFrom-Json).entries).Count } catch { $kbCount=([regex]::Matches($rawKB,'"id"\s*:')).Count }; $ok.C4=($kbCount -ge 0 -and [string]$kbCount -eq [string]$kbEntriesIn); $msg.C4=$(if($ok.C4){"OK"}else{"Entries pointer="+$kbEntriesIn+" vs real="+$kbCount}) -- [L 174] $kbblk=[regex]::Match($raw,'(?ms)^\[BUG_KB_JSON_POINTER\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $kbPath=[regex]::Match($kbblk,'(?mi)^\s*Path:\s*(.+)$').Groups[1].Value.Trim(); $kbShaIn=[regex]::Match($kbblk,'(?mi)^\s*SHA256:\s*([0-9A-Fa-f]+)$').Groups[1].Value.Trim().ToLower(); $kbShaReal=(FileSha $kbPath).ToLower(); $ok.C3=($kbShaReal -ne '' -and $kbShaIn -eq $kbShaReal); $msg.C3=$(if($ok.C3){"OK"}else{"SHA pointer="+$kbShaIn+" vs real="+$kbShaReal}) [L 175] $rawKB=''; if(Test-Path $kbPath){ $rawKB=Get-Content -LiteralPath $kbPath -Raw -Encoding UTF8 }; $i=$rawKB.LastIndexOf(']}'); if($i -gt 0){ $rawKB=$rawKB.Substring(0,$i+2) }; $kbEntriesIn=[regex]::Match($kbblk,'(?mi)^\s*Entries:\s*([0-9]+)$').Groups[1].Value; $kbCount=-1; try{ $kbCount=(($rawKB|ConvertFrom-Json).entries).Count } catch { $kbCount=([regex]::Matches($rawKB,'"id"\s*:')).Count }; $ok.C4=($kbCount -ge 0 -and [string]$kbCount -eq [string]$kbEntriesIn); $msg.C4=$(if($ok.C4){"OK"}else{"Entries pointer="+$kbEntriesIn+" vs real="+$kbCount}) [L 176] $man=[regex]::Match($raw,'(?ms)^\[SYNC_MANIFEST\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $snapPath=[regex]::Match($man,'(?mi)^\s*SNAPSHOT_FILE\s*:\s*(.+)$').Groups[1].Value.Trim(); $snapShaIn=[regex]::Match($man,'(?mi)^\s*SNAPSHOT_SHA256\s*:\s*([0-9A-Fa-f]+|MISSING)$').Groups[1].Value.Trim().ToLower(); $snapRealExist=Test-Path $snapPath; $snapShaReal=$(if($snapRealExist){ (FileSha $snapPath).ToLower() } else { 'missing' }); $ok.C5=($(if($snapRealExist){ $snapShaReal -eq $snapShaIn.ToLower() } else { $snapShaIn -eq 'missing' })); $msg.C5=$(if($ok.C5){"OK"}else{"SNAPSHOT "+$(if($snapRealExist){"hash="+$snapShaReal}else{"absent"})+" vs manifest="+$snapShaIn}) -- [L 175] $rawKB=''; if(Test-Path $kbPath){ $rawKB=Get-Content -LiteralPath $kbPath -Raw -Encoding UTF8 }; $i=$rawKB.LastIndexOf(']}'); if($i -gt 0){ $rawKB=$rawKB.Substring(0,$i+2) }; $kbEntriesIn=[regex]::Match($kbblk,'(?mi)^\s*Entries:\s*([0-9]+)$').Groups[1].Value; $kbCount=-1; try{ $kbCount=(($rawKB|ConvertFrom-Json).entries).Count } catch { $kbCount=([regex]::Matches($rawKB,'"id"\s*:')).Count }; $ok.C4=($kbCount -ge 0 -and [string]$kbCount -eq [string]$kbEntriesIn); $msg.C4=$(if($ok.C4){"OK"}else{"Entries pointer="+$kbEntriesIn+" vs real="+$kbCount}) [L 176] $man=[regex]::Match($raw,'(?ms)^\[SYNC_MANIFEST\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $snapPath=[regex]::Match($man,'(?mi)^\s*SNAPSHOT_FILE\s*:\s*(.+)$').Groups[1].Value.Trim(); $snapShaIn=[regex]::Match($man,'(?mi)^\s*SNAPSHOT_SHA256\s*:\s*([0-9A-Fa-f]+|MISSING)$').Groups[1].Value.Trim().ToLower(); $snapRealExist=Test-Path $snapPath; $snapShaReal=$(if($snapRealExist){ (FileSha $snapPath).ToLower() } else { 'missing' }); $ok.C5=($(if($snapRealExist){ $snapShaReal -eq $snapShaIn.ToLower() } else { $snapShaIn -eq 'missing' })); $msg.C5=$(if($ok.C5){"OK"}else{"SNAPSHOT "+$(if($snapRealExist){"hash="+$snapShaReal}else{"absent"})+" vs manifest="+$snapShaIn}) [L 177] $prf=[regex]::Match($raw,'(?ms)^\[PROJECT_PROFILE_REF\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $pf=[regex]::Match($prf,'(?mi)^\s*PROFILE_FILE\s*:\s*(.+)$').Groups[1].Value.Trim(); $pfShaIn=[regex]::Match($prf,'(?mi)^\s*PROFILE_SHA256\s*:\s*([0-9A-Fa-f:]+)$').Groups[1].Value.Trim().ToLower(); $pfExist=Test-Path $pf; $pfShaReal=$(if($pfExist){ (FileSha $pf).ToLower() } else { 'missing' }); $ok.C6=($pfExist -and $pfShaIn -eq $pfShaReal); if(-not $pfExist -and ($pfShaIn -like 'planned:*')){$ok.C6=$true}; $msg.C6=$(if($ok.C6){"OK"}else{"PROFILE "+$(if($pfExist){"hash="+$pfShaReal}else{"absent"})+" vs ref="+$pfShaIn}) -- [L 176] $man=[regex]::Match($raw,'(?ms)^\[SYNC_MANIFEST\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $snapPath=[regex]::Match($man,'(?mi)^\s*SNAPSHOT_FILE\s*:\s*(.+)$').Groups[1].Value.Trim(); $snapShaIn=[regex]::Match($man,'(?mi)^\s*SNAPSHOT_SHA256\s*:\s*([0-9A-Fa-f]+|MISSING)$').Groups[1].Value.Trim().ToLower(); $snapRealExist=Test-Path $snapPath; $snapShaReal=$(if($snapRealExist){ (FileSha $snapPath).ToLower() } else { 'missing' }); $ok.C5=($(if($snapRealExist){ $snapShaReal -eq $snapShaIn.ToLower() } else { $snapShaIn -eq 'missing' })); $msg.C5=$(if($ok.C5){"OK"}else{"SNAPSHOT "+$(if($snapRealExist){"hash="+$snapShaReal}else{"absent"})+" vs manifest="+$snapShaIn}) [L 177] $prf=[regex]::Match($raw,'(?ms)^\[PROJECT_PROFILE_REF\]\s*(.*?)(?=^\[|\Z)').Groups[1].Value; $pf=[regex]::Match($prf,'(?mi)^\s*PROFILE_FILE\s*:\s*(.+)$').Groups[1].Value.Trim(); $pfShaIn=[regex]::Match($prf,'(?mi)^\s*PROFILE_SHA256\s*:\s*([0-9A-Fa-f:]+)$').Groups[1].Value.Trim().ToLower(); $pfExist=Test-Path $pf; $pfShaReal=$(if($pfExist){ (FileSha $pf).ToLower() } else { 'missing' }); $ok.C6=($pfExist -and $pfShaIn -eq $pfShaReal); if(-not $pfExist -and ($pfShaIn -like 'planned:*')){$ok.C6=$true}; $msg.C6=$(if($ok.C6){"OK"}else{"PROFILE "+$(if($pfExist){"hash="+$pfShaReal}else{"absent"})+" vs ref="+$pfShaIn}) [L 178] $res=Recalc-ManifestShaObject $raw; $ok.C7=($res.ok -and $res.infile -eq $res.recalc); $msg.C7=$(if($ok.C7){"OK"}else{"hash file="+$res.infile+" vs recalc="+$res.recalc}) -- ---- NON_ASCII lines (indexes only) ---- L 29 L 30 L 33 L 36 L 51 L 60 L 68 L 113 L 115 L 116 L 143 L 145 L 165 L 169 L 210 L 211 L 219