to_harness_profile(
self,
) -> HarnessProfileConvert this declarative config into a runtime HarnessProfile.
excluded_middleware entries are passed through as name-based
exclusions matched against AgentMiddleware.name.
from_harness_profileThis direction is currently lossless because HarnessProfileConfig
carries only the file-friendly subset of fields by design —
extra_middleware instances and factories cannot be
represented in YAML/JSON, so they are absent from this type
and the resulting HarnessProfile will not have them
populated. The reverse direction (from_harness_profile)
raises when a runtime profile contains runtime-only state,
rather than silently dropping it. Round-tripping a runtime
profile that uses extra_middleware through config form is
therefore not supported by design at this moment — keep
such profiles in HarnessProfile form.