Skip to content

[T-003b] roboprobe config show [--sources] command with masked secrets #21

Closed

Description

@CodewithJha

Task T-003b · Milestone M1 — Foundation · Size XS · Priority P1 · Epic #1

Implements NFR-CFG-002

Branch feat/t-003b-command-with-masked-secrets — one task = one branch = one PR (doc 32 §6)

Summary

Add the config CLI group that prints the resolved settings tree and, with --sources, which source set each value.

Context / motivation

Operators debugging a deployment need to see what configuration a process actually resolved (doc 27 §2, runbook doc 30 §1).

Scope

In scope

  • backend/src/roboprobe/cli/config.py with show [--sources] [--json].
  • Secrets masked as **********.
  • Emit log event config.loaded with sources only, never values (doc 34 §6).

Implementation guidance

  • Use explain_sources() from T-003a. Render nested keys as dotted paths in a Rich table; --json prints a dict for scripting.
  • Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff PLR2004); public APIs typed (mypy strict) and documented.

Acceptance criteria

  • roboprobe config show lists every key; secrets masked.
  • --sources shows default|toml|dotenv|env|cli|secret_file per key.
  • Exit code 2 with readable errors on invalid config.
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • CliRunner tests with env/TOML fixtures.

Dependencies

Blocked by: #19 (T-003a), #20 (T-008)

Blocks: no other task (leaf)

Parallelization notes

Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:

  • backend/src/roboprobe/cli/config.py
  • backend/tests/unit/cli/test_config_cmd.py

Single new module + one registration line in cli/main.py.

Definition of Done

Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-003b (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.

References

Design docs: doc 27 §2 · doc 30 §1 · doc 34 §6

Requirements: NFR-CFG-002 (traceability: doc 28)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCommand-line interfacearea:configTyped settings / configurationgood first issueGood for newcomersmilestone:M1M1 — Foundationpriority:P1Required for milestone exitsize:XS< 2 hourstaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions