cli: add `--json` to `doberman memory`
Débutant
enhancementgood first issuelevel-3
211 ★
Poids du clone léger
Mise à jour
Description
`doberman memory` (`src/doberman/cli/main.py:1476`) prints a human summary built from `memory_summary(path)`, which is already a plain dict with `decisions`, `verdicts`, `top_path_classes`, `secrets_seen`. Every sibling view in the Daily/Policy panels has a `--json`: `scan` (`:254`), `status` (`:789`), `doctor` (`:808`), `policy-history`, `tune`. `memory` is the one left out, so scripts have to scrape its text.
**What to do**
1. Add `as_json: bool = typer.Option(False, "--json", help="Emit the learned-memory summary as one JSON document.")` to `memory()`, copied from `status`'s option.
2. Before the human output: `if as_json: typer.echo(json.dumps(summary, sort_keys=True, separators=(",", ":"))); return`. Same call shape as the other five, so it lands inside the shared JSON-output contract in docs/CLI.md automatically. Add the command to that doc's machine-readable list.
3. New `tests/unit/test_cli_memory_json.py`, shaped like `tests/unit/test_cli_scan_json.py`: seed with `doberman demo --fast`, run `memory --json`, `json.loads` it, assert the four keys are present and the text is compact.
`memory_summary` already returns counts and classes only, so the JSON path exposes nothing the text path doesn't.
Issues similaires
Tout voir
Python
Débutant
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an im…
Mise à jour
Python
Débutant
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:54…
Mise à jour
Python
Débutant
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the r…
Mise à jour