Aller au contenu
login
arrow_backRetour aux issues
fu351/Doberman-Core #431

cli: `tune --json` is the one JSON command that isn't compact

ecoDébutant bug good first issue level-2

descriptionDescription

Every JSON-emitting command in the CLI uses the compact, diff-friendly form `json.dumps(..., sort_keys=True, separators=(",", ":"))`: `scan` (`src/doberman/cli/main.py:305`), `status` (`:800`), `doctor` (`:844`), `log --jsonl` (`:1333`), `policy-history` (`:1630`). `tune --json` (`:1237`) forgot the `separators=` argument, so its output is the spaced form: ``` tune --json -> {"approval_rate_by_reason": {"egress_requires_auth": {"approved": 0, ... status --json -> {"doberman_version":"0.18.1","elevations":[],... ``` The shared JSON-output contract (docs/CLI.md, "machine-readable output") promises the compact form. **What to do** 1. Add `separators=(",", ":")` to the `json.dumps` call at `main.py:1237`. 2. Add `tests/unit/test_cli_tune_json.py`, shaped like `tests/unit/test_cli_scan_json.py`: run `tune --json` against a seeded temp repo, `json.loads` the output, and assert the raw text contains neither `", "` nor `": "`. 3. `pytest tests/unit/test_cli_tune_json.py` green. Formatting only; no field or schema changes.
codeOuvre sur GitHub