The previous attempt left three CI-breaking issues:
- features/steps/config_cli_safety_net_coverage_steps.py imported
_env_var_for_key/_normalize_key from config.py, but those helpers
moved to _config_helpers.py and were never re-exported. Import
from _config_helpers directly (matches where the symbols live).
- features/steps/config_get_spec_output_steps.py defined two when-
steps whose default-parse {key} placeholders made the longer step
ambiguous against the shorter one (behave raised AmbiguousStep on
load). Switch those two patterns to the re matcher with [^"]+ so
the quoted argument can't swallow ` with format "..."`.
- The same step file cached parsed JSON on context._spec_json with
no invalidation. Behave layers context attributes — a value set at
one scenario's layer remained visible to later scenarios, so the
assertion read stale JSON from an earlier scenario's get. Parse
fresh each call.
- src/cleveragents/cli/commands/config.py built a spec-correct JSON
envelope and then passed it through format_output, which wraps its
input in another envelope — the outer envelope's data field was
the inner envelope, so data.type / data.source / data.overridden
were absent. Emit the manually-built envelope directly via
json.dumps / yaml.safe_dump so the started timing field and all
spec data fields appear at the correct depth.
ISSUES CLOSED: #3423
- Import _env_var_for_key from _config_helpers (where it was moved
during refactor) instead of config module, fixing ImportError that
blocked all unit_tests from running
- Restore --verbose / -v as a deprecated no-op parameter on config_get
so existing tests and user scripts that pass --verbose continue to work;
resolution chain is always shown per spec regardless of the flag
- Fix CliRunner(mix_stderr=False) in config_get_spec_output_steps.py to
CliRunner() — mix_stderr is not accepted by this version of Typer
ISSUES CLOSED: #3423
Implements all spec-required output for `agents config get`:
Rich output:
- Rename panel title from 'Configuration Value' to 'Config' per spec
- Add 'Overridden' field to the Config panel
- Add 'Origin' panel showing File, Line, and Default fields
- Add 'Resolution Chain' panel (always shown, not just with --verbose)
- Add 'Winner' indicator to the Resolution Chain panel
- Use spec-required type strings (string/boolean/integer) instead of
Python type names (str/bool/int)
- Add '✓ OK Config read' confirmation message
JSON output:
- Wrap result in standard envelope (command, status, exit_code, data,
timing, messages)
- Add 'overridden' field to data
- Add 'origin' nested object (file, line, default)
- Add 'winner' nested object (source, level)
- Use human-readable source names (CLI flag, Env var, Config file,
Default) instead of internal enum values
- Add 'started' timestamp to timing
BDD:
- Add features/config_get_spec_output.feature with 20 scenarios
covering all Rich panels and JSON envelope fields
- Update existing tests to match new spec-compliant output
ISSUES CLOSED: #3423