You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a repository-wide Architectural Decision Record (ADR) that establishes a single, canonical command-line output contract for every first-party, operator-facing CLI entrypoint in the torrust-tracker repository, aligning with the approach adopted by torrust-index (ADR-T-010) and reflecting the reality that AI agents are the dominant CLI consumers today.
This ADR is prescriptive. The current codebase does not yet comply with the rules it establishes. Existing binaries will be migrated progressively in a separate follow-up issue.
Key rules (to be codified in the ADR)
Both stdout and stderr are machine-readable JSON — no plain text on either channel.
Stdout = result data (one JSON object + newline on success; empty on failure).
Stderr = diagnostics — internal tracing records and user-facing progress events, both as NDJSON (filterable by record kind/type).
TTY refusal adopted: commands with stdout result data refuse when stdout is a TTY (exit 2 + JSON stderr diagnostic).
src/bin/profiling.rs — likely developer-only; may be out of normative scope
console/tracker-client/ — all subcommands
Relationship to existing contracts
The tracker-client local ADR (console/tracker-client/docs/adrs/20260512080000_define_tracker_cli_io_contract_and_error_handling.md) will be superseded by this global ADR once accepted.
Goal
Write a repository-wide Architectural Decision Record (ADR) that establishes a single, canonical command-line output contract for every first-party, operator-facing CLI entrypoint in the
torrust-trackerrepository, aligning with the approach adopted bytorrust-index(ADR-T-010) and reflecting the reality that AI agents are the dominant CLI consumers today.This ADR is prescriptive. The current codebase does not yet comply with the rules it establishes. Existing binaries will be migrated progressively in a separate follow-up issue.
Key rules (to be codified in the ADR)
kind/type).0success,1runtime failure,2usage/TTY/argv failure.packages/tracker-cli-common) to be decided.clippy::print_stdout/clippy::print_stderr(interacts with chore: migrate lint configuration to[workspace.lints]in Cargo.toml #1786)..tmp/<cmd>.stdout/.tmp/<cmd>.stderr.Scope — in-scope binaries
src/main.rs— tracker server (no-stdout-result class)src/bin/http_health_check.rs— stdout-result-data classsrc/bin/e2e_tests_runner.rs,src/bin/qbittorrent_e2e_runner.rs— TBDsrc/bin/profiling.rs— likely developer-only; may be out of normative scopeconsole/tracker-client/— all subcommandsRelationship to existing contracts
The tracker-client local ADR (
console/tracker-client/docs/adrs/20260512080000_define_tracker_cli_io_contract_and_error_handling.md) will be superseded by this global ADR once accepted.Full spec
docs/issues/open/1798-global-cli-output-contract-adr.mdReferences
[workspace.lints]in Cargo.toml #1786 (workspace lints migration)