Repository navigation
fix(check): backport complete piped Explainer receipts to stable - #1240
Conversation
…out is not truncated On macOS, process.stdout is asynchronous when it is a pipe. The explainer branch of scripts/check-render-output.mjs printed its receipt with console.log and called process.exit() on the next line, so any receipt larger than one pipe chunk (about 8 KiB) was cut mid-JSON. deliver and finalize spawn the checker with a piped stdout and then fail with "Could not parse the successful artifact-check receipt: Unterminated fractional number in JSON" even though the artifact passed. The diagram path at the bottom of the same script already avoids this by setting process.exitCode and letting the process drain. The explainer branch now writes the receipt with process.stdout.write and exits from the write callback; a never-resolving top-level await keeps the diagram path from running and printing a second receipt. Reproduced with a 7-panel, 4-diagram explainer (receipt 21,289 bytes): before, `archify check <html> --json | wc -c` gave 8192 and finalize failed at deliver; after, the full receipt is emitted and finalize passes. (cherry picked from commit 8be5ace)
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Thanks @tt-a1i for contributing to Archify! Your work is now part of the project. |

Problem and value
Refs #1204 and #1130; backports #1131 to stable
main. On macOS, the stable 3.2.0 checker exits while a large Explainer receipt is still buffered, so delivery/finalize receives truncated JSON. The user authorized the stable backport in the maintenance task; targeting main is deliberate because dev already contains the fix. No release, tag, merge, or live installation is part of this PR.Preserves @Moonhyeseong's original commit with
cherry-pick -x 8be5ace8e4f8cf97a6b1d6cebade2cbff6369118, then carries the reviewed integration comment and regressions from merged #1131 (26513e7b01c7e91bd5f335c8b48cdd8bcfbcd234). No unrelated dev changes.AI assistance and accountability
Human confirmation remains pending; this is a Draft.
Stability impact
Local CLI process/output behavior shared by Explainer check, deliver and finalize. Complete receipts retain their JSON shape and exit statuses 0/1. The write callback prevents early exit; the pending await prevents diagram dispatch and duplicate receipts.
Test-value assessment: reuse the two existing >64 KiB piped success/failure cases. They expose lost receipts, duplicate output, incorrect exit status, and lost child bindings through public process behavior; no new fixture family or implementation-source assertions. No concrete duplication/state complexity introduced, so no simplification changes.
Reversible source/package backport; affected area is Explainer receipt emission. No schema, renderer, authoring, or version changes. No visual/generation comparison needed for this process flush correction.
Tests run
Agent-run on macOS arm64, official Node 22.23.3 / bundled zlib 1.3.1-e00f703.
a4065941f12be7967436261d9934784e381d423c; candidate:5eda30bfed3fc80410324e20c71177af34ea4d77.npm run test:focus -- test/explainer-check.test.mjs test/explainer-cli.test.mjs test/finalize.test.mjs test/core-smoke.test.mjs --concurrency=2: 69 passed, 0 failed, 0 skipped.node scripts/package-smoke.mjs <extracted-archify> --explainer-only: dependency-free parser, native graph, delivery, strict check and panel patch passed.git diff --checkpassed.Generated artifacts
Regenerated only
archify.zipfrom final source with canonical Node/zlib. SHA-256:4ffb3bc251c7ec3ada0181829530405f10b5a379cadcae2aa7161d662bf1a42b.Stable 3.2.0 is not released with this fix; the current published stable artifact remains unchanged until an independently authorized release.