Repository navigation
fix(cli): keep JSON argument failures machine-readable - #331
Merged
sunsunsun-java merged 1 commit intoSep 7, 2026
Merged
Conversation
sunsunsun-java
approved these changes
Sep 7, 2026
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.
Problem and value
validate --jsonanddeliver --jsonpromise one JSON receipt on every failure, but argument parsing errors still used the human-only failure path: exit status 2, empty stdout, and plain-text stderr. This breaks callers that unconditionally parse stdout.Closes #330.
Scope
validate --jsonanddeliver --jsonargument failures through a versionedstage: "arguments"receipt; add stable CLI diagnostics for invalid or missing values, unknown options and diagram types, unsupported combinations, and usage errors; add table-driven regression coverage.Stability impact
Tests run
From
archify/, each command passed with 1 target test, 0 failures:npx --yes node@18.20.8 --test --test-name-pattern "validate and deliver keep argument failures machine-readable with --json" test/cli.test.mjsnpx --yes node@20.20.2 --test --test-name-pattern "validate and deliver keep argument failures machine-readable with --json" test/cli.test.mjsnpx --yes node@22.23.2 --test --test-name-pattern "validate and deliver keep argument failures machine-readable with --json" test/cli.test.mjsnpx --yes node@24.20.0 --test --test-name-pattern "validate and deliver keep argument failures machine-readable with --json" test/cli.test.mjsAdditional results:
node --check archify/bin/archify.mjs: passed.git diff --check: passed.node --test test/cli.test.mjs: 40 passed, 1 failed, 3 skipped on each tested Node version on Windows. The sole failure is the existing installed-preview shutdown assertion: Windows reports{ code: null, signal: "SIGTERM" }after the test sends SIGTERM, while the test expects a clean code 0 exit.validate --jsonanddeliver --jsonargument failures both returned exit status 2, valid JSON stdout,stage: "arguments", and empty stderr.npm test: the brand-mark, validator, release-identity, golden-render, and new CLI regression checks passed; the overall Windows run exited 1 on existing platform/environment cases including unavailable symlinks, Bash not being on PATH, preview SIGTERM semantics, a Windows ESM drive-path fixture, and timing-sensitive notifier cases. The repository's full CI test matrix runs on Ubuntu; the Windows CI lane runs the package smoke exercised above.Visual evidence
Generated artifacts
archify.zipwith the canonical Node 22 toolchain.Checklist
npm testinarchify/.