Severity
High — two related state-invalidation gaps in the staged Import workflow.
What happens
handleRetry loads the failed-rows dataset and calls setMappings(lastPushConfig.mappings), but the automap effect keyed on dataset?.filename fires on the same commit and overwrites the restored mappings — manual mapping choices (renames, transforms, blank behavior, lookups) are silently lost.
mappedRecords, validationErrors, and furthestStage are never invalidated when the dataset changes, so after loading the retry dataset (or any new file) the user can click straight to Review — still gated on the old validationErrors: [] — and Confirm pushes the previous mappedRecords: all original rows re-sent, duplicating every already-successful record.
Evidence
src/ui/screens/DataPushScreen.tsx:328 (automap effect) vs :564 (restore), :173/:393 (stale state)
Suggested fix
Reset mappedRecords/validationErrors/furthestStage whenever the dataset changes, and skip the automap effect when mappings were just restored programmatically.
Environment
Commit 74cf21b (main), WaveLink 0.6.0. Found in the 2026-08-31 adversarial audit (code-verified).
Severity
High — two related state-invalidation gaps in the staged Import workflow.
What happens
handleRetryloads the failed-rows dataset and callssetMappings(lastPushConfig.mappings), but the automap effect keyed ondataset?.filenamefires on the same commit and overwrites the restored mappings — manual mapping choices (renames, transforms, blank behavior, lookups) are silently lost.mappedRecords,validationErrors, andfurthestStageare never invalidated when the dataset changes, so after loading the retry dataset (or any new file) the user can click straight to Review — still gated on the oldvalidationErrors: []— and Confirm pushes the previousmappedRecords: all original rows re-sent, duplicating every already-successful record.Evidence
src/ui/screens/DataPushScreen.tsx:328(automap effect) vs:564(restore),:173/:393(stale state)Suggested fix
Reset
mappedRecords/validationErrors/furthestStagewhenever the dataset changes, and skip the automap effect when mappings were just restored programmatically.Environment
Commit
74cf21b(main), WaveLink 0.6.0. Found in the 2026-08-31 adversarial audit (code-verified).