fix(data-integrity): remove silent argument swap in ValidationAttachmentRepository.attach #11220

Closed
HAL9000 wants to merge 2 commits from fix/arg-swap-validation-attachment-8177 into master

2 Commits

Author SHA1 Message Date
controller-ci-rerun 2dc7e4adc3 chore: re-trigger CI [controller]
CI / push-validation (pull_request) Successful in 23s
CI / build (pull_request) Successful in 39s
CI / helm (pull_request) Successful in 40s
CI / quality (pull_request) Successful in 43s
CI / lint (pull_request) Failing after 43s
CI / typecheck (pull_request) Successful in 1m17s
CI / security (pull_request) Successful in 1m19s
CI / integration_tests (pull_request) Successful in 3m56s
CI / unit_tests (pull_request) Failing after 6m7s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
2026-05-28 17:36:39 -04:00
HAL9000 b885a3814c fix(data-integrity): remove silent argument swap in ValidationAttachmentRepository.attach
Fixes a critical data integrity bug where validation_name and resource_id
arguments were being silently swapped based on a fragile heuristic when
resource_id contained '/'. This caused silent data corruption without any
error being raised.

The 3-line conditional swap block has been removed from
ValidationAttachmentRepository.attach(), ensuring arguments flow directly
from caller to the persistence layer in their correct positional order.

A comprehensive BDD test suite (11 scenarios) verifies:
- Arguments are preserved in correct order across all boundary conditions
- Slash-containing IDs and namespacing work correctly
- Optional parameters (project_name, plan_id, mode, args) work properly
- Duplicate rejection works as expected (#7492)

ISSUES CLOSED: #8177, #7492
2026-05-28 17:36:39 -04:00