chore(cli): canonical --output jsonl (ndjson kept as hidden alias) - #4
Draft
h4x0r wants to merge 2 commits into
Draft
chore(cli): canonical --output jsonl (ndjson kept as hidden alias)#4h4x0r wants to merge 2 commits into
h4x0r wants to merge 2 commits into
Conversation
mem4n6 spells newline-delimited JSON `ndjson`; the rest of the fleet spells it `jsonl` (1381 occurrences across 20 repos vs 338 across 6, and the fleet machine-view list reads "JSON, JSONL, CSV, bodyfile"). Two names for one concept. Four failing tests pin the intended contract: - `--output jsonl` parses and its canonical name is `jsonl` - legacy `--output ndjson` still parses and resolves to the SAME variant - `--help` advertises `jsonl` only (the alias stays hidden) - both spellings parse end-to-end through clap on a real subcommand The alias test is the load-bearing one: every existing `mem4n6 <cmd> --output ndjson` invocation, script and runbook must keep working after the rename. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…dden alias
`OutputFormat::Ndjson` becomes `Jsonl` with `#[value(name = "jsonl", alias =
"ndjson")]`, so:
- `--output jsonl` is the canonical spelling and the only one `--help` lists
- `--output ndjson` keeps parsing, resolving to the same variant
No invocation breaks. The alias is deliberately hidden rather than deprecated-
with-a-warning: the spelling change carries no semantic change, so a warning
would be noise on every piped run.
Also rewritten: 49 `OutputFormat::Ndjson` match arms, the six `--output`
help strings ("table, json, csv, ndjson" -> "... jsonl"), and two stale
in-code references to the old name.
Chosen by measured fleet usage, not preference: `jsonl` appears 1381 times
across 20 repos, `ndjson` 338 times across 6, and the fleet machine-view list
is "JSON, JSONL, CSV, bodyfile".
Gate: cargo build, cargo test (232 passed), cargo clippy --all-targets
-D warnings, cargo fmt --check - all clean.
Co-Authored-By: Claude Opus 5 (1M context) <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
mem4n6spelled newline-delimited JSON--output ndjson; the rest of the fleet spells itjsonl. This makesjsonlthe canonical spelling here and keepsndjsonworking as a hidden alias, so no existing invocation breaks.Why
jsonlis canonical (measured, not preferred)Counted across
ronin-issen/components(all tracked files — source, docs, READMEs, CI, tests, fixtures), excludingtarget/:jsonlndjsonThe fleet machine-view list in
CLAUDE.core.mdreads "JSON,JSONL,CSV,bodyfile", and prefers JSONL over a pretty JSON array for streams. Both the docs and the code lean the same way.Of the 6 repos mentioning
ndjson, only two ever exposed it as a CLI value: this one andsrum-cli. Inblazehashandwinevt-clithe string appears only as prose describing what some other flag emits (--stream,-f ecs), not as a format name a user types.What changes
OutputFormat::Ndjson->Jsonl, carrying#[value(name = "jsonl", alias = "ndjson")]:--output jsonl— canonical, and the only spelling--helplists--output ndjson— still parses, resolves to the same variantPlus 49 rewritten match arms, the six
--outputhelp strings, and two stale in-code references.The alias is hidden rather than deprecated-with-a-warning: the rename carries no semantic change, so a warning would be noise on every piped run.
Invocations that would break without the alias
Every
mem4n6 <subcommand> ... --output ndjson, across the six subcommands that accept--output:framebuf, and the five others whose help strings previously read "table, json, csv, ndjson". With the alias, none break.Semver
CLI surface, not Rust API — the crate's public API is unchanged. The removed spelling is still accepted, so this is not a breaking UX change either.
TDD
Two commits, RED then GREEN.
RED (
4765266) — four failing tests, output pasted in the commit:The alias test is the load-bearing one — it protects users, and it is written so it would fail if the alias were ever dropped.
GREEN (
fba5a34) — implementation. All four pass.Gate
cargo build,cargo test(232 passed, 18 ignored),cargo clippy --all-targets -- -D warnings,cargo fmt --check— all clean.🤖 Generated with Claude Code