Skip to content

fix(check): backport complete piped Explainer receipts to stable - #1240

Merged
tt-a1i merged 4 commits into
mainfrom
codex/stable-explainer-receipt-20261107
Nov 10, 2026
Merged

tt-a1i merged 4 commits into
mainfrom
codex/stable-explainer-receipt-20261107

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

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.

 Explainer check receipt
- write JSON; exit immediately
+ write JSON; exit after write callback

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.

  • Comparison base: a4065941f12be7967436261d9934784e381d423c; candidate: 5eda30bfed3fc80410324e20c71177af34ea4d77.
  • Before: run the imported large receipt tests against the unchanged main checker: 0 passed, 2 failed; JSON parsing failed from truncated output (including position 65536).
  • After: 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.
  • Extract committed ZIP outside the repository and run the same two large receipt tests against its packaged checker: 2 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.
  • Canonical ZIP rebuilt twice and byte-compared; git diff --check passed.
  • Final-head CI run 42259786396: success. Both full regression shards, Node 18/20/22/24 checks, browser shards, WebM, Windows Node 22/24 portability, package smoke on macOS/Linux/Windows, ZIP freshness, published manifest and website passed; deployment jobs were skipped as expected for a PR.
  • No full local suite, local browser inspection, local Windows runtime check, or human review claimed. Unrelated main README/DSH baseline work is intentionally excluded.

Generated artifacts

Regenerated only archify.zip from 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.

Moonhyeseong and others added 3 commits November 7, 2026 01:12
…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)
Backport the integration coverage and final comment from #1131 (26513e7), without unrelated dev changes.
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Summary

The checker could emit truncated JSON when macOS piped stdout. It now writes the explainer receipt and exits after the write callback, without continuing into the diagram path. New regression tests cover large receipts for valid and invalid HTML. The package archive was rebuilt. No public API change is evident.

Reviewed base 11b0d6031853bdae89eed57e7979aabbf0034097 and head 0e7b95916439fa485757ea8646240d7dd07a539b; the diff changes three files (+29/−2). The author reports 69 focused tests passed and both large-receipt tests passed against the packaged checker. These results were not independently verified, and no evidence identifies them as reused from an earlier revision. CI success is author-reported; CI was not independently observed at the reviewed head. No browser or perceptual acceptance is claimed.

The explainer-check path now writes its JSON receipt to stdout and exits after the write callback. A pending promise prevents execution from reaching the later diagram receipt. New CLI tests cover valid and invalid HTML with 20 native diagrams and verify that receipts larger than 65,536 bytes are parseable and include valid checksums.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Possibly related issues

  • #1204 — Reports macOS truncation of Explainer receipts when the checker exits before piped stdout flushes. This change waits for the write callback before exiting.
  • #1130 — Reports truncated large Explainer receipts and delivery/receipt-invalid failures. This change adds a flush fix and regression coverage for large receipts.

Possibly related PRs

  • tt-a1i/archify#1131 — Implements the same receipt-flush change and large piped-receipt regression tests; this PR backports that behavior to stable.
Merge Risk: Minimal · up to 0e7b9

Large receipts are written before exit. No merge-blocking issue was identified.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 11b0d60 and 0e7b959.

Files ignored due to path filters: 1

  • archify.zip is excluded by !**/*.zip
Files selected for processing: 2

  • archify/scripts/check-render-output.mjs
  • test/explainer-check.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@tt-a1i
tt-a1i merged commit 7e45f36 into main Nov 10, 2026
22 checks passed
github-actions Bot added a commit that referenced this pull request Nov 10, 2026
@github-actions

Copy link
Copy Markdown

Thanks @tt-a1i for contributing to Archify! Your work is now part of the project.

Archify contribution card for tt-a1i

Download your card

View contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants