2 Commits

Author SHA1 Message Date
freemo 32b352832f fix(cli): replace manual DI wiring in _get_tool_registry_service with container resolution
_get_tool_registry_service in cli/commands/validation.py was manually
constructing the full ToolRegistryService dependency graph (create_engine,
sessionmaker, ToolRegistryRepository, ValidationAttachmentRepository) instead
of delegating to the DI container. This duplicated wiring logic that belongs
exclusively in the container and made the function harder to test.

Changes:
- Add _build_tool_registry_service() builder function to container.py
  following the established _build_skill_service/_build_session_service pattern
- Register tool_registry_service as a Singleton provider in the Container class
- Refactor _get_tool_registry_service() to delegate to
  container.tool_registry_service() — a one-liner consistent with
  _get_skill_service() in cli/commands/skill.py
- Add TDD Behave feature (tdd_di_tool_registry_service.feature) with two
  scenarios: (1) function delegates to container, (2) container exposes the
  provider — both scenarios were failing before this fix
- Update validation_cli_uncovered_branches_steps.py to match the new
  container-delegation pattern (mock container.tool_registry_service()
  instead of container.database_url())

ISSUES CLOSED: #3006
2026-04-05 17:52:59 +00:00
freemo ca1c341b18 Tests: Significantly improved coverage of the unit tests 2026-02-22 00:43:08 -05:00