Repository navigation
fix(artifact): flush piped reports before exit - #404
Merged
Merged
Conversation
what changed: Await the existing exitAfterFlush helper for all artifact CLI help, refusal, success and validation endings. Add large-output regressions for JSON and text with 700 missing files. why: Direct process.exit can discard queued stdout on POSIX pipes, truncating reports after 64 KiB. Drain output before preserving the existing exit code. what it touched: artifact CLI/tests, architecture, changelog and README test inventory. No report schema or exit-code change. what you verified: verified - corrected baseline and fixed CLI each passed 23 artifact-cli tests; large JSON parses and text retains 700 errors, both over 64 KiB and exit 1. Handoff OK, preflight PASS, doctor READY. Full gate is running. what you got wrong and fixed: mistake - initial missing-files fixture was rebuilt by the seal helper. where - artifact-cli test. impact - it did not reproduce the truncation defect; no delivery affected. cause - default inventory recomputation; fix - preserve the mutated inventory using recomputeFiles:false; verified - corrected baseline and fixed CLI each passed 23 tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Large artifact-validation reports sent through a pipe could be truncated at 64 KiB because the CLI called process.exit before stdout drained. Artifact CLI endings now await the existing exitAfterFlush helper, preserving report contents and exit codes. Regression coverage exercises 700 missing-file diagnostics in both JSON and text modes.
Fixes #359
what changed: Awaited output flush for artifact CLI help, refusal, successful create and validation endings. Added a large piped-report regression that verifies parseable JSON and all 700 text errors above 64 KiB, with exit code 1.
why: process.exit can discard queued stdout on asynchronous POSIX pipes. Use the established drain helper before exiting.
what it touched: artifact CLI and tests, architecture map, changelog and README test inventory. No report schema or exit-code change.
what you verified: verified - red-first/corrected-baseline runs and fixed CLI each passed 23 artifact-cli tests; JSON parses and text contains all 700 errors, both over 64 KiB. The required full commit gate accepted 87652bf. Expected - POSIX pipe truncation is prevented by awaiting the stream drain. Untested locally - POSIX pipe runtime behavior; GitHub CI passed all seven required jobs, including Linux and Windows (run 38441197165).
what you got wrong and fixed: mistake - the first missing-files test fixture was rebuilt by the seal helper; where - artifact-cli.test.mjs; impact - it did not reproduce the truncation failure; no delivered result was affected; cause - default inventory recomputation; fix - preserve the mutated manifest inventory using recomputeFiles:false; verified - corrected baseline and fixed CLI each passed 23 artifact-cli tests.