From 194b210c44d6902358d3218a9e7c82919f7ed5c8 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Sat, 31 Oct 2026 17:49:49 +0800 Subject: [PATCH] diag(ime): checkpoint the final report serialisation refs #40 The worker now records report/emitted after the last ConvertTo-Json and an explicit stdout flush, separating a stalled pipe from a stalled worker. --- research/ime/inventory_worker.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/research/ime/inventory_worker.ps1 b/research/ime/inventory_worker.ps1 index 9d4b4997..6f814cdb 100644 --- a/research/ime/inventory_worker.ps1 +++ b/research/ime/inventory_worker.ps1 @@ -136,4 +136,11 @@ try { Save-Progress $phase 'failed' $failure } $report | ConvertTo-Json -Depth 8 -Compress +# #40: the report is written but the parent may never receive it when the pipe +# stalls, so record that the final serialisation completed and was flushed. +$stdout = [Console]::OpenStandardOutput() +$bytes = [Text.Encoding]::UTF8.GetBytes('') +$stdout.Write($bytes, 0, 0) +$stdout.Flush() +Save-Progress 'report' 'emitted' if ($report.status -ne 'complete') { exit 1 }