feat(output): YAML/CSV formats + bare-array list payloads#1
Open
UnbreakableMJ wants to merge 1 commit into
Open
feat(output): YAML/CSV formats + bare-array list payloads#1UnbreakableMJ wants to merge 1 commit into
UnbreakableMJ wants to merge 1 commit into
Conversation
Replace the `--format yaml` and `--format csv` stubs with dependency-free serializers over serde_json::Value: - yaml: block-style YAML 1.2 emitter with conservative scalar quoting - csv: RFC 4180 writer; a single-key array wrapper unwraps into a table Adding a YAML crate was avoided deliberately: serde_yaml is deprecated and flagged by RUSTSEC, which would fail the mandatory cargo-audit CI gate (Steelbore Standard §3.3). The Value model is closed, so a small tested emitter suffices with zero dependency-audit surface. List subcommands now return a bare array as `data` instead of a single-key wrapper object, so `--fields` selects columns per record and `--format jsonl` streams one bare record per line (ACS §8). Errors in yaml/csv mode emit structured JSON to stderr, matching json mode (PRD §9.7). Adds unit tests for the yaml/csv emitters and trim_payload, plus integration tests for the array-shaped list payload and jsonl streaming. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
--format yamland--format csvstubs with dependency-free serializers overserde_json::Value.yaml: block-style YAML 1.2 emitter with conservative scalar quoting (numbers, booleans, nulls, reserved words, colon/comment sequences, control chars). Validated against PyYAML.csv: RFC 4180 writer; a single-key array wrapper (e.g.vpn status) unwraps into a table; nested values become lossless compact-JSON cells.serde_yamlis deprecated and RUSTSEC-flagged, which would fail the mandatorycargo auditCI gate (Standard §3.3). TheValuemodel is closed, so a small tested emitter suffices.listsubcommands now return a bare array asdatainstead of a single-key wrapper object, so--fieldsselects columns per record and--format jsonlstreams one bare record per line (ACS §8).yaml/csvmode emit structured JSON to stderr, matchingjsonmode (PRD §9.7).Behavior fixed
list --providers --jsondata{"providers":[…]}[…](metadata intact)--fieldson a list"data":{}(no-op)--format jsonlTests
yaml/csvemitters andtrim_payload.--fields) and jsonl streaming.cargo fmt --check,cargo clippy --all-targets -- -D warnings, fullcargo test(115 unit + 8 integration) all pass.Note for review
jsonlnow drops the per-linemetadataenvelope (NDJSON convention), which diverges from SFRS §6's "every response isResponse<T>". Per-line envelopes would defeat the point of NDJSON; flag if strict envelope conformance is preferred instead.🤖 Generated with Claude Code