You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from a review nit on rossoctl/cortex#809 (pre-commit policy conflict diagnostic).
check_policy_conflicts (aiac/src/aiac/agent/uc/policy_check/check.py) calls config.get_services() to derive service_type, and then resolve_focal_entities
(aiac/src/aiac/agent/shared/focal_entities.py) calls config.get_services() again
internally. That is two IdP catalog round-trips per check request where one would do.
resolve_focal_entities is shared with the live /apply builder path, and its docstring
deliberately forbids deriving service_type from focus.type (the caller routes on the
passed-in type to preserve the /apply contract). So the fix must not move the type lookup
into the resolver.
Proposed fix
Add an optional pre-fetched services parameter to resolve_focal_entities and thread the
already-fetched list through from check_policy_conflicts, keeping the /apply contract
byte-for-byte. (Caching the catalog on Configuration is an alternative, but the explicit
param keeps the seam obvious and testable.)
Acceptance
Single get_services() call per POST /policy/check request.
Live /apply path and its 422 contract unchanged.
A test asserts the catalog call count (none currently does — noted in review).
changed the title [-]Refactor: Avoid double IdP catalog fetch in check_policy_conflicts[/-][+]Task: Avoid double IdP catalog fetch in policy-conflict check (#154)[/+]on Aug 26, 2026
Obsolete: the POST /policy/check route was retired, and uc/policy_check/check.py no longer exists. check_policy_conflicts now lives in src/aiac/agent/policy_rules_builder/diagnostic_survey.py as a library function that only tests call, with no production caller. The double get_services() call still exists there, but with no request path the cost doesn't matter. Reopen if the survey gets a production caller again.
Activity
[-]Refactor: Avoid double IdP catalog fetch in check_policy_conflicts[/-][+]Task: Avoid double IdP catalog fetch in policy-conflict check (#154)[/+]Fix: Surface unjoinable auditor contradictions instead of dropping them
anatolykoyfman commentedon Oct 5, 2026
Obsolete: the
POST /policy/checkroute was retired, anduc/policy_check/check.pyno longer exists.check_policy_conflictsnow lives insrc/aiac/agent/policy_rules_builder/diagnostic_survey.pyas a library function that only tests call, with no production caller. The doubleget_services()call still exists there, but with no request path the cost doesn't matter. Reopen if the survey gets a production caller again.