Fix pass0b queries to skip deprecated/duplicate controls
The NOT EXISTS check and Duplicate Guard now exclude deprecated and duplicate controls, enabling clean re-runs after invalidation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2450,6 +2450,7 @@ class DecompositionPass:
|
|||||||
SELECT 1 FROM canonical_controls ac
|
SELECT 1 FROM canonical_controls ac
|
||||||
WHERE ac.parent_control_uuid = oc.parent_control_uuid
|
WHERE ac.parent_control_uuid = oc.parent_control_uuid
|
||||||
AND ac.decomposition_method = 'pass0b'
|
AND ac.decomposition_method = 'pass0b'
|
||||||
|
AND ac.release_state NOT IN ('deprecated', 'duplicate')
|
||||||
AND ac.title LIKE '%' || LEFT(oc.action, 20) || '%'
|
AND ac.title LIKE '%' || LEFT(oc.action, 20) || '%'
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
@@ -3025,7 +3026,7 @@ class DecompositionPass:
|
|||||||
SELECT id::text FROM canonical_controls
|
SELECT id::text FROM canonical_controls
|
||||||
WHERE parent_control_uuid = CAST(:parent AS uuid)
|
WHERE parent_control_uuid = CAST(:parent AS uuid)
|
||||||
AND generation_metadata->>'merge_group_hint' = :hint
|
AND generation_metadata->>'merge_group_hint' = :hint
|
||||||
AND release_state != 'rejected'
|
AND release_state NOT IN ('rejected', 'deprecated', 'duplicate')
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
"""),
|
"""),
|
||||||
{"parent": parent_uuid, "hint": merge_hint},
|
{"parent": parent_uuid, "hint": merge_hint},
|
||||||
@@ -3291,6 +3292,7 @@ class DecompositionPass:
|
|||||||
SELECT 1 FROM canonical_controls ac
|
SELECT 1 FROM canonical_controls ac
|
||||||
WHERE ac.parent_control_uuid = oc.parent_control_uuid
|
WHERE ac.parent_control_uuid = oc.parent_control_uuid
|
||||||
AND ac.decomposition_method = 'pass0b'
|
AND ac.decomposition_method = 'pass0b'
|
||||||
|
AND ac.release_state NOT IN ('deprecated', 'duplicate')
|
||||||
AND ac.title LIKE '%' || LEFT(oc.action, 20) || '%'
|
AND ac.title LIKE '%' || LEFT(oc.action, 20) || '%'
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user