fix(data-integrity): remove silent argument swap in ValidationAttachmentRepository.attach
CI / helm (pull_request) Successful in 55s
CI / build (pull_request) Successful in 1m13s
CI / push-validation (pull_request) Successful in 36s
CI / lint (pull_request) Successful in 1m29s
CI / typecheck (pull_request) Successful in 1m40s
CI / quality (pull_request) Successful in 1m46s
CI / security (pull_request) Successful in 2m6s
CI / integration_tests (pull_request) Successful in 4m42s
CI / unit_tests (pull_request) Successful in 8m47s
CI / docker (pull_request) Successful in 1m44s
CI / coverage (pull_request) Successful in 12m24s
CI / status-check (pull_request) Successful in 2s

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 the correct order.
This commit is contained in:
2026-05-16 08:27:35 +00:00
parent 5c5309f35d
commit c3c2377390
2 changed files with 6 additions and 3 deletions
+6
View File
@@ -7,6 +7,12 @@ Changed `wf10_batch.robot` to be less likely to create files, and
## [Unreleased]
Data integrity fix: ValidationAttachmentRepository argument swap (#7492): Fixed
a critical data integrity issue in `ValidationAttachmentRepository.attach` where
`validation_name` and `resource_id` arguments were being silently swapped based on a
fragile heuristic (`"/" in resource_id`). Arguments are now passed in the correct order,
ensuring data is stored with proper parameter values.
- Hardened the TDD bug-fix quality gate for issue #629: PR parsing now
requires whole-word closing keywords (avoids false positives like
"prefixes #12"), TDD bug tag discovery now uses exact token matching
@@ -3916,9 +3916,6 @@ class ValidationAttachmentRepository:
from ulid import ULID as _ULID
if "/" in resource_id and "/" not in validation_name:
validation_name, resource_id = resource_id, validation_name
session = self._session()
try:
# Check for existing attachment with same validation+resource+scope