fix: Pass 0b filter — skip obligations whose parent already has pass0b controls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-25 21:54:32 +02:00
parent 7ddb572f5d
commit c73a489075

View File

@@ -3543,12 +3543,12 @@ class DecompositionPass:
FROM obligation_candidates oc
JOIN canonical_controls cc ON cc.id = oc.parent_control_uuid
WHERE oc.release_state = 'validated'
AND oc.merged_into_id IS NULL
AND NOT EXISTS (
SELECT 1 FROM canonical_controls ac
WHERE ac.parent_control_uuid = oc.parent_control_uuid
AND ac.decomposition_method = 'pass0b'
AND ac.release_state NOT IN ('deprecated', 'duplicate')
AND ac.title LIKE '%' || LEFT(oc.action, 20) || '%'
AND ac.release_state NOT IN ('deprecated')
)
"""
if limit > 0: