Skip to content

Add versioned JSON output to core commands - #28

Merged
konojunya merged 3 commits into
mainfrom
agent/json-output
Sep 5, 2026
Merged

konojunya merged 3 commits into
mainfrom
agent/json-output

Conversation

@konojunya

@konojunya konojunya commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add --json to stack check, stack fmt, and stack render while preserving the existing human-readable output
  • expose a stable versioned envelope for outcomes, exit statuses, diagnostics, operational errors, and produced artifacts
  • publish the immutable v1 JSON Schema, golden fixtures, compatibility checks, consumer example, and command documentation
  • keep inline formatter and renderer payloads in artifacts while representing file outputs with paths
  • normalize corrupted gzip errors at the release-verification boundary so invalid archives fail closed without a traceback

Contract

  • every machine-readable result writes exactly one JSON document plus a newline to stdout
  • schema version 1 uses a versioned $schema URL and rejects unknown fields or incoherent outcome/exit/error combinations
  • diagnostics use stable codes and severities with end-exclusive, zero-based UTF-8 byte offsets plus one-based Unicode scalar line/column positions
  • argument, I/O, configuration, engine, and internal failures remain parseable and retain exit status 2; Stack source failures retain exit status 1
  • help and all invocations without --json retain their current stream and exit behavior

Verification

  • cargo fmt --all --check
  • cargo test --locked
  • cargo clippy --all-targets --all-features --locked -- -D warnings
  • RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --locked
  • python3 scripts/generate_cli_assets.py --binary target/debug/stack --check
  • release supply-chain validation (38 Node tests and 12 Python tests)
  • npm ci --ignore-scripts --no-audit
  • npm audit --audit-level=moderate (0 vulnerabilities)
  • npm run test:cli-output-schema (7 fixtures and 3 compatibility tests)
  • STACK_BINARY=target/debug/stack npm run test:consumer-prototype
  • cargo llvm-cov --all-features --locked --fail-under-lines 90 --fail-under-functions 95 --fail-under-regions 90 (90.74% lines, 96.92% functions, 91.45% regions)
  • cargo audit (no known RustSec vulnerabilities)
  • PR CI on latest stable and Rust 1.85

Ajv 8.20.0 is pinned as a development-only schema validator, installed without lifecycle scripts, and its MIT license is recorded with the other third-party licenses.

@konojunya
konojunya merged commit 4beab2a into main Sep 5, 2026
2 checks passed
@konojunya
konojunya deleted the agent/json-output branch September 5, 2026 10:41
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.

1 participant