Skip to content

[Clean Code/KISS] Split runtime target resolution from user feedback ports #117

Closed

Description

@KeyffMS

Audit finding

IRuntimeEnvironment currently combines two unrelated roles:

  • target/window environment queries (ResolveTargetWindow, IsSupportedTarget, ResolveIdentity);
  • presentation feedback (ShowNotification, SynchronizeAutomaticMode).

The public RuntimeCoordinator constructor consequently accepts five raw delegates and adapts them into one mixed interface. This obscures dependency intent and couples runtime evaluation tests to notification/control synchronization concerns.

Target state

Introduce two small named ports, for example:

  • IRuntimeTargetResolver for window support and application identity;
  • IRuntimeFeedback for notifications and automatic-mode presentation synchronization.

Compose concrete adapters in SightAdaptContext. Keep the runtime services framework-free.

Acceptance criteria

  • Target resolution and user feedback are represented by separate interfaces.
  • RuntimeCoordinator, AutomaticActivationService and RuntimeOverlayActivator depend only on the portions they use.
  • The five-delegate constructor is removed or replaced with named collaborators.
  • SightAdaptContext remains the composition root.
  • Runtime tests can substitute target resolution without also configuring UI feedback, and vice versa.
  • Existing notification messages and automatic-mode synchronization behavior remain unchanged.
  • No DI container or service locator is introduced.

Completion evidence — 2026-09-24

Implemented in PR #160 and merged as e9ef6373ad8ed4c75c48d544a8b3c3cf978b6c29.

Verified checks:

  • DCO run 36002397999 — success;
  • full Windows build/test/release-compliance run 36002398000 — success.

Runtime target discovery and user feedback are now separate named ports composed in SightAdaptContext. Overlay activation failures are classified and diagnosed: expected native/availability failures recover into a safe fault state with automatic-target suppression, while contract/programming failures are diagnosed, cleaned up best-effort and rethrown without cleanup replacing the primary exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions