Position is a presentation choice
A sortable grid, filtered list or asynchronous map can change item order while work runs. Filenames and prompts can also repeat. Correlation must remain stable even if a user reorders cards or several items have identical descriptions.
What to do next
- 01
Create item identities first
Persist an item ID, approved input snapshot and display-order field for each batch member before dispatch. Keep the display order editable without making it the key used to associate remote jobs and completed assets.
- 02
Carry identity through every stage
Pass the item and action identity through dispatch, observation, delivery and review records. Resolve results from the saved association, not from array indexes, returned model names or the order promises settle.
- 03
Test reordering and duplicates
Use identical prompts on several items, reorder the grid and release completions in reverse order. Verify every result remains attached to its original item and any export preserves the chosen presentation order deliberately.
A concrete example
Illustrative example: items A, B and C finish C, A, B. The gallery can still display A, B, C because results join by item ID. Reordering the cards to C, B, A changes presentation without reassigning any result.
Run the local counterexample
Local runtime fixture, executed November 16, 2026. No AISwapLab request, payment or model generation was made.
Recorded runtime: v24.16.0. Run the complete script below using that runtime or record the version and changed behavior in your own environment. The script uses synthetic data and temporary resources only.
const release = {};
const completionOrder = [];
const inputIds = ['A','B','C'];
const tasks = inputIds.map(id => new Promise(resolve => {release[id]=resolve;})
.then(() => {completionOrder.push(id);return {itemId:id};}));
const aggregate = Promise.all(tasks);
release.C();release.A();release.B();
const values = await aggregate;
console.log(JSON.stringify({inputIds,completionOrder,
promiseAllOrder:values.map(x=>x.itemId),
completionIndexPairing:inputIds.map((id,i)=>[id,completionOrder[i]])}));
Actual output from this run
{
"inputIds": [
"A",
"B",
"C"
],
"completionOrder": [
"C",
"A",
"B"
],
"promiseAllOrder": [
"A",
"B",
"C"
],
"completionIndexPairing": [
[
"A",
"C"
],
[
"B",
"A"
],
[
"C",
"B"
]
]
}Use the result within its scope
Completion occurred C, A, B, but Promise.all returned values in its original input order A, B, C. Pairing the first completion with the first input was wrong; claiming Promise.all itself returns completion order would also be wrong. Persist stable IDs because UI reordering, filtering, retries and partial delivery can break an application's positional assumptions even when this particular aggregate retains order.
These are manually released local promises, not AISwapLab jobs, network responses or an application persistence test.
Before you call it ready
- Every item has a stable persisted ID.
- Completion order never drives pairing.
- Repeated prompts do not collapse distinct items.
When to stop or choose another method
Stop using list indexes or filenames as the authoritative correlation key for independently completing generation tasks.
