Commit Graph
4 Commits
Author SHA1 Message Date
KaifAhmad1andClaude Sonnet 4.6 8feb8c00c6 fix(cli): address review findings from PR #576
- Remove incorrect # pragma: no cover from _run_with_error_handling
  generic Exception branch (test_runtime_errors_are_click_safe already
  covers it via the monkeypatched RuntimeError path)

- Add _require_ctx() guard: converts None ctx.obj into a clean
  ClickException instead of an AttributeError (protects standalone_mode=False
  / library-use callers); apply to info, kg_build, build_alias commands

- Rename serve group -> services to avoid collision with the future
  `semantica server` flat command specified in issue #568; update docstring
  to document planned subcommand layout

- Fix command-level config logging: re-call setup_logging() with the
  command-level config logging section when -c is used (setup_logging
  clears handlers before adding, so no accumulation risk)

- Fix missing log_level_override in command_ctx: global --log-level was
  silently dropped when a per-command -c config was present, breaking
  the override chain for any nested _build_runtime_config calls

- Add return-shape docstring on _run_build documenting the expected
  build_knowledge_base() return dict structure

- Add type annotation to runner fixture (-> CliRunner) so Pylance
  correctly types runner.invoke() -> Result across all test functions

- Expand test suite: 25 -> 32 tests
  * test_info_command_shows_framework_components
  * test_info_command_shows_config_path_when_supplied
  * test_log_level_global_override_stores_in_context
  * test_command_config_preserves_global_log_level_override
  * test_build_result_with_stats_shows_source_count
  * test_build_result_without_stats_shows_generic_success
  * test_build_result_none_shows_generic_success
  * test_require_ctx_raises_click_exception_on_none
  * test_require_ctx_returns_ctx_unchanged

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 15:29:39 +05:30
Sameer6305 c447bf5934 cli: harden config parsing and isolate CLI test logging 2026-05-27 13:57:18 +05:30
Sameer6305 b54d885bf2 cli: harden config parsing and logging override handling
- keep command-level config from overriding logging unless --log-level is set

- validate YAML/JSON config roots and surface parse failures as Click errors

- tighten CLI tests around isolation and cleanup
2026-05-26 23:06:00 +05:30
Sameer6305 bc9db1ff89 cli: add foundation wiring and kg build with legacy build parity
- add CLI runtime context, global config/log-level handling, and click-safe error wrapping

- implement kg build as a thin wrapper over existing orchestrator build flow

- keep hidden legacy build alias and route both build handlers through shared internal path

- add focused CLI tests for help UX, config flag compatibility, alias parity, and clean error output

- keep tests lightweight by mocking heavy build execution paths
2026-05-26 22:45:50 +05:30