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

cli: `doberman log` columns shift for `network_request` and `package_install` rows

ecoDébutant bug good first issue level-2

descriptionDescription

`doberman log` pads the action type to a fixed 13 characters (`src/doberman/cli/main.py:1345`: `{row['action_type']:<13}`). Two `ActionType` values are 15 characters long, `network_request` and `package_install` (`src/doberman/models.py:25,27`), so their rows push the target and reason-code columns two characters to the right. After `doberman demo --fast --path `: ``` 2026-08-20T19:32:19 BLOCK git_op - [destructive_command, egress_requires_auth] 2026-08-20T19:32:20 BLOCK network_request - [smuggled_token_channel] ``` **What to do** 1. Compute the width from the enum instead of hardcoding it, the way `src/doberman/render.py:30` already does for verdicts (`_LABEL_WIDTH = max(len(v.value) for v in Verdict)`). An `_ACTION_WIDTH = max(len(a.value) for a in ActionType)` next to the `log` command, used as `{row['action_type']:<{_ACTION_WIDTH}}`, is the whole fix. 2. Add a test beside `tests/unit/test_cli_log_jsonl.py`: seed one `network_request` and one `git_op` decision, run `log`, and assert the `-` target column starts at the same offset on both lines. 3. `pytest tests/unit -k cli_log` green. Text output only; the `--jsonl` path is untouched.
codeOuvre sur GitHub